Skip to content

Commit

Permalink
modify docker port
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Nov 3, 2021
1 parent 5594703 commit 217ee79
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 102 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,32 @@ jobs:
pushd nebula-docker-compose/
cp ../../client/src/test/resources/docker-compose.yaml .
docker-compose up -d
sleep 10
sleep 30
docker-compose ps
popd
popd
- name: Install nebula-graph with CA SSL
run: |
pushd tmp
mkdir ca
pushd ca
cp ../../client/src/test/resources/docker-compose-casigned.yaml .
docker-compose -f docker-compose-casigned.yaml up -d
sleep 30
docker-compose -f docker-compose-casigned.yaml ps
popd
popd
- name: Install nebula-graph with Self SSL
run: |
pushd tmp
mkdir self
pushd self
cp ../../client/src/test/resources/docker-compose-selfsigned.yaml .
docker-compose -f docker-compose-selfsigned.yaml up -d
sleep 30
docker-compose -f docker-compose-selfsigned.yaml ps
popd
popd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,6 @@ public void testSelfSignedSsl() {
Session sslSession = null;
NebulaPool sslPool = new NebulaPool();
try {
Runtime runtime = Runtime.getRuntime();
runtime.exec("docker-compose -f src/test/resources/docker-compose"
+ "-selfsigned.yaml up -d");

NebulaPoolConfig nebulaSslPoolConfig = new NebulaPoolConfig();
nebulaSslPoolConfig.setMaxConnSize(100);
Expand All @@ -566,8 +563,7 @@ public void testSelfSignedSsl() {
"src/test/resources/ssl/selfsigned.pem",
"src/test/resources/ssl/selfsigned.key",
"vesoft"));
TimeUnit.SECONDS.sleep(45);
Assert.assertTrue(sslPool.init(Arrays.asList(new HostAddress("127.0.0.1", 8669)),
Assert.assertTrue(sslPool.init(Arrays.asList(new HostAddress("127.0.0.1", 7669)),
nebulaSslPoolConfig));
sslSession = sslPool.getSession("root", "nebula", true);

Expand All @@ -577,9 +573,6 @@ public void testSelfSignedSsl() {
.getJSONObject(0).getJSONArray("row").toJSONString();
String exp = "[1]";
Assert.assertEquals(rowData, exp);

runtime.exec("docker-compose -f src/test/resources/docker-compose"
+ "-selfsigned.yaml down").waitFor(60, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
assert false;
Expand All @@ -596,18 +589,13 @@ public void testCASignedSsl() {
Session sslSession = null;
NebulaPool sslPool = new NebulaPool();
try {
Runtime runtime = Runtime.getRuntime();
runtime.exec("docker-compose -f src/test/resources/docker-compose"
+ "-casigned.yaml up -d");

NebulaPoolConfig nebulaSslPoolConfig = new NebulaPoolConfig();
nebulaSslPoolConfig.setMaxConnSize(100);
nebulaSslPoolConfig.setEnableSsl(true);
nebulaSslPoolConfig.setSslParam(new CASignedSSLParam(
"src/test/resources/ssl/casigned.pem",
"src/test/resources/ssl/casigned.crt",
"src/test/resources/ssl/casigned.key"));
TimeUnit.SECONDS.sleep(45);
Assert.assertTrue(sslPool.init(Arrays.asList(new HostAddress("127.0.0.1", 8669)),
nebulaSslPoolConfig));
sslSession = sslPool.getSession("root", "nebula", true);
Expand All @@ -619,8 +607,6 @@ public void testCASignedSsl() {
String exp = "[1]";
Assert.assertEquals(rowData, exp);

runtime.exec("docker-compose -f src/test/resources/docker-compose"
+ "-casigned.yaml down").waitFor(60, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
assert false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static void createSpaceWithSelfSSL() {
"src/test/resources/ssl/selfsigned.pem",
"src/test/resources/ssl/selfsigned.key",
"vesoft"));
List<HostAddress> addresses = Arrays.asList(new HostAddress("127.0.0.1", 8669));
List<HostAddress> addresses = Arrays.asList(new HostAddress("127.0.0.1", 7669));
NebulaPool pool = new NebulaPool();
Session session = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,8 @@ public void testListOnlineHosts() {
public void testCASignedSSLMetaClient() {
String startCmd = "docker-compose -f src/test/resources/docker-compose-casigned.yaml up -d";
String stopCmd = "docker-compose -f src/test/resources/docker-compose-casigned.yaml down";
Runtime runtime = Runtime.getRuntime();
MetaClient metaClient = null;
try {
Process p = runtime.exec(startCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(startCmd, p);

// mock data with CA ssl
MockNebulaGraph.createSpaceWithCASSL();
Expand All @@ -173,27 +169,12 @@ public void testCASignedSSLMetaClient() {
if (metaClient != null) {
metaClient.close();
}
try {
Process p = runtime.exec(stopCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(stopCmd, p);
} catch (InterruptedException | IOException e) {
e.printStackTrace();
}
}
}

public void testSelfSignedSSLMetaClient() {
String startCmd =
"docker-compose -f src/test/resources/docker-compose-selfsigned.yaml up -d";
String stopCmd = "docker-compose -f src/test/resources/docker-compose-selfsigned.yaml down";

MetaClient metaClient = null;
Runtime runtime = Runtime.getRuntime();
try {
Process p = runtime.exec(startCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(startCmd, p);

// mock data with Self ssl
MockNebulaGraph.createSpaceWithSelfSSL();
Expand All @@ -202,7 +183,7 @@ public void testSelfSignedSSLMetaClient() {
"src/test/resources/ssl/selfsigned.pem",
"src/test/resources/ssl/selfsigned.key",
"vesoft");
metaClient = new MetaClient(Arrays.asList(new HostAddress(address, 8559)),
metaClient = new MetaClient(Arrays.asList(new HostAddress(address, 7559)),
3000, 1, 1, true, sslParam);
metaClient.connect();

Expand All @@ -216,13 +197,6 @@ public void testSelfSignedSSLMetaClient() {
if (metaClient != null) {
metaClient.close();
}
try {
Process p = runtime.exec(stopCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(stopCmd, p);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,8 @@ public void testMultiVersionSchema() throws ClientServerIncompatibleException {


public void testCASignedSSLMetaManager() {
String startCmd = "docker-compose -f src/test/resources/docker-compose-casigned.yaml up -d";
String stopCmd = "docker-compose -f src/test/resources/docker-compose-casigned.yaml down";
Runtime runtime = Runtime.getRuntime();
MetaManager metaManager = null;
try {
Process p = runtime.exec(startCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(startCmd, p);

// mock data with CA ssl
MockNebulaGraph.createSpaceWithCASSL();
Expand Down Expand Up @@ -161,26 +155,12 @@ public void testCASignedSSLMetaManager() {
if (metaManager != null) {
metaManager.close();
}
try {
Process p = runtime.exec(stopCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(stopCmd, p);
} catch (InterruptedException | IOException e) {
e.printStackTrace();
}
}
}

public void testSelfSignedSSLMetaClient() {
String startCmd =
"docker-compose -f src/test/resources/docker-compose-selfsigned.yaml up -d";
String stopCmd = "docker-compose -f src/test/resources/docker-compose-selfsigned.yaml down";
Runtime runtime = Runtime.getRuntime();
MetaManager metaManager = null;
try {
Process p = runtime.exec(startCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(startCmd, p);

// mock data with Self ssl
MockNebulaGraph.createSpaceWithSelfSSL();
Expand All @@ -189,7 +169,7 @@ public void testSelfSignedSSLMetaClient() {
"src/test/resources/ssl/selfsigned.pem",
"src/test/resources/ssl/selfsigned.key",
"vesoft");
metaManager = new MetaManager(Arrays.asList(new HostAddress("127.0.0.1", 8559)),
metaManager = new MetaManager(Arrays.asList(new HostAddress("127.0.0.1", 7559)),
3000, 1, 1, true, sslParam);

assert (metaManager.getSpaceId("testMeta") > 0);
Expand All @@ -212,13 +192,6 @@ public void testSelfSignedSSLMetaClient() {
if (metaManager != null) {
metaManager.close();
}
try {
Process p = runtime.exec(stopCmd);
p.waitFor(60, TimeUnit.SECONDS);
ProcessUtil.printProcessStatus(stopCmd, p);
} catch (InterruptedException | IOException e) {
e.printStackTrace();
}
}
}
}
18 changes: 9 additions & 9 deletions client/src/test/resources/docker-compose-casigned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ services:
USER: root
TZ: "${TZ}"
command:
- --meta_server_addrs=172.29.1.1:8559
- --meta_server_addrs=172.29.1.1:9559
- --local_ip=172.29.1.1
- --ws_ip=172.29.1.1
- --port=8559
- --port=9559
- --data_path=/data/meta
- --log_dir=/logs
- --v=0
Expand All @@ -28,7 +28,7 @@ services:
retries: 3
start_period: 20s
ports:
- "8559:8559"
- "8559:9559"
- 11000
- 11002
volumes:
Expand All @@ -48,10 +48,10 @@ services:
USER: root
TZ: "${TZ}"
command:
- --meta_server_addrs=172.29.1.1:8559
- --meta_server_addrs=172.29.1.1:9559
- --local_ip=172.29.2.1
- --ws_ip=172.29.2.1
- --port=8779
- --port=9779
- --data_path=/data/storage
- --log_dir=/logs
- --v=0
Expand All @@ -72,7 +72,7 @@ services:
retries: 3
start_period: 20s
ports:
- "8779:8779"
- "8779:9779"
- 12000
- 12002
volumes:
Expand All @@ -92,8 +92,8 @@ services:
USER: root
TZ: "${TZ}"
command:
- --meta_server_addrs=172.29.1.1:8559
- --port=8669
- --meta_server_addrs=172.29.1.1:9559
- --port=9669
- --ws_ip=172.29.3.1
- --log_dir=/logs
- --v=0
Expand All @@ -114,7 +114,7 @@ services:
retries: 3
start_period: 20s
ports:
- "8669:8669"
- "8669:9669"
- 13000
- 13002
volumes:
Expand Down
Loading

0 comments on commit 217ee79

Please sign in to comment.