Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "cloud"
version = "3.3.2"
version = "3.3.3"
repository = "https://github.com/ballerina-platform/module-ballerina-c2c"
license = ["Apache-2.0"]
keywords = ["cloud", "kubernetes", "docker", "k8s", "c2c"]
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "code2cloud"
class = "io.ballerina.c2c.C2CCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/cloud-compiler-plugin-3.3.2.jar"
path = "../compiler-plugin/build/libs/cloud-compiler-plugin-3.3.3-SNAPSHOT.jar"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.12.0"
[[package]]
org = "ballerina"
name = "cloud"
version = "3.3.2"
version = "3.3.3"
modules = [
{org = "ballerina", packageName = "cloud", moduleName = "cloud"}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(),
"[java, -Xdiag, -cp, anjana-testObservation_0.1.5-0.1.0.jar:jars/*, " +
"[java, -XX:+ExitOnOutOfMemoryError, -Xdiag, -cp, " +
"anjana-testObservation_0.1.5-0.1.0.jar:jars/*, " +
"anjana.testObservation_0&00461&00465.0.$_init]");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ public void validateDockerfile() {

@Test
public void validateDockerImage() {
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp," +
" anjana-mix_configs_job-0.1.0.jar:jars/*, anjana.mix_configs_job.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, anjana-mix_configs_job-0.1.0.jar:jars/*, anjana.mix_configs_job.0.$_init]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"anjana-mix_configs-0.1.0.jar:jars/*, anjana.mix_configs.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, anjana-mix_configs-0.1.0.jar:jars/*, anjana.mix_configs.0.$_init]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp," +
" anjana-fat_jar-0.1.0.jar:jars/*, anjana.fat_jar.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, anjana-fat_jar-0.1.0.jar:jars/*, anjana.fat_jar.0.$_init]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public void validateChoreoYaml() throws IOException {
public void validateDockerfile() throws IOException {
File dockerFile = DOCKER_TARGET_PATH.resolve("Dockerfile").toFile();
String dockerFileContent = new String(Files.readAllBytes(dockerFile.toPath()));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-Xdiag\",\"-cp\"," +
"\"hello-hello-0.0.1.jar:jars/*\",\"hello.hello.0.$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-XX:+ExitOnOutOfMemoryError\"," +
"\"-Xdiag\",\"-cp\",\"hello-hello-0.0.1.jar:jars/*\",\"hello.hello.0.$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("USER ballerina"));
Assert.assertTrue(dockerFile.exists());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public void validateChoreoYaml() throws IOException {
public void validateDockerfile() throws IOException {
File dockerFile = DOCKER_TARGET_PATH.resolve("Dockerfile").toFile();
String dockerFileContent = new String(Files.readAllBytes(dockerFile.toPath()));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-Xdiag\",\"-cp\"," +
"\"hello-hello-0.0.1.jar:jars/*\",\"hello.hello.0.$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-XX:+ExitOnOutOfMemoryError\"," +
"\"-Xdiag\",\"-cp\",\"hello-hello-0.0.1.jar:jars/*\",\"hello.hello.0.$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("USER ballerina"));
Assert.assertTrue(dockerFile.exists());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public void testCustomDockerCMD() throws IOException, InterruptedException {
Assert.assertTrue(FileUtils.readFileToString(dockerFile, StandardCharsets.UTF_8)
.contains("FROM ballerina/jre8:v1"));
Assert.assertEquals(Arrays.toString(imageInspect.getConfig().getEntrypoint()),
"[/bin/sh, -c, [\"java\",\"-Xdiag\", \"-cp\", \"hello-hello-0.0.1.jar:jars/*\" \"$_init\" " +
"\"--b7a.http.accesslog.console=true\"]");
"[/bin/sh, -c, [\"java\",\"-XX:+ExitOnOutOfMemoryError\",\"-Xdiag\", \"-cp\", " +
"\"hello-hello-0.0.1.jar:jars/*\" \"$_init\" \"--b7a.http.accesslog.console=true\"]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void buildDockerImageTest() throws DockerGenException, IOException {
PackageID packageID = new PackageID(new Name("wso2"), new Name("bal"), new Name("1.0.0"));
dockerModel.setPkgId(packageID);
dockerModel.setDependencyJarPaths(jarFilePaths);
dockerModel.setEntryPoint("ENTRYPOINT java -Xdiag -cp '${APP}:jars/*' '$_init' " +
dockerModel.setEntryPoint("ENTRYPOINT java -XX:+ExitOnOutOfMemoryError -Xdiag -cp '${APP}:jars/*' '$_init' " +
"--b7a.http.accesslog.console=true");
Path outputDir = SOURCE_DIR_PATH.resolve("target");
Files.createDirectories(outputDir);
Expand All @@ -83,8 +83,8 @@ public void buildDockerImageTest() throws DockerGenException, IOException {
Assert.assertNotNull(getDockerImage(DOCKER_IMAGE));
InspectImageResponse imageInspect = getDockerImage(DOCKER_IMAGE);
Assert.assertEquals(Arrays.toString(Objects.requireNonNull(imageInspect.getConfig()).getEntrypoint()),
"[/bin/sh, -c, java -Xdiag -cp 'hello.jar:jars/*' '$_init' --b7a.http.accesslog" +
".console=true]");
"[/bin/sh, -c, java -XX:+ExitOnOutOfMemoryError -Xdiag -cp 'hello.jar:jars/*' " +
"'$_init' --b7a.http.accesslog.console=true]");
}

private Set<Path> getJarFilePaths() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public void buildDockerImageTest() throws DockerGenException, IOException {

String dockerFileContent = new String(Files.readAllBytes(dockerFile.toPath()));
cleaningUpDir = outputDir;
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-Xdiag\"," +
"\"-cp\",\"hello.jar:jars/*\",\"wso2.bal.1.$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-XX:+ExitOnOutOfMemoryError\"," +
"\"-Xdiag\",\"-cp\",\"hello.jar:jars/*\",\"wso2.bal.1.$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("USER ballerina"));
}

Expand All @@ -132,8 +132,8 @@ public void validateDockerImage() {
Assert.assertEquals(DockerTestUtils.getExposedPorts(DOCKER_IMAGE).size(), 1);
Assert.assertEquals(Objects.requireNonNull(DockerTestUtils.getDockerImage(DOCKER_IMAGE).getConfig()
.getEnv()).length, 8);
Assert.assertEquals(DockerTestUtils.getEntryPoint(DOCKER_IMAGE), Arrays.asList("java", "-Xdiag",
"-cp", "hello.jar:jars/*", "wso2.bal.1.$_init"));
Assert.assertEquals(DockerTestUtils.getEntryPoint(DOCKER_IMAGE), Arrays.asList("java",
"-XX:+ExitOnOutOfMemoryError", "-Xdiag", "-cp", "hello.jar:jars/*", "wso2.bal.1.$_init"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.get(0), "9095/tcp");
Assert.assertEquals(ports.get(1), "9096/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@Test(groups = { "integration" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void validateDockerImage() {
Assert.assertEquals(ports.get(0), "9096/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(),
"[java, -Xdiag, -cp, service.jar:jars/*, $_init]");
"[java, -XX:+ExitOnOutOfMemoryError, -Xdiag, -cp, service.jar:jars/*, $_init]");
}

@Test(groups = { "integration" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "8080/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@Test(groups = { "integration" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp," +
" hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@Test(groups = { "integration" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public void validateK8SService() {
public void validateDockerfile() throws IOException {
File dockerFile = DOCKER_TARGET_PATH.resolve("Dockerfile").toFile();
String dockerFileContent = new String(Files.readAllBytes(dockerFile.toPath()));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-Xdiag\",\"-cp\"," +
"\"hello_world.jar:jars/*\",\"$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("ENTRYPOINT [\"java\",\"-XX:+ExitOnOutOfMemoryError\"," +
"\"-Xdiag\",\"-cp\",\"hello_world.jar:jars/*\",\"$_init\"]"));
Assert.assertTrue(dockerFileContent.contains("USER ballerina"));
Assert.assertTrue(dockerFile.exists());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@Test(groups = {"integration"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"xlight-hello-0.0.1.jar:jars/*, xlight.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, xlight-hello-0.0.1.jar:jars/*, xlight.hello.0.$_init]");
}

@Test(groups = { "integration" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public void validateDockerImage() {
Assert.assertEquals(ports.size(), 1);
Assert.assertEquals(ports.get(0), "9090/tcp");
// Validate ballerina.conf in run command
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -Xdiag, -cp, " +
"hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
Assert.assertEquals(getEntryPoint(DOCKER_IMAGE).toString(), "[java, -XX:+ExitOnOutOfMemoryError, " +
"-Xdiag, -cp, hello-hello-0.0.1.jar:jars/*, hello.hello.0.$_init]");
}

@Test(groups = { "integration" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
repository= "anuruddhal" # optional default is local
name="cmd" # optional
tag="v1" # default is latest
entrypoint="ENTRYPOINT [\"java\",\"-Xdiag\", \"-cp\", \"${APP}:jars/*\" \"$_init\" \"--b7a.http.accesslog.console=true\""
entrypoint="ENTRYPOINT [\"java\",\"-XX:+ExitOnOutOfMemoryError\",\"-Xdiag\", \"-cp\", \"${APP}:jars/*\" \"$_init\" \"--b7a.http.accesslog.console=true\""
base="ballerina/jre8:v1"
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ private String generateDockerfile() {
packageID.name.getValue(), packageID.version.getValue(), MODULE_INIT_CLASS_NAME);
List<String> args = new ArrayList<>();
args.add("java");
args.add("-XX:+ExitOnOutOfMemoryError");
args.add("-Xdiag");
if (this.dockerModel.isEnableDebug()) {
args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:" +
Expand Down