From 716ae332bca8fc6a8a257b13bc343789e9c2f310 Mon Sep 17 00:00:00 2001 From: Libor Fuka Date: Fri, 29 May 2026 08:48:22 +0200 Subject: [PATCH 1/2] New runtimes tests 05/2026 --- exporter/test/e2e/golang_test.go | 22 ++ exporter/test/e2e/java_test.go | 23 ++ exporter/test/e2e/nodejs_test.go | 24 +- exporter/test/e2e/os_test.go | 8 + exporter/test/e2e/quarkus_test.go | 52 +++ exporter/test/e2e/spring_boot_test.go | 27 ++ exporter/test/e2e/tomcat_test.go | 27 ++ exporter/test/e2e/wildfly_test.go | 28 ++ runtime-samples/Makefile | 19 +- .../golang-app/1.26.3/Containerfile | 9 + runtime-samples/golang-app/1.26.3/Makefile | 7 + runtime-samples/golang-app/1.26.3/README.md | 20 ++ runtime-samples/golang-app/1.26.3/deploy.sh | 10 + .../golang-app/1.26.3/http-server.go | 28 ++ runtime-samples/nodejs/26.2.0/Containerfile | 6 + runtime-samples/nodejs/26.2.0/Makefile | 4 + runtime-samples/nodejs/26.2.0/README.md | 20 ++ runtime-samples/nodejs/26.2.0/deploy.sh | 10 + .../plain-java/26.0.1/Containerfile | 4 + runtime-samples/plain-java/26.0.1/Makefile | 7 + runtime-samples/plain-java/26.0.1/README.md | 25 ++ runtime-samples/plain-java/26.0.1/deploy.sh | 7 + runtime-samples/plain-java/26.0.1/pom.xml | 54 +++ .../26.0.1/src/main/java/HelloWorld.java | 13 + runtime-samples/quarkus/3.36.0/Makefile | 17 + runtime-samples/quarkus/3.36.0/README.md | 46 +++ runtime-samples/quarkus/3.36.0/mvnw | 332 ++++++++++++++++++ runtime-samples/quarkus/3.36.0/mvnw.cmd | 206 +++++++++++ runtime-samples/quarkus/3.36.0/pom.xml | 130 +++++++ .../3.36.0/src/main/docker/Dockerfile.jvm | 97 +++++ .../src/main/docker/Dockerfile.legacy-jar | 93 +++++ .../3.36.0/src/main/docker/Dockerfile.native | 27 ++ .../src/main/docker/Dockerfile.native-micro | 30 ++ .../main/java/org/acme/GreetingResource.java | 16 + .../src/main/resources/application.properties | 0 .../java/org/acme/GreetingResourceIT.java | 8 + .../java/org/acme/GreetingResourceTest.java | 20 ++ .../spring-boot/4.0.6/Containerfile | 5 + runtime-samples/spring-boot/4.0.6/Makefile | 7 + runtime-samples/spring-boot/4.0.6/README.md | 29 ++ runtime-samples/spring-boot/4.0.6/deploy.sh | 7 + runtime-samples/spring-boot/4.0.6/pom.xml | 41 +++ .../com/example/demo/DemoApplication.java | 13 + .../example/demo/web/SampleController.java | 16 + 44 files changed, 1591 insertions(+), 3 deletions(-) create mode 100644 runtime-samples/golang-app/1.26.3/Containerfile create mode 100644 runtime-samples/golang-app/1.26.3/Makefile create mode 100644 runtime-samples/golang-app/1.26.3/README.md create mode 100755 runtime-samples/golang-app/1.26.3/deploy.sh create mode 100644 runtime-samples/golang-app/1.26.3/http-server.go create mode 100644 runtime-samples/nodejs/26.2.0/Containerfile create mode 100644 runtime-samples/nodejs/26.2.0/Makefile create mode 100644 runtime-samples/nodejs/26.2.0/README.md create mode 100755 runtime-samples/nodejs/26.2.0/deploy.sh create mode 100644 runtime-samples/plain-java/26.0.1/Containerfile create mode 100644 runtime-samples/plain-java/26.0.1/Makefile create mode 100644 runtime-samples/plain-java/26.0.1/README.md create mode 100755 runtime-samples/plain-java/26.0.1/deploy.sh create mode 100644 runtime-samples/plain-java/26.0.1/pom.xml create mode 100644 runtime-samples/plain-java/26.0.1/src/main/java/HelloWorld.java create mode 100644 runtime-samples/quarkus/3.36.0/Makefile create mode 100644 runtime-samples/quarkus/3.36.0/README.md create mode 100755 runtime-samples/quarkus/3.36.0/mvnw create mode 100755 runtime-samples/quarkus/3.36.0/mvnw.cmd create mode 100644 runtime-samples/quarkus/3.36.0/pom.xml create mode 100644 runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.jvm create mode 100644 runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.legacy-jar create mode 100644 runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native create mode 100644 runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native-micro create mode 100644 runtime-samples/quarkus/3.36.0/src/main/java/org/acme/GreetingResource.java create mode 100644 runtime-samples/quarkus/3.36.0/src/main/resources/application.properties create mode 100644 runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceIT.java create mode 100644 runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceTest.java create mode 100644 runtime-samples/spring-boot/4.0.6/Containerfile create mode 100644 runtime-samples/spring-boot/4.0.6/Makefile create mode 100644 runtime-samples/spring-boot/4.0.6/README.md create mode 100755 runtime-samples/spring-boot/4.0.6/deploy.sh create mode 100644 runtime-samples/spring-boot/4.0.6/pom.xml create mode 100644 runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/DemoApplication.java create mode 100644 runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/web/SampleController.java diff --git a/exporter/test/e2e/golang_test.go b/exporter/test/e2e/golang_test.go index 0e7a27d4..ab56ed5f 100644 --- a/exporter/test/e2e/golang_test.go +++ b/exporter/test/e2e/golang_test.go @@ -72,4 +72,26 @@ func TestGolang_1_25_4(t *testing.T) { g.Expect(runtimeInfo).Should(Ω.Equal(expected)) })) _ = testenv.Test(t, feature.Feature()) +} + +func TestGolang_1_26_3(t *testing.T) { + + appName := "golang-app-1-26-3" + containerName := "main" + image := "quay.io/insights-runtime-extractor-samples/golang-app:1.26.3" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("Golang application "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "debian", + OsVersion: "13", + Kind: "Golang", + KindVersion: "go1.26.3", + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) } \ No newline at end of file diff --git a/exporter/test/e2e/java_test.go b/exporter/test/e2e/java_test.go index 1b600a53..2a87a7ad 100644 --- a/exporter/test/e2e/java_test.go +++ b/exporter/test/e2e/java_test.go @@ -76,3 +76,26 @@ func TestJava_25_0_1(t *testing.T) { })) _ = testenv.Test(t, feature.Feature()) } + +func TestJava_26_0_1(t *testing.T) { + + appName := "plain-java" + containerName := "main" + image := "quay.io/insights-runtime-extractor-samples/plain-java:26.0.1" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("Plain Java from "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "rhel", + OsVersion: "10.0", + Kind: "Java", + KindVersion: "26.0.1", + KindImplementer: "Eclipse Adoptium", + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) +} diff --git a/exporter/test/e2e/nodejs_test.go b/exporter/test/e2e/nodejs_test.go index 25637d01..35436f93 100644 --- a/exporter/test/e2e/nodejs_test.go +++ b/exporter/test/e2e/nodejs_test.go @@ -77,7 +77,7 @@ func TestNodeJS_24_4_1(t *testing.T) { func TestNodeJS_25_1_0(t *testing.T) { appName := "node-app-25-1-0" containerName := "nodejs-25-1-0" - // corresponded to node:24.4.1-alpine3.22 + // corresponded to node:25.1.0-alpine3.22 image := "quay.io/insights-runtime-extractor-samples/node:25.1.0-alpine3.22" deployment := newAppDeployment(namespace, appName, 1, containerName, image) @@ -96,3 +96,25 @@ func TestNodeJS_25_1_0(t *testing.T) { _ = testenv.Test(t, feature.Feature()) } +func TestNodeJS_26_2_0(t *testing.T) { + appName := "node-app-26-2-0" + containerName := "nodejs-26-2-0" + // corresponded to node:26.2.0-alpine3.23 + image := "quay.io/insights-runtime-extractor-samples/node:26.2.0-alpine3.23" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("Node.js from base image "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "alpine", + OsVersion: "3.23", + Kind: "Node.js", + KindVersion: "v26.2.0", + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) +} + diff --git a/exporter/test/e2e/os_test.go b/exporter/test/e2e/os_test.go index 4cef6ada..b75c7317 100644 --- a/exporter/test/e2e/os_test.go +++ b/exporter/test/e2e/os_test.go @@ -11,10 +11,18 @@ import ( "sigs.k8s.io/e2e-framework/pkg/features" ) +func TestUbi10Minimal_10_2(t *testing.T) { + testBaseImage(t, "registry.access.redhat.com/ubi10-minimal:10.2", "rhel", "10.2") +} + func TestUbi10Minimal_10_0(t *testing.T) { testBaseImage(t, "registry.access.redhat.com/ubi10-minimal:10.0", "rhel", "10.0") } +func TestUbi9Minimal_9_8(t *testing.T) { + testBaseImage(t, "registry.access.redhat.com/ubi9-minimal:9.8", "rhel", "9.8") +} + func TestUbi9Minimal_9_6(t *testing.T) { testBaseImage(t, "registry.access.redhat.com/ubi9-minimal:9.6", "rhel", "9.6") } diff --git a/exporter/test/e2e/quarkus_test.go b/exporter/test/e2e/quarkus_test.go index 47b84796..b3394efb 100644 --- a/exporter/test/e2e/quarkus_test.go +++ b/exporter/test/e2e/quarkus_test.go @@ -267,6 +267,58 @@ func TestNativeQuarkus_3_29_2(t *testing.T) { _ = testenv.Test(t, feature.Feature()) } +func TestQuarkus_3_36_0(t *testing.T) { + + appName := "quarkus" + containerName := "main" + image := "quay.io/insights-runtime-extractor-samples/quarkus:3.36.0" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("Quarkus from "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "rhel", + OsVersion: "8.10", + Kind: "Java", + KindVersion: "21.0.4", + KindImplementer: "Red Hat, Inc.", + Runtimes: []types.RuntimeComponent{{ + Name: "Quarkus", + Version: "3.36.0", + }}, + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) +} + +func TestNativeQuarkus_3_36_0(t *testing.T) { + + appName := "native-quarkus" + containerName := "main" + image := "quay.io/insights-runtime-extractor-samples/native-quarkus:3.36.0" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("Native Quarkus from "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "rhel", + OsVersion: "8.10", + Kind: "GraalVM", + Runtimes: []types.RuntimeComponent{{ + Name: "Quarkus", + Version: "3.36.0", + }}, + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) +} + func TestRedHatBuildOfQuarkus_3_8_6(t *testing.T) { appName := "quarkus" diff --git a/exporter/test/e2e/spring_boot_test.go b/exporter/test/e2e/spring_boot_test.go index d6bb67e2..00f42529 100644 --- a/exporter/test/e2e/spring_boot_test.go +++ b/exporter/test/e2e/spring_boot_test.go @@ -88,3 +88,30 @@ func TestSpringBootJar_3_5_3(t *testing.T) { })) _ = testenv.Test(t, feature.Feature()) } + +func TestSpringBootJar_4_0_6(t *testing.T) { + + appName := "spring-boot" + containerName := "main" + image := "quay.io/insights-runtime-extractor-samples/spring-boot:4.0.6" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("Spring Boot from "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "rhel", + OsVersion: "8.10", + Kind: "Java", + KindVersion: "21.0.6", + KindImplementer: "Red Hat, Inc.", + Runtimes: []types.RuntimeComponent{{ + Name: "Spring Boot", + Version: "4.0.6", + }}, + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) +} \ No newline at end of file diff --git a/exporter/test/e2e/tomcat_test.go b/exporter/test/e2e/tomcat_test.go index 94413265..6302ddb8 100644 --- a/exporter/test/e2e/tomcat_test.go +++ b/exporter/test/e2e/tomcat_test.go @@ -117,4 +117,31 @@ func TestJBossWebServer_6_1_0(t *testing.T) { g.Expect(runtimeInfo).Should(Ω.Equal(expected)) })) _ = testenv.Test(t, feature.Feature()) +} + +func TestJBossWebServer_6_2_0(t *testing.T) { + + appName := "jboss-webserver-6-2-0" + containerName := "main" + image := "registry.redhat.io/jboss-webserver-6/jws62-openjdk21-openshift-rhel9@sha256:1ba4324dd5bc243e50be58b0fc93e3e100b0b4366801daa37c60dcefeb20562d" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("JBoss WebServer 6.2.0 from base image "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "rhel", + OsVersion: "9.8", + Kind: "Java", + KindVersion: "21.0.7", + KindImplementer: "Red Hat, Inc.", + Runtimes: []types.RuntimeComponent{{ + Name: "Apache Tomcat", + Version: "10.1.49.redhat-00011", + }}, + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) } \ No newline at end of file diff --git a/exporter/test/e2e/wildfly_test.go b/exporter/test/e2e/wildfly_test.go index f4eb3e44..43219f2f 100644 --- a/exporter/test/e2e/wildfly_test.go +++ b/exporter/test/e2e/wildfly_test.go @@ -146,4 +146,32 @@ func TestWildFly_38_0_0_Final(t *testing.T) { g.Expect(runtimeInfo).Should(Ω.Equal(expected)) })) _ = testenv.Test(t, feature.Feature()) +} + +func TestWildFly_40_0_0_Final(t *testing.T) { + + appName := "wildfly-40-0-0-app" + containerName := "main" + // corresponded to quay.io/wildfly/wildfly:40.0.0.Final-jdk21 + image := "quay.io/wildfly/wildfly@sha256:d974604dafe72557654d834d1dec060e953429b7ecf3d7dac3988d95514a3caa" + deployment := newAppDeployment(namespace, appName, 1, containerName, image) + + feature := features.New("WildFly from "+image). + Setup(deployTestResource(deployment, appName)). + Teardown(undeployTestResource(deployment, appName)). + Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { + expected := types.ContainerRuntimeInfo{ + Os: "rhel", + OsVersion: "9.6", + Kind: "Java", + KindVersion: "21.0.8", + KindImplementer: "Eclipse Adoptium", + Runtimes: []types.RuntimeComponent{{ + Name: "WildFly", + Version: "40.0.0.Final", + }}, + } + g.Expect(runtimeInfo).Should(Ω.Equal(expected)) + })) + _ = testenv.Test(t, feature.Feature()) } \ No newline at end of file diff --git a/runtime-samples/Makefile b/runtime-samples/Makefile index 93233724..ee8fb622 100644 --- a/runtime-samples/Makefile +++ b/runtime-samples/Makefile @@ -1,6 +1,6 @@ -.PHONY: golang-app-1.22.6 golang-app-1.24.1 golang-app-1.25.4 quarkus-3.13.0 quarkus-3.15.1 quarkus-3.19.3 quarkus-3.24.4 quarkus-3.29.2 spring-boot-3.1.4 spring-boot-3.4.3 spring-boot-3.5.3 plain-java-17.0.13 plain-java-24.0.1 plain-java-25.0.1 python-app-2.7.18 python-app-3.9.19 python-app-3.13.2 python-app-3.14.0 nodejs-app-22.6.0 nodejs-app-22.14.0 nodejs-app-24.4.1 nodejs-app-25.1.0 RHBQ-3.8.6 RHBQ-3.15.3 RHBQ-3.20.1 RHBQ-3.27.0 debian-11 debian-12 debian-13 oracle-linux-8 oracle-linux-10 +.PHONY: golang-app-1.22.6 golang-app-1.24.1 golang-app-1.25.4 golang-app-1.26.3 quarkus-3.13.0 quarkus-3.15.1 quarkus-3.19.3 quarkus-3.24.4 quarkus-3.29.2 quarkus-3.36.0 spring-boot-3.1.4 spring-boot-3.4.3 spring-boot-3.5.3 spring-boot-4.0.6 plain-java-17.0.13 plain-java-24.0.1 plain-java-25.0.1 plain-java-26.0.1 python-app-2.7.18 python-app-3.9.19 python-app-3.13.2 python-app-3.14.0 nodejs-app-22.6.0 nodejs-app-22.14.0 nodejs-app-24.4.1 nodejs-app-25.1.0 nodejs-app-26.2.0 RHBQ-3.8.6 RHBQ-3.15.3 RHBQ-3.20.1 RHBQ-3.27.0 debian-11 debian-12 debian-13 oracle-linux-8 oracle-linux-10 -all: quarkus-3.13.0 quarkus-3.15.1 quarkus-3.19.3 quarkus-3.24.4 quarkus-3.29.2 spring-boot-3.1.4 spring-boot-3.4.3 spring-boot-3.5.3 golang-app-1.22.6 golang-app-1.24.1 golang-app-1.25.4 plain-java-17.0.13 plain-java-24.0.1 plain-java-25.0.1 python-app-2.7.18 python-app-3.9.19 python-app-3.13.2 python-app-3.14.0 nodejs-app-22.6.0 nodejs-app-22.14.0 nodejs-app-24.4.1 nodejs-app-25.1.0 RHBQ-3.8.6 RHBQ-3.15.3 RHBQ-3.20.1 RHBQ-3.27.0 debian-11 debian-12 debian-13 oracle-linux-8 oracle-linux-10 +all: quarkus-3.13.0 quarkus-3.15.1 quarkus-3.19.3 quarkus-3.24.4 quarkus-3.29.2 quarkus-3.36.0 spring-boot-3.1.4 spring-boot-3.4.3 spring-boot-3.5.3 spring-boot-4.0.6 golang-app-1.22.6 golang-app-1.24.1 golang-app-1.25.4 golang-app-1.26.3 plain-java-17.0.13 plain-java-24.0.1 plain-java-25.0.1 plain-java-26.0.1 python-app-2.7.18 python-app-3.9.19 python-app-3.13.2 python-app-3.14.0 nodejs-app-22.6.0 nodejs-app-22.14.0 nodejs-app-24.4.1 nodejs-app-25.1.0 nodejs-app-26.2.0 RHBQ-3.8.6 RHBQ-3.15.3 RHBQ-3.20.1 RHBQ-3.27.0 debian-11 debian-12 debian-13 oracle-linux-8 oracle-linux-10 nodejs-app-22.6.0: cd ./nodejs/22.6.0 && make @@ -14,6 +14,9 @@ nodejs-app-24.4.1: nodejs-app-25.1.0: cd ./nodejs/25.1.0 && make +nodejs-app-26.2.0: + cd ./nodejs/26.2.0 && make + python-app-2.7.18: cd ./python/2.7.18 && make @@ -35,6 +38,9 @@ golang-app-1.24.1: golang-app-1.25.4: cd ./golang-app/1.25.4 && make +golang-app-1.26.3: + cd ./golang-app/1.26.3 && make + quarkus-3.13.0: cd ./quarkus/3.13.0. && make @@ -50,6 +56,9 @@ quarkus-3.24.4: quarkus-3.29.2: cd ./quarkus/3.29.2 && make +quarkus-3.36.0: + cd ./quarkus/3.36.0 && make + spring-boot-3.1.4: cd ./spring-boot/3.1.4 && make @@ -59,6 +68,9 @@ spring-boot-3.4.3: spring-boot-3.5.3: cd ./spring-boot/3.5.3 && make +spring-boot-4.0.6: + cd ./spring-boot/4.0.6 && make + RHBQ-3.8.6: cd ./RHBQ/3.8.6 && make @@ -80,6 +92,9 @@ plain-java-24.0.1: plain-java-25.0.1: cd ./plain-java/25.0.1 && make +plain-java-26.0.1: + cd ./plain-java/26.0.1 && make + debian-11: cd ./debian/11 && make diff --git a/runtime-samples/golang-app/1.26.3/Containerfile b/runtime-samples/golang-app/1.26.3/Containerfile new file mode 100644 index 00000000..037fbe98 --- /dev/null +++ b/runtime-samples/golang-app/1.26.3/Containerfile @@ -0,0 +1,9 @@ +# corresponded to 1.26.3 +FROM golang@sha256:2d6c80227255c3112a4d08e67ba98e58efd3846daf15d9d7d4c389565d881b1a + +WORKDIR /workspace/golang-app +COPY . . +ARG GO_LDFLAGS="" +RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on make build + +ENTRYPOINT [ "/workspace/golang-app/http-server" ] \ No newline at end of file diff --git a/runtime-samples/golang-app/1.26.3/Makefile b/runtime-samples/golang-app/1.26.3/Makefile new file mode 100644 index 00000000..e8b5fc70 --- /dev/null +++ b/runtime-samples/golang-app/1.26.3/Makefile @@ -0,0 +1,7 @@ +.DEFAULT_GOAL = push + +build: + go build -o http-server http-server.go + +push: + ./deploy.sh diff --git a/runtime-samples/golang-app/1.26.3/README.md b/runtime-samples/golang-app/1.26.3/README.md new file mode 100644 index 00000000..58f241bf --- /dev/null +++ b/runtime-samples/golang-app/1.26.3/README.md @@ -0,0 +1,20 @@ +# golang-app +# Runtime sample for the insights-runtime-extractor + +To build the container image and make it available to the OpenShift internal image +registry, run: + +```shell script +make +``` + +# Workload Runtime Information: + +```json +"runtimeInfo": { + "os": "debian", + "osVersion": "13", + "kind": "Golang", + "kindVersion": "go1.26.3", +} +``` \ No newline at end of file diff --git a/runtime-samples/golang-app/1.26.3/deploy.sh b/runtime-samples/golang-app/1.26.3/deploy.sh new file mode 100755 index 00000000..e5330e9b --- /dev/null +++ b/runtime-samples/golang-app/1.26.3/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +IMAGE_NAME=golang-app:1.26.3 +CONTAINER_REGISTRY=quay.io/insights-runtime-extractor-samples +IMAGE=${CONTAINER_REGISTRY}/${IMAGE_NAME} + +echo "Building ${IMAGE}" +podman build --platform linux/amd64 -t ${IMAGE} . +echo "Pushing ${IMAGE}" +podman push ${IMAGE} \ No newline at end of file diff --git a/runtime-samples/golang-app/1.26.3/http-server.go b/runtime-samples/golang-app/1.26.3/http-server.go new file mode 100644 index 00000000..44fb79d5 --- /dev/null +++ b/runtime-samples/golang-app/1.26.3/http-server.go @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "net/http" +) + +func hello(w http.ResponseWriter, req *http.Request) { + + fmt.Fprintf(w, "hello\n") +} + +func headers(w http.ResponseWriter, req *http.Request) { + + for name, headers := range req.Header { + for _, h := range headers { + fmt.Fprintf(w, "%v: %v\n", name, h) + } + } +} + +func main() { + + http.HandleFunc("/hello", hello) + http.HandleFunc("/headers", headers) + + http.ListenAndServe(":8090", nil) +} diff --git a/runtime-samples/nodejs/26.2.0/Containerfile b/runtime-samples/nodejs/26.2.0/Containerfile new file mode 100644 index 00000000..bd5d9d91 --- /dev/null +++ b/runtime-samples/nodejs/26.2.0/Containerfile @@ -0,0 +1,6 @@ +# corresponded to node:26.2.0-alpine3.23 +FROM node@sha256:7c6af15abe4e3de859690e7db171d0d711bf37d27528eddfe625b2fe89e097f8 + +WORKDIR /workspace + +ENTRYPOINT [ "node", "-e", "r=require;r(\"http\").createServer((i,o)=>r(\"stream\").pipeline(r(\"fs\").createReadStream(i.url.slice(1)),o,_=>_)).listen(8080)" ] \ No newline at end of file diff --git a/runtime-samples/nodejs/26.2.0/Makefile b/runtime-samples/nodejs/26.2.0/Makefile new file mode 100644 index 00000000..9cf0fd5d --- /dev/null +++ b/runtime-samples/nodejs/26.2.0/Makefile @@ -0,0 +1,4 @@ +.DEFAULT_GOAL = push + +push: + ./deploy.sh diff --git a/runtime-samples/nodejs/26.2.0/README.md b/runtime-samples/nodejs/26.2.0/README.md new file mode 100644 index 00000000..3dc5874d --- /dev/null +++ b/runtime-samples/nodejs/26.2.0/README.md @@ -0,0 +1,20 @@ +# nodejs-app +# Runtime sample for the insights-runtime-extractor + +To build the container image and make it available to the OpenShift internal image +registry, run: + +```shell script +make +``` + +# Workload Runtime Information: + +```json +"runtimeInfo": { + "os": "alpine", + "osVersion": "3.23", + "kind": "Node.js", + "kindVersion": "v26.2.0", +} +``` \ No newline at end of file diff --git a/runtime-samples/nodejs/26.2.0/deploy.sh b/runtime-samples/nodejs/26.2.0/deploy.sh new file mode 100755 index 00000000..f5f6378c --- /dev/null +++ b/runtime-samples/nodejs/26.2.0/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +IMAGE_NAME=node:26.2.0-alpine3.23 +CONTAINER_REGISTRY=quay.io/insights-runtime-extractor-samples +IMAGE=${CONTAINER_REGISTRY}/${IMAGE_NAME} + +echo "Building ${IMAGE}" +podman build --platform linux/amd64 -t ${IMAGE} . +echo "Pushing ${IMAGE}" +podman push ${IMAGE} \ No newline at end of file diff --git a/runtime-samples/plain-java/26.0.1/Containerfile b/runtime-samples/plain-java/26.0.1/Containerfile new file mode 100644 index 00000000..ce0c2d59 --- /dev/null +++ b/runtime-samples/plain-java/26.0.1/Containerfile @@ -0,0 +1,4 @@ +# Eclipse Temurin 26.0.1_8-jdk-ubi10-minimal +FROM eclipse-temurin@sha256:753634b50e80662e3fee5ee38c6436663cf23596a13008f8499208f18f97f578 +COPY target/plain-java-0.0.1-SNAPSHOT-jar-with-dependencies.jar /plain-java-app.jar +ENTRYPOINT ["java","-jar","/plain-java-app.jar"] \ No newline at end of file diff --git a/runtime-samples/plain-java/26.0.1/Makefile b/runtime-samples/plain-java/26.0.1/Makefile new file mode 100644 index 00000000..d5c80f02 --- /dev/null +++ b/runtime-samples/plain-java/26.0.1/Makefile @@ -0,0 +1,7 @@ +.DEFAULT_GOAL = push + +build: + mvn package + +push: build + ./deploy.sh diff --git a/runtime-samples/plain-java/26.0.1/README.md b/runtime-samples/plain-java/26.0.1/README.md new file mode 100644 index 00000000..166db391 --- /dev/null +++ b/runtime-samples/plain-java/26.0.1/README.md @@ -0,0 +1,25 @@ +# plain-java + +# Runtime sample for the insights-runtime-extractor + +To build the container image and make it available to the OpenShift internal image +registry, run: + +```shell script +make +``` + +# Workload Runtime Information: + + +```json +"runtimeInfo": { + "os": "rhel", + "osVersion": "10", + "kind": "Java", + "kindVersion": "26.0.1", + "kindImplementer": "Eclipse Adoptium", + "runtimes": [ + ] +} +``` \ No newline at end of file diff --git a/runtime-samples/plain-java/26.0.1/deploy.sh b/runtime-samples/plain-java/26.0.1/deploy.sh new file mode 100755 index 00000000..4667e271 --- /dev/null +++ b/runtime-samples/plain-java/26.0.1/deploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +IMAGE=quay.io/insights-runtime-extractor-samples/plain-java:26.0.1 + +echo "Building & pushing ${IMAGE}" +podman build --platform linux/amd64 -t ${IMAGE} . +podman push ${IMAGE} \ No newline at end of file diff --git a/runtime-samples/plain-java/26.0.1/pom.xml b/runtime-samples/plain-java/26.0.1/pom.xml new file mode 100644 index 00000000..0f8d8f84 --- /dev/null +++ b/runtime-samples/plain-java/26.0.1/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.helloWorld + plain-java + 0.0.1-SNAPSHOT + hello-world + Hello World test app for insights + + + 26 + 3.7.1 + 3.13.0 + + + + + + org.apache.maven.plugins + maven-assembly-plugin + ${maven.assembly.version} + + + + HelloWorld + + + + jar-with-dependencies + + + + + make-my-jar-with-dependencies + package + + single + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + ${maven.compiler.release.version} + + + + + \ No newline at end of file diff --git a/runtime-samples/plain-java/26.0.1/src/main/java/HelloWorld.java b/runtime-samples/plain-java/26.0.1/src/main/java/HelloWorld.java new file mode 100644 index 00000000..1d8aa9b8 --- /dev/null +++ b/runtime-samples/plain-java/26.0.1/src/main/java/HelloWorld.java @@ -0,0 +1,13 @@ +public class HelloWorld { + + public static void main(String[] args){ + while (!Thread.currentThread().isInterrupted()) { + System.out.println("Hello World"); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/runtime-samples/quarkus/3.36.0/Makefile b/runtime-samples/quarkus/3.36.0/Makefile new file mode 100644 index 00000000..5336004c --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/Makefile @@ -0,0 +1,17 @@ +.DEFAULT_GOAL = push + +build: + ./mvnw install + +# corresponded to quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.1.9.0-Final-java21-amd64 +build-native: + ./mvnw clean package -DskipTests \ + -Dnative \ + -Dquarkus.native.container-build=true \ + -Dquarkus.native.container-runtime=podman \ + -Dquarkus.native.march=x86-64-v3 \ + -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image@sha256:39f81544bb9f1c6b663fc73e93400887f5b084ebf03c12e50785b5883a444fca \ + -Dquarkus.container-image.image=quay.io/insights-runtime-extractor-samples/native-quarkus:3.36.0 + + +push: build build-native \ No newline at end of file diff --git a/runtime-samples/quarkus/3.36.0/README.md b/runtime-samples/quarkus/3.36.0/README.md new file mode 100644 index 00000000..7d389a52 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/README.md @@ -0,0 +1,46 @@ +# quarkus 3.36.0 + +# Runtime sample for the insights-runtime-extractor + +To build the container image and make it available to the OpenShift internal image +registry, run: + +```shell script +make +``` + +# Workload Runtime Information: + +For the OpenJDK image: + +```json +"runtimeInfo": { + "os": "rhel", + "osVersion": "8.10", + "kind": "Java", + "kindVersion": "21.0.4", + "kindImplementer": "Red Hat, Inc.", + "runtimes": [ + { + "name": "Quarkus", + "version": "3.36.0" + } + ] +} +``` + +For the native image: + +```json +"runtimeInfo": { + "os": "rhel", + "osVersion": "8.10", + "kind": "GraalVM", + "runtimes": [ + { + "name": "Quarkus", + "version": "3.36.0" + } + ] +} +``` \ No newline at end of file diff --git a/runtime-samples/quarkus/3.36.0/mvnw b/runtime-samples/quarkus/3.36.0/mvnw new file mode 100755 index 00000000..5e9618ca --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/mvnw @@ -0,0 +1,332 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ]; then + + if [ -f /usr/local/etc/mavenrc ]; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ]; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ]; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false +darwin=false +mingw=false +case "$(uname)" in +CYGWIN*) cygwin=true ;; +MINGW*) mingw=true ;; +Darwin*) + darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)" + export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home" + export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ]; then + if [ -r /etc/gentoo-release ]; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin; then + [ -n "$JAVA_HOME" ] \ + && JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] \ + && CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] \ + && JAVA_HOME="$( + cd "$JAVA_HOME" || ( + echo "cannot cd into $JAVA_HOME." >&2 + exit 1 + ) + pwd + )" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "$javaExecutable" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin; then + javaHome="$(dirname "$javaExecutable")" + javaExecutable="$(cd "$javaHome" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "$javaExecutable")" + fi + javaHome="$(dirname "$javaExecutable")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ]; then + if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$( + \unset -f command 2>/dev/null + \command -v java + )" + fi +fi + +if [ ! -x "$JAVACMD" ]; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ]; then + echo "Warning: JAVA_HOME environment variable is not set." >&2 +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ]; then + echo "Path not specified to find_maven_basedir" >&2 + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ]; do + if [ -d "$wdir"/.mvn ]; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$( + cd "$wdir/.." || exit 1 + pwd + ) + fi + # end of workaround + done + printf '%s' "$( + cd "$basedir" || exit 1 + pwd + )" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' <"$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1 +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in wrapperUrl) + wrapperUrl="$safeValue" + break + ;; + esac + done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget >/dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl >/dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in wrapperSha256Sum) + wrapperSha256Sum=$value + break + ;; + esac +done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum >/dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c >/dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c >/dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] \ + && JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] \ + && CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] \ + && MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/runtime-samples/quarkus/3.36.0/mvnw.cmd b/runtime-samples/quarkus/3.36.0/mvnw.cmd new file mode 100755 index 00000000..4136715f --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/mvnw.cmd @@ -0,0 +1,206 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. >&2 +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. >&2 +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. >&2 +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. >&2 +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash;"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/runtime-samples/quarkus/3.36.0/pom.xml b/runtime-samples/quarkus/3.36.0/pom.xml new file mode 100644 index 00000000..c27e0b47 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/pom.xml @@ -0,0 +1,130 @@ + + + 4.0.0 + insights-runtime-extractor-samples + quarkus + 1.0.0-SNAPSHOT + + + 3.14.0 + 21 + UTF-8 + UTF-8 + 3.36.0 + true + 3.3.1 + linux/amd64 + true + true + quay.io/insights-runtime-extractor-samples/quarkus:${quarkus.platform.version} + + + + + + io.quarkus + quarkus-bom + ${quarkus.platform.version} + pom + import + + + + + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-rest + + + io.quarkus + quarkus-container-image-podman + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + true + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + native + + + + false + true + + + + diff --git a/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.jvm b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.jvm new file mode 100644 index 00000000..3949c745 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.jvm @@ -0,0 +1,97 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/code-with-quarkus-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-jvm +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-jvm +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +#FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 +FROM registry.access.redhat.com/ubi8/openjdk-21-runtime@sha256:ddbb1ea169c262f8001ed76ad9bea178413927cc94eb238a174da78fb03304c5 +ENV LANGUAGE='en_US:en' + + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 target/quarkus-app/*.jar /deployments/ +COPY --chown=185 target/quarkus-app/app/ /deployments/app/ +COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] + diff --git a/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.legacy-jar b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.legacy-jar new file mode 100644 index 00000000..7eb464a9 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.legacy-jar @@ -0,0 +1,93 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the container image run: +# +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/code-with-quarkus-legacy-jar . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-legacy-jar +# +# If you want to include the debug port into your docker image +# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005. +# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005 +# when running the container +# +# Then run the container using : +# +# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus-legacy-jar +# +# This image uses the `run-java.sh` script to run the application. +# This scripts computes the command line to execute your Java application, and +# includes memory/GC tuning. +# You can configure the behavior using the following environment properties: +# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") +# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options +# in JAVA_OPTS (example: "-Dsome.property=foo") +# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is +# used to calculate a default maximal heap memory based on a containers restriction. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio +# of the container available memory as set here. The default is `50` which means 50% +# of the available memory is used as an upper boundary. You can skip this mechanism by +# setting this value to `0` in which case no `-Xmx` option is added. +# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This +# is used to calculate a default initial heap memory based on the maximum heap memory. +# If used in a container without any memory constraints for the container then this +# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio +# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx` +# is used as the initial heap size. You can skip this mechanism by setting this value +# to `0` in which case no `-Xms` option is added (example: "25") +# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS. +# This is used to calculate the maximum value of the initial heap memory. If used in +# a container without any memory constraints for the container then this option has +# no effect. If there is a memory constraint then `-Xms` is limited to the value set +# here. The default is 4096MB which means the calculated value of `-Xms` never will +# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096") +# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output +# when things are happening. This option, if set to true, will set +# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true"). +# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example: +# true"). +# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787"). +# - CONTAINER_CORE_LIMIT: A calculated core limit as described in +# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2") +# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024"). +# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion. +# (example: "20") +# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking. +# (example: "40") +# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection. +# (example: "4") +# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus +# previous GC times. (example: "90") +# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20") +# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100") +# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should +# contain the necessary JRE command-line options to specify the required GC, which +# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC). +# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080") +# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080") +# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be +# accessed directly. (example: "foo.example.com,bar.example.com") +# +### +FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 + +ENV LANGUAGE='en_US:en' + + +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/quarkus-run.jar + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" + +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ] diff --git a/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native new file mode 100644 index 00000000..60b0f9a4 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native @@ -0,0 +1,27 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/code-with-quarkus . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native-micro b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native-micro new file mode 100644 index 00000000..373286b8 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/main/docker/Dockerfile.native-micro @@ -0,0 +1,30 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. +# It uses a micro base image, tuned for Quarkus native executables. +# It reduces the size of the resulting container image. +# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image. +# +# Before building the container image run: +# +# ./mvnw package -Dnative +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/code-with-quarkus . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus +# +### +FROM quay.io/quarkus/quarkus-micro-image:2.0 +WORKDIR /work/ +RUN chown 1001 /work \ + && chmod "g+rwX" /work \ + && chown 1001:root /work +COPY --chown=1001:root target/*-runner /work/application + +EXPOSE 8080 +USER 1001 + +ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/runtime-samples/quarkus/3.36.0/src/main/java/org/acme/GreetingResource.java b/runtime-samples/quarkus/3.36.0/src/main/java/org/acme/GreetingResource.java new file mode 100644 index 00000000..244f2942 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/main/java/org/acme/GreetingResource.java @@ -0,0 +1,16 @@ +package org.acme; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/hello") +public class GreetingResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "Hello from Quarkus REST"; + } +} diff --git a/runtime-samples/quarkus/3.36.0/src/main/resources/application.properties b/runtime-samples/quarkus/3.36.0/src/main/resources/application.properties new file mode 100644 index 00000000..e69de29b diff --git a/runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceIT.java b/runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceIT.java new file mode 100644 index 00000000..cfa9d1b1 --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceIT.java @@ -0,0 +1,8 @@ +package org.acme; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +class GreetingResourceIT extends GreetingResourceTest { + // Execute the same tests but in packaged mode. +} diff --git a/runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceTest.java b/runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceTest.java new file mode 100644 index 00000000..18332e4c --- /dev/null +++ b/runtime-samples/quarkus/3.36.0/src/test/java/org/acme/GreetingResourceTest.java @@ -0,0 +1,20 @@ +package org.acme; + +import io.quarkus.test.junit.QuarkusTest; +import org.junit.jupiter.api.Test; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; + +@QuarkusTest +class GreetingResourceTest { + @Test + void testHelloEndpoint() { + given() + .when().get("/hello") + .then() + .statusCode(200) + .body(is("Hello from Quarkus REST")); + } + +} \ No newline at end of file diff --git a/runtime-samples/spring-boot/4.0.6/Containerfile b/runtime-samples/spring-boot/4.0.6/Containerfile new file mode 100644 index 00000000..1968b8d3 --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/Containerfile @@ -0,0 +1,5 @@ +# Red Hat OpenJDK 21 +FROM registry.access.redhat.com/ubi8/openjdk-21@sha256:7aaabadcb6bbcc3783d3f5d0685037797efbb7a590088dafab7927414fe93a37 +WORKDIR /app +COPY target/rest-service-complete-0.0.1-SNAPSHOT.jar app.jar +ENTRYPOINT ["java","-jar","/app/app.jar"] diff --git a/runtime-samples/spring-boot/4.0.6/Makefile b/runtime-samples/spring-boot/4.0.6/Makefile new file mode 100644 index 00000000..9f985f09 --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/Makefile @@ -0,0 +1,7 @@ +.DEFAULT_GOAL = push + +build: + mvn install + +push: build + ./deploy.sh diff --git a/runtime-samples/spring-boot/4.0.6/README.md b/runtime-samples/spring-boot/4.0.6/README.md new file mode 100644 index 00000000..f8c18ebc --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/README.md @@ -0,0 +1,29 @@ +# spring-boot + +# Runtime sample for the insights-runtime-extractor + +To build the container image and make it available to the OpenShift internal image +registry, run: + +```shell script +make +``` + +# Workload Runtime Information: + + +```json +"runtimeInfo": { + "os": "rhle", + "osVersion": "8.10", + "kind": "Java", + "kindVersion": "21.0.6", + "kindImplementer": "Red Hat, Inc.", + "runtimes": [ + { + "name": "Spring Boot", + "version": "4.0.6" + } + ] +} +``` \ No newline at end of file diff --git a/runtime-samples/spring-boot/4.0.6/deploy.sh b/runtime-samples/spring-boot/4.0.6/deploy.sh new file mode 100755 index 00000000..d5017e71 --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/deploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +IMAGE=quay.io/insights-runtime-extractor-samples/spring-boot:4.0.6 + +echo "Building & pushing ${IMAGE}" +podman build --platform linux/amd64 -t ${IMAGE} . +podman push ${IMAGE} \ No newline at end of file diff --git a/runtime-samples/spring-boot/4.0.6/pom.xml b/runtime-samples/spring-boot/4.0.6/pom.xml new file mode 100644 index 00000000..39f6085a --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 4.0.6 + + + com.example + rest-service-complete + 0.0.1-SNAPSHOT + rest-service-complete + Demo project for Spring Boot + + 17 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/DemoApplication.java b/runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/DemoApplication.java new file mode 100644 index 00000000..64b538a1 --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/DemoApplication.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/web/SampleController.java b/runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/web/SampleController.java new file mode 100644 index 00000000..ace6dffc --- /dev/null +++ b/runtime-samples/spring-boot/4.0.6/src/main/java/com/example/demo/web/SampleController.java @@ -0,0 +1,16 @@ +package com.example.demo; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +public class SampleController { + + @GetMapping("/ping") + @ResponseBody + public String ping() { + return "pong"; + } + +} From f4365d88670f23683a49a6e35e73e12e51bb2519 Mon Sep 17 00:00:00 2001 From: Libor Fuka Date: Fri, 29 May 2026 09:34:38 +0200 Subject: [PATCH 2/2] Runtimes versions fixes --- exporter/test/e2e/java_test.go | 2 +- exporter/test/e2e/nodejs_test.go | 2 +- exporter/test/e2e/tomcat_test.go | 6 +++--- exporter/test/e2e/wildfly_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/exporter/test/e2e/java_test.go b/exporter/test/e2e/java_test.go index 2a87a7ad..b9df72f1 100644 --- a/exporter/test/e2e/java_test.go +++ b/exporter/test/e2e/java_test.go @@ -90,7 +90,7 @@ func TestJava_26_0_1(t *testing.T) { Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { expected := types.ContainerRuntimeInfo{ Os: "rhel", - OsVersion: "10.0", + OsVersion: "10.2", Kind: "Java", KindVersion: "26.0.1", KindImplementer: "Eclipse Adoptium", diff --git a/exporter/test/e2e/nodejs_test.go b/exporter/test/e2e/nodejs_test.go index 35436f93..854ca31f 100644 --- a/exporter/test/e2e/nodejs_test.go +++ b/exporter/test/e2e/nodejs_test.go @@ -109,7 +109,7 @@ func TestNodeJS_26_2_0(t *testing.T) { Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { expected := types.ContainerRuntimeInfo{ Os: "alpine", - OsVersion: "3.23", + OsVersion: "3.23.4", Kind: "Node.js", KindVersion: "v26.2.0", } diff --git a/exporter/test/e2e/tomcat_test.go b/exporter/test/e2e/tomcat_test.go index 6302ddb8..dac5d2ec 100644 --- a/exporter/test/e2e/tomcat_test.go +++ b/exporter/test/e2e/tomcat_test.go @@ -132,13 +132,13 @@ func TestJBossWebServer_6_2_0(t *testing.T) { Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { expected := types.ContainerRuntimeInfo{ Os: "rhel", - OsVersion: "9.8", + OsVersion: "9.7", Kind: "Java", - KindVersion: "21.0.7", + KindVersion: "21.0.10", KindImplementer: "Red Hat, Inc.", Runtimes: []types.RuntimeComponent{{ Name: "Apache Tomcat", - Version: "10.1.49.redhat-00011", + Version: "10.1.49.redhat-00006", }}, } g.Expect(runtimeInfo).Should(Ω.Equal(expected)) diff --git a/exporter/test/e2e/wildfly_test.go b/exporter/test/e2e/wildfly_test.go index 43219f2f..f00fb8d1 100644 --- a/exporter/test/e2e/wildfly_test.go +++ b/exporter/test/e2e/wildfly_test.go @@ -162,9 +162,9 @@ func TestWildFly_40_0_0_Final(t *testing.T) { Assess("runtime info extracted", checkExtractedRuntimeInfo(namespace, "app="+appName, containerName, func(g *Ω.WithT, runtimeInfo types.ContainerRuntimeInfo) { expected := types.ContainerRuntimeInfo{ Os: "rhel", - OsVersion: "9.6", + OsVersion: "9.8", Kind: "Java", - KindVersion: "21.0.8", + KindVersion: "21.0.11", KindImplementer: "Eclipse Adoptium", Runtimes: []types.RuntimeComponent{{ Name: "WildFly",