From cb9b7d545633fd109b3f836e21985a9883930902 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Thu, 22 Feb 2024 11:56:06 -0300 Subject: [PATCH 1/2] Issue #1747 - Remove Kogito Operator managed images Signed-off-by: Ricardo Zanini --- .github/pull_request_template.md | 2 +- README.md | 21 +- kogito-base-builder-image.yaml | 68 --- kogito-imagestream.yaml | 84 --- kogito-runtime-jvm-image.yaml | 83 --- kogito-runtime-native-image.yaml | 80 --- kogito-s2i-builder-image.yaml | 101 ---- modules/kogito-epel/7/configure.sh | 27 - modules/kogito-epel/7/module.yaml | 24 - .../22.3-java-11/configure | 41 -- .../22.3-java-11/module.yaml | 50 -- .../23.0-java-17/configure | 42 -- .../23.0-java-17/module.yaml | 51 -- .../22.3-java-11/configure | 35 -- .../22.3-java-11/module.yaml | 24 - .../common/added/memory-limit.sh | 60 --- .../kogito-graalvm-scripts/common/configure | 24 - .../kogito-graalvm-scripts/common/module.yaml | 24 - .../common/tests/bats/memory-limits.bats | 68 --- modules/kogito-image-dependencies/clean.sh | 22 - modules/kogito-image-dependencies/module.yaml | 33 -- .../added/kogito-kubernetes-client.sh | 87 ---- modules/kogito-kubernetes-client/configure | 25 - modules/kogito-kubernetes-client/module.yaml | 24 - .../tests/bats/kogito-kubernetes-client.bats | 48 -- modules/kogito-maven/3.8.x/module.yaml | 32 -- modules/kogito-maven/3.9.x/module.yaml | 32 -- .../maven-dnf-module/artifacts/maven.module | 5 - .../kogito-maven/maven-dnf-module/configure | 25 - .../kogito-maven/maven-dnf-module/module.yaml | 25 - modules/kogito-openjdk/11-headless/clean.sh | 22 - .../kogito-openjdk/11-headless/module.yaml | 47 -- modules/kogito-openjdk/11/clean.sh | 22 - modules/kogito-openjdk/11/module.yaml | 48 -- modules/kogito-openjdk/17-headless/clean.sh | 22 - .../kogito-openjdk/17-headless/module.yaml | 47 -- modules/kogito-openjdk/17/clean.sh | 21 - modules/kogito-openjdk/17/module.yaml | 47 -- .../added/kogito-persistence.sh | 57 -- modules/kogito-persistence/configure | 28 - modules/kogito-persistence/module.yaml | 28 - .../tests/bats/kogito-persistence.bats | 96 ---- modules/kogito-pkg-update/configure | 32 -- modules/kogito-pkg-update/module.yaml | 25 - .../added/kogito-app-launch.sh | 64 --- modules/kogito-runtime-jvm/configure | 33 -- modules/kogito-runtime-jvm/module.yaml | 24 - modules/kogito-runtime-jvm/s2i/bin/assemble | 25 - modules/kogito-runtime-jvm/s2i/bin/usage | 40 -- .../added/kogito-app-launch.sh | 45 -- modules/kogito-runtime-native/configure | 33 -- modules/kogito-runtime-native/module.yaml | 24 - .../kogito-runtime-native/s2i/bin/assemble | 25 - modules/kogito-runtime-native/s2i/bin/usage | 38 -- .../added/kogito-app-launch.sh | 74 --- modules/kogito-s2i-builder/configure | 35 -- modules/kogito-s2i-builder/module.yaml | 37 -- modules/kogito-s2i-builder/s2i/bin/assemble | 78 --- modules/kogito-s2i-builder/s2i/bin/usage | 70 --- modules/kogito-s2i-core/added/s2i-core | 323 ------------ modules/kogito-s2i-core/configure.sh | 31 -- modules/kogito-s2i-core/module.yaml | 85 --- .../kogito-s2i-core/s2i/bin/assemble-runtime | 29 -- modules/kogito-s2i-core/s2i/bin/run | 21 - .../kogito-s2i-core/s2i/bin/save-artifacts | 23 - .../tests/bats/mocks/myapp-0.0.1-runner | Bin 21736 -> 0 bytes .../kogito-s2i-core/tests/bats/s2i-core.bats | 490 ------------------ scripts/common.py | 20 +- scripts/run-bats.sh | 17 +- scripts/update-repository.py | 11 - tests/features/common-build-runtime.feature | 11 - .../kogito-common-builder-jvm.feature | 227 -------- .../kogito-common-runtime-jvm.feature | 80 --- .../kogito-common-runtime-native.feature | 20 - tests/features/kogito-runtime-jvm.feature | 13 - tests/features/kogito-runtime-native.feature | 13 - .../kogito-s2i-builder-native.feature | 137 ----- tests/features/kogito-s2i-builder.feature | 147 ------ 78 files changed, 6 insertions(+), 4146 deletions(-) delete mode 100644 kogito-base-builder-image.yaml delete mode 100644 kogito-runtime-jvm-image.yaml delete mode 100644 kogito-runtime-native-image.yaml delete mode 100644 kogito-s2i-builder-image.yaml delete mode 100644 modules/kogito-epel/7/configure.sh delete mode 100644 modules/kogito-epel/7/module.yaml delete mode 100644 modules/kogito-graalvm-installer/22.3-java-11/configure delete mode 100644 modules/kogito-graalvm-installer/22.3-java-11/module.yaml delete mode 100644 modules/kogito-graalvm-installer/23.0-java-17/configure delete mode 100644 modules/kogito-graalvm-installer/23.0-java-17/module.yaml delete mode 100644 modules/kogito-graalvm-scripts/22.3-java-11/configure delete mode 100644 modules/kogito-graalvm-scripts/22.3-java-11/module.yaml delete mode 100644 modules/kogito-graalvm-scripts/common/added/memory-limit.sh delete mode 100644 modules/kogito-graalvm-scripts/common/configure delete mode 100644 modules/kogito-graalvm-scripts/common/module.yaml delete mode 100644 modules/kogito-graalvm-scripts/common/tests/bats/memory-limits.bats delete mode 100644 modules/kogito-image-dependencies/clean.sh delete mode 100644 modules/kogito-image-dependencies/module.yaml delete mode 100644 modules/kogito-kubernetes-client/added/kogito-kubernetes-client.sh delete mode 100644 modules/kogito-kubernetes-client/configure delete mode 100644 modules/kogito-kubernetes-client/module.yaml delete mode 100644 modules/kogito-kubernetes-client/tests/bats/kogito-kubernetes-client.bats delete mode 100644 modules/kogito-maven/3.8.x/module.yaml delete mode 100644 modules/kogito-maven/3.9.x/module.yaml delete mode 100644 modules/kogito-maven/maven-dnf-module/artifacts/maven.module delete mode 100644 modules/kogito-maven/maven-dnf-module/configure delete mode 100644 modules/kogito-maven/maven-dnf-module/module.yaml delete mode 100644 modules/kogito-openjdk/11-headless/clean.sh delete mode 100644 modules/kogito-openjdk/11-headless/module.yaml delete mode 100644 modules/kogito-openjdk/11/clean.sh delete mode 100644 modules/kogito-openjdk/11/module.yaml delete mode 100644 modules/kogito-openjdk/17-headless/clean.sh delete mode 100644 modules/kogito-openjdk/17-headless/module.yaml delete mode 100644 modules/kogito-openjdk/17/clean.sh delete mode 100644 modules/kogito-openjdk/17/module.yaml delete mode 100644 modules/kogito-persistence/added/kogito-persistence.sh delete mode 100644 modules/kogito-persistence/configure delete mode 100644 modules/kogito-persistence/module.yaml delete mode 100644 modules/kogito-persistence/tests/bats/kogito-persistence.bats delete mode 100644 modules/kogito-pkg-update/configure delete mode 100644 modules/kogito-pkg-update/module.yaml delete mode 100644 modules/kogito-runtime-jvm/added/kogito-app-launch.sh delete mode 100644 modules/kogito-runtime-jvm/configure delete mode 100644 modules/kogito-runtime-jvm/module.yaml delete mode 100755 modules/kogito-runtime-jvm/s2i/bin/assemble delete mode 100644 modules/kogito-runtime-jvm/s2i/bin/usage delete mode 100644 modules/kogito-runtime-native/added/kogito-app-launch.sh delete mode 100644 modules/kogito-runtime-native/configure delete mode 100644 modules/kogito-runtime-native/module.yaml delete mode 100755 modules/kogito-runtime-native/s2i/bin/assemble delete mode 100644 modules/kogito-runtime-native/s2i/bin/usage delete mode 100644 modules/kogito-s2i-builder/added/kogito-app-launch.sh delete mode 100644 modules/kogito-s2i-builder/configure delete mode 100644 modules/kogito-s2i-builder/module.yaml delete mode 100644 modules/kogito-s2i-builder/s2i/bin/assemble delete mode 100644 modules/kogito-s2i-builder/s2i/bin/usage delete mode 100644 modules/kogito-s2i-core/added/s2i-core delete mode 100644 modules/kogito-s2i-core/configure.sh delete mode 100644 modules/kogito-s2i-core/module.yaml delete mode 100644 modules/kogito-s2i-core/s2i/bin/assemble-runtime delete mode 100644 modules/kogito-s2i-core/s2i/bin/run delete mode 100644 modules/kogito-s2i-core/s2i/bin/save-artifacts delete mode 100755 modules/kogito-s2i-core/tests/bats/mocks/myapp-0.0.1-runner delete mode 100644 modules/kogito-s2i-core/tests/bats/s2i-core.bats delete mode 100644 tests/features/common-build-runtime.feature delete mode 100644 tests/features/kogito-common-builder-jvm.feature delete mode 100644 tests/features/kogito-common-runtime-jvm.feature delete mode 100644 tests/features/kogito-common-runtime-native.feature delete mode 100644 tests/features/kogito-runtime-jvm.feature delete mode 100644 tests/features/kogito-runtime-native.feature delete mode 100644 tests/features/kogito-s2i-builder-native.feature delete mode 100644 tests/features/kogito-s2i-builder.feature diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9511f9aad..d03a30e15 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,7 +3,7 @@ Many thanks for submitting your Pull Request :heart:! Please make sure your PR meets the following requirements: - [ ] You have read the [contributors guide](README.md#contributing-to-kogito-images-repository) -- [ ] Pull Request title is properly formatted: `[KOGITO|RHPAM-XYZ] Subject` +- [ ] Pull Request title is properly formatted: `[Issue XXXX] Subject` - [ ] Pull Request contains link to the JIRA issue - [ ] Pull Request contains description of the issue - [ ] Pull Request does not include fixes for issues other than the main ticket diff --git a/README.md b/README.md index f511a8d40..b44206e56 100644 --- a/README.md +++ b/README.md @@ -1070,26 +1070,15 @@ Below you can find all modules used to build the Kogito Images - [kogito-data-index-common](modules/kogito-data-index-common): Data Index common module. - [kogito-data-index-ephemeral](modules/kogito-data-index-ephemeral): Installs and Configure the ephemeral PostgreSQL data-index jar inside the image. - [kogito-data-index-postgresql](modules/kogito-data-index-postgresql): Installs and Configure the PostgreSQL data-index jar inside the image. -- [kogito-epel](modules/kogito-epel): Configures the epel repository on the target image. -- [kogito-graalvm-installer](modules/kogito-graalvm-installer): Installs the GraalVM on the target Image. -- [kogito-graalvm-scripts](modules/kogito-graalvm-scripts): Configures the GraalVM on the target image and provides custom configuration script. -- [kogito-image-dependencies](modules/kogito-image-dependencies): Installs rpm packages on the target image. Contains common dependencies for Kogito Images. - [kogito-jobs-service-common](modules/kogito-jobs-service-common): Job service common module - [kogito-jobs-service-ephemeral](modules/kogito-jobs-service-ephemeral): Installs and Configure the in-memory jobs-service jar inside the image - [kogito-jobs-service-postgresql](modules/kogito-jobs-service-postgresql): Installs and Configure the postgresql jobs-service jar inside the image - [kogito-jobs-service-allinone](modules/kogito-jobs-service-all-in-one): Provides the runner script that supports all jobs-service flavors -- [kogito-kubernetes-client](modules/kogito-kubernetes-client): Provides a simple wrapper to interact with Kubernetes API. - [kogito-launch-scripts](modules/kogito-launch-scripts): Main script for all images, it contains the startup script for Kogito Images - [kogito-logging](modules/kogito-logging): Provides common logging functions. - [kogito-management-console](modules/kogito-management-console): Installs and Configure the management-console jar inside the image - [kogito-jit-runner](modules/kogito-jit-runner): Installs and Configure the jit-runner jar inside the image -- [kogito-maven](modules/kogito-maven): Installs and configure Maven on the S2I images, also provides custom configuration script. -- [kogito-openjdk](modules/kogito-openjdk): Provides OpenJDK and JRE. -- [kogito-persistence](modules/kogito-persistence): Provides the needed configuration scripts to properly configure the Kogito Services in the target image. -- [kogito-runtime-native](modules/kogito-runtime-native): Main module for the quay.io/kiegroup/kogito-runtime-native image. -- [kogito-runtime-jvm](modules/kogito-runtime-jvm): Main module for the quay.io/kiegroup/kogito-runtime-jvm image. -- [kogito-s2i-builder](modules/kogito-s2i-builder): Main module for the quay.io/kiegroup/kogito-s2i-builder image. -- [kogito-s2i-core](modules/kogito-s2i-core): Provides the source-to-image needed scripts and configurations. +- [kogito-maven](modules/kogito-maven): Provides custom configuration script. For each image, we use a specific *-image.yaml file. @@ -1102,10 +1091,6 @@ Please inspect the image files to learn which modules are being installed on eac - [quay.io/kiegroup/kogito-jobs-service-allinone](kogito-jobs-service-allinone-image.yaml) - [quay.io/kiegroup/kogito-management-console](kogito-management-console-image.yaml) - [quay.io/kiegroup/kogito-jit-runner](kogito-jit-runner-image.yaml) -- [quay.io/kiegroup/kogito-runtime-jvm](kogito-runtime-jvm-image.yaml) -- [quay.io/kiegroup/kogito-runtime-native](kogito-runtime-native-image.yaml) -- [quay.io/kiegroup/kogito-s2i-builder](kogito-s2i-builder-image.yaml) - ### Testing Images @@ -1129,12 +1114,12 @@ See [Writing Behave Tests](#writing-behave-tests). Example: ```bash -make build-image image_name=kogito-s2i-builder test_options=--wip +make build-image image_name=kogito-swf-builder test_options=--wip ``` Or by name: ```bash -make build-image image_name=kogito-s2i-builder test_options=--name +make build-image image_name=kogito-swf-builder test_options=--name ``` You can also add `cekit_option` to the make command, which will be appended to the Cekit command. Default is `cekit -v`. diff --git a/kogito-base-builder-image.yaml b/kogito-base-builder-image.yaml deleted file mode 100644 index 92964f745..000000000 --- a/kogito-base-builder-image.yaml +++ /dev/null @@ -1,68 +0,0 @@ -# -# 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. -# -schema_version: 1 - -name: "quay.io/kiegroup/kogito-base-builder" -version: "999-SNAPSHOT" -from: "registry.access.redhat.com/ubi8/ubi-minimal:latest" -description: "Image with JDK and Maven, used as a base image. It is used by Web Tools !" - -labels: - - name: "io.openshift.s2i.scripts-url" - value: "image:///usr/local/s2i" - - name: "io.openshift.s2i.destination" - value: "/tmp" - - name: "io.openshift.expose-services" - value: "8080:http" - - name: "io.quarkus.platform.version" - value: "3.2.10.Final" - - name: "org.kie.kogito.version" - value: "999-SNAPSHOT" - - name: "maintainer" - value: "Apache KIE " - - name: "io.k8s.description" - value: "Platform for building Kogito based on JDK and Maven" - - name: "io.k8s.display-name" - value: "Kogito based on JDK and Maven" - - name: "io.openshift.tags" - value: "base-builder,kogito" - -packages: - manager: microdnf - -modules: - repositories: - - path: modules - install: - - name: org.kie.kogito.image.dependencies - - name: org.kie.kogito.system.user - - name: org.kie.kogito.logging - - name: org.kie.kogito.launch.scripts - - name: org.kie.kogito.openjdk - version: "17" - - name: org.kie.kogito.dynamic.resources - - name: org.kie.kogito.maven - version: "3.9.3" - - name: org.kie.kogito.maven.common - - name: org.kie.kogito.project.versions - - name: org.kie.kogito.security.custom.truststores - -run: - workdir: "/home/kogito" - user: 1001 diff --git a/kogito-imagestream.yaml b/kogito-imagestream.yaml index 139458273..71fec5708 100644 --- a/kogito-imagestream.yaml +++ b/kogito-imagestream.yaml @@ -24,69 +24,6 @@ metadata: description: ImageStream definitions for Kogito images openshift.io/provider-display-name: Kie Group. items: - - kind: ImageStream - apiVersion: v1 - metadata: - name: kogito-runtime-native - annotations: - openshift.io/display-name: Runtime image for Kogito based on Quarkus native image - openshift.io/provider-display-name: Kie Group. - spec: - tags: - - name: '999-SNAPSHOT' - annotations: - description: Runtime image for Kogito based on Quarkus native image - iconClass: icon-jbpm - tags: runtime,kogito,quarkus - supports: quarkus - version: '999-SNAPSHOT' - referencePolicy: - type: Local - from: - kind: DockerImage - name: quay.io/kiegroup/kogito-runtime-native:999-SNAPSHOT - - kind: ImageStream - apiVersion: v1 - metadata: - name: kogito-runtime-jvm - annotations: - openshift.io/display-name: Runtime image for Kogito based on Quarkus or Springboot JVM image - openshift.io/provider-display-name: Kie Group. - spec: - tags: - - name: '999-SNAPSHOT' - annotations: - description: Runtime image for Kogito based on Quarkus or Springboot JVM image - iconClass: icon-jbpm - tags: runtime,kogito,quarkus,springboot,jvm - supports: quarkus - version: '999-SNAPSHOT' - referencePolicy: - type: Local - from: - kind: DockerImage - name: quay.io/kiegroup/kogito-runtime-jvm:999-SNAPSHOT - - kind: ImageStream - apiVersion: v1 - metadata: - name: kogito-s2i-builder - annotations: - openshift.io/display-name: Platform for building Kogito based on Quarkus or Springboot - openshift.io/provider-display-name: Kie Group. - spec: - tags: - - name: '999-SNAPSHOT' - annotations: - description: Platform for building Kogito based on Quarkus or Springboot - iconClass: icon-jbpm - tags: s2i-builder,kogito,quarkus,springboot - supports: quarkus - version: '999-SNAPSHOT' - referencePolicy: - type: Local - from: - kind: DockerImage - name: quay.io/kiegroup/kogito-s2i-builder:999-SNAPSHOT - kind: ImageStream apiVersion: v1 metadata: @@ -108,27 +45,6 @@ items: from: kind: DockerImage name: quay.io/kiegroup/kogito-swf-builder:999-SNAPSHOT - - kind: ImageStream - apiVersion: v1 - metadata: - name: kogito-base-builder - annotations: - openshift.io/display-name: Kogito base builder - openshift.io/provider-display-name: KIE Group. - spec: - tags: - - name: '999-SNAPSHOT' - annotations: - description: Kogito base builder - iconClass: icon-jbpm - tags: kogito,jdk,maven - supports: quarkus - version: '999-SNAPSHOT' - referencePolicy: - type: Local - from: - kind: DockerImage - name: quay.io/kiegroup/kogito-base-builder:999-SNAPSHOT - kind: ImageStream apiVersion: v1 metadata: diff --git a/kogito-runtime-jvm-image.yaml b/kogito-runtime-jvm-image.yaml deleted file mode 100644 index a16aa13e7..000000000 --- a/kogito-runtime-jvm-image.yaml +++ /dev/null @@ -1,83 +0,0 @@ -# -# 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. -# -schema_version: 1 - -name: "quay.io/kiegroup/kogito-runtime-jvm" -version: "999-SNAPSHOT" -from: "registry.access.redhat.com/ubi8/ubi-minimal:latest" -description: "Runtime image for Kogito based on Quarkus or Springboot JVM image" - -labels: - - name: "io.openshift.s2i.scripts-url" - value: "image:///usr/local/s2i" - - name: "io.openshift.s2i.destination" - value: "/tmp" - - name: "io.openshift.expose-services" - value: "8080:http" - - name: "io.quarkus.platform.version" - value: "3.2.10.Final" - - name: "org.kie.kogito.version" - value: "999-SNAPSHOT" - - name: "maintainer" - value: "Apache KIE " - - name: "io.k8s.description" - value: "Runtime image for Kogito based on Quarkus or Spring Boot JVM image" - - name: "io.k8s.display-name" - value: "Kogito based on Quarkus or Spring Boot JVM image" - - name: "io.openshift.tags" - value: "runtime,kogito,quarkus,springboot,jvm" - - name: "io.openshift.s2i.assemble-input-files" - value: "/home/kogito/bin" - -envs: - - name: "SCRIPT_DEBUG" - example: "true" - description: "If set to true, ensures that the bash scripts are executed with the -x option, printing the commands and their arguments as they are executed. Also debug JVM initialization." - - name: "RUNTIME_TYPE" - example: "springboot" - description: "Defines the runtime type of your Kogito application. Allowed values are 'springboot' or 'quarkus'. Default value is quarkus." - - name: JAVA_OPTIONS - example: "-Dquarkus.log.level=DEBUG" - description: JVM options passed to the Java command. - -packages: - manager: microdnf - -modules: - repositories: - - path: modules - install: - - name: org.kie.kogito.image.dependencies - - name: org.kie.kogito.system.user - - name: org.kie.kogito.logging - - name: org.kie.kogito.launch.scripts - - name: org.kie.kogito.openjdk.headless - version: "17" - - name: org.kie.kogito.dynamic.resources - - name: org.kie.kogito.project.versions - - name: org.kie.kogito.s2i.core - - name: org.kie.kogito.runtime.jvm - - name: org.kie.kogito.security.custom.truststores - -ports: - - value: 8080 - -run: - workdir: "/home/kogito" - user: 1001 diff --git a/kogito-runtime-native-image.yaml b/kogito-runtime-native-image.yaml deleted file mode 100644 index e75649ff5..000000000 --- a/kogito-runtime-native-image.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# -# 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. -# -schema_version: 1 - -name: "quay.io/kiegroup/kogito-runtime-native" -version: "999-SNAPSHOT" -from: "registry.access.redhat.com/ubi8/ubi-minimal:latest" -description: "Runtime image for Kogito based on Quarkus native image" - -labels: - - name: "io.openshift.s2i.scripts-url" - value: "image:///usr/local/s2i" - - name: "io.openshift.s2i.destination" - value: "/tmp" - - name: "io.openshift.expose-services" - value: "8080:http" - - name: "io.quarkus.platform.version" - value: "3.2.10.Final" - - name: "org.kie.kogito.version" - value: "999-SNAPSHOT" - - name: "maintainer" - value: "Apache KIE " - - name: "io.k8s.description" - value: "Runtime image for Kogito based on Quarkus native image" - - name: "io.k8s.display-name" - value: "Kogito based on Quarkus native image" - - name: "io.openshift.tags" - value: "runtime,kogito,quarkus,native" - - name: "io.openshift.s2i.assemble-input-files" - value: "/home/kogito/bin" - -envs: - - name: "SCRIPT_DEBUG" - example: "true" - description: "If set to true, ensures that the bash scripts are executed with the -x option, printing the commands and their arguments as they are executed. Also debug JVM initialization." - - name: JAVA_OPTIONS - example: "-Dquarkus.log.level=DEBUG" - description: JVM options passed to the Java command. - - name: BINARY_BUILD - example: "true" - description: Enables binary builds for this image, meaning that the application binaries (e.g. maven target directory) will be uploaded to it. - -packages: - manager: microdnf - -modules: - repositories: - - path: modules - install: - - name: org.kie.kogito.image.dependencies - - name: org.kie.kogito.system.user - - name: org.kie.kogito.logging - - name: org.kie.kogito.launch.scripts - - name: org.kie.kogito.project.versions - - name: org.kie.kogito.s2i.core - - name: org.kie.kogito.runtime.native - -ports: - - value: 8080 - -run: - workdir: "/home/kogito" - user: 1001 - diff --git a/kogito-s2i-builder-image.yaml b/kogito-s2i-builder-image.yaml deleted file mode 100644 index 10e7520b7..000000000 --- a/kogito-s2i-builder-image.yaml +++ /dev/null @@ -1,101 +0,0 @@ -# -# 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. -# -schema_version: 1 - -name: "quay.io/kiegroup/kogito-s2i-builder" -version: "999-SNAPSHOT" -from: "registry.access.redhat.com/ubi8/ubi-minimal:latest" -description: "Platform for building Kogito based on Quarkus or Springboot" - -labels: - - name: "io.openshift.s2i.scripts-url" - value: "image:///usr/local/s2i" - - name: "io.openshift.s2i.destination" - value: "/tmp" - - name: "io.openshift.expose-services" - value: "8080:http" - - name: "io.quarkus.platform.version" - value: "3.2.10.Final" - - name: "org.kie.kogito.version" - value: "999-SNAPSHOT" - - name: "maintainer" - value: "Apache KIE " - - name: "io.k8s.description" - value: "Platform for building Kogito based on Quarkus or Spring Boot" - - name: "io.k8s.display-name" - value: "Kogito based on Quarkus or Spring Boot" - - name: "io.openshift.tags" - value: "s2i-builder,kogito,quarkus,springboot" - -envs: - - name: "SCRIPT_DEBUG" - example: "true" - description: "If set to true, ensures that the bash scripts are executed with the -x option, printing the commands and their arguments as they are executed. Also debug JVM initialization." - - name: "RUNTIME_TYPE" - example: "springboot" - description: "Defines the runtime type of your kogito application. Allowed values are 'springboot' or 'quarkus'. Default value is quarkus. Applies only at build time, except for binary builds, for runtime and binary builds, it is populated during runtime by identifying the runtime type based on the provided application jar." - - name: NATIVE - example: true - description: If set to true, perform a native build. Only supported for RUNTIME_TYPE is 'quarkus'. - - name: JAVA_OPTIONS - example: "-Dquarkus.log.level=DEBUG" - description: JVM options passed to the Java command. - - name: MAVEN_ARGS_APPEND - example: "-pl mymodule -am" - description: Additional Maven arguments - - name: ARTIFACT_DIR - example: mymodule/target - description: Path to target/ where the jar files are created for multi-module builds - -packages: - manager: microdnf - install: - - bc - - gcc - - gcc-c++ - - glibc-devel - - zlib-devel - -modules: - repositories: - - path: modules - install: - - name: org.kie.kogito.image.dependencies - - name: org.kie.kogito.system.user - - name: org.kie.kogito.logging - - name: org.kie.kogito.launch.scripts - - name: org.kie.kogito.graalvm.java17.installer - version: "23.0" - - name: org.kie.kogito.graalvm.common.scripts - - name: org.kie.kogito.openjdk - version: "17" - - name: org.kie.kogito.dynamic.resources - - name: org.kie.kogito.maven - version: "3.9.3" - - name: org.kie.kogito.maven.common - - name: org.kie.kogito.project.versions - - name: org.kie.kogito.s2i.core - - name: org.kie.kogito.s2i.builder - -ports: - - value: 8080 - -run: - workdir: "/home/kogito" - user: 1001 diff --git a/modules/kogito-epel/7/configure.sh b/modules/kogito-epel/7/configure.sh deleted file mode 100644 index ee946345f..000000000 --- a/modules/kogito-epel/7/configure.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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. -# - -set -e - -rpm -i https://download.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - - -microdnf clean all -rm -rf /var/cache/yum \ No newline at end of file diff --git a/modules/kogito-epel/7/module.yaml b/modules/kogito-epel/7/module.yaml deleted file mode 100644 index 3a84cf27b..000000000 --- a/modules/kogito-epel/7/module.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.epel -version: "7" - -execute: - - script: configure.sh diff --git a/modules/kogito-graalvm-installer/22.3-java-11/configure b/modules/kogito-graalvm-installer/22.3-java-11/configure deleted file mode 100644 index 7ce473e71..000000000 --- a/modules/kogito-graalvm-installer/22.3-java-11/configure +++ /dev/null @@ -1,41 +0,0 @@ -#!/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. -# -set -e - -architecture=$(uname -i) - -if [ "$architecture" = "x86_64" ]; then - arch='amd64' -elif [ "$architecture" = "aarch64" ]; then - arch='aarch64' -else - exit 0 -fi - -SOURCES_DIR=/tmp/artifacts -SCRIPT_DIR=$(dirname "${0}") - -tar xzf "${SOURCES_DIR}"/graalvm-ce-java"${GRAALVM_JAVA_VERSION}"-linux-${arch}-"${GRAALVM_VERSION}".tar.gz -C /usr/share -mv /usr/share/graalvm-ce-java"${GRAALVM_JAVA_VERSION}"-"${GRAALVM_VERSION}" /usr/share/graalvm - -#KOGITO-384 - Add libsunec.so and cacerts to Kogito runtime native image -mkdir -p "${KOGITO_HOME}"/ssl-libs -cp -v "$GRAALVM_HOME"/lib/libsunec.so "${KOGITO_HOME}"/ssl-libs -cp -v "$GRAALVM_HOME"/lib/security/cacerts "${KOGITO_HOME}"/ diff --git a/modules/kogito-graalvm-installer/22.3-java-11/module.yaml b/modules/kogito-graalvm-installer/22.3-java-11/module.yaml deleted file mode 100644 index 5a5c81a54..000000000 --- a/modules/kogito-graalvm-installer/22.3-java-11/module.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.graalvm.java11.installer -version: "22.3" - -envs: - - name: "JAVA_HOME" - value: "/usr/share/graalvm" - - name: "GRAALVM_HOME" - value: "/usr/share/graalvm" - #version without prefix ce - - name: "GRAALVM_VERSION" - value: "22.3.2" - - name: "GRAALVM_JAVA_VERSION" - value: "11" - -artifacts: - - name: graalvm-ce-java11-linux-amd64-22.3.2.tar.gz - url: https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.2/graalvm-ce-java11-linux-amd64-22.3.2.tar.gz - md5: 68c9e14932ac6c8606953b88aff89cf4 - - name: graalvm-ce-java11-linux-aarch64-22.3.2.tar.gz - url: https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.2/graalvm-ce-java11-linux-aarch64-22.3.2.tar.gz - md5: 5cb31954ef5538057d83502c19492ad0 - - name: native-image-installable-svm-java11-linux-amd64-22.3.2.jar - url: https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.2/native-image-installable-svm-java11-linux-amd64-22.3.2.jar - md5: dae44733baf47ffaadf7ef98959b5653 - - name: native-image-installable-svm-java11-linux-aarch64-22.3.2.jar - url: https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.2/native-image-installable-svm-java11-linux-aarch64-22.3.2.jar - md5: 9d87d8650aa17e2ec375a587dc445651 - -execute: - - script: configure - diff --git a/modules/kogito-graalvm-installer/23.0-java-17/configure b/modules/kogito-graalvm-installer/23.0-java-17/configure deleted file mode 100644 index b88d4b063..000000000 --- a/modules/kogito-graalvm-installer/23.0-java-17/configure +++ /dev/null @@ -1,42 +0,0 @@ -#!/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. -# -set -e - -architecture=$(uname -i) - -if [ "$architecture" = "x86_64" ]; then - arch='amd64' -elif [ "$architecture" = "aarch64" ]; then - arch='aarch64' -else - exit 0 -fi - -SOURCES_DIR=/tmp/artifacts -SCRIPT_DIR=$(dirname "${0}") - -tar xzf "${SOURCES_DIR}"/mandrel-java"${GRAALVM_JAVA_VERSION}"-linux-${arch}-"${GRAALVM_VERSION}"-Final.tar.gz -C /usr/share -mv /usr/share/mandrel-java"${GRAALVM_JAVA_VERSION}"-"${GRAALVM_VERSION}-Final" /usr/share/graalvm - -#KOGITO-384 - Add libsunec.so and cacerts to Kogito runtime native image -# Java 17 + Mandrel: libsunec.so is not distributed in Mandrel -#mkdir -p "${KOGITO_HOME}"/ssl-libs -#cp -v "$GRAALVM_HOME"/lib/libsunec.so "${KOGITO_HOME}"/ssl-libs -cp -v "$GRAALVM_HOME"/lib/security/cacerts "${KOGITO_HOME}"/ diff --git a/modules/kogito-graalvm-installer/23.0-java-17/module.yaml b/modules/kogito-graalvm-installer/23.0-java-17/module.yaml deleted file mode 100644 index 83cee0a3d..000000000 --- a/modules/kogito-graalvm-installer/23.0-java-17/module.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.graalvm.java17.installer -version: "23.0" - -envs: - - name: "JAVA_HOME" - value: "/usr/share/graalvm" - - name: "GRAALVM_HOME" - value: "/usr/share/graalvm" - - name: "GRAALVM_VERSION" - value: "23.0.2.1" - - name: "GRAALVM_JAVA_VERSION" - value: "17" - -packages: - manager: microdnf - install: - - freetype-devel - - gcc - - glibc-devel - - libstdc++-static - - zlib-devel - -artifacts: - - name: mandrel-java17-linux-amd64-23.0.2.1-Final.tar.gz - url: https://github.com/graalvm/mandrel/releases/download/mandrel-23.0.2.1-Final/mandrel-java17-linux-amd64-23.0.2.1-Final.tar.gz - md5: b026ea8d357b13702f9cd05f3d87f64a - - name: mandrel-java17-linux-aarch64-23.0.2.1-Final.tar.gz - url: https://github.com/graalvm/mandrel/releases/download/mandrel-23.0.2.1-Final/mandrel-java17-linux-aarch64-23.0.2.1-Final.tar.gz - md5: e3143fe4bb21267087cca3ca66ae6af2 - -execute: - - script: configure diff --git a/modules/kogito-graalvm-scripts/22.3-java-11/configure b/modules/kogito-graalvm-scripts/22.3-java-11/configure deleted file mode 100644 index b39969f7b..000000000 --- a/modules/kogito-graalvm-scripts/22.3-java-11/configure +++ /dev/null @@ -1,35 +0,0 @@ -#!/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. -# -set -e - -architecture=$(uname -i) -arch=${architecture} - -if [ "$architecture" = "x86_64" ]; then - arch='amd64' -elif [ "$architecture" = "aarch64" ]; then - arch='aarch64' -else - exit 0 -fi - -SOURCES_DIR=/tmp/artifacts - -/usr/share/graalvm/bin/gu -L install "${SOURCES_DIR}"/native-image-installable-svm-java"${GRAALVM_JAVA_VERSION}"-linux-${arch}-"${GRAALVM_VERSION}".jar diff --git a/modules/kogito-graalvm-scripts/22.3-java-11/module.yaml b/modules/kogito-graalvm-scripts/22.3-java-11/module.yaml deleted file mode 100644 index 49a2e2b38..000000000 --- a/modules/kogito-graalvm-scripts/22.3-java-11/module.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.graalvm.scripts -version: "22.3-java-11" - -execute: - - script: configure diff --git a/modules/kogito-graalvm-scripts/common/added/memory-limit.sh b/modules/kogito-graalvm-scripts/common/added/memory-limit.sh deleted file mode 100644 index 7b5e53bc6..000000000 --- a/modules/kogito-graalvm-scripts/common/added/memory-limit.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -# -# Limit memory usage for Graal VM native builds -# for more info access https://issues.jboss.org/browse/KOGITO-306 -# -# For now we only limit the memory usage based on the LIMIT_MEMORY env which is set by the operator in bytes. -# the default value is JVM builds 1Gi and for 4Gi for native builds -# -# TODO: rely on cgroups to detect the container limits to define the memory usage based on the total memory available on the container. - -# configure the GraalVM build memory usage limit based on the LIMIT_MEMORY env -# its value must be in binary bytes. - -#import -source "${KOGITO_HOME}"/launch/logging.sh -source "${JBOSS_CONTAINER_JAVA_JVM_MODULE}"/container-limits - -function configure() { - # backwards compatibility, if LIMIT_MEMORY it is set honor it - if [ "${LIMIT_MEMORY}x" != "x" ]; then - CONTAINER_MAX_MEMORY="${LIMIT_MEMORY}" - log_info "Using backwards compatibility with LIMIT_MEMORY env, if you want to rely com cgroups, unset this env." - fi - if [[ "${CONTAINER_MAX_MEMORY}" =~ ^[-+]?[0-9]+{9}$ ]]; then - # native builds requires at least 1024m (1073741824=1024MB - 1 MB = 2^20 B in base 2) - local limit=1073741824 - # only 80% of the actual limit will be used for the JVM - local jvm_limit_memory=$(awk -vn="${CONTAINER_MAX_MEMORY}" 'BEGIN{printf("%.0f\n",n*0.8)}') - - if [ "${jvm_limit_memory}" -lt "${limit}" ]; then - limit=$(echo "scale=1; ${limit} / (80/100)" | bc -l) - printf "Available memory (${CONTAINER_MAX_MEMORY}) limit is too small (should be greater than %.0f bytes), native build will use all available memory.\n" "${limit}" - else - log_info "Limit memory for this container is set to ${CONTAINER_MAX_MEMORY}. Allocated memory for JVM will be set to ${jvm_limit_memory}." - export KOGITO_OPTS="${KOGITO_OPTS} -Dquarkus.native.native-image-xmx=${jvm_limit_memory}" - fi - else - log_warning "Not able to determine the available memory. Using all memory available." - fi -} - diff --git a/modules/kogito-graalvm-scripts/common/configure b/modules/kogito-graalvm-scripts/common/configure deleted file mode 100644 index 8d0a9cae0..000000000 --- a/modules/kogito-graalvm-scripts/common/configure +++ /dev/null @@ -1,24 +0,0 @@ -#!/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. -# -set -e - -SCRIPT_DIR=$(dirname "${0}") - -cp -v "${SCRIPT_DIR}"/added/* "${KOGITO_HOME}"/launch/ diff --git a/modules/kogito-graalvm-scripts/common/module.yaml b/modules/kogito-graalvm-scripts/common/module.yaml deleted file mode 100644 index a9ec2e0a0..000000000 --- a/modules/kogito-graalvm-scripts/common/module.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.graalvm.common.scripts -version: "999-SNAPSHOT" - -execute: - - script: configure diff --git a/modules/kogito-graalvm-scripts/common/tests/bats/memory-limits.bats b/modules/kogito-graalvm-scripts/common/tests/bats/memory-limits.bats deleted file mode 100644 index 703711580..000000000 --- a/modules/kogito-graalvm-scripts/common/tests/bats/memory-limits.bats +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bats -# -# 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. -# - - -export KOGITO_HOME=/tmp/kogito -export JBOSS_CONTAINER_JAVA_JVM_MODULE=${KOGITO_HOME}/launch -mkdir -p "${KOGITO_HOME}"/launch -cp $BATS_TEST_DIRNAME/../../../../kogito-logging/added/logging.sh "${KOGITO_HOME}"/launch/ -cp $BATS_TEST_DIRNAME/../../../../kogito-dynamic-resources/added/container-limits "${KOGITO_HOME}"/launch/ - -# imports -source $BATS_TEST_DIRNAME/../../added/memory-limit.sh - -@test "test a valid memory limit value" { - export LIMIT_MEMORY="1342177280" - local expected=" -Dquarkus.native.native-image-xmx=1073741824" # 80% of LIMIT_MEMORY, top expected by JVM - configure - echo "Expected: ${expected}" - echo "Result: ${KOGITO_OPTS}" - [ "${expected}" = "${KOGITO_OPTS}" ] -} - -@test "test a result jvm memory with float points" { - export LIMIT_MEMORY="2147483648" # 80% is 1717986918.4 - local expected=" -Dquarkus.native.native-image-xmx=1717986918" - configure - echo "Expected: ${expected}" - echo "Result: ${KOGITO_OPTS}" - [ "${expected}" = "${KOGITO_OPTS}" ] -} - -@test "test a small memory limit value" { - export LIMIT_MEMORY="1073741600" - local expected="Available memory (1073741600) limit is too small" - run configure - local result="${lines[1]}" - echo "Expected: ${expected}" - echo "Result is ${result}" - [[ "${result}" == *"${expected}"* ]] -} - -@test "test a invalid memory limit value" { - function log_warning() { echo "WARN ${1}"; } - export LIMIT_MEMORY="1024m" - local expected="WARN Not able to determine the available memory. Using all memory available." - run configure - echo "Expected: ${expected}" - echo "Result: ${lines[@]}" - [ "${lines[0]}" = "INFO Using backwards compatibility with LIMIT_MEMORY env, if you want to rely com cgroups, unset this env." ] - [ "${lines[1]}" = "WARN Not able to determine the available memory. Using all memory available." ] -} diff --git a/modules/kogito-image-dependencies/clean.sh b/modules/kogito-image-dependencies/clean.sh deleted file mode 100644 index 5b184d1a0..000000000 --- a/modules/kogito-image-dependencies/clean.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# 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. -# - -microdnf clean all -rm -rf /var/cache/yum \ No newline at end of file diff --git a/modules/kogito-image-dependencies/module.yaml b/modules/kogito-image-dependencies/module.yaml deleted file mode 100644 index bae10fce5..000000000 --- a/modules/kogito-image-dependencies/module.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.image.dependencies -version: "999-SNAPSHOT" -description: holds common dependencies across images - -execute: - - script: clean.sh - -packages: - install: - - file - - shadow-utils - - tar - - gzip - - unzip diff --git a/modules/kogito-kubernetes-client/added/kogito-kubernetes-client.sh b/modules/kogito-kubernetes-client/added/kogito-kubernetes-client.sh deleted file mode 100644 index ad347c762..000000000 --- a/modules/kogito-kubernetes-client/added/kogito-kubernetes-client.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - - -# imports -source "${KOGITO_HOME}"/launch/logging.sh - -# checks if this script is running on a Kubernetes environment -function is_running_on_kubernetes() { - if [ -e /var/run/secrets/kubernetes.io/serviceaccount/token ]; then - return 0 - else - return 1 - fi -} - -# lists or gets a resource kind in the given api within the namespace and return a JSON response -# ${1} api, e.g. "apis/apps" (for core APIs, use just "api") -# ${2} resource, e.g. "deployments/${resource_name}". To list a resource, don't specify the resource name -# ${3} labels (list only), restrict resources by these labels. e.g. app=myapp. Defaults to empty -# ${4} fields (list only), restrict resources by these fields. e.g. metadata.name=${resource_name}. see: https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/ -# see: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/ -# to parse this response, use jq: https://stedolan.github.io/jq/tutorial/ -function list_or_get_k8s_resource() { - local api="${1}" - local resource="${2}" - local labels="${3}" - local fields="${4}" - - log_info "--> [k8s-client] Trying to fetch Kubernetes API ${api} for resource ${resource}" - - if is_running_on_kubernetes; then - namespace=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) - token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) - response=$(curl -s -w "%{http_code}" --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ - -H "Authorization: Bearer $token" \ - -H 'Accept: application/json' \ - "${KUBERNETES_SERVICE_PROTOCOL:-https}://${KUBERNETES_SERVICE_HOST:-kubernetes.default.svc}:${KUBERNETES_SERVICE_PORT:-443}/${api}/v1/namespaces/${namespace}/${resource}?labelSelector=${labels}\&fieldSelector=${fields}") - log_info "${response}" - else - log_info "--> [k8s-client] Not running on Kubernetes, skipping..." - fi -} - -# sends a patch request to the Kubernetes API using JSON merge strategy -# ${1} api, e.g. "apis/apps" (for core APIs, leave in blank) -# ${2} resource, e.g. "deployments/${resource_name}" -# ${3} json_body file in JSON Patch format: http://jsonpatch.com/ Example: [ { "op": "replace", "path": "/metadata/annotations", "value" : {} }, {"op": "replace", "path": "/data", "value": {"file1.proto", "file2.proto"} } ] -# see: https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment -function patch_json_k8s_resource() { - local api="${1}" - local resource="${2}" - local file="${3}" - - log_info "--> [k8s-client] Trying to patch resource ${resource} in Kubernetes API ${api}" - - if is_running_on_kubernetes; then - namespace=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) - token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) - response=$(curl --request PATCH -s -w "%{http_code}" --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ - -H "Authorization: Bearer $token" \ - -H 'Accept: application/json' \ - -H 'Content-Type: application/json-patch+json' \ - --data "@${file}" \ - "${KUBERNETES_SERVICE_PROTOCOL:-https}://${KUBERNETES_SERVICE_HOST:-kubernetes.default.svc}:${KUBERNETES_SERVICE_PORT:-443}/${api}/v1/namespaces/${namespace}/${resource}") - echo "${response}" - else - log_info "--> [k8s-client] Not running on Kubernetes, skipping..." - fi -} \ No newline at end of file diff --git a/modules/kogito-kubernetes-client/configure b/modules/kogito-kubernetes-client/configure deleted file mode 100644 index edee947fd..000000000 --- a/modules/kogito-kubernetes-client/configure +++ /dev/null @@ -1,25 +0,0 @@ -#!/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. -# -SCRIPT_DIR=$(dirname "${0}") - -# kogito-kubernetes-client -mkdir -p "${KOGITO_HOME}"/launch/ -cp -v "${SCRIPT_DIR}"/added/* "${KOGITO_HOME}"/launch/ -chmod +x-w "${KOGITO_HOME}"/launch/kogito-kubernetes-client.sh \ No newline at end of file diff --git a/modules/kogito-kubernetes-client/module.yaml b/modules/kogito-kubernetes-client/module.yaml deleted file mode 100644 index 0b69f553a..000000000 --- a/modules/kogito-kubernetes-client/module.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.kubernetes.client -version: "999-SNAPSHOT" - -execute: - - script: configure diff --git a/modules/kogito-kubernetes-client/tests/bats/kogito-kubernetes-client.bats b/modules/kogito-kubernetes-client/tests/bats/kogito-kubernetes-client.bats deleted file mode 100644 index 6f4df27e1..000000000 --- a/modules/kogito-kubernetes-client/tests/bats/kogito-kubernetes-client.bats +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bats -# -# 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. -# - - -export KOGITO_HOME=$BATS_TMPDIR/kogito_home -mkdir -p "${KOGITO_HOME}"/launch - -cp $BATS_TEST_DIRNAME/../../../kogito-logging/added/logging.sh "${KOGITO_HOME}"/launch/ - -# imports -source $BATS_TEST_DIRNAME/../../added/kogito-kubernetes-client.sh - -@test "list_or_get_k8s_resource sanity check" { - run list_or_get_k8s_resource "" "configmaps/my-config-map" - - echo "result= ${lines[@]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "INFO --> [k8s-client] Trying to fetch Kubernetes API for resource configmaps/my-config-map" ] - [ "${lines[1]}" = "INFO --> [k8s-client] Not running on Kubernetes, skipping..." ] -} - -@test "patch_json_k8s_resource sanity check" { - run patch_json_k8s_resource "" "configmaps/my-config-map" "{ spec: {data: []}}" - - echo "result= ${lines[@]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "INFO --> [k8s-client] Trying to patch resource configmaps/my-config-map in Kubernetes API " ] - [ "${lines[1]}" = "INFO --> [k8s-client] Not running on Kubernetes, skipping..." ] -} \ No newline at end of file diff --git a/modules/kogito-maven/3.8.x/module.yaml b/modules/kogito-maven/3.8.x/module.yaml deleted file mode 100644 index 2749d798b..000000000 --- a/modules/kogito-maven/3.8.x/module.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.maven -version: "3.8.6" - -envs: - - name: "MAVEN_VERSION" - value: "3.8.6" - -# unfortunately by now the version needs to be hardcoded. -artifacts: - - name: apache-maven-3.8.6-bin.tar.gz - url: https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz - md5: 0e07de4a7b5c84ebed737a2002f52019 - diff --git a/modules/kogito-maven/3.9.x/module.yaml b/modules/kogito-maven/3.9.x/module.yaml deleted file mode 100644 index dcd4b8a67..000000000 --- a/modules/kogito-maven/3.9.x/module.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.maven -version: "3.9.3" - -envs: - - name: "MAVEN_VERSION" - value: "3.9.3" - -# unfortunately by now the version needs to be hardcoded. -artifacts: - - name: apache-maven-3.9.3-bin.tar.gz - url: https://archive.apache.org/dist/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.tar.gz - md5: f3fbff830d9a0dc2c6c99a76e27d0c01 - diff --git a/modules/kogito-maven/maven-dnf-module/artifacts/maven.module b/modules/kogito-maven/maven-dnf-module/artifacts/maven.module deleted file mode 100644 index 386b70bd6..000000000 --- a/modules/kogito-maven/maven-dnf-module/artifacts/maven.module +++ /dev/null @@ -1,5 +0,0 @@ -[maven] -name=maven -stream=3.8 -profiles= -state=enabled \ No newline at end of file diff --git a/modules/kogito-maven/maven-dnf-module/configure b/modules/kogito-maven/maven-dnf-module/configure deleted file mode 100644 index fd40c2e4c..000000000 --- a/modules/kogito-maven/maven-dnf-module/configure +++ /dev/null @@ -1,25 +0,0 @@ -#!/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. -# -set -e - -SCRIPT_DIR=$(dirname $0) -ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts - -cp ${ARTIFACTS_DIR}/maven.module /etc/dnf/modules.d/maven.module \ No newline at end of file diff --git a/modules/kogito-maven/maven-dnf-module/module.yaml b/modules/kogito-maven/maven-dnf-module/module.yaml deleted file mode 100644 index 13daf59a2..000000000 --- a/modules/kogito-maven/maven-dnf-module/module.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.maven.dnf.module -version: "3.8" -description: Enables the AppStream RPM Module for Maven 3.8 packages. - -execute: - - script: configure diff --git a/modules/kogito-openjdk/11-headless/clean.sh b/modules/kogito-openjdk/11-headless/clean.sh deleted file mode 100644 index 5b184d1a0..000000000 --- a/modules/kogito-openjdk/11-headless/clean.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# 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. -# - -microdnf clean all -rm -rf /var/cache/yum \ No newline at end of file diff --git a/modules/kogito-openjdk/11-headless/module.yaml b/modules/kogito-openjdk/11-headless/module.yaml deleted file mode 100644 index bf78ddea6..000000000 --- a/modules/kogito-openjdk/11-headless/module.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.openjdk.headless -version: "11" - -labels: - - name: "com.redhat.component" - value: "jboss-openjdk11-rhel8-container" - - name: "org.jboss.product" - value: "openjdk" - - name: "org.jboss.product.version" - value: "11" - - name: "org.jboss.product.openjdk.version" - value: "11" - -envs: - - name: "JAVA_HOME" - value: "/usr/lib/jvm/java-11" - - name: "JAVA_VENDOR" - value: "openjdk" - - name: "JAVA_VERSION" - value: "11" - -execute: - - script: clean.sh - -packages: - install: - - tzdata-java # Fix for new openjdk installations. See https://bugzilla.redhat.com/show_bug.cgi?id=2224411 - - java-11-openjdk-headless diff --git a/modules/kogito-openjdk/11/clean.sh b/modules/kogito-openjdk/11/clean.sh deleted file mode 100644 index 5b184d1a0..000000000 --- a/modules/kogito-openjdk/11/clean.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# 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. -# - -microdnf clean all -rm -rf /var/cache/yum \ No newline at end of file diff --git a/modules/kogito-openjdk/11/module.yaml b/modules/kogito-openjdk/11/module.yaml deleted file mode 100644 index c0f8e74eb..000000000 --- a/modules/kogito-openjdk/11/module.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.openjdk -version: "11" - -labels: - - name: "com.redhat.component" - value: "jboss-openjdk11-rhel8-container" - - name: "org.jboss.product" - value: "openjdk" - - name: "org.jboss.product.version" - value: "11" - - name: "org.jboss.product.openjdk.version" - value: "11" - -envs: - - name: "JAVA_HOME" - value: "/usr/lib/jvm/java-11" - - name: "JAVA_VENDOR" - value: "openjdk" - - name: "JAVA_VERSION" - value: "11" - -execute: - - script: clean.sh - -packages: - install: - - tzdata-java # Fix for new openjdk installations. See https://bugzilla.redhat.com/show_bug.cgi?id=2224411 - - java-11-openjdk-devel - diff --git a/modules/kogito-openjdk/17-headless/clean.sh b/modules/kogito-openjdk/17-headless/clean.sh deleted file mode 100644 index 5b184d1a0..000000000 --- a/modules/kogito-openjdk/17-headless/clean.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# 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. -# - -microdnf clean all -rm -rf /var/cache/yum \ No newline at end of file diff --git a/modules/kogito-openjdk/17-headless/module.yaml b/modules/kogito-openjdk/17-headless/module.yaml deleted file mode 100644 index db55c4fe0..000000000 --- a/modules/kogito-openjdk/17-headless/module.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.openjdk.headless -version: "17" - -labels: - - name: "org.jboss.product" - value: "openjdk" - - name: "org.jboss.product.version" - value: "17" - - name: "org.jboss.product.openjdk.version" - value: "17" - -envs: - - name: "JAVA_HOME" - value: "/usr/lib/jvm/java-17" - - name: "JAVA_VENDOR" - value: "openjdk" - - name: "JAVA_VERSION" - value: "17" - # Same env set by the openjdk image for modules that won't use it - - name: JBOSS_CONTAINER_JAVA_JVM_MODULE - value: /opt/container/java/jvm - -execute: - - script: clean.sh - -packages: - install: - - java-17-openjdk-headless diff --git a/modules/kogito-openjdk/17/clean.sh b/modules/kogito-openjdk/17/clean.sh deleted file mode 100644 index f4c79eb5c..000000000 --- a/modules/kogito-openjdk/17/clean.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# 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. -# -microdnf clean all -rm -rf /var/cache/yum \ No newline at end of file diff --git a/modules/kogito-openjdk/17/module.yaml b/modules/kogito-openjdk/17/module.yaml deleted file mode 100644 index 6cd287ddf..000000000 --- a/modules/kogito-openjdk/17/module.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.openjdk -version: "17" - -labels: - - name: "org.jboss.product" - value: "openjdk" - - name: "org.jboss.product.version" - value: "17" - - name: "org.jboss.product.openjdk.version" - value: "17" - -envs: - - name: "JAVA_HOME" - value: "/usr/lib/jvm/java-17" - - name: "JAVA_VENDOR" - value: "openjdk" - - name: "JAVA_VERSION" - value: "17" - # Same env set by the openjdk image for modules that won't use it - - name: JBOSS_CONTAINER_JAVA_JVM_MODULE - value: /opt/container/java/jvm - -execute: - - script: clean.sh - -packages: - install: - - java-17-openjdk-devel diff --git a/modules/kogito-persistence/added/kogito-persistence.sh b/modules/kogito-persistence/added/kogito-persistence.sh deleted file mode 100644 index a9cea6665..000000000 --- a/modules/kogito-persistence/added/kogito-persistence.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - - -# imports -source "${KOGITO_HOME}"/launch/kogito-kubernetes-client.sh -source "${KOGITO_HOME}"/launch/logging.sh - -# copies the generated persistence files to -# "${KOGITO_HOME}"/bin, that's the directory used to exchange files between builds -# TODO: copy those files directly to the final dir only when bin is not used to exchange data anymore -function copy_persistence_files() { - local persistenceDir="target" - if [ -n "${ARTIFACT_DIR}" ]; then - persistenceDir="${ARTIFACT_DIR}" - fi - - log_info "---> [persistence] Copying persistence files..." - if [ -d /tmp/src/"${persistenceDir}"/classes/META-INF/resources/persistence/protobuf ]; then - cp -v /tmp/src/"${persistenceDir}"/classes/META-INF/resources/persistence/protobuf/* "${KOGITO_HOME}"/bin/ - # we don't need this file to be indexed - rm -rfv "${KOGITO_HOME}"/bin/kogito-application.proto - move_persistence_files - else - log_info "---> [persistence] Skip copying files, persistence directory does not exist..." - fi -} - -# move_persistence_files moves persistence files from "${KOGITO_HOME}"/bin to the final directory -# where those files will be handled by the runtime image. -# TODO: remove this function when s2i build move the KOGITO_HOME instead bin directory between images in chained builds -function move_persistence_files() { - log_info "---> [persistence] Moving persistence files to final directory" - if ls "${KOGITO_HOME}"/bin/*.proto &>/dev/null; then - # copy to the final dir, so we keep bin clean - cp -v "${KOGITO_HOME}"/bin/*.proto "${KOGITO_HOME}"/data/protobufs/ - else - log_info "---> [persistence] Skip copying files, ${KOGITO_HOME}/bin directory does not have proto files!" - fi -} diff --git a/modules/kogito-persistence/configure b/modules/kogito-persistence/configure deleted file mode 100644 index 1ecd7ef1d..000000000 --- a/modules/kogito-persistence/configure +++ /dev/null @@ -1,28 +0,0 @@ -#!/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. -# -SCRIPT_DIR=$(dirname "${0}") - -# kogito-persistence -mkdir -p "${KOGITO_HOME}"/launch/ -cp -v "${SCRIPT_DIR}"/added/* "${KOGITO_HOME}"/launch/ -chmod +x-w "${KOGITO_HOME}"/launch/kogito-persistence.sh - -mkdir -p "${KOGITO_HOME}"/data/protobufs -chmod +w "${KOGITO_HOME}"/data/protobufs diff --git a/modules/kogito-persistence/module.yaml b/modules/kogito-persistence/module.yaml deleted file mode 100644 index c65cb8f2b..000000000 --- a/modules/kogito-persistence/module.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.persistence -version: "999-SNAPSHOT" - -modules: - install: - - name: org.kie.kogito.kubernetes.client - -execute: - - script: configure diff --git a/modules/kogito-persistence/tests/bats/kogito-persistence.bats b/modules/kogito-persistence/tests/bats/kogito-persistence.bats deleted file mode 100644 index fdb026348..000000000 --- a/modules/kogito-persistence/tests/bats/kogito-persistence.bats +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env bats -# -# 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. -# - - -export KOGITO_HOME=$BATS_TMPDIR/kogito_home -export MOCK_RESPONSE="" -mkdir -p "${KOGITO_HOME}"/launch - -cp $BATS_TEST_DIRNAME/../../../kogito-logging/added/logging.sh "${KOGITO_HOME}"/launch/ -cp $BATS_TEST_DIRNAME/../../../kogito-kubernetes-client/added/kogito-kubernetes-client.sh "${KOGITO_HOME}"/launch/ - -# imports -source $BATS_TEST_DIRNAME/../../added/kogito-persistence.sh - -setup() { - export HOME="${KOGITO_HOME}" - mkdir -p "${KOGITO_HOME}" - mkdir -p "${KOGITO_HOME}"/bin - mkdir -p "${KOGITO_HOME}"/data/protobufs/ - mkdir -p "${KOGITO_HOME}"/podinfo - echo "exampleapp-cm" > "${KOGITO_HOME}"/podinfo/protobufcm -} - -teardown() { - rm -rf "${KOGITO_HOME}" - rm -rf /tmp/src - rm -rf "${KOGITO_HOME}"/bin/* -} - -@test "There's some proto files in the target directory" { - mkdir -p /tmp/src/target/classes/META-INF/resources/persistence/protobuf - touch /tmp/src/target/classes/META-INF/resources/persistence/protobuf/{file1.proto,kogito-application.proto} - - run copy_persistence_files - - echo "result= ${lines[@]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "INFO ---> [persistence] Copying persistence files..." ] - [ "${lines[1]}" = "'/tmp/src/target/classes/META-INF/resources/persistence/protobuf/file1.proto' -> '"${KOGITO_HOME}"/bin/file1.proto'" ] - [ "${lines[2]}" = "'/tmp/src/target/classes/META-INF/resources/persistence/protobuf/kogito-application.proto' -> '"${KOGITO_HOME}"/bin/kogito-application.proto'" ] - [ "${lines[3]}" = "removed '"${KOGITO_HOME}"/bin/kogito-application.proto'" ] - [ "${lines[4]}" = "INFO ---> [persistence] Moving persistence files to final directory" ] - [ "${lines[5]}" = "'"${KOGITO_HOME}"/bin/file1.proto' -> '"${KOGITO_HOME}"/data/protobufs/file1.proto'" ] -} - -@test "There are no persistence files" { - KOGITO_HOME=/tmp/kogito - - run copy_persistence_files - - echo "result= ${lines[@]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "INFO ---> [persistence] Copying persistence files..." ] - [ "${lines[1]}" = "INFO ---> [persistence] Skip copying files, persistence directory does not exist..." ] -} - -@test "There's some proto files in the bin directory" { - touch "${KOGITO_HOME}"/bin/file1.proto - - run move_persistence_files - - echo "result= ${lines[@]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "INFO ---> [persistence] Moving persistence files to final directory" ] - [ "${lines[1]}" = "'"${KOGITO_HOME}"/bin/file1.proto' -> '"${KOGITO_HOME}"/data/protobufs/file1.proto'" ] -} - -@test "There's no proto files in the bin directory" { - run move_persistence_files - - echo "result= ${lines[@]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "INFO ---> [persistence] Moving persistence files to final directory" ] - [ "${lines[1]}" = "INFO ---> [persistence] Skip copying files, "${KOGITO_HOME}"/bin directory does not have proto files!" ] -} diff --git a/modules/kogito-pkg-update/configure b/modules/kogito-pkg-update/configure deleted file mode 100644 index 82dc65a5d..000000000 --- a/modules/kogito-pkg-update/configure +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# 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. -# -set -euo pipefail - -for candidate in yum dnf microdnf; do - if command -v "$candidate"; then - mgr="$(command -v "$candidate")" - "$mgr" update -y - "$mgr" -y clean all - exit - fi -done - -echo "cannot find a package manager" >&2 -exit 1 diff --git a/modules/kogito-pkg-update/module.yaml b/modules/kogito-pkg-update/module.yaml deleted file mode 100644 index f62beedc9..000000000 --- a/modules/kogito-pkg-update/module.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.pkg-update -version: "999-SNAPSHOT" -description: "Perform a system update via the package manager." - -execute: - - script: configure diff --git a/modules/kogito-runtime-jvm/added/kogito-app-launch.sh b/modules/kogito-runtime-jvm/added/kogito-app-launch.sh deleted file mode 100644 index 0a2b12647..000000000 --- a/modules/kogito-runtime-jvm/added/kogito-app-launch.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -# -# S2I run script for the 'kogito-runtime-jvm' images. -# The run script executes the server that runs your application. -# -# For more information see the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# -# Image help. -if [[ "$1" == "-h" ]]; then - exec /usr/local/s2i/usage - exit 0 -fi -set -e - -# Configuration scripts -# Any configuration script that needs to run on image startup must be added here. -CONFIGURE_SCRIPTS=( - "${KOGITO_HOME}"/launch/configure-custom-truststore.sh -) -source ${S2I_MODULE_LOCATION}/s2i-core -source "${KOGITO_HOME}"/launch/configure.sh - -runtime_type=$(get_runtime_type) - -############################################# - -DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)" - -# shellcheck disable=SC2086 -case ${runtime_type} in - "quarkus") - exec java ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_QUARKUS_JVM_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \ - -Dquarkus.http.host=0.0.0.0 \ - -Dquarkus.http.port=8080 \ - -jar "${KOGITO_HOME}"/bin/*.jar - ;; - "springboot") - exec java ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_SPRINGBOOT_PROPS} ${CUSTOM_TRUSTSTORE_ARGS} \ - -Dserver.address=0.0.0.0 -Dserver.port=8080 -jar "${KOGITO_HOME}"/bin/*.jar - ;; - *) - log_error "${runtime_type} is not supported." - exit 1 -esac \ No newline at end of file diff --git a/modules/kogito-runtime-jvm/configure b/modules/kogito-runtime-jvm/configure deleted file mode 100644 index 6635e0e76..000000000 --- a/modules/kogito-runtime-jvm/configure +++ /dev/null @@ -1,33 +0,0 @@ -#!/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. -# -SCRIPT_DIR=$(dirname "${0}") -ADDED_DIR="${SCRIPT_DIR}"/added - -# kogito-launch -cp -p "${ADDED_DIR}"/kogito-app-launch.sh "${KOGITO_HOME}"/ -chmod +x-w "${KOGITO_HOME}"/kogito-app-launch.sh - -cp -rv "${ADDED_DIR}"/launch/* "${KOGITO_HOME}"/launch/ -cp -rv "${SCRIPT_DIR}"/s2i/bin/* /usr/local/s2i/ - -chmod 755 /usr/local/s2i/* -chown -R 1001:0 "${KOGITO_HOME}" -chmod -R ug+rwX "${KOGITO_HOME}" - diff --git a/modules/kogito-runtime-jvm/module.yaml b/modules/kogito-runtime-jvm/module.yaml deleted file mode 100644 index 23b538245..000000000 --- a/modules/kogito-runtime-jvm/module.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.runtime.jvm -version: "999-SNAPSHOT" - -execute: - - script: configure diff --git a/modules/kogito-runtime-jvm/s2i/bin/assemble b/modules/kogito-runtime-jvm/s2i/bin/assemble deleted file mode 100755 index 390579ce5..000000000 --- a/modules/kogito-runtime-jvm/s2i/bin/assemble +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -e -# -# 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. -# -# this script is used by OpenShift with chained builds -# to transfer data from builder image into the runtime image - -source ${S2I_MODULE_LOCATION}/s2i-core -runtime_assemble - diff --git a/modules/kogito-runtime-jvm/s2i/bin/usage b/modules/kogito-runtime-jvm/s2i/bin/usage deleted file mode 100644 index 7a5201d0a..000000000 --- a/modules/kogito-runtime-jvm/s2i/bin/usage +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -e -# -# 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. -# -IMAGE_NAME="quay.io/kiegroup/kogito-runtime-jvm" -if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - IMAGE_NAME="registry.redhat.io/rhpam-7/rhpam-kogito-runtime-jvm-rhel8" -fi - -cat < -e RUNTIME_TYPE= ${IMAGE_NAME} - -Where the binary path/URL is the built artifact that you want to copy to your image. -RUNTIME_TYPE is the runtime your application is based on. Default value is 'quarkus'. -Note that, for quarkus non Uberjar builds, you also must add the target/lib on the current directory -so the s2i build can copy it into the image. - -You can then run the resulting image via: -docker run -EOF diff --git a/modules/kogito-runtime-native/added/kogito-app-launch.sh b/modules/kogito-runtime-native/added/kogito-app-launch.sh deleted file mode 100644 index 234ea8820..000000000 --- a/modules/kogito-runtime-native/added/kogito-app-launch.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -# -# S2I run script for the 'kogito-runtime-native' images. -# The run script executes the server that runs your application. -# -# For more information see the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# -# Image help. -if [[ "$1" == "-h" ]]; then - exec /usr/local/s2i/usage - exit 0 -fi - -# Configuration scripts -# Any configuration script that needs to run on image startup must be added here. -CONFIGURE_SCRIPTS=( - -) -source "${KOGITO_HOME}"/launch/configure.sh -############################################# - -# shellcheck disable=SC2086 -exec "${KOGITO_HOME}"/bin/*-runner ${JAVA_OPTIONS} ${KOGITO_QUARKUS_NATIVE_PROPS} \ - -Dquarkus.http.host=0.0.0.0 \ - -Dquarkus.http.port=8080 diff --git a/modules/kogito-runtime-native/configure b/modules/kogito-runtime-native/configure deleted file mode 100644 index 6635e0e76..000000000 --- a/modules/kogito-runtime-native/configure +++ /dev/null @@ -1,33 +0,0 @@ -#!/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. -# -SCRIPT_DIR=$(dirname "${0}") -ADDED_DIR="${SCRIPT_DIR}"/added - -# kogito-launch -cp -p "${ADDED_DIR}"/kogito-app-launch.sh "${KOGITO_HOME}"/ -chmod +x-w "${KOGITO_HOME}"/kogito-app-launch.sh - -cp -rv "${ADDED_DIR}"/launch/* "${KOGITO_HOME}"/launch/ -cp -rv "${SCRIPT_DIR}"/s2i/bin/* /usr/local/s2i/ - -chmod 755 /usr/local/s2i/* -chown -R 1001:0 "${KOGITO_HOME}" -chmod -R ug+rwX "${KOGITO_HOME}" - diff --git a/modules/kogito-runtime-native/module.yaml b/modules/kogito-runtime-native/module.yaml deleted file mode 100644 index c9dadd2d1..000000000 --- a/modules/kogito-runtime-native/module.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.runtime.native -version: "999-SNAPSHOT" - -execute: - - script: configure diff --git a/modules/kogito-runtime-native/s2i/bin/assemble b/modules/kogito-runtime-native/s2i/bin/assemble deleted file mode 100755 index 390579ce5..000000000 --- a/modules/kogito-runtime-native/s2i/bin/assemble +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -e -# -# 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. -# -# this script is used by OpenShift with chained builds -# to transfer data from builder image into the runtime image - -source ${S2I_MODULE_LOCATION}/s2i-core -runtime_assemble - diff --git a/modules/kogito-runtime-native/s2i/bin/usage b/modules/kogito-runtime-native/s2i/bin/usage deleted file mode 100644 index 1366d83c9..000000000 --- a/modules/kogito-runtime-native/s2i/bin/usage +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -IMAGE_NAME="quay.io/kiegroup/kogito-runtime-native" -if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - IMAGE_NAME="registry.redhat.io/rhpam-7/rhpam-kogito-runtime-native-rhel8" -fi - -cat < -e RUNTIME_TYPE= ${IMAGE_NAME} - -Where the binary path/URL is the built artifact that you want to copy to your image. - -You can then run the resulting image via: -docker run -EOF diff --git a/modules/kogito-s2i-builder/added/kogito-app-launch.sh b/modules/kogito-s2i-builder/added/kogito-app-launch.sh deleted file mode 100644 index 77ec66bf8..000000000 --- a/modules/kogito-s2i-builder/added/kogito-app-launch.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -# -# S2I run script for the 'kogito-s2i-builder' image. -# The run script executes the server that runs your application. -# -# For more information see the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# -# Image help. -if [[ "$1" == "-h" ]]; then - exec /usr/local/s2i/usage - exit 0 -fi - -# Configuration scripts -# Any configuration script that needs to run on image startup must be added here. -CONFIGURE_SCRIPTS=( - -) - -source ${S2I_MODULE_LOCATION}/s2i-core -source "${KOGITO_HOME}"/launch/configure.sh - -runtime_type=$(get_runtime_type) - -DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-options) $(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/debug-options)" - -############################################# - -case ${runtime_type} in - "quarkus") - if [ "${NATIVE^^}" == "TRUE" ]; then - if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - log_warning "Container Image ${JBOSS_IMAGE_NAME} does not supports native builds, please refer to the documentation." - exit 10 - fi - # shellcheck disable=SC2086 - exec "${KOGITO_HOME}"/bin/*-runner ${JAVA_OPTIONS} ${KOGITO_QUARKUS_S2I_PROPS} \ - -Dquarkus.http.host=0.0.0.0 \ - -Dquarkus.http.port=8080 \ - -Djavax.net.ssl.trustStore="${KOGITO_HOME}"/cacerts - else - # shellcheck disable=SC2086 - exec java ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_QUARKUS_S2I_PROPS} -Dquarkus.http.host=0.0.0.0 \ - -Dquarkus.http.port=8080 -jar "${KOGITO_HOME}"/bin/*.jar - fi - ;; - "springboot") # shellcheck disable=SC2086 - exec java ${DYNAMIC_RESOURCES_OPTS} ${JAVA_OPTIONS} ${KOGITO_SPRINGBOOT_S2I_PROPS} \ - -Dserver.address=0.0.0.0 -Dserver.port=8080 -jar "${KOGITO_HOME}"/bin/*.jar - ;; - *) - log_error "${runtime_type} is not supported." - exit 1 -esac \ No newline at end of file diff --git a/modules/kogito-s2i-builder/configure b/modules/kogito-s2i-builder/configure deleted file mode 100644 index ebfe5a14b..000000000 --- a/modules/kogito-s2i-builder/configure +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -set -e - -SCRIPT_DIR=$(dirname "${0}") -ADDED_DIR="${SCRIPT_DIR}"/added - -# kogito-launch -cp -p "${ADDED_DIR}"/kogito-app-launch.sh "${KOGITO_HOME}"/ -chmod +x "${KOGITO_HOME}"/kogito-app-launch.sh - -cp -rv "${SCRIPT_DIR}"/s2i/bin/* /usr/local/s2i/ - -chmod 755 /usr/local/s2i/* -chown -R 1001:0 "${KOGITO_HOME}" -chmod -R ug+rwX "${KOGITO_HOME}" - diff --git a/modules/kogito-s2i-builder/module.yaml b/modules/kogito-s2i-builder/module.yaml deleted file mode 100644 index 772cc9956..000000000 --- a/modules/kogito-s2i-builder/module.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.s2i.builder -version: "999-SNAPSHOT" - -labels: - - name: "io.openshift.s2i.scripts-url" - value: "image:///usr/local/s2i" - - name: "io.openshift.s2i.destination" - value: "/tmp" - - name: "io.openshift.expose-services" - value: "8080:http" - -execute: - - script: configure - -run: - user: 1001 - cmd: - - "/usr/local/s2i/run" diff --git a/modules/kogito-s2i-builder/s2i/bin/assemble b/modules/kogito-s2i-builder/s2i/bin/assemble deleted file mode 100644 index be0aeec0d..000000000 --- a/modules/kogito-s2i-builder/s2i/bin/assemble +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# -# -# S2I assemble script for the 'kogito-builder' image. -# The 'assemble' script builds your application source so that it is ready to run. -# -# For more information refer to the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# -set -e - -source ${S2I_MODULE_LOCATION}/s2i-core - -runtime_type=$(get_runtime_type) -log_info "----> RUNTIME_TYPE has been set to $runtime_type" - -############################################# -# Configure maven - for a complete list of -# supported values, please refer the module.yaml -# file. -# Configure GraalVM memory limits - -case ${runtime_type} in - "quarkus") - if [ "${NATIVE^^}" == "TRUE" ] && [[ ! "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - CONFIGURE_SCRIPTS=( - "${KOGITO_HOME}"/launch/configure-maven.sh - "${KOGITO_HOME}"/launch/memory-limit.sh - ) - else - CONFIGURE_SCRIPTS=( - "${KOGITO_HOME}"/launch/configure-maven.sh - ) - fi - ;; - "springboot") - CONFIGURE_SCRIPTS=( - "${KOGITO_HOME}"/launch/configure-maven.sh - ) - ;; - *) - log_error "${runtime_type} is not supported." - exit 1 -esac - - -source "${KOGITO_HOME}"/launch/configure.sh -############################################# - - -# incremental builds -manage_incremental_build - -# kogito app build -build_kogito_app "${runtime_type}" - -# copy kogito app to "${KOGITO_HOME}"/bin dir -copy_kogito_app - -# handle persistence files -copy_persistence_files diff --git a/modules/kogito-s2i-builder/s2i/bin/usage b/modules/kogito-s2i-builder/s2i/bin/usage deleted file mode 100644 index 416d0f117..000000000 --- a/modules/kogito-s2i-builder/s2i/bin/usage +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -IMAGE_NAME="quay.io/kiegroup/kogito-s2i-builder" -RUNTIME_JVM_IMAGE_NAME="quay.io/kiegroup/kogito-runtime-jvm" - -NATIVE_COMMANDS="For the native build, just set the NATIVE environment variable to "true" and use -the quay.io/kiegroup/kogito-runtime-native image as runtime-image. -In that way, a native build will be produced and copied to the runtime image. - -Example: - -$ s2i build -c /Development/project/ ${IMAGE_NAME} --env RUNTIME_TYPE=quarkus --runtime-image quay.io/kiegroup/kogito-runtime-native --env NATIVE=true" - -if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - IMAGE_NAME="registry.redhat.io/rhpam-7/rhpam-kogito-builder-rhel8" - RUNTIME_JVM_IMAGE_NAME="registry.redhat.io/rhpam-7/rhpam-kogito-runtime-jvm-rhel8" - NATIVE_COMMANDS="" -fi - - -cat < ${IMAGE_NAME} --runtime-image - - -Sample invocation: - -$ s2i build -c /Development/project/ ${IMAGE_NAME} --env RUNTIME_TYPE=quarkus --runtime-image ${RUNTIME_JVM_IMAGE_NAME} - -By default, it generates a non-native build. Use the ${RUNTIME_JVM_IMAGE_NAME} image as runtime-image, -in that way, a *runner.jar will be produced and copied to the runtime image. - -Example: - -$ s2i build -c /Development/project/ ${IMAGE_NAME} --env RUNTIME_TYPE=quarkus --runtime-image ${RUNTIME_JVM_IMAGE_NAME} - -echo -n ${NATIVE_COMMANDS} - -You can then run the resulting image via: -docker run -EOF diff --git a/modules/kogito-s2i-core/added/s2i-core b/modules/kogito-s2i-core/added/s2i-core deleted file mode 100644 index 7a4070d13..000000000 --- a/modules/kogito-s2i-core/added/s2i-core +++ /dev/null @@ -1,323 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -# imports -source "${KOGITO_HOME}"/launch/logging.sh -source "${KOGITO_HOME}"/launch/kogito-persistence.sh - -S2I_DESTINATION_DIR="${S2I_DESTINATION_DIR:-/tmp}" -S2I_ARTIFACTS_DIR="${S2I_DESTINATION_DIR}/artifacts" -S2I_SOURCE_DIR="${S2I_DESTINATION_DIR}/src" -PROJECT_GROUP_ID="${PROJECT_GROUP_ID:-com.company}" -PROJECT_ARTIFACT_ID="${PROJECT_ARTIFACT_ID:-project}" -PROJECT_VERSION="${PROJECT_VERSION:-1.0-SNAPSHOT}" -artifactDir="target" -readonly QUARKUS_RUNTIME_TYPE="quarkus" -readonly SPRINGBOOT_RUNTIME_TYPE="springboot" - -if [ ! -z "${ARTIFACT_DIR}" ]; then - artifactDir="${ARTIFACT_DIR}" -fi - -# setup file permissions for injected content -if [ -d "${S2I_ARTIFACTS_DIR}" ]; then - chmod -R ug+rwX "${S2I_ARTIFACTS_DIR}" -fi - - -function manage_incremental_build() { - if [ -d /tmp/artifacts ]; then - log_info "Expanding artifacts from incremental build..." - ( cd /tmp/artifacts && tar cf - . ) | ( cd ${HOME} && tar xvf - ) - rm -rf /tmp/artifacts - fi -} - - -function assemble_runtime() { - # handle persistence files - move_persistence_files -} - - -# copy already built artifacts to the runtime image. -function runtime_assemble() { - log_info "-----> [s2i-core] Running runtime assemble script" - cd ${S2I_DESTINATION_DIR}/src - if [ "${BINARY_BUILD^^}" == "TRUE" ] || ls | grep -E '*.jar|classes|maven*|*-runner|target|quarkus-app' 1> /dev/null 2>&1; then - log_info "-----> Binary build enabled, artifacts were uploaded directly to the image build" - if ls target 1> /dev/null 2>&1; then - log_info "-----> Entire target dir uploaded." - cd "target" - fi - - local result=$(file -b --mime-type *-runner | grep x-executable) - if [ "$result" == "application/x-executable" ]; then - log_info "-----> Found binary file, native build." - NATIVE="TRUE" - - else - if ls | grep -E '*-runner.jar' 1> /dev/null 2>&1;then - log_info "-----> Found Quarkus runner.jar file, not native build." - NATIVE="FALSE" - - elif ls | grep -E 'quarkus-app/*-run.jar' 1> /dev/null 2>&1;then - log_info "-----> Found Quarkus app.jar file, not native build." - NATIVE="FALSE" - fi - fi - - log_info "-----> Cleaning up unneeded jar files" - rm -rfv *-tests.jar - rm -rfv *-sources.jar - - log_info "-----> Copying uploaded files to "${KOGITO_HOME}"" - artifactDir="." - ARTIFACT_DIR=$artifactDir - copy_kogito_app - copy_persistence_files - else - cp -Rv --parents ./* "${KOGITO_HOME}"/ - fi - assemble_runtime - log_info "-----> Cleaning up s2i directory" - rm -rfv ${S2I_DESTINATION_DIR}/src/* -} - -function build_kogito_app() { - local RUNTIME_TYPE="${1:-$QUARKUS_RUNTIME_TYPE}" - cd "${S2I_SOURCE_DIR}" - - nativeBuild="" - if [ "${NATIVE^^}" == "TRUE" ]; then - if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - log_warning "Container Image ${JBOSS_IMAGE_NAME} does not supports native builds, please refer to the documentation." - exit 10 - else - nativeBuild="-Dnative" - fi - fi - - if [ "${SCRIPT_DEBUG}" != "true" ]; then - export MAVEN_ARGS_APPEND="${MAVEN_ARGS_APPEND} --batch-mode" - else - set -x - fi - - if [ -f "pom.xml" ]; then - log_info "---> Building application from source..." - $MAVEN_HOME/bin/mvn clean package ${MAVEN_ARGS_APPEND} ${KOGITO_OPTS} ${nativeBuild} -s "${MAVEN_SETTINGS_PATH}" \ - -DskipTests -Dmaven.test.skip -Dmaven.javadoc.skip=true -Dmaven.site.skip=true -Dmaven.source.skip=true \ - -Djacoco.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true -Dfabric8.skip=true - - else - log_info "---> Generating $RUNTIME_TYPE project structure for $PROJECT_ARTIFACT_ID..." - local quarkus_platform_version - if [ "${RUNTIME_TYPE}" == "${QUARKUS_RUNTIME_TYPE}" ]; then - - local quarkus_plugin="${QUARKUS_PLUGIN:-io.quarkus.platform:quarkus-maven-plugin}" - if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - quarkus_plugin="${QUARKUS_PLUGIN:-com.redhat.quarkus.platform:quarkus-maven-plugin}" - fi - - IFS=':' read -ra GAV <<< "${quarkus_plugin}" - for i in "${GAV[@]}"; do - if [[ "$i" =~ ^[0-9]{0,2}\.[0-9]{0,3} ]]; then - log_info "version [${i}] provided through QUARKUS_PLUGIN env." - quarkus_platform_version=${i} - else - quarkus_platform_version=${QUARKUS_PLATFORM_VERSION} || exit 1 - fi - done - - log_info "----> Using Quarkus ${quarkus_plugin}:${quarkus_platform_version} to bootstrap the application." - - $MAVEN_HOME/bin/mvn -B ${MAVEN_ARGS_APPEND} -s "${MAVEN_SETTINGS_PATH}" $(get_quarkus_platform_properties) \ - "${quarkus_plugin}":"${quarkus_platform_version}":create \ - -DprojectGroupId=$PROJECT_GROUP_ID \ - -DprojectArtifactId=$PROJECT_ARTIFACT_ID \ - -DprojectVersion=$PROJECT_VERSION \ - -Dextensions="org.jbpm:jbpm-with-drools-quarkus:${KOGITO_VERSION},quarkus-smallrye-health,quarkus-smallrye-openapi,quarkus-resteasy,quarkus-resteasy-jackson" - - if [ ! -z ${QUARKUS_EXTRA_EXTENSIONS} ]; then - log_info "----> Adding extra Quarkus extensions: ${QUARKUS_EXTRA_EXTENSIONS}" - $MAVEN_HOME/bin/mvn ${MAVEN_ARGS_APPEND} -s "${MAVEN_SETTINGS_PATH}" $(get_quarkus_platform_properties) \ - -f $PROJECT_ARTIFACT_ID/pom.xml \ - "${quarkus_plugin}":"${quarkus_platform_version}":add-extension \ - -Dextensions="${QUARKUS_EXTRA_EXTENSIONS}" - fi - - # Fix as we cannot rely on Quarkus platform - # Should be removed once https://issues.redhat.com/browse/KOGITO-9120 is implemented - if [ ! -z ${KOGITO_VERSION} ]; then - echo "Replacing Kogito Platform BOM with version ${KOGITO_VERSION}" - # [ ]* -> is a regexp pattern to match any number of spaces - pattern_1="[ ]*.*<\/groupId>" - pattern_2="[ ]*quarkus-kogito-bom<\/artifactId>\n" - pattern_3="[ ]*.*<\/version>\n" - complete_pattern="$pattern_1\n$pattern_2$pattern_3" - - replace_1=" org.kie.kogito<\/groupId>\n" - replace_2=" kogito-bom<\/artifactId>\n" - replace_3=" ${KOGITO_VERSION}<\/version>\n" - complete_replace="$replace_1$replace_2$replace_3" - - sed -i.bak -e "/$pattern_1/{ - N;N;N - s/$complete_pattern/$complete_replace/ - }" ${PROJECT_ARTIFACT_ID}/pom.xml - fi - - elif [ "${RUNTIME_TYPE}" == "${SPRINGBOOT_RUNTIME_TYPE}" ]; then - log_info "----> Using Spring Boot to bootstrap the application." - $MAVEN_HOME/bin/mvn archetype:generate -B -DinteractiveMode=false -DarchetypeGroupId=org.kie.kogito \ - -DarchetypeArtifactId=kogito-spring-boot-archetype -DarchetypeVersion=$KOGITO_VERSION \ - -DgroupId=$PROJECT_GROUP_ID -DartifactId=$PROJECT_ARTIFACT_ID -Dversion=$PROJECT_VERSION \ - ${MAVEN_ARGS_APPEND} -s "${MAVEN_SETTINGS_PATH}" - else - log_error "---> Invalid RUNTIME_TYPE(${RUNTIME_TYPE}) provided, failing build..." - exit 1 - fi - - # remove resources generated by the archetype - log_info "--> Remove archetype generated resources" - rm -rfv $PROJECT_ARTIFACT_ID/src/main/resources/*.{bpm,bpmn2,dmn,drl} - - local require_sw - # copy resources into the generated project - for item in * - do - if [ -d "${item}" ] && [ "${item}" == "$PROJECT_ARTIFACT_ID" ]; then - log_info "--> Skipping generated project ..." - else - log_info "--> Copying resource ${item}" - cp -Rv "${item}" $PROJECT_ARTIFACT_ID/src/main/resources - - if [[ ${item} =~ .*\.sw\.(yaml|yml|json) ]]; then - if [[ "${RUNTIME_TYPE}" == "${QUARKUS_RUNTIME_TYPE}" ]]; then - log_info "--> Found Serverless Workflow file. Will add Kogito Quarkus Workflows extension to the project." - require_sw="true" - else - log_warning "--> Builds from Serverless Workflow files are not supported for SpringBoot. Please build your project locally or use Quarkus." - break - fi - fi - fi - done - - # move all project content into the current directory - mv -v $PROJECT_ARTIFACT_ID/* . - - # add extension if needed - if [ "${require_sw}" == "true" ]; then - log_info "--> Adding Kogito Quarkus Workflows extension to the generated project." - - # we must set the evaluate version since forceStdout is not available in previous versions - local quarkus_platform_version - quarkus_platform_version=${QUARKUS_PLATFORM_VERSION} || exit 1 - log_info "--> Quarkus version is '$quarkus_platform_version'" - - $MAVEN_HOME/bin/mvn ${MAVEN_ARGS_APPEND} -s "${MAVEN_SETTINGS_PATH}" $(get_quarkus_platform_properties) \ - "${quarkus_plugin}":"${quarkus_platform_version}":add-extension \ - -Dextensions="org.apache.kie.sonataflow:sonataflow-quarkus:${KOGITO_VERSION}" - fi - - $MAVEN_HOME/bin/mvn clean package ${MAVEN_ARGS_APPEND} ${KOGITO_OPTS} ${nativeBuild} -s "${MAVEN_SETTINGS_PATH}" \ - -DskipTests -Dmaven.test.skip -Dmaven.javadoc.skip=true -Dmaven.site.skip=true -Dmaven.source.skip=true \ - -Djacoco.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true -Dfabric8.skip=true - fi - - log_info "---> Build finished, installing application from path $(pwd)" -} - -function copy_kogito_app() { - - if [ "${NATIVE^^}" == "TRUE" ]; then - if ls $artifactDir/*-runner 1> /dev/null 2>&1; then - # quarkus native build binary - log_info "---> Installing native application binaries" - cp -v $artifactDir/*-runner "${KOGITO_HOME}"/bin/ - chmod +x "${KOGITO_HOME}"/bin/*-runner - fi - - elif ls $artifactDir/*-runner.jar 1> /dev/null 2>&1; then - # handle quarkus build files - log_info "---> Installing runner jar file" - cp -v $artifactDir/*-runner.jar "${KOGITO_HOME}"/bin - if [ -d "${artifactDir}/lib" ]; then - log_info "---> Copying application libraries" - cp -r $artifactDir/lib/ "${KOGITO_HOME}"/bin - fi - - elif ls $artifactDir/quarkus-app/*-run.jar 1> /dev/null 2>&1; then - # handle quarkus 1.12+ build files - log_info "---> Installing Quarkus 1.12+ Application files" - # copy everything that resides on quarkus-app directory - cp -rv $artifactDir/quarkus-app/* "${KOGITO_HOME}"/bin - - else - # handle normal java builds - log_info "---> Installing common application binaries" - cp -v $artifactDir/*.jar "${KOGITO_HOME}"/bin - fi -} - -function get_runtime_type() { - allowed_runtime_values=("$QUARKUS_RUNTIME_TYPE" "$SPRINGBOOT_RUNTIME_TYPE") - local runtime_type="${QUARKUS_RUNTIME_TYPE}" - - jar_2_inspect="${KOGITO_HOME}/bin/*.jar" - quarkus_main_class="io.quarkus.bootstrap.runner.QuarkusEntryPoint" - spring_main_class="org.springframework.boot.loader.JarLauncher" - if [ -f ${jar_2_inspect} ]; then - log_info "---> Binary build, trying to detect runtime type based on the provided application jar." - zipgrep "$quarkus_main_class" $jar_2_inspect > /dev/null - if [ $? = 0 ]; then - RUNTIME_TYPE="${QUARKUS_RUNTIME_TYPE}" - else - zipgrep "$spring_main_class" $jar_2_inspect > /dev/null - if [ $? = 0 ]; then - RUNTIME_TYPE="${SPRINGBOOT_RUNTIME_TYPE}" - fi - fi - fi - - if [ "${RUNTIME_TYPE}x" = "x" ]; then - RUNTIME_TYPE=${RUNTIME_TYPE:-${runtime_type}} - fi - - if [[ ! "${allowed_runtime_values[*]}" =~ ${RUNTIME_TYPE} ]]; then - log_warning "RUNTIME_TYPE ${RUNTIME_TYPE} is not allowed, the allowed types are [${allowed_runtime_values[*]}]. Application might fail" - fi - - log_info "----> Setting RUNTIME_TYPE to ${RUNTIME_TYPE}" - echo "${RUNTIME_TYPE}" -} - -function get_quarkus_platform_properties() { - local quarkus_platform_group_id="${QUARKUS_PLATFORM_GROUP_ID:-io.quarkus.platform}" - local quarkus_platform_artifact_id="${QUARKUS_PLATFORM_ARTIFACT_ID:-quarkus-bom}" - if [[ "${JBOSS_IMAGE_NAME}" =~ "rhpam-7" ]]; then - quarkus_platform_group_id="${QUARKUS_PLATFORM_GROUP_ID:-com.redhat.quarkus.platform}" - quarkus_platform_artifact_id="${QUARKUS_PLATFORM_ARTIFACT_ID:-quarkus-bom}" - fi - - echo " -DplatformGroupId=${quarkus_platform_group_id} -DplatformArtifactId=${quarkus_platform_artifact_id} -DplatformVersion=${QUARKUS_PLATFORM_VERSION}" -} diff --git a/modules/kogito-s2i-core/configure.sh b/modules/kogito-s2i-core/configure.sh deleted file mode 100644 index 3b2991106..000000000 --- a/modules/kogito-s2i-core/configure.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -# Configure module -set -e - -SCRIPT_DIR=$(dirname "${0}") -ADDED_DIR="${SCRIPT_DIR}"/added - -mkdir "${S2I_MODULE_LOCATION}" - -cp -v "${ADDED_DIR}"/s2i-core "${S2I_MODULE_LOCATION}" -cp -rv "${SCRIPT_DIR}"/s2i/bin/* "${S2I_MODULE_LOCATION}" -chmod 755 "${S2I_MODULE_LOCATION}"/* \ No newline at end of file diff --git a/modules/kogito-s2i-core/module.yaml b/modules/kogito-s2i-core/module.yaml deleted file mode 100644 index d2e8b05ae..000000000 --- a/modules/kogito-s2i-core/module.yaml +++ /dev/null @@ -1,85 +0,0 @@ -# -# 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. -# -schema_version: 1 -name: org.kie.kogito.s2i.core -version: '999-SNAPSHOT' -description: Kogito s2i core module. All s2i files shoul be placed here. - -labels: - - name: "io.openshift.s2i.scripts-url" - value: "image:///usr/local/s2i" - - name: "io.openshift.s2i.destination" - value: "/tmp" - - name: "io.openshift.s2i.assemble-input-files" - value: "/home/kogito/bin" - -envs: - - name: S2I_MODULE_LOCATION - value: "/usr/local/s2i" - - name: S2I_DESTINATION_DIR - description: ^ Root directory for S2I mount, as specified by the **io.openshift.s2i.destination** label. This should not be overridden by end users. - example: /tmp - - - name: S2I_ARTIFACTS_DIR - description: ^ Location mount for artifacts persisted with **save-artifacts** script, which are used with incremental builds. This should not be overridden by end users. - example: "${S2I_DESTINATION_DIR}/artifacts}" - - - name: S2I_SOURCE_DIR - description: ^ Location of mount for source code to be built. This should not be overridden by end users. - example: "${S2I_DESTINATION_DIR}/src}" - - - name: PROJECT_GROUP_ID - description: ^ Indicates the unique identifier of the organization or group that created the project.(default "com.company") - example: "com.company" - - - name: PROJECT_ARTIFACT_ID - description: ^ Indicates the unique base name of the primary artifact being generated.(default "project") - example: "project" - - - name: PROJECT_VERSION - description: ^ Indicates the version of the artifact generated by the project.(default "1.0-SNAPSHOT") - example: "1.0-SNAPSHOT" - - - name: QUARKUS_PLUGIN - description: ^ Defines the maven artifact for Quarkus Maven plugin, defaults to io.quarkus:quarkus-maven-plugin. If no version specified it will be detected automatically based on the current Kogito version. - example: "io.quarkus:custom-plugin:custom.version" - - - name: QUARKUS_PLATFORM_GROUP_ID - description: ^ Defines the Quarkus platform group id, defaults to io.quarkus.platform for community and com.redhat.quarkus.platform for product. - example: "io.quarkus.custom" - - - name: QUARKUS_PLATFORM_ARTIFACT_ID - description: ^ Defines the Quarkus platform artifact id, defaults to quarkus-bom for community and product. - example: "quarkus-bom-custom" - - - name: QUARKUS_EXTRA_EXTENSIONS - description: ^ Defines the Quarkus' extra extensions (as comma-separated list) to be added when performing build from assets. - example: "org.kie:kie-addons-quarkus-knative-eventing,quarkus-kubernetes" - -modules: - install: - - name: org.kie.kogito.persistence - -run: - cmd: - - "/usr/local/s2i/run" - -execute: - - script: configure.sh - diff --git a/modules/kogito-s2i-core/s2i/bin/assemble-runtime b/modules/kogito-s2i-core/s2i/bin/assemble-runtime deleted file mode 100644 index e9b027587..000000000 --- a/modules/kogito-s2i-core/s2i/bin/assemble-runtime +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -e -# -# 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. -# -# S2I assemble-runtime script for the 'kogito-runtime-native' image. -# The assemble-runtime script executes preparation for running the container on runtime image. -# -# For more information see the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# - -source ${S2I_MODULE_LOCATION}/s2i-core -assemble_runtime - diff --git a/modules/kogito-s2i-core/s2i/bin/run b/modules/kogito-s2i-core/s2i/bin/run deleted file mode 100644 index 3294dc1db..000000000 --- a/modules/kogito-s2i-core/s2i/bin/run +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# -set -e -exec "${KOGITO_HOME}"/kogito-app-launch.sh ${1} \ No newline at end of file diff --git a/modules/kogito-s2i-core/s2i/bin/save-artifacts b/modules/kogito-s2i-core/s2i/bin/save-artifacts deleted file mode 100644 index 114e50a2a..000000000 --- a/modules/kogito-s2i-core/s2i/bin/save-artifacts +++ /dev/null @@ -1,23 +0,0 @@ - -#!/usr/bin/env bash -# -# 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. -# -cd ${HOME} -tar cf - .m2 - diff --git a/modules/kogito-s2i-core/tests/bats/mocks/myapp-0.0.1-runner b/modules/kogito-s2i-core/tests/bats/mocks/myapp-0.0.1-runner deleted file mode 100755 index 7f45e1a0d050e21b8860c94430a33646acc5b5ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21736 zcmeHPdu$v>8K1k0W2Z^Z=e%&6fHz7Jj)T{a2FIbK-Su-V*|Bl#HW4J7^WEA$<$Pz| z?NxS!L`p&>hX(vls{8{&NI^kGB7Z;>2?>(MYCuBBl~DO3pp-|{Kq0t5OQ9sk_s!0C zce}S2g{mMGW@PU-^ZOn%^X=^H&g16uy@P$hK!8yQvL_g(l!(S5=gQdaA)XXiCtJ%j zwvBCNs{vUB{~G5Ybz(%PgARjejgSigMZF7xe<7$r3ey@AuU>RTvd%ChAA@yvTqk$rbWbP#J=vaYD34=n*Z|L*I<3j`+wEjvmpU2)$)NNe|tD zdPjxcQK3h4QOFY|e`0m>h(vKU5g*>Q|V6igx2Ty!^2F-Da1 zJ`H+U&Ib+T_EC{vCBIx0^&?8|X-Os~I(D}tV{euHt-DbPmu6_czQ#0w5;F@5`DQN&oh-D;y z<{n9`LEeW&UMo*(JcjqCv@Y+I;8bU!B8l{X^nmn$^nmn$^nmn$^nmn$^uYg#2mVs~ zk$)H`|4?Imsp@wvj2U0NVh8if#>u6cYup3KZ~NoG!YfCNgsJ*{uCE4?-~0_w|LY>kUz=2G8%}Zc#mkBYqWkb_Z@i2cX0hgn2;^UzT)Z|}6s~R1 z*blh;vv)XISTU~NdD6K0PRIznY`k*Mt}9rm78bnvnE#1=I+TUwHjWz$w{9QL=kqUD zwEz-0e61`$lz-zi3SN$b&f$`>*EaMphJ5|$!87}IG&80@HL&oiK0dJUmOiF0{Bztm z)4U1b1A{y7q7QF>=UzTuLX>~zs&s} z{rj22`e*gS`VrkMtpoQT=pp6zrEn+Enheqd(gV^1(gV^1(gV^1(gV^1(gV^1(gV^1 z@67{&!V0LPAJ`gt9M^hrtvs@l&yN7rfa2izZJ=|AznRaU19}4JYd|sJ`YVRO@lh6- ziv+f=tFFN{YFwwpHT=te%I9%V&U&gNh_%B1&j90V@(@QE7;dv?AP-zqWqLUBT(Eon z>OL?ecvyy6;9JP=3rD^Z90=EcIn*0g&aCPUH$Gq06K;KOwGr+-S=}GjQsGWL+^UBg zyTVFWxV|eK=?d5I@_ZZA&w(Av8_mfeJs>?GJs>?GJs>?GJs>?GJs>?GJs>^sZ+ZaM zf-x+M{nfMwmFPOog^S>?7wL0C?_rUqebQS+n)W$ABGL!NzGxgbVj%uo_ws3;4rxf7 zJ>NiQMVj_3H;VK_T#B(yLHXDd;`JiESx_R?BC;&>DPJ7VVt~!KJdi%D2=nq>6!Neb z&C>xP2g6XFz99Gl{;v_*SMHZ#e|PsMl}6Yty;Io>dy?Cf_SUw&t)1v7X@zy4_8vFXk|=u<`9XQCfM84QkG)l@9zG0wQHqD)i&@YAfR7XZ3< zj&2j*#$3w<$=)v5OdUIB#*)$OG-DfGyr$TsIh#q_R?JSMQ`lgr?FoB*!=qyZeTP^c z)wZ~Fck!Ls2M?P1fdjoDHN5`-@IB?J#{J}lIR#$7?Ywz-Y^7%swmF%J&RFJbI+3!i z4Cob}3$E9+dIMl}fYt%!!LjGmFJncMiK!Ig(x1EDSAUkZL)|87UTLEtfLdksU^{EQ@VS#(=drIKm z`hE*=zjpFnz=LpF3iY$(pGyK?^gO>m7WlFUzX^B%W+kaTV>L0{;duG;wHYQOF<<8C zBew${fG<7obE*OESN=-%>gRT9*{batFGuOc&(1i=;}@p4ADHBJ%KL$|koT7J3mh-+ zm(FrK<^98pfNual;4juN(ERLg09Snajqd{<0i68ImEiI{v=c1vKVRbZNvcSHCG2?n zr8|HtMX^HcF5q>+^{htG3K&KnT7~n##r_$RJUk2$tQWnTErE|g!-zmT!Qao7hMg!6 z?Vs8+`Qde5{$jt;B9wHHM>}3W42gW{dx6$VMggx2ZZ6Ar2hZ2%J=K!SX7Es#7FYpj zfzw>fj@``}D?S~yofBSK_O_^M@ed^7_?KA5Zd21tjiyrRiA2gwq!P9o^QKKJ758H5 zblUb}DCdW(xl}T7%u3GtDpX>s{2-Uytgli9o@&h{{EOvgfV!QCnHejYj+NHejl1jZ z=DF+X=9T-w&G+$#TYwuV_lsMo+&^wUHv&+`F7=^X#^WzHlN)gR&5S15#+YxeH%F-=I}15uERGqdN=etl@5+s)xl1_)O6%w9uSFnUIr**`ekr4O3J zeSHUd$ILOkYp@rs@^gw}*&Hu1Gp%^kjuOm`@#Bj$&3%3mN;&5jfvoE=Bk)-^ZB9p1 z@ubDffnkt}!_%D0T2SO-Zde&s;ogAUL^dnT^TU%&b8M(vID)C!`58Mp0o2Yobedv( z#SNa)6f6a*Q>mOfkxRg_QVHlXIHY$CG~3ZB#(C4Ykf_GzQ((`bcE;g6V`Z|qj>yGC z!UP^Xqft~~DlfijTXXP)ntM*Qrp3*jj)MlJ91Z90IT{oPbJ3Xu^m9|#iNQsk zO+v&m25w*~w6_^(Lr!UUh195RXA%=RXeg!cf%h86b$I;dfX@vcXgo#dx6wMhU~^fD zBi#Z2xOPtZOF<1%#q-J@<*DKYUK_5^0jW}b8lT-31{IgIa~4`D)B}mPVXd9=r*T{j zy#Fvz`RTn_}FX5R7(m>q`*-V@TN@#wP9r~MC< zzqkIUKo{#odpTW zaKi8}Zdc*^pU&a)%2S%?OQ4H;El8if;}42+3P}z`c%U@Vp8|^ap7d$lPv;yiiUv>Z zgY?L+KL=eDA$^)3SP>trBnKiqkUr6009vYFm`7-JASvO=zH&% zs1BK9Z$J!fQTge+dfNl)uZaAGc)>2|f4qP=5z3$F-vOq*ODI9}9ELFXxrn1jSHJoc z+CB*Z{gLJ*E(+tgKTC&y@*DXT_eD|N9S!F?XE^kTCqpVX$>L+`r~m4pBT?&7@Fdy4 E0BT_2<^TWy diff --git a/modules/kogito-s2i-core/tests/bats/s2i-core.bats b/modules/kogito-s2i-core/tests/bats/s2i-core.bats deleted file mode 100644 index 40e71fddf..000000000 --- a/modules/kogito-s2i-core/tests/bats/s2i-core.bats +++ /dev/null @@ -1,490 +0,0 @@ -#!/usr/bin/env bats -# -# 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. -# - - -export KOGITO_HOME=$BATS_TMPDIR/kogito_home -mkdir -p "${KOGITO_HOME}"/{bin,launch} - -cp $BATS_TEST_DIRNAME/../../../kogito-logging/added/logging.sh "${KOGITO_HOME}"/launch/ -cp $BATS_TEST_DIRNAME/../../../kogito-persistence/added/kogito-persistence.sh "${KOGITO_HOME}"/launch/ -cp $BATS_TEST_DIRNAME/../../../kogito-kubernetes-client/added/kogito-kubernetes-client.sh "${KOGITO_HOME}"/launch/ - -# imports -source $BATS_TEST_DIRNAME/../../added/s2i-core - -setup() { - export HOME="${KOGITO_HOME}" - mkdir -p target - function log_error() { echo "${1}"; } - function log_info() { echo "${1}"; } -} - -teardown() { - rm -rf "${KOGITO_HOME}"/bin - rm -rf /tmp/.s2i - rm -rf /tmp/src - rm -rf target - rm -rf "${KOGITO_HOME}"/bin/* -} - - -@test "test manage_incremental_builds" { - rm -rf /tmp/artifacts && mkdir /tmp/artifacts - touch /tmp/artifacts/{file,file1,file2,file3} - run manage_incremental_build - - IFS=$'\n' sorted=($(sort <<<"${lines[*]}")); unset IFS - echo "result= ${sorted[@]}" - - [ "$status" -eq 0 ] - if [ -z "${GITHUB_ACTIONS}" ]; then - [ "$status" -eq 0 ] - [ "${sorted[0]}" = "./" ] - [ "${sorted[1]}" = "Expanding artifacts from incremental build..." ] - [ "${sorted[2]}" = "./file" ] - [ "${sorted[3]}" = "./file1" ] - [ "${sorted[4]}" = "./file2" ] - [ "${sorted[5]}" = "./file3" ] - else - [ "${sorted[0]}" = "./" ] - [ "${sorted[1]}" = "./file" ] - [ "${sorted[2]}" = "./file1" ] - [ "${sorted[3]}" = "./file2" ] - [ "${sorted[4]}" = "./file3" ] - [ "${sorted[5]}" = "Expanding artifacts from incremental build..." ] - fi - -} - -@test "test assemble_runtime no binaries" { - run assemble_runtime - [ "$status" -eq 0 ] -} - -@test "test runtime_assemble" { - mkdir -p "${KOGITO_HOME}"/bin - mkdir -p /tmp/src/bin - touch /tmp/src/bin/myapp.jar - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - [ "${lines[1]}" = "'./bin/myapp.jar' -> '"${KOGITO_HOME}"/./bin/myapp.jar'" ] -} - -@test "test runtime_assemble with binary builds" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/ - touch /tmp/src/myapp.jar - mkdir -p /tmp/src/lib - mkdir -p /tmp/src/classes - mkdir -p /tmp/src/maven-archiver - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - [ "${lines[5]}" = "'./myapp.jar' -> '"${KOGITO_HOME}"/bin/myapp.jar'" ] -} - -@test "test runtime_assemble with binary builds with new Quarkus 1.12+ default builds" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/quarkus-app/{app,quarkus} - mkdir -p /tmp/src/quarkus-app/lib/{boot,main} - - touch /tmp/src/quarkus-app/my-app-run.jar - - touch /tmp/src/quarkus-app/lib/boot/my-boot-dependency-1.0.jar - touch /tmp/src/quarkus-app/lib/main/my-main-dependency-1.0.jar - - touch /tmp/src/quarkus-app/quarkus/{generated-bytecode.jar,quarkus-application.dat} - - touch /tmp/src/quarkus-app/app/my-1.0.jar - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - [ "${lines[5]}" = "'./quarkus-app/app' -> '/tmp/kogito_home/bin/app'" ] - [ "${lines[6]}" = "'./quarkus-app/app/my-1.0.jar' -> '/tmp/kogito_home/bin/app/my-1.0.jar'" ] - [ "${lines[7]}" = "'./quarkus-app/lib' -> '/tmp/kogito_home/bin/lib'" ] - [ "${lines[8]}" = "'./quarkus-app/lib/boot' -> '/tmp/kogito_home/bin/lib/boot'" ] - [ "${lines[9]}" = "'./quarkus-app/lib/boot/my-boot-dependency-1.0.jar' -> '/tmp/kogito_home/bin/lib/boot/my-boot-dependency-1.0.jar'" ] - [ "${lines[10]}" = "'./quarkus-app/lib/main' -> '/tmp/kogito_home/bin/lib/main'" ] - [ "${lines[11]}" = "'./quarkus-app/lib/main/my-main-dependency-1.0.jar' -> '/tmp/kogito_home/bin/lib/main/my-main-dependency-1.0.jar'" ] - [ "${lines[12]}" = "'./quarkus-app/my-app-run.jar' -> '/tmp/kogito_home/bin/my-app-run.jar'" ] - [ "${lines[13]}" = "'./quarkus-app/quarkus' -> '/tmp/kogito_home/bin/quarkus'" ] - [ "${lines[14]}" = "'./quarkus-app/quarkus/generated-bytecode.jar' -> '/tmp/kogito_home/bin/quarkus/generated-bytecode.jar'" ] - [ "${lines[15]}" = "'./quarkus-app/quarkus/quarkus-application.dat' -> '/tmp/kogito_home/bin/quarkus/quarkus-application.dat'" ] -} - -@test "test runtime_assemble with binary builds native binary" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/ - cp $BATS_TEST_DIRNAME/mocks/myapp-0.0.1-runner /tmp/src/myapp-0.0.1-runner - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - [ "${lines[6]}" = "'./myapp-0.0.1-runner' -> '"${KOGITO_HOME}"/bin/myapp-0.0.1-runner'" ] - - # Only runner is located in bin directory - [ -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-runner" ] -} - -@test "test runtime_assemble with binary builds entire target!" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/target - touch /tmp/src/target/myapp.jar - touch /tmp/src/target/myapp-sources.jar - mkdir -p /tmp/src/target/lib - mkdir -p /tmp/src/target/classes - mkdir -p /tmp/src/target/maven-archiver - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - [ "${lines[7]}" = "'./myapp.jar' -> '"${KOGITO_HOME}"/bin/myapp.jar'" ] -} - -@test "test runtime_assemble with binary builds entire target with new Quarkus 1.12+ default builds" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/target/quarkus-app/{app,quarkus} - mkdir -p /tmp/src/target/quarkus-app/lib/{boot,main} - - touch /tmp/src/target/quarkus-app/my-app-run.jar - - touch /tmp/src/target/quarkus-app/lib/boot/my-boot-dependency-1.0.jar - touch /tmp/src/target/quarkus-app/lib/main/my-main-dependency-1.0.jar - - touch /tmp/src/target/quarkus-app/quarkus/{generated-bytecode.jar,quarkus-application.dat} - - touch /tmp/src/target/quarkus-app/app/my-1.0.jar - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - [ "${lines[6]}" = "'./quarkus-app/app' -> '/tmp/kogito_home/bin/app'" ] - [ "${lines[7]}" = "'./quarkus-app/app/my-1.0.jar' -> '/tmp/kogito_home/bin/app/my-1.0.jar'" ] - [ "${lines[8]}" = "'./quarkus-app/lib' -> '/tmp/kogito_home/bin/lib'" ] - [ "${lines[9]}" = "'./quarkus-app/lib/boot' -> '/tmp/kogito_home/bin/lib/boot'" ] - [ "${lines[10]}" = "'./quarkus-app/lib/boot/my-boot-dependency-1.0.jar' -> '/tmp/kogito_home/bin/lib/boot/my-boot-dependency-1.0.jar'" ] - [ "${lines[11]}" = "'./quarkus-app/lib/main' -> '/tmp/kogito_home/bin/lib/main'" ] - [ "${lines[12]}" = "'./quarkus-app/lib/main/my-main-dependency-1.0.jar' -> '/tmp/kogito_home/bin/lib/main/my-main-dependency-1.0.jar'" ] - [ "${lines[13]}" = "'./quarkus-app/my-app-run.jar' -> '/tmp/kogito_home/bin/my-app-run.jar'" ] - [ "${lines[14]}" = "'./quarkus-app/quarkus' -> '/tmp/kogito_home/bin/quarkus'" ] - [ "${lines[15]}" = "'./quarkus-app/quarkus/generated-bytecode.jar' -> '/tmp/kogito_home/bin/quarkus/generated-bytecode.jar'" ] - [ "${lines[16]}" = "'./quarkus-app/quarkus/quarkus-application.dat' -> '/tmp/kogito_home/bin/quarkus/quarkus-application.dat'" ] -} - -# Check that the irrelevant binaries are excluded -@test "test runtime_assemble with binary builds entire target SpringBoot build" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/target - touch /tmp/src/target/myapp-0.0.1.jar - touch /tmp/src/target/myapp-0.0.1.jar.original - touch /tmp/src/target/myapp-0.0.1-sources.jar - touch /tmp/src/target/myapp-0.0.1-tests.jar - touch /tmp/src/target/myapp-0.0.1-tests-sources.jar - mkdir -p /tmp/src/target/classes - mkdir -p /tmp/src/target/generated-sources - mkdir -p /tmp/src/target/maven-archiver - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - - # Target directory is removed from initial location - [ ! -d "/tmp/src/target" ] - - # Only expected runnable is located in bin directory - [ -f ""${KOGITO_HOME}"/bin/myapp-0.0.1.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1.jar.original" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-sources.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-tests.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-tests-sources.jar" ] -} - -# Check that the irrelevant binaries are excluded -@test "test runtime_assemble with binary builds entire target Quarkus build" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/target - touch /tmp/src/target/myapp-0.0.1.jar - touch /tmp/src/target/myapp-0.0.1-runner.jar - touch /tmp/src/target/myapp-0.0.1-sources.jar - touch /tmp/src/target/myapp-0.0.1-tests.jar - touch /tmp/src/target/myapp-0.0.1-tests-sources.jar - mkdir -p /tmp/src/target/classes - mkdir -p /tmp/src/target/generated-sources - mkdir -p /tmp/src/target/lib - touch /tmp/src/target/lib/mydependency-0.0.1.jar - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - - # Target directory is removed from initial location - [ ! -d "/tmp/src/target" ] - - # Only runner and dependency is located in bin directory - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1.jar" ] - [ -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-runner.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-sources.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-tests.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-tests-sources.jar" ] - [ -f ""${KOGITO_HOME}"/bin/lib/mydependency-0.0.1.jar" ] -} - -# Check that the irrelevant binaries are excluded -@test "test runtime_assemble with binary builds entire target Quarkus native build" { - mkdir -p "${KOGITO_HOME}"/bin - # emulating an upload - mkdir -p /tmp/src/target - touch /tmp/src/target/myapp-0.0.1.jar - cp $BATS_TEST_DIRNAME/mocks/myapp-0.0.1-runner /tmp/src/target/myapp-0.0.1-runner - touch /tmp/src/target/myapp-0.0.1-runner.jar - touch /tmp/src/target/myapp-0.0.1-sources.jar - touch /tmp/src/target/myapp-0.0.1-tests.jar - touch /tmp/src/target/myapp-0.0.1-tests-sources.jar - mkdir -p /tmp/src/target/classes - mkdir -p /tmp/src/target/generated-sources - mkdir -p /tmp/src/target/lib - touch /tmp/src/target/lib/mydependency-0.0.1.jar - - run runtime_assemble - - echo "result= ${lines[@]}" - [ "$status" -eq 0 ] - - # Target directory is removed from initial location - [ ! -d "/tmp/src/target" ] - - # Only runner and dependency is located in bin directory - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-runner.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-sources.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-tests.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/myapp-0.0.1-tests-sources.jar" ] - [ ! -f ""${KOGITO_HOME}"/bin/lib/mydependency-0.0.1.jar" ] -} - -@test "test copy_kogito_app default java build no jar file present" { - run copy_kogito_app - - echo "result= ${lines[@]}" - echo "status= $status" - [ "$status" -eq 1 ] - [ "${lines[0]}" = "---> Installing common application binaries" ] - [ "${lines[1]}" = "cp: cannot stat 'target/*.jar': No such file or directory" ] -} - -@test "test copy_kogito_app default java build jar file present" { - touch target/app.jar - run copy_kogito_app - - rm -rf target/app.jar - - echo "result= ${lines[@]}" - echo "status= $status" - [ "$status" -eq 0 ] - [ "${lines[0]}" = "---> Installing common application binaries" ] - [ "${lines[1]}" = "'target/app.jar' -> '"${KOGITO_HOME}"/bin/app.jar'" ] -} - -@test "test copy_kogito_app default quarkus java build no jar file present" { - NATIVE="false" - touch target/app-runner.jar - mkdir target/lib - touch target/lib/{lib.jar,lib1.jar} - - run copy_kogito_app - rm -rf target/* - - echo "result= ${lines[@]}" - echo "status= $status" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "---> Installing runner jar file" ] - [ "${lines[1]}" = "'target/app-runner.jar' -> '"${KOGITO_HOME}"/bin/app-runner.jar'" ] - [ "${lines[2]}" = "---> Copying application libraries" ] -} - -@test "test copy_kogito_app default quarkus java build uberJar runner file present" { - NATIVE="false" - touch target/app-runner.jar - - run copy_kogito_app - rm -rf target/* - - echo "result= ${lines[@]}" - echo "status= $status" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "---> Installing runner jar file" ] - [ "${lines[1]}" = "'target/app-runner.jar' -> '"${KOGITO_HOME}"/bin/app-runner.jar'" ] -} - -@test "test copy_kogito_app default quarkus native builds file present" { - NATIVE="true" - touch target/app-runner - mkdir target/lib - touch target/lib/{lib.jar,lib1.jar} - - run copy_kogito_app - rm -rf target/* - - echo "result= ${lines[@]}" - echo "status= $status" - - echo "${lines[1]}" - - [ "$status" -eq 0 ] - [ "${lines[0]}" = "---> Installing native application binaries" ] - [ "${lines[1]}" = "'target/app-runner' -> '"${KOGITO_HOME}"/bin/app-runner'" ] -} - -@test "build_kogito_app only checks if it will generate the project in case there's no pom.xml" { - mkdir /tmp/src - - run build_kogito_app - rm -rf target/* - - echo "result= ${lines[@]}" - [ "${lines[0]}" = "---> Generating quarkus project structure for project..." ] -} - -@test "build_kogito_app only checks if it will generate the springboot project in case there's no pom.xml" { - mkdir /tmp/src - - run build_kogito_app $SPRINGBOOT_RUNTIME_TYPE - rm -rf target/* - - echo "result= ${lines[@]}" - [ "${lines[0]}" = "---> Generating springboot project structure for project..." ] - [ "${lines[1]}" = "----> Using Spring Boot to bootstrap the application." ] -} - -@test "build_kogito_app only checks if it will a build will be triggered if a pom is found" { - mkdir /tmp/src - touch /tmp/src/pom.xml - - run build_kogito_app - rm -rf target/* - - echo "result= ${lines[@]}" - [ "${lines[0]}" = "---> Building application from source..." ] -} - -@test "build_kogito_app build a project from a JSON Serverless Workflow file" { - mkdir /tmp/src - touch /tmp/src/workflow.sw.json - - run build_kogito_app - rm -rf target/* - echo "result= ${lines[@]}" - [ "${lines[0]}" = "---> Generating quarkus project structure for project..." ] -} - -@test "build_kogito_app build a project from a YAML Serverless Workflow file" { - mkdir /tmp/src - touch /tmp/src/workflow.sw.yaml - - run build_kogito_app - rm -rf target/* - - echo "result= ${lines[@]}" - [ "${lines[0]}" = "---> Generating quarkus project structure for project..." ] -} - - -@test "test get_runtime_type to make sure it returns the expected runtime_type for Quarkus using binary build" { - echo "Main-Class: io.quarkus.bootstrap.runner.QuarkusEntryPoint" > /tmp/MANIFEST.MF - jar -0 -c --file $KOGITO_HOME/bin/my-app.jar -m /tmp/MANIFEST.MF - - run get_runtime_type - - echo "result: ${lines[@]}" - [ "${lines[2]}" = "quarkus" ] -} - -@test "test get_runtime_type to make sure it returns the expected runtime_type for Springboot binary build" { - echo "Main-Class: org.springframework.boot.loader.JarLauncher" > /tmp/MANIFEST.MF - echo "public void hello(){}" > /tmp/hello.java - jar -0 -c --file $KOGITO_HOME/bin/my-app.jar -m /tmp/MANIFEST.MF - jar -0 -c --file /tmp/my-app.jar -m /tmp/MANIFEST.MF - - run get_runtime_type - - echo "result: ${lines[@]}" - [ "${lines[2]}" = "springboot" ] -} - - -@test "test if the Quarkus platform properties are correctly returned for community version" { - QUARKUS_PLATFORM_VERSION=1.2.3.4 - - result=$(get_quarkus_platform_properties) - - expected=" -DplatformGroupId=io.quarkus.platform -DplatformArtifactId=quarkus-bom -DplatformVersion=1.2.3.4" - - echo "result : $result `env | grep QUARKUS`" - echo "expected: $expected" - [ "${result}" = "${expected}" ] -} - -@test "Check if the expected message is printed if native build is enabled" { - QUARKUS_PLATFORM_VERSION="1.2.3.4" - JBOSS_IMAGE_NAME="rhpam-7/kogito-builder" - NATIVE=true - mkdir /tmp/src - run build_kogito_app - echo "result = $(echo ${lines[0]} | sed -r 's/\x1B\[(;?[0-9]{1,3})+[mGK]//g')" - [ "$status" -eq 10 ] - # remove color from the log_warning func - [ "$(echo ${lines[0]} | sed -r 's/\x1B\[(;?[0-9]{1,3})+[mGK]//g')" = "WARN Container Image rhpam-7/kogito-builder does not supports native builds, please refer to the documentation." ] -} - -@test "test if the Quarkus platform properties are correctly returned for using custom values" { - QUARKUS_PLATFORM_VERSION="12" - QUARKUS_PLATFORM_GROUP_ID="groupId-1" - QUARKUS_PLATFORM_ARTIFACT_ID="artifactId-2" - - result=$(get_quarkus_platform_properties) - - expected=" -DplatformGroupId=groupId-1 -DplatformArtifactId=artifactId-2 -DplatformVersion=12" - - echo "result : $result" - echo "expected: $expected" - [ "${result}" = "${expected}" ] -} - diff --git a/scripts/common.py b/scripts/common.py index 9398669b7..39a61387b 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -53,7 +53,7 @@ "kogito-management-console", "kogito-task-console" } -SWF_BUILDER_IMAGES = {"kogito-swf-builder", "kogito-base-builder", "kogito-swf-devmode"} +SWF_BUILDER_IMAGES = {"kogito-swf-builder", "kogito-swf-devmode"} def yaml_loader(): @@ -311,24 +311,6 @@ def update_artifacts_version_in_behave_tests(artifacts_version): replacement = '| KOGITO_VERSION | {} | '.format(artifacts_version) update_in_behave_tests(pattern, replacement) - -def update_runtime_image_in_behave_tests(runtime_image_name, image_suffix): - """ - Update a runtime image into behave tests - :param runtime_image_name: new full tag name of the runtime image - :param image_suffix: suffix of the runtime image to update - """ - print("Set {0} runtime image to {1} in behave tests".format(image_suffix, runtime_image_name)) - # pattern to change the KOGITO_VERSION - pattern = re.compile(r'(runtime-image quay.io/kiegroup/kogito-runtime-{}:latest)'.format(image_suffix)) - replacement = 'runtime-image {}'.format(runtime_image_name) - update_in_behave_tests(pattern, replacement) - - pattern = re.compile(r'(runtime-image rhpam-7/rhpam-kogito-runtime-{}-rhel8:latest)'.format(image_suffix)) - replacement = 'runtime-image {}'.format(runtime_image_name) - update_in_behave_tests(pattern, replacement) - - def update_maven_repo_in_behave_tests(repo_url, replace_default_repository): """ Update maven repository into behave tests diff --git a/scripts/run-bats.sh b/scripts/run-bats.sh index c7e1adecc..f17bf7402 100755 --- a/scripts/run-bats.sh +++ b/scripts/run-bats.sh @@ -29,29 +29,14 @@ else rm -rf bats-core fi -echo "----> running bats on kogito-graalvm-scripts" -./bats/bin/bats modules/kogito-graalvm-scripts/common/tests/bats - echo "----> running bats on kogito-jobs-service-common" ./bats/bin/bats modules/kogito-jobs-service-common/tests/bats -echo "----> running bats on kogito-kubernetes-client" -./bats/bin/bats modules/kogito-kubernetes-client/tests/bats/ - echo "----> running bats on kogito-management-console" ./bats/bin/bats modules/kogito-management-console/tests/bats/ echo "----> running bats on kogito-task-console" ./bats/bin/bats modules/kogito-task-console/tests/bats/ -echo "----> running bats on kogito-maven" -./bats/bin/bats modules/kogito-maven/tests/bats - -echo "----> running bats on kogito-persistence" -./bats/bin/bats modules/kogito-persistence/tests/bats - -echo "----> running bats on kogito-s2i-core" -./bats/bin/bats modules/kogito-s2i-core/tests/bats - echo "----> running bats on kogito-swf-builder" -./bats/bin/bats modules/kogito-swf/common/scripts/tests/bats \ No newline at end of file +./bats/bin/bats modules/kogito-swf/common/scripts/tests/bats diff --git a/scripts/update-repository.py b/scripts/update-repository.py index 2583e4096..f854b37d9 100644 --- a/scripts/update-repository.py +++ b/scripts/update-repository.py @@ -50,11 +50,6 @@ help='To update the artifacts version for testing') parser.add_argument('--quarkus-platform-version', dest='quarkus_platform_version', help='Update Quarkus version for the tests') - parser.add_argument('--runtime-image-jvm', dest='runtime_image_jvm', - help='To update the runtime jvm image name in behave tests\'s steps') - parser.add_argument('--runtime-image-native', dest='runtime_image_native', - help='To update the runtime native image name in behave tests\'s steps') - parser.add_argument('--tests-only', dest='tests_only', default=False, action='store_true', help='Update product modules/images') args = parser.parse_args() @@ -93,9 +88,3 @@ common.update_quarkus_platform_version_in_build(args.quarkus_platform_version) common.update_quarkus_platform_version_in_behave_tests_repository_paths(args.quarkus_platform_version) - - if args.runtime_image_jvm: - common.update_runtime_image_in_behave_tests(args.runtime_image_jvm, 'jvm') - - if args.runtime_image_native: - common.update_runtime_image_in_behave_tests(args.runtime_image_native, 'native') diff --git a/tests/features/common-build-runtime.feature b/tests/features/common-build-runtime.feature deleted file mode 100644 index b543feba3..000000000 --- a/tests/features/common-build-runtime.feature +++ /dev/null @@ -1,11 +0,0 @@ -@quay.io/kiegroup/kogito-s2i-builder -@quay.io/kiegroup/kogito-runtime-native -@quay.io/kiegroup/kogito-runtime-jvm -Feature: Common tests for Kogito builder and runtime images - - # This scenario launches a container that dies instantly, causing Cekit to hand trying to fetch logs - # See https://github.com/apache/incubator-kie-kogito-images/issues/1722 - @ignore - Scenario: Verify if usage help is correctly called - When container is started with command bash -c "sleep 5s; /home/kogito/kogito-app-launch.sh -h" - Then container log should contain This is the diff --git a/tests/features/kogito-common-builder-jvm.feature b/tests/features/kogito-common-builder-jvm.feature deleted file mode 100644 index ab4bf8711..000000000 --- a/tests/features/kogito-common-builder-jvm.feature +++ /dev/null @@ -1,227 +0,0 @@ -@quay.io/kiegroup/kogito-s2i-builder -Feature: kogito-s2i-builder image JVM build tests - - Scenario: verify if the maven and java installation are correct - When container is started with command bash - Then run sh -c 'echo $MAVEN_HOME' in container and immediately check its output for /usr/share/maven - And run sh -c 'echo $MAVEN_VERSION' in container and immediately check its output for 3.9.3 - And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-17 - - Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main - | variable | value | - | NATIVE | false | - | RUNTIME_TYPE | quarkus | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - And file /home/kogito/cacerts should exist - - Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image and no RUNTIME_TYPE defined - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main - | variable | value | - | NATIVE | false | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - And file /home/kogito/cacerts should exist - - @ignore - Scenario: Verify if the s2i build is finished as expected performing a non native build with runtime image - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | NATIVE | false | - | RUNTIME_TYPE | quarkus | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - And container log should contain DEBUG [io.qua. - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Dquarkus.log.level=DEBUG - - @ignore - Scenario: Verify if the s2i build is finished as expected performing a non native build and if it is listening on the expected port , test uses custom properties file to test the port configuration. - Given s2i build /tmp/kogito-examples from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - @ignore - Scenario: Verify if the multi-module s2i build is finished as expected performing a non native build - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from . using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | ARTIFACT_DIR | kogito-quarkus-examples/rules-quarkus-helloworld/target | - | MAVEN_ARGS_APPEND | -pl :rules-quarkus-helloworld -am | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Perform an incremental s2i build using quarkus runtime type - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld with env and incremental using nightly-main - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - And s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld with env and incremental using nightly-main - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - Then s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - And s2i build log should contain Expanding artifacts from incremental build... - And file /home/kogito/bin/quarkus-run.jar should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - -#### SpringBoot Scenarios - - @ignore - Scenario: Verify if the s2i build is finished as expected with debug enabled - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-springboot-examples/process-springboot-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | springboot | - | JAVA_OPTIONS | -Ddebug=true | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain Started DemoApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Verify if the s2i build is finished as expected with no runtime image and debug enabled - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-springboot-examples/process-springboot-example using nightly-main - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain Started DemoApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - @ignore - Scenario: Verify if the s2i build is finished as expected and if it is listening on the expected port, test uses custom properties file to test the port configuration. - Given s2i build /tmp/kogito-examples from kogito-springboot-examples/process-springboot-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. - | variable | value | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain Tomcat initialized with port(s): 8080 (http) - - @ignore - Scenario: Verify if the s2i build is finished as expected using multi-module build with debug enabled - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from . using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | RUNTIME_TYPE | springboot | - | ARTIFACT_DIR | kogito-springboot-examples/process-springboot-example/target | - | MAVEN_ARGS_APPEND | -pl :process-springboot-example -am | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain Started DemoApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Perform an incremental s2i build using springboot runtime type - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-springboot-examples/process-springboot-example with env and incremental using nightly-main - # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. - | variable | value | - | RUNTIME_TYPE | springboot | - And s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-springboot-examples/process-springboot-example with env and incremental using nightly-main - # Leave those here as placeholder for scripts adding variable to the test. No impact on tests if empty. - | variable | value | - | RUNTIME_TYPE | springboot | - Then s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - And s2i build log should contain Expanding artifacts from incremental build... - And file /home/kogito/bin/process-springboot-example.jar should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - - @ignore - Scenario: Verify if the s2i build is finished as expected with uber-jar package type built - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/process-quarkus-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | MAVEN_ARGS_APPEND | -Dquarkus.package.type=uber-jar | - | RUNTIME_TYPE | quarkus | - Then file /home/kogito/bin/process-quarkus-example-runner.jar should exist diff --git a/tests/features/kogito-common-runtime-jvm.feature b/tests/features/kogito-common-runtime-jvm.feature deleted file mode 100644 index 79b8c98b8..000000000 --- a/tests/features/kogito-common-runtime-jvm.feature +++ /dev/null @@ -1,80 +0,0 @@ -@quay.io/kiegroup/kogito-runtime-jvm -Feature: kogito-runtime-jvm feature. - - Scenario: verify if the java installation is correct - When container is started with command bash - Then run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-17 - And run sh -c 'echo $JAVA_VENDOR' in container and immediately check its output for openjdk - And run sh -c 'echo $JAVA_VERSION' in container and immediately check its output for 17 - - Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port with quarkus - Given s2i build /tmp/kogito-examples/kogito-quarkus-examples/rules-quarkus-helloworld from target - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Verify if the binary build (forcing) is finished as expected and if it is listening on the expected port with quarkus - Given s2i build /tmp/kogito-examples/kogito-quarkus-examples/rules-quarkus-helloworld from target - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - | BINARY_BUILD | true | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/quarkus-run.jar should exist - - Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port with springboot - Given s2i build /tmp/kogito-examples/kogito-springboot-examples/process-springboot-example from target - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain DEBUG 1 --- [ main] o.s.boot.SpringApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - - Scenario: Verify if the binary build (forcing) is finished as expected and if it is listening on the expected port with springboot - Given s2i build /tmp/kogito-examples/kogito-springboot-examples/process-springboot-example from target - | variable | value | - | JAVA_OPTIONS | -Ddebug=true | - | BINARY_BUILD | true | - | RUNTIME_TYPE | springboot | - Then check that page is served - | property | value | - | port | 8080 | - | path | /orders | - | wait | 80 | - | request_method | POST | - | request_body | {"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}} | - | content_type | application/json | - | expected_status_code | 201 | - And file /home/kogito/bin/process-springboot-example.jar should exist - And container log should contain DEBUG 1 --- [ main] o.s.boot.SpringApplication - And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true diff --git a/tests/features/kogito-common-runtime-native.feature b/tests/features/kogito-common-runtime-native.feature deleted file mode 100644 index 9715614ca..000000000 --- a/tests/features/kogito-common-runtime-native.feature +++ /dev/null @@ -1,20 +0,0 @@ -@quay.io/kiegroup/kogito-runtime-native -Feature: Kogito-runtime-native feature. - - Scenario: Verify if the binary build is finished as expected and if it is listening on the expected port with quarkus native - Given s2i build /tmp/kogito-examples/kogito-quarkus-examples/rules-quarkus-helloworld-native/ from target - | variable | value | - | NATIVE | true | - | BINARY_BUILD | true | - | RUNTIME_TYPE | quarkus | - | JAVA_OPTIONS | -Dquarkus.log.level=DEBUG | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist diff --git a/tests/features/kogito-runtime-jvm.feature b/tests/features/kogito-runtime-jvm.feature deleted file mode 100644 index 98732c802..000000000 --- a/tests/features/kogito-runtime-jvm.feature +++ /dev/null @@ -1,13 +0,0 @@ -@quay.io/kiegroup/kogito-runtime-jvm -Feature: kogito-runtime-jvm feature. - - Scenario: verify if all labels are correctly set on kogito-runtime-jvm image - Given image is built - Then the image should contain label maintainer with value Apache KIE - And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i - And the image should contain label io.openshift.s2i.destination with value /tmp - And the image should contain label io.openshift.expose-services with value 8080:http - And the image should contain label io.k8s.description with value Runtime image for Kogito based on Quarkus or Spring Boot JVM image - And the image should contain label io.k8s.display-name with value Kogito based on Quarkus or Spring Boot JVM image - And the image should contain label io.openshift.tags with value runtime,kogito,quarkus,springboot,jvm - And the image should contain label io.openshift.s2i.assemble-input-files with value /home/kogito/bin diff --git a/tests/features/kogito-runtime-native.feature b/tests/features/kogito-runtime-native.feature deleted file mode 100644 index 314881aba..000000000 --- a/tests/features/kogito-runtime-native.feature +++ /dev/null @@ -1,13 +0,0 @@ -@quay.io/kiegroup/kogito-runtime-native -Feature: Kogito-runtime-native feature. - - Scenario: verify if all labels are correctly set on kogito-runtime-native image - Given image is built - Then the image should contain label maintainer with value Apache KIE - And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i - And the image should contain label io.openshift.s2i.destination with value /tmp - And the image should contain label io.openshift.expose-services with value 8080:http - And the image should contain label io.k8s.description with value Runtime image for Kogito based on Quarkus native image - And the image should contain label io.k8s.display-name with value Kogito based on Quarkus native image - And the image should contain label io.openshift.tags with value runtime,kogito,quarkus,native - And the image should contain label io.openshift.s2i.assemble-input-files with value /home/kogito/bin diff --git a/tests/features/kogito-s2i-builder-native.feature b/tests/features/kogito-s2i-builder-native.feature deleted file mode 100644 index 4019e6d4f..000000000 --- a/tests/features/kogito-s2i-builder-native.feature +++ /dev/null @@ -1,137 +0,0 @@ -@quay.io/kiegroup/kogito-s2i-builder -Feature: kogito-s2i-builder image native build tests - - Scenario: verify java cacerts and libsunec are available in the given kogito builder container. - When container is started with command bash - Then file /home/kogito/cacerts should exist - - Scenario: verify if the maven and graal vm settings are correct on kogito-s2i-builder image for native - When container is started with command bash - Then run sh -c 'echo $MAVEN_HOME' in container and immediately check its output for /usr/share/maven - And run sh -c 'echo $MAVEN_VERSION' in container and immediately check its output for 3.9.3 - And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-17 - And run sh -c 'echo $GRAALVM_HOME' in container and immediately check its output for /usr/share/graalvm - And run sh -c 'echo $GRAALVM_VERSION' in container and immediately check its output for 23.0.2.1 - - @ignore - Scenario: Verify if the s2i build is finished as expected using native build and runtime image - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | NATIVE | true | - | RUNTIME_TYPE | quarkus | - | LIMIT_MEMORY | 3221225472 | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And s2i build log should contain -J-Xmx2576980378 - - Scenario: Verify if the s2i build is finished as expected using native build and no runtime image - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main - | variable | value | - | NATIVE | true | - | RUNTIME_TYPE | quarkus | - | LIMIT_MEMORY | 3221225472 | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And file /home/kogito/cacerts should exist - And s2i build log should contain -J-Xmx2576980378 - - @ignore - Scenario: Verify if the s2i build is finished as expected performing a native build and if it is listening on the expected port, test uses custom properties file to test the port configuration. - Given s2i build /tmp/kogito-examples from kogito-quarkus-examples/rules-quarkus-helloworld using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | NATIVE | true | - | RUNTIME_TYPE | quarkus | - | LIMIT_MEMORY | 6442450944 | - Then check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And s2i build log should contain -J-Xmx5153960755 - - @ignore - Scenario: Verify if the s2i build is finished as expected performing a native build with persistence enabled - Step 1: build the application and copy to the runtime image - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/process-quarkus-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - | MAVEN_ARGS_APPEND | -Ppersistence | - When container integ- is started with command bash - Then file /home/kogito/bin/process-quarkus-example-runner should exist - And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' - And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' - And s2i build log should contain -J-Xmx5153960755 - - Scenario: Perform an incremental s2i build for native test - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld with env and incremental using nightly-main - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - And s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/rules-quarkus-helloworld with env and incremental using nightly-main - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - Then s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts - And s2i build log should contain Expanding artifacts from incremental build... - And s2i build log should contain -J-Xmx5153960755 - And file /home/kogito/bin/rules-quarkus-helloworld-runner should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /hello | - | request_method | POST | - | content_type | application/json | - | request_body | {"strings":["hello"]} | - | wait | 80 | - | expected_phrase | ["hello","world"] | - - @ignore - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly using native build - Given s2i build /tmp/kogito-examples from dmn-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-native:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | LIMIT_MEMORY | 6442450944 | - | KOGITO_VERSION | 999-SNAPSHOT | - Then file /home/kogito/bin/project-1.0-SNAPSHOT-runner should exist - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - And check that page is served - | property | value | - | port | 8080 | - | path | /q/health/live | - | wait | 80 | - | request_method | GET | - | content_type | application/json | - | request_body | {"status": "UP", "checks": []} | - And s2i build log should contain -J-Xmx5153960755 diff --git a/tests/features/kogito-s2i-builder.feature b/tests/features/kogito-s2i-builder.feature deleted file mode 100644 index 3031b628e..000000000 --- a/tests/features/kogito-s2i-builder.feature +++ /dev/null @@ -1,147 +0,0 @@ -@quay.io/kiegroup/kogito-s2i-builder -Feature: kogito-s2i-builder image tests - - Scenario: verify if all labels are correctly set on kogito-s2i-builder image - Given image is built - Then the image should contain label maintainer with value Apache KIE - And the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i - And the image should contain label io.openshift.s2i.destination with value /tmp - And the image should contain label io.openshift.expose-services with value 8080:http - And the image should contain label io.k8s.description with value Platform for building Kogito based on Quarkus or Spring Boot - And the image should contain label io.k8s.display-name with value Kogito based on Quarkus or Spring Boot - And the image should contain label io.openshift.tags with value s2i-builder,kogito,quarkus,springboot - - Scenario: verify if community builder image does not contain the red hat maven repositories - When container is started with command bash - Then file /home/kogito/.m2/settings.xml should not contain redhat-maven-repositories - And file /home/kogito/.m2/settings.xml should not contain redhat-maven-repositories - And file /home/kogito/.m2/settings.xml should not contain redhat-ga-repository - And file /home/kogito/.m2/settings.xml should not contain https://maven.repository.redhat.com/ga/ - And file /home/kogito/.m2/settings.xml should not contain redhat-ea-repository - And file /home/kogito/.m2/settings.xml should not contain https://maven.repository.redhat.com/earlyaccess/all/ - And file /home/kogito/.m2/settings.xml should not contain redhat-techpreview-repository - And file /home/kogito/.m2/settings.xml should not contain https://maven.repository.redhat.com/techpreview/all - - @ignore - Scenario: Verify if the s2i build is finished as expected performing a non native build with persistence enabled - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-quarkus-examples/process-quarkus-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | NATIVE | false | - | RUNTIME_TYPE | quarkus | - | MAVEN_ARGS_APPEND | -Ppersistence | - Then file /home/kogito/bin/quarkus-run.jar should exist - And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' - And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' - - @ignore - Scenario: Verify if the s2i build is finished as expected with persistence enabled - Given s2i build https://github.com/apache/incubator-kie-kogito-examples.git from kogito-springboot-examples/process-springboot-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | MAVEN_ARGS_APPEND | -Ppersistence | - | RUNTIME_TYPE | springboot | - Then file /home/kogito/bin/process-springboot-example.jar should exist - And s2i build log should contain '/home/kogito/bin/demo.orders.proto' -> '/home/kogito/data/protobufs/demo.orders.proto' - And s2i build log should contain '/home/kogito/bin/persons.proto' -> '/home/kogito/data/protobufs/persons.proto' - - @ignore - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly - Given s2i build /tmp/kogito-examples from dmn-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | KOGITO_VERSION | 999-SNAPSHOT | - Then file /home/kogito/bin/quarkus-run.jar should exist - And s2i build log should contain Generating quarkus project structure for project... - And s2i build log should contain Using Quarkus io.quarkus.platform:quarkus-maven-plugin: - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - And check that page is served - | property | value | - | port | 8080 | - | path | /q/health/live | - | wait | 80 | - | request_method | GET | - | content_type | application/json | - | request_body | {"status": "UP", "checks": []} | - - @ignore - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly with custom group id, archetype & version - Given s2i build /tmp/kogito-examples from dmn-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | KOGITO_VERSION | 999-SNAPSHOT | - | PROJECT_GROUP_ID | com.mycompany | - | PROJECT_ARTIFACT_ID | myproject | - | PROJECT_VERSION | 2.0-SNAPSHOT | - Then file /home/kogito/bin/quarkus-run.jar should exist - And s2i build log should contain Generating quarkus project structure for myproject... - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - - @ignore - Scenario: Verify that the Kogito Quarkus Serverless Workflow Extension is building the service properly - Given s2i build /tmp/kogito-examples from serverless-workflow-examples/serverless-workflow-order-processing/src/main/resources using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | - | KOGITO_VERSION | 999-SNAPSHOT | - | PROJECT_GROUP_ID | com.mycompany | - | PROJECT_ARTIFACT_ID | myproject | - | PROJECT_VERSION | 2.0-SNAPSHOT | - | K_SINK | http://localhost:8181 | - | QUARKUS_EXTRA_EXTENSIONS | org.kie:kie-addons-quarkus-knative-eventing | - Then file /home/kogito/bin/quarkus-run.jar should exist - And s2i build log should contain Generating quarkus project structure for myproject... - And s2i build log should contain Adding Kogito Quarkus Workflows extension to the generated project. - And check that page is served - | property | value | - | port | 8080 | - | path | / | - | wait | 80 | - | expected_status_code | 202 | - | request_method | POST | - | content_type | application/cloudevents+json | - | request_body | {"specversion": "1.0", "datacontenttype": "application/json", "source": "behave", "type": "orderEvent", "id": "12345", "data": {"id":"f0643c68-609c-48aa-a820-5df423fa4fe0","country":"Brazil","total":10000,"description":"iPhone 12"}}| - -#### SpringBoot Scenarios - - @ignore - Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly when runtime is springboot - Given s2i build /tmp/kogito-examples from dmn-example using nightly-main and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest - | variable | value | - | KOGITO_VERSION | 999-SNAPSHOT | - | RUNTIME_TYPE | springboot | - Then file /home/kogito/bin/project-1.0-SNAPSHOT.jar should exist - And s2i build log should contain Generating springboot project structure for project... - And check that page is served - | property | value | - | port | 8080 | - | path | /Traffic%20Violation | - | wait | 80 | - | expected_phrase | Should the driver be suspended? | - | request_method | POST | - | content_type | application/json | - | request_body | {"Driver": {"Points": 2}, "Violation": {"Type": "speed","Actual Speed": 120,"Speed Limit": 100}} | - And check that page is served - | property | value | - | port | 8080 | - | path | /actuator/health | - | wait | 80 | - | request_method | GET | - | content_type | application/json | - | request_body | {"status":"UP"} | From 710514918a9c9ffb2782626a2a59aa81f8cc8ea7 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Thu, 22 Feb 2024 14:37:06 -0300 Subject: [PATCH 2/2] Removing leftovers and fixing docs Signed-off-by: Ricardo Zanini --- .ci/jenkins/Jenkinsfile.build-image | 1 - README.md | 644 ------------------ .../features/common-custom-truststore.feature | 1 - .../features/common-dynamic-resources.feature | 2 - tests/features/common.feature | 4 - 5 files changed, 652 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.build-image b/.ci/jenkins/Jenkinsfile.build-image index b51a48cf3..892c0343b 100644 --- a/.ci/jenkins/Jenkinsfile.build-image +++ b/.ci/jenkins/Jenkinsfile.build-image @@ -181,7 +181,6 @@ pipeline { // Debug purpose in case of issue sh 'cat tests/test-apps/clone-repo.sh' sh 'cat scripts/setup-maven.sh' - sh 'cat tests/features/kogito-s2i-builder.feature' } } } diff --git a/README.md b/README.md index b44206e56..1800b4a11 100644 --- a/README.md +++ b/README.md @@ -27,29 +27,6 @@ Table of Contents - [Table of Contents](#table-of-contents) - [Kogito Images Requirements](#kogito-images-requirements) - [Kogito Images JVM Memory Management](#kogito-images-jvm-memory-management) - - [Kogito Runtime and Builder Images](#kogito-runtime-and-builder-images) - - [Kogito Builder Images](#kogito-builder-images) - - [Kogito SWF (Serverless Workflow) Builder Image usage](#kogito-swf-serverless-workflow-builder-image-usage) - - [Using as a builder](#using-as-a-builder) - - [Using for application development](#using-for-application-development) - - [Using the Kogito SWF Builder Image nightly image](#using-the-kogito-swf-builder-image-nightly-image) - - [Kogito s2i Builder Image usage](#kogito-s2i-builder-image-usage) - - [Kogito s2i Builder Image example](#kogito-s2i-builder-image-example) - - [S2i Builder Image Example with Quarkus](#s2i-builder-image-example-with-quarkus) - - [S2i Builder Image Example with Springboot](#s2i-builder-image-example-with-springboot) - - [Improving Build Time](#improving-build-time) - - [Using incremental builds](#using-incremental-builds) - - [Using a Maven mirror](#using-a-maven-mirror) - - [Kogito Runtime Images](#kogito-runtime-images) - - [Binary Builds](#binary-builds) - - [KJAR Maven Project](#kjar-maven-project) - - [Assets only](#assets-only) - - [Kogito Runtime JVM Image](#kogito-runtime-jvm-image) - - [Kogito Runtime JVM Image usage](#kogito-runtime-jvm-image-usage) - - [Kogito Runtime JVM Image examples](#kogito-runtime-jvm-image-examples) - - [Kogito Runtime Native Image](#kogito-runtime-native-image) - - [Kogito Runtime Native Image Usage](#kogito-runtime-native-image-usage) - - [Kogito Runtime Native Image Example](#kogito-runtime-native-image-example) - [Kogito Component Images](#kogito-component-images) - [Kogito Data Index Component Images](#kogito-data-index-component-images) - [Kogito Jobs Service Component Images](#kogito-jobs-service-component-images) @@ -57,9 +34,6 @@ Table of Contents - [Kogito Management Console Component Image](#kogito-management-console-component-image) - [Kogito Task Console Component Image](#kogito-task-console-component-image) - [Kogito JIT Runner Component Image](#kogito-jit-runner-component-image) - - [Using Kogito Images to Deploy Apps on OpenShift](#using-kogito-images-to-deploy-apps-on-openshift) - - [Using released images](#using-released-images) - - [Pushing the built images to a local OCP registry:](#pushing-the-built-images-to-a-local-ocp-registry) - [Contributing to Kogito Images repository](#contributing-to-kogito-images-repository) - [Building Images](#building-images) - [Image Modules](#image-modules) @@ -124,49 +98,6 @@ The build process will use 80% of the total memory reported by cgroups. For back `LIMIT_MEMORY` will be respected, but it is recommended unset it and let the memory be calculated automatic based on the available memory, it can be used in specific scenarios, like a CI test where it does not run on OpenShift cluster. - -## Kogito Runtime and Builder Images - -Today, the Kogito images are divided basically in 2 vectors, when we talk about images that would be used to assemble -or run Kogito applications: Runtime image and Builder image. -Those are described bellow. - - -### Kogito Builder Images - -The Kogito Builder Images are responsible for building the project with Apache Maven and generating the binary that will -be used by the Kogito Runtime images to run the Kogito application. - -There are three builder images available: - - -* [quay.io/kiegroup/kogito-base-builder](https://quay.io/kiegroup/kogito-base-builder) -The Kogito base Builder Image is equipped with the following components: - * OpenJDK 17.x - * Maven 3.9.3 - -* [quay.io/kiegroup/kogito-swf-builder](https://quay.io/kiegroup/kogito-swf-builder) - The Kogito SWF Builder Image extends the kogito-base-builder is equipped with the following components for faster builds: - * Quarkus dependencies - * kogito-quarkus-serverless-workflow extension dependencies - * kogito-addons-quarkus-knative-eventing extension dependencies - -* [quay.io/kiegroup/kogito-s2i-builder](https://quay.io/kiegroup/kogito-s2i-builder) - -Former name: `quay.io/kiegroup/kogito-builder` -The Kogito s2i builder image supports building applications based on Spring Boot and Quarkus. To define your runtime, specify the `RUNTIME_TYPE` environment variable. If var is not defined, it defaults to `quarkus`. -When `RUNTIME_TYPE` quarkus is chosen, the Builder Image allows you to create a native image using GraalVM, which allows you to have lightweight and fast applications ready to run in the Cloud. - -The Kogito s2i Builder Image is equipped with the following components: - - * GraalVM 23+ - * OpenJDK 17+ - * Maven 3.9.3 - -For more information about what is installed on this image, take a look [here](kogito-s2i-builder-image.yaml) in the -**modules.install** section. - - #### SonataFlow Builder Image usage ##### Using as a builder @@ -212,389 +143,6 @@ There are 2 environment variables that should not be changed when using it: That way, no new artifacts will be downloaded and you can directly use it. -#### Kogito s2i Builder Image usage - -This image contains a helper option to better understand how to use it: - -```bash -$ docker run -it quay.io/kiegroup/kogito-s2i-builder:latest /home/kogito/kogito-app-launch.sh -h -``` - -By default, quarkus is selected as runtime, and a normal java build will be performed. To perform a native build, just set the **NATIVE** build environment variable to **true**. - -See the next topic for an example. - - -#### Kogito s2i Builder Image example - -##### S2i Builder Image Example with Quarkus -In this example, let's use a simple application based on Quarkus that is available in the [Kogito Examples](https://github.com/apache/incubator-kie-kogito-examples) -repository: the *rules-quarkus-helloworld* example, with native compilation disabled. - - -```bash -$ s2i build https://github.com/apache/incubator-kie-kogito-examples.git \ - --ref main \ - -e RUNTIME_TYPE=quarkus \ - --context-dir kogito-quarkus-examples/rules-quarkus-helloworld \ - quay.io/kiegroup/kogito-s2i-builder:latest \ - rules-example:1.0 -... -[INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 08:37 s -[INFO] Finished at: 2020-04-06T19:13:42Z -[INFO] ------------------------------------------------------------------------ ----> Build finished, installing application from path /tmp/src ----> Installing jar file -'target/rules-quarkus-helloworld-runner.jar' -> '/home/kogito/bin/rules-quarkus-helloworld-runner.jar' ----> Copying application libraries -INFO ---> [persistence] Copying persistence files... -INFO ---> [persistence] Skip copying files, persistence directory does not exist... -Build completed successfully -``` - -After the image is built, let's test it: - -```bash -$ docker run -it -p 8080:8080 rules-example:1.0 - --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ - -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \ ---\___\_\____/_/ |_/_/|_/_/|_|\____/___/ -2020-04-08 18:59:57,753 INFO [io.quarkus] (main) rules-quarkus-helloworld 8.0.0-SNAPSHOT (powered by Quarkus 1.3.0.Final) started in 0.839s. Listening on: http://0.0.0.0:8080 -2020-04-08 18:59:57,755 INFO [io.quarkus] (main) Profile prod activated. -2020-04-08 18:59:57,756 INFO [io.quarkus] (main) Installed features: [cdi, kogito, resteasy, resteasy-jackson, resteasy-jsonb] -``` - -In a different shell, try the following command: -```bash -$ curl -H "Content-Type: application/json" -X POST -d '{"strings":["hello"]}' http://localhost:8080/hello - -# the service will return `["hello", "world"]` -``` - - - -##### S2i Builder Image Example with Springboot -In this example, let's use a simple application based on Spring Boot that is available in the [Kogito Examples](https://github.com/apache/incubator-kie-kogito-examples) -repository: the *process-springboot-example*. - -```bash -$ s2i build https://github.com/apache/incubator-kie-kogito-examples.git \ - --ref main \ - --context-dir kogito-springboot-examples/process-springboot-example \ - -e RUNTIME_TYPE=springboot \ - quay.io/kiegroup/kogito-s2i-builder:latest \ - springboot-example:1.0 -``` - -After the image is built, let's test it: - -```bash -$ docker run -it -p 8080:8080 springboot-example:1.0 -``` - -In a different shell, try the following commands: -```bash -$ curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" \ - -X POST http://localhost:8080/orders - -{"id":"10de03c0-828f-4f2e-bb3f-68c3ddfea7ec","approver":"john","order":{"orderNumber":"12345","shipped":false,"total":0.4231905542160477}}✔ - -$ curl -X GET http://localhost:8080/orders -$ curl -X DELETE http://localhost:8080/orders/10de03c0-828f-4f2e-bb3f-68c3ddfea7ec -``` - -#### Improving Build Time - -The time needed to build the application is rather long. This is mainly due to maven downloading all dependencies, which takes several minutes. - - -##### Using incremental builds - -If you are planning to build many times the same application, you can use the incremental builds which will improve drastically the build time. -Let's start 2 builds with the incremental option enabled and compare the time spent to build each one: - -```bash -# First incremental build -$ time s2i build https://github.com/apache/incubator-kie-kogito-examples.git \ - --ref main \ - -e RUNTIME_TYPE=quarkus - --context-dir kogito-quarkus-examples/rules-quarkus-helloworld \ - quay.io/kiegroup/kogito-s2i-builder:latest \ - rules-example-incremental:1.0 \ - --incremental \ - --env NATIVE=false -... -real 13m49.819s -user 0m1.768s -sys 0m1.429s -``` - -And now, let's run it again. - -```bash -# Second incremental build -$ time s2i build https://github.com/apache/incubator-kie-kogito-examples.git \ - --ref main \ - -e RUNTIME_TYPE=quarkus - --context-dir kogito-quarkus-examples/rules-quarkus-helloworld \ - quay.io/kiegroup/kogito-s2i-builder:latest \ - rules-example-incremental:1.0 \ - --incremental \ - --env NATIVE=false -... -real 0m57.582s -user 0m1.628s -sys 0m1.123s -``` - -In the second try, you can see the artifacts getting unpacked and reused from the previous build. -Now, pay also attention to the time spent to build it. There is a big difference. -In fact, an incremental build reuses the previously built image and it takes advantage of already downloaded artifacts. -This can significantly improve the build time. - -##### Using a Maven mirror - -Another option is to use a Maven Mirror. -This can be used together with incremental builds to speed up the build even more. -To make it possible we just need to set the **MAVEN_MIRROR_URL** environment variable when starting a new build, see the example below: - - -```bash -# Third incremental build, with Maven mirror option -$ time s2i build https://github.com/apache/incubator-kie-kogito-examples.git \ - --ref main \ - -e RUNTIME_TYPE=quarkus - --context-dir kogito-quarkus-examples/rules-quarkus-helloworld \ - quay.io/kiegroup/kogito-s2i-builder:latest \ - rules-example-incremental-1 \ - --incremental \ - --env NATIVE=false \ - --env MAVEN_MIRROR_URL=http://nexus.apps.local.cloud/nexus/content/groups/public -... -real 0m49.658s -user 0m0.968s -sys 0m0.539s -``` - -Here you can see that the build time has again been reduced. -If the maven mirror already has all the dependencies there, the build time can be even faster. -Also, Maven generates lots of transfer logs for downloading/uploading of maven dependencies. By default, these logs are -disabled. To view these logs we need to set env variable **MAVEN_DOWNLOAD_OUTPUT** to true. - -If a custom Maven Repository is required, the S2i images also support it. -In case the **MAVEN_REPO_URL** environment variable is provided a new Repository and Plugin Repository will be added to the internal `settings.xml` file. -If no repo-id is provided using the **MAVEN_REPO_ID** environment variable, a generated one will be used. -There is also the possibility to provide more than one custom Repository. In this case, we need to provide the repo **prefix** using the **MAVEN_REPOS** environment variable. -Example, if we want to add two new repositories, the following environment variables is needed: - -```bash -MAVEN_REPOS="CENTRAL,COMPANY" -CENTRAL_MAVEN_REPO_URL="http://central.severinolabs.com/group/public" -CENTRAL_MAVEN_REPO_ID="my_cool_id_central" -COMPANY_MAVEN_REPO_URL="http://company.severinolabs.com/group/public" -COMPANY_MAVEN_REPO_ID="my_cool_id_company" -``` - -### Kogito Runtime Images - -The Kogito Runtime Images have 2 behaviors: -* Run the artifacts built by the Kogito Builder Images -* Run your pre-built local artifacts, via what we call a _Binary Build_. -For non-native built applications, they have a JRE installed to allow to execute Java applications. - -With this approach, we can have smaller and more compact images that do not include any of the build tools or artifacts (like the local maven repository for example). - -Today we have the following Kogito Runtime Images: - -* [quay.io/kiegroup/kogito-runtime-jvm](https://quay.io/kiegroup/kogito-runtime-jvm) -* [quay.io/kiegroup/kogito-runtime-native](http://quay.io/kiegroup/kogito-runtime-native) - -#### Binary Builds - -A Binary Build allows you to quickly copy the built locally artifacts into the target *Kogito Runtime Image*, -saving the time needed to build the final image using the method with Kogito Builder Images. -Below are the supported source structure: - -- KJAR Maven Project -- Assets only - -Both methods are described below. - -##### KJAR Maven Project - -[KieJAR](https://developers.redhat.com/blog/2018/03/14/what-is-a-kjar/) stands for Knowledge Is Everything jar which is a custom JAR file -that contains Business Process or Rules and all needed dependencies and files to execute it on the target runtime, -either Quarkus or Spring Boot. - -If you don't have an already existing project, the best way to create a new one is to use Kogito Maven Archetypes -to generate project structure. -The available archetypes are: - -- [Kogito Quarkus Archetype](https://github.com/apache/incubator-kie-kogito-runtimes/tree/main/archetypes/kogito-quarkus-archetype) -- [Kogito Spring Boot Archetype](https://github.com/apache/incubator-kie-kogito-runtimes/tree/main/archetypes/kogito-springboot-archetype) - -Note that, when building Quarkus based application that is **not** an *UberJAR* we also need to copy the **lib** directory -located inside the *target* directory. -Examples on how to use this feature can be found in the next topics. - - -##### Assets only - -This source structure assumes that there is no maven project but only business assets, stored either directly in the top folder -or grouped into directories. - -Types of Business assets can be: - -- Business Process definition - bpmn2 or just bpmn files -- Business Rule definition - drl files -- Business Decision definition - dmn files - -Upon build, these assets will be copied to a generated maven project and built with Maven to produce a runnable binary. Default value of group id is "com.company", artifact id is "project" and version is "1.0-SNAPSHOT". To provide custom value we need to set the **PROJECT_GROUP_ID**, **PROJECT_ARTIFACT_ID** and **PROJECT_VERSION**. - -#### Kogito Runtime JVM Image - -This Kogito Runtime Image contains only the needed files to execute a pre built Kogito application and a JRE. -The Image can run an application based on Quarkus or Springboot. Users can define `RUNTIME_TYPE` environment variable to switch between the two. - - -##### Kogito Runtime JVM Image usage - -This image contains a helper option to better understand how to use it: - -```bash -docker run -it quay.io/kiegroup/kogito-runtime-jvm:latest /home/kogito/kogito-app-launch.sh -h -``` - - -##### Kogito Runtime JVM Image examples - -In the next few lines let's take a look on how this image can be used to receive an already built UberJAR. -To configure Quarkus to generate an UberJAR please follow the instructions described [here](https://quarkus.io/guides/maven-tooling#configuration-reference) - -For this example let's use the [process-quarkus-example](https://github.com/apache/incubator-kie-kogito-examples/tree/stable/kogito-quarkus-examples/process-quarkus-example). -Once you have checked out the example on your local machine follow the steps below: - -**Example with UberJAR** -```bash -# build the example using uberjar reference -$ mvn clean package -Dquarkus.package.uber-jar -# inspect and run the generated uberjar, for instructions on how to use this example see its README file. -$ java -jar target/jbpm-quarkus-example-runner.jar - -# performing a source to image build to copy the artifacts to the runtime image -$ s2i build target/ -e RUNTIME_TYPE=quarkus quay.io/kiegroup/kogito-runtime-jvm:latest process-quarkus-example - -# run the generated image -$ docker run -p 8080:8080 -it process-quarkus-example - -# On another shell do a simple post request -curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" -X POST http://localhost:8080/orders - -# notice the container logs the following message: -Order has been created Order[12345] with assigned approver JOHN -``` - - -**Example with non UberJAR** -For non uberjar the process is the same, but you only need to remove the property from Quarkus configuration to not generate uberjar. -```bash -$ mvn clean package -``` - -Note that this time there is a *lib* folder in the **target** directory. The s2i build will take care of copying it to the correct place. -Just perform a build: - -```bash -$ s2i build target/ quay.io/kiegroup/kogito-runtime-jvm:latest process-quarkus-example-non-uberjar -$ docker run -p 8080:8080 -it process-quarkus-example-non-uberjar - -# On another shell do a simple post request -$ curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" -X POST http://localhost:8080/orders - -# notice the container logs the following message: -Order has been created Order[12345] with assigned approver JOHN -``` -**Runtime Image example with springboot** -Let's try, here, the *process-springboot-example*: - -```bash -$ mvn clean package -``` - -An uberjar file has been generated into the **target directory**. -Let's use this uberjar to perform the build: - -```bash -$ s2i build target/ -e RUNTIME_TYPE=springboot quay.io/kiegroup/kogito-runtime-jvm:latest spring-binary-example ------> [s2i-core] Running runtime assemble script ------> Binary build enabled, artifacts were uploaded directly to the image build ------> Cleaning up unneeded jar files -removed 'process-springboot-example-tests.jar' -removed 'process-springboot-example-sources.jar' -removed 'process-springboot-example-test-sources.jar' ------> Copying uploaded files to /home/kogito ----> Installing application binaries -'./process-springboot-example.jar' -> '/home/kogito/bin/process-springboot-example.jar' -... - -# run the output image -$ docker run -it -p 8080:8080 spring-binary-example - -# on another terminal, interact with the kogito service -$ curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" -X POST http://localhost:8080/orders - -# notice the container logs the following message: -Order has been created Order[12345] with assigned approver JOHN -``` - -#### Kogito Runtime Native Image - -This Kogito Runtime Image contains only the needed files to execute a pre built Kogito application. - - -##### Kogito Runtime Native Image Usage - -This image contains a helper option to better understand how to it: - -```bash -docker run -it quay.io/kiegroup/kogito-runtime-native:latest /home/kogito/kogito-app-launch.sh -h -``` - -##### Kogito Runtime Native Image Example - -For this example, let's use the same as the previous one (process-quarkus-example). -But this time, let's perform a native build: - -```bash -$ mvn clean package -Dnative -``` - -A binary has been generated into the **target directory**. -Let's use this binary to perform the source-to-image build: - -```bash -s2i build target/ -e RUNTIME_TYPE=quarkus quay.io/kiegroup/kogito-runtime-native:latest binary-test-example ------> [s2i-core] Running runtime assemble script ------> Binary build enabled, artifacts were uploaded directly to the image build ------> Found binary file, native build. ------> Cleaning up unneeded jar files -... ----> Installing application binaries -'./process-quarkus-example-runner' -> '/home/kogito/bin/process-quarkus-example-runner' -... - -# run the output image -$ docker run -it -p 8080:8080 binary-test-example - -# on another terminal, interact with the kogito service -$ curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" -X POST http://localhost:8080/orders - -# notice the container logs the following message: -Order has been created Order[12345] with assigned approver JOHN -``` - ## Kogito Component Images The Kogito Component Images can be considered as lightweight images that will complement the Kogito core engine @@ -789,199 +337,10 @@ You should notice a few debug messages being printed in the system output. You c To know what configurations this image accepts please take a look [here](kogito-jit-runner-image.yaml) on the **envs** section. -## Using Kogito Images to Deploy Apps on OpenShift - -Once the images are built and imported into a registry (quay.io or any other registry), new applications can be built and deployed within a few steps. - - -### Using released images - -As a first step, we need to make the Kogito Images available as Image Streams in OpenShift. If you have `cluster-admin` -rights you can deploy it into the **openshift** namespace, otherwise, deploy it into the namespace where you have permissions. -To install the image stream use this imagestream file: [kogito-imagestream.yaml](https://raw.githubusercontent.com/apache/incubator-kie-kogito-images/main/kogito-imagestream.yaml). -It points to the latest released version. - -Let's use the *kogito-quarkus-examples/rules-quarkus-helloworld* from [Kogito Examples](https://github.com/apache/incubator-kie-kogito-examples). - -```bash -# creating a new namespace -$ oc new-project rules-quarkus-helloworld -Now using project "rules-quarkus-helloworld" on server "https://ocp.lab.cloud:8443". - -You can add applications to this project with the 'new-app' command. For example, try: - - oc new-app centos/ruby-25-centos7~https://github.com/sclorg/ruby-ex.git - -to build a new example application in Ruby. - -# installing the imagestream on the current namespace -$ oc create -f https://raw.githubusercontent.com/apache/incubator-kie-kogito-images/0.16.0/kogito-imagestream.yaml -imagestream.image.openshift.io/kogito-runtime-native created -imagestream.image.openshift.io/kogito-runtime-jvm created -imagestream.image.openshift.io/kogito-s2i-builder created -imagestream.image.openshift.io/kogito-data-index-ephemeral created -imagestream.image.openshift.io/kogito-data-index-postgresql created -imagestream.image.openshift.io/kogito-jobs-service-ephemeral created -imagestream.image.openshift.io/kogito-jobs-service-postgresql created -imagestream.image.openshift.io/kogito-jobs-service-allinone created -imagestream.image.openshift.io/kogito-management-console created - -# performing a new build -$ oc new-build --name=rules-quarkus-helloworld-builder --image-stream=kogito-s2i-builder:latest \ - https://github.com/apache/incubator-kie-kogito-examples.git#main --context-dir=kogito-quarkus-examples/rules-quarkus-helloworld \ - --strategy=source --env NATIVE=false ---> Found image 8c9d756 (5 days old) in image stream "rules-quarkus-helloworld/kogito-s2i-builder" under tag "latest" for "kogito-s2i-builder:latest" - - Kogito based on Quarkus - ----------------------- - Platform for building Kogito based on Quarkus - - Tags: builder, kogito, quarkus - - * The source repository appears to match: jee - * A source build using source code from https://github.com/apache/incubator-kie-kogito-examples.git#main will be created - * The resulting image will be pushed to image stream tag "rules-quarkus-helloworld-builder:latest" - * Use 'start-build' to trigger a new build - ---> Creating resources with label build=drools-helloworld-builder ... - imagestreamtag.image.openshift.io "rules-quarkus-helloworld-builder:latest" created - buildconfig.build.openshift.io "rules-quarkus-helloworld-builder" created ---> Success -``` - -The build has started, you can check the logs with the following command: - -```bash -$ oc logs -f bc/rules-quarkus-helloworld-builder -``` - -Once the build is finished, you can now create a new build to copy the generated artifact from the source to image build -to the Kogito Runtime Image. To do this, execute the following command: - -```bash -$ oc new-build --name=rules-quarkus-helloworld-service --source-image=rules-quarkus-helloworld-builder \ - --source-image-path=/home/kogito/bin:. --image-stream=kogito-runtime-jvm:latest ---> Found image 1608e71 (6 days old) in image stream "rules-quarkus-helloworld/kogito-runtime-jvm" under tag "latest" for "kogito-runtime-jvm:latest" - - Kogito based on Quarkus JVM image - --------------------------------- - Runtime image for Kogito based on Quarkus JVM image - - Tags: builder, runtime, kogito, quarkus, jvm - - * A source build using will be created - * The resulting image will be pushed to image stream tag "rules-quarkus-helloworld-service:latest" - * Use 'start-build' to trigger a new build - ---> Creating resources with label build=drools-helloworld-service ... - imagestream.image.openshift.io "rules-quarkus-helloworld-service" created - buildconfig.build.openshift.io "rules-quarkus-helloworld-service" created ---> Success -``` - -Follow the logs with the following command: -```bash -$ oc logs -f bc/rules-quarkus-helloworld-service -``` - -Once the build gets finished, you need to create an application and use the service image created with the latest command. - -```bash -$ oc new-app rules-quarkus-helloworld-service:latest - --> Found image 664b295 (3 minutes old) in image stream "rules-quarkus-helloworld/rules-quarkus-helloworld-service" under tag "latest" for "rules-quarkus-helloworld-service:latest" - - temp.builder.openshift.io/rules-quarkus-helloworld/rules-quarkus-helloworld-service-1:e8062a99 - --------------------------------------------------------------------------------------- - Runtime image for Kogito based on Quarkus JVM image - - Tags: builder, runtime, kogito, quarkus, jvm - - * This image will be deployed in deployment config "rules-quarkus-helloworld-service" - * Port 8080/tcp will be load balanced by service "rules-quarkus-helloworld-service" - * Other containers can access this service through the hostname "rules-quarkus-helloworld-service" - - --> Creating resources ... - deploymentconfig.apps.openshift.io "rules-quarkus-helloworld-service" created - service "rules-quarkus-helloworld-service" created - --> Success - Application is not exposed. You can expose services to the outside world by executing one or more of the commands below: - 'oc expose svc/rules-quarkus-helloworld-service' - Run 'oc status' to view your app. -``` - -As described in the command output, to be able to access the application, we need to expose it to the external world. -For that, just execute the command listed in the output above, e.g.: - -```bash -$ oc expose svc/rules-quarkus-helloworld-service -``` - -To see the route name, just execute the following command: - -```bash -$ oc get routes -NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD -rules-quarkus-helloworld-service rules-quarkus-helloworld-service-rules-quarkus-helloworld.apps.lab.cloud rules-quarkus-helloworld-service 8080-tcp None -``` - -Now, with the service address in hand we can test our service: - -```bash -$ curl -H "Content-Type: application/json" -X POST -d '{"strings":["hello"]}' \ - http://rules-quarkus-helloworld-service-rules-quarkus-helloworld.apps.lab.cloud/hello -``` - -As output, you should see the following response: - -```json -["hello","world"] -``` - - -For more complex deployment, please use the [Kogito Cloud Operator](https://github.com/apache/incubator-kie-kogito-operator) - - - -### Pushing the built images to a local OCP registry: - -To be able to build the image it should be installed and available on OpenShift before it can be used. - -Suppose we have built the kogito-s2i-builder with the following command: - -```bash -$ make build-image image_name=kogito-s2i-builder -``` - -We'll have as output the following image: - -```bash -quay.io/kiegroup/kogito-s2i-builder:X.X.X -``` - -Then we need to tag the image properly. -Suppose your local registry is openshift.local.registry:8443, you should do: - -```bash -$ docker tag quay.io/kiegroup/kogito-s2i-builder:X.X.X \ - openshift.local.registry:8443/{NAMESPACE}/kogito-s2i-builder:X.X.X -``` - -Where the namespace is the place where you want the image to be available for usage. -Once the image is properly tagged, log in to the registry and push the new image: - -```bash -$ docker login -u -p openshift.local.registry:8443 -$ docker push openshift.local.registry:8443/{NAMESPACE}/kogito-s2i-builder:X.X.X -``` - -To deploy and test the new image, follow the same steps as described [here](#using-released-images) - - ## Contributing to Kogito Images repository Before proceeding please make sure you have checked the [requirements](#kogito-images-requirements). - ### Building Images To build the images for local testing there is a [Makefile](./Makefile) which will do all the hard work for you. @@ -1003,9 +362,6 @@ With this Makefile you can: - Build images individually, by default it will build and test each image ```bash - $ make build-image image_name=kogito-s2i-builder - $ make build-image image_name=kogito-runtime-jvm-ubi8 - $ make build-image image_name=kogito-runtime-native $ make build-image image_name=kogito-data-index-ephemeral $ make build-image image_name=kogito-data-index-postgresql $ make build-image image_name=kogito-jobs-service-ephemeral diff --git a/tests/features/common-custom-truststore.feature b/tests/features/common-custom-truststore.feature index 4184dc17c..3aca41aa7 100644 --- a/tests/features/common-custom-truststore.feature +++ b/tests/features/common-custom-truststore.feature @@ -1,4 +1,3 @@ -@quay.io/kiegroup/kogito-runtime-jvm @quay.io/kiegroup/kogito-data-index-ephemeral @quay.io/kiegroup/kogito-data-index-postgresql @quay.io/kiegroup/kogito-task-console diff --git a/tests/features/common-dynamic-resources.feature b/tests/features/common-dynamic-resources.feature index da33c0d08..ae5eb11fb 100644 --- a/tests/features/common-dynamic-resources.feature +++ b/tests/features/common-dynamic-resources.feature @@ -1,7 +1,5 @@ # Run only on images that won't die instantly # See https://github.com/apache/incubator-kie-kogito-images/issues/1722 -#@quay.io/kiegroup/kogito-s2i-builder -#@quay.io/kiegroup/kogito-runtime-jvm @quay.io/kiegroup/kogito-data-index-ephemeral #@quay.io/kiegroup/kogito-data-index-postgresql #@quay.io/kiegroup/kogito-jit-runner diff --git a/tests/features/common.feature b/tests/features/common.feature index 4fcbdec22..678ef79ad 100644 --- a/tests/features/common.feature +++ b/tests/features/common.feature @@ -1,6 +1,3 @@ -@quay.io/kiegroup/kogito-s2i-builder -@quay.io/kiegroup/kogito-runtime-jvm -@quay.io/kiegroup/kogito-runtime-native @quay.io/kiegroup/kogito-data-index-ephemeral @quay.io/kiegroup/kogito-data-index-postgresql @quay.io/kiegroup/kogito-jit-runner @@ -9,7 +6,6 @@ @quay.io/kiegroup/kogito-management-console @quay.io/kiegroup/kogito-task-console @quay.io/kiegroup/kogito-swf-builder -@quay.io/kiegroup/kogito-base-builder Feature: Common tests for Kogito images Scenario: Verify if Kogito user is correctly configured