From 94127dd6a266db62034c56035d7e7e2bb649c52b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 10:12:09 +0200 Subject: [PATCH 01/12] [1.13.x] Separate Maven behave tests for community and prod (#1496) (#1499) * Separate Maven behave tests for community and prod * correct CI * correction * corrected some tests * Fix failing native s2i build * Revert "corrected some tests" This reverts commit d1caf5fde2fac2c51ec488d3de89947b063cb7d6. * correction * added backporting GHA Co-authored-by: Tristan Radisson --- .ci/jenkins/Jenkinsfile | 1 + .ci/jenkins/Jenkinsfile.deploy | 1 + .github/workflows/pr-backporting.yml | 40 +++++++++++++++++++ .../features/bamoe-kogito-builder-jvm.feature | 16 +++++++- tests/features/kogito-builder.feature | 6 +++ .../kogito-common-builder-jvm.feature | 10 ----- 6 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/pr-backporting.yml diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index 509152b22..cbf8267f4 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -10,6 +10,7 @@ pipeline { agent { label 'kogito-image-slave && !built-in' } tools { jdk 'kie-jdk11' + maven 'kie-maven-3.8.6' } options { timeout(time: 120, unit: 'MINUTES') diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 14d5a6d8a..eb3ee33cf 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -16,6 +16,7 @@ pipeline { // Needed for local build tools { jdk 'kie-jdk11' + maven 'kie-maven-3.8.6' } options { diff --git a/.github/workflows/pr-backporting.yml b/.github/workflows/pr-backporting.yml new file mode 100644 index 000000000..c4b93fde9 --- /dev/null +++ b/.github/workflows/pr-backporting.yml @@ -0,0 +1,40 @@ +name: Pull Request Backporting + +on: + pull_request_target: + types: [closed, labeled] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + compute-targets: + if: ${{ github.event.pull_request.state == 'closed' && github.event.pull_request.merged }} + runs-on: ubuntu-latest + outputs: + target-branches: ${{ steps.set-targets.outputs.targets }} + env: + LABELS: ${{ toJSON(github.event.pull_request.labels) }} + steps: + - name: Set target branches + id: set-targets + uses: kiegroup/kogito-pipelines/.ci/actions/parse-labels@main + with: + labels: ${LABELS} + + backporting: + if: ${{ github.event.pull_request.state == 'closed' && github.event.pull_request.merged && needs.compute-targets.outputs.target-branches != '[]' }} + name: "[${{ matrix.target-branch }}] - Backporting" + runs-on: ubuntu-latest + needs: compute-targets + strategy: + matrix: + target-branch: ${{ fromJSON(needs.compute-targets.outputs.target-branches) }} + fail-fast: false + env: + REVIEWERS: ${{ toJSON(github.event.pull_request.requested_reviewers) }} + steps: + - name: Backporting + uses: kiegroup/kogito-pipelines/.ci/actions/backporting@main + with: + target-branch: ${{ matrix.target-branch }} + additional-reviewers: ${REVIEWERS} \ No newline at end of file diff --git a/tests/features/bamoe-kogito-builder-jvm.feature b/tests/features/bamoe-kogito-builder-jvm.feature index 03f6752c2..19ec98721 100644 --- a/tests/features/bamoe-kogito-builder-jvm.feature +++ b/tests/features/bamoe-kogito-builder-jvm.feature @@ -1,7 +1,13 @@ @ibm-bamoe/bamoe-kogito-builder-rhel8 Feature: rhpam-kogito-builder-rhel8 feature. - Scenario: verify if all labels are correctly set on bamoe-kogito-builder-rhel8 image + 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.8 + And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 + + Scenario: verify if all labels are correctly set on rhpam-kogito-builder-rhel8 image Given image is built # Then the image should not contain label maintainer TODO add support to this sentence on cekit behave steps Then the image should contain label io.openshift.s2i.scripts-url with value image:///usr/local/s2i @@ -24,6 +30,14 @@ Feature: rhpam-kogito-builder-rhel8 feature. And file /home/kogito/.m2/settings.xml should contain redhat-techpreview-repository And file /home/kogito/.m2/settings.xml should contain https://maven.repository.redhat.com/techpreview/all + Scenario: Check if the expected message is printed if native build is enabled + Given failing s2i build /tmp/kogito-examples from dmn-example using 1.13.x + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | true | + | KOGITO_VERSION | 2.0.0-SNAPSHOT | + # Then s2i build log should contain does not supports native builds # looks like it does not work ... + 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-1.13.x-blue and runtime-image ibm-bamoe/bamoe-kogito-runtime-jvm-rhel8:latest | variable | value | diff --git a/tests/features/kogito-builder.feature b/tests/features/kogito-builder.feature index 78101cd75..4c0bed76d 100644 --- a/tests/features/kogito-builder.feature +++ b/tests/features/kogito-builder.feature @@ -1,6 +1,12 @@ @quay.io/kiegroup/kogito-builder Feature: kogito-builder image 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.8.1 + And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 + Scenario: verify if all labels are correctly set on kogito-builder image Given image is built Then the image should contain label maintainer with value kogito diff --git a/tests/features/kogito-common-builder-jvm.feature b/tests/features/kogito-common-builder-jvm.feature index 3f399cf15..210871fb5 100644 --- a/tests/features/kogito-common-builder-jvm.feature +++ b/tests/features/kogito-common-builder-jvm.feature @@ -2,12 +2,6 @@ @ibm-bamoe/bamoe-kogito-builder-rhel8 Feature: kogito-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.8.1 - And run sh -c 'echo $JAVA_HOME' in container and immediately check its output for /usr/lib/jvm/java-11 - Scenario: Verify if the s2i build is finished as expected with non native build and no runtime image Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using nightly-1.13.x-blue | variable | value | @@ -23,8 +17,6 @@ Feature: kogito-builder image JVM build tests | wait | 80 | | expected_phrase | ["hello","world"] | And file /home/kogito/bin/quarkus-run.jar should exist - And file /home/kogito/ssl-libs/libsunec.so 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/kiegroup/kogito-examples.git from rules-quarkus-helloworld using nightly-1.13.x-blue @@ -40,8 +32,6 @@ Feature: kogito-builder image JVM build tests | wait | 80 | | expected_phrase | ["hello","world"] | And file /home/kogito/bin/quarkus-run.jar should exist - And file /home/kogito/ssl-libs/libsunec.so should exist - And file /home/kogito/cacerts should exist Scenario: Verify if the s2i build is finished as expected performing a non native build with runtime image Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld using nightly-1.13.x-blue and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest From 4551a4e0aa9b941bcc24b7b2bff10ab0aa676248 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 20:23:36 +0200 Subject: [PATCH 02/12] [1.13.x] RHPAM-4680 maven rpm module should include Red Hat repositories (#1502) (#1505) * RHPAM-4680 maven rpm module should include Red Hat repositories * correct after review Co-authored-by: Tristan Radisson --- modules/kogito-maven/3.8.x-rpm/configure | 80 +++++++++++++++++++ .../kogito-maven/3.8.x-rpm/maven/settings.xml | 4 +- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/modules/kogito-maven/3.8.x-rpm/configure b/modules/kogito-maven/3.8.x-rpm/configure index 7b92f84d2..12edfbf4c 100644 --- a/modules/kogito-maven/3.8.x-rpm/configure +++ b/modules/kogito-maven/3.8.x-rpm/configure @@ -7,3 +7,83 @@ SCRIPT_DIR=$(dirname "${0}") mkdir "${KOGITO_HOME}"/.m2 cp -v "${SCRIPT_DIR}"/maven/* "${KOGITO_HOME}"/.m2 cp -v "${SCRIPT_DIR}"/added/* "${KOGITO_HOME}"/launch/ + +# configure Red Hat repositories on the maven settings.xml for product builds +if [ "${ENABLE_RH_MAVEN_REPO}" == "true" ]; then + echo "enabling red hat repositories" + rh_repos=" \ +\ + redhat-maven-repositories\ + \ + \ + redhat-ga-repository\ + https://maven.repository.redhat.com/ga/\ + \ + true\ + \ + \ + false\ + \ + \ + \ + redhat-ea-repository\ + https://maven.repository.redhat.com/earlyaccess/all/\ + \ + true\ + \ + \ + false\ + \ + \ + \ + redhat-techpreview-repository\ + https://maven.repository.redhat.com/techpreview/all\ + \ + true\ + \ + \ + false\ + \ + \ + \ + \ + \ + redhat-ga-plugin-repository\ + https://maven.repository.redhat.com/ga/\ + \ + true\ + \ + \ + false\ + \ + \ + \ + redhat-ea-plugin-repository\ + https://maven.repository.redhat.com/earlyaccess/all/\ + \ + true\ + \ + \ + false\ + \ + \ + \ + redhat-techpreview-repository\ + https://maven.repository.redhat.com/techpreview/all\ + \ + true\ + \ + \ + false\ + \ + \ + \ +\ +" + sed -i "s||$rh_repos|" "${KOGITO_HOME}"/.m2/settings.xml + sed -i "s||redhat-maven-repositories|" "${KOGITO_HOME}"/.m2/settings.xml + + mv "${KOGITO_HOME}"/.m2/settings.xml "${KOGITO_HOME}"/.m2/settings.xml.bkp + #format and write the new file + xmllint --format "${KOGITO_HOME}"/.m2/settings.xml.bkp > "${KOGITO_HOME}"/.m2/settings.xml +fi diff --git a/modules/kogito-maven/3.8.x-rpm/maven/settings.xml b/modules/kogito-maven/3.8.x-rpm/maven/settings.xml index 5fe723c3e..826461aa8 100644 --- a/modules/kogito-maven/3.8.x-rpm/maven/settings.xml +++ b/modules/kogito-maven/3.8.x-rpm/maven/settings.xml @@ -12,7 +12,7 @@ - + kogito-images @@ -54,7 +54,7 @@ - + kogito-images From 320b66ae1dd7e4037eb29cb278087b68588b5971 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 21:28:24 +0200 Subject: [PATCH 03/12] [1.13.x-blue-next] [1.13.x] Setup prod CI (#1507) * [1.13.x] Setup prod CI (#1498) * Setup prod CI * updated makefile * updated cekit validator * corrected makefile * update * correction * update * correction * correction * Update Jenkinsfile --------- Co-authored-by: Tristan Radisson --- .ci/jenkins/Jenkinsfile | 33 ++++++++++++++++--- .ci/jenkins/dsl/jobs.groovy | 7 ++++ Makefile | 3 ++ .../features/bamoe-kogito-builder-jvm.feature | 4 +-- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index cbf8267f4..5530ca190 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -7,7 +7,9 @@ def changeTarget = env.ghprbTargetBranch ?: CHANGE_TARGET BUILD_FAILED_IMAGES = [] pipeline { - agent { label 'kogito-image-slave && !built-in' } + agent { + label 'kogito-image-slave && !built-in' + } tools { jdk 'kie-jdk11' maven 'kie-maven-3.8.6' @@ -28,7 +30,7 @@ pipeline { if (env.MAVEN_MIRROR_REPOSITORY != null && env.MAVEN_MIRROR_REPOSITORY != '') { env.MAVEN_MIRROR_URL = env.MAVEN_MIRROR_REPOSITORY - } + } githubscm.checkoutIfExists('kogito-images', changeAuthor, changeBranch, 'kiegroup', changeTarget, true) @@ -36,6 +38,16 @@ pipeline { if (env.MAVEN_MIRROR_URL != '') { runPythonCommand('python3 scripts/update-tests.py --ignore-self-signed-cert') } + + if (isProdCI()) { + // Prod fix to be able to build the image as a community one + sh """ + echo '' > content_sets.yaml + sed -i 's|from: "registry.redhat.io/ubi8|from: "registry.access.redhat.com/ubi8|g' bamoe-kogito-*.yaml + sed -i 's/\\(| KOGITO_VERSION.* | .* |\\)/\\1\\n | QUARKUS_PLUGIN | io.quarkus:quarkus-maven-plugin |\\n | QUARKUS_PLATFORM_GROUP_ID | io.quarkus.platform |/g' tests/features/*.feature + git diff + """ + } } } } @@ -43,7 +55,7 @@ pipeline { steps { script { sh ''' - curl -Ls https://github.com/kiegroup/kie-cloud-tools/releases/download/v1.2/cekit-image-validator-runner.tgz --output cekit-image-validator-runner.tgz + curl -Ls https://github.com/kiegroup/kie-cloud-tools/releases/download/v1.3.4/cekit-image-validator-runner.tgz --output cekit-image-validator-runner.tgz tar -xzvf cekit-image-validator-runner.tgz chmod +x cekit-image-validator-runner ''' @@ -150,11 +162,11 @@ void launchParallelForEachImage(stageNamePrefix, executeOnImage) { } void buildImage(String imageName) { - runPythonCommand("make build-image image_name=${imageName} ignore_test=true cekit_option='--work-dir .'") + runPythonCommand("make build-image image_name=${imageName} ignore_test=true cekit_option='--work-dir .' ignore_tag=${isProdCI()}") } void testImage(String imageName) { - runPythonCommand("make build-image image_name=${imageName} ignore_build=true cekit_option='--work-dir .'") + runPythonCommand("make build-image image_name=${imageName} ignore_build=true cekit_option='--work-dir .' ignore_tag=${isProdCI()}") } void registerBuildFailedImage(String imageName) { @@ -185,9 +197,20 @@ String getWorkspacePath(String image) { } String[] getImages() { + if (isProdCI()) { + return [ + 'bamoe-kogito-builder-rhel8', + 'bamoe-kogito-runtime-jvm-rhel8', + 'bamoe-kogito-runtime-native-rhel8' + ] + } return [ 'kogito-builder', 'kogito-runtime-jvm', 'kogito-runtime-native' ] } void runPythonCommand(String cmd, boolean stdout = false) { return sh(script: "source ~/virtenvs/cekit/bin/activate && ${cmd}", returnStdout: stdout) } + +boolean isProdCI() { + return env.PROD_CI ? env.PROD_CI.toBoolean() : false +} diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index cc19ed942..89c995dce 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -50,6 +50,13 @@ void setupPrJob(String branch = "${GIT_BRANCH}") { disable_status_message_error: true, disable_status_message_failure: true, ]) + if (isProdCI) { + jobParams.job.name += '.prod' + jobParams.pr.trigger_phrase = '.*[j|J]enkins,?.*(rerun|run) [prod|Prod|PROD].*' + jobParams.pr.trigger_phrase_only = true + jobParams.pr.commitContext = 'Prod' + jobParams.env.put('PROD_CI', true) + } KogitoJobTemplate.createPRJob(this, jobParams) } diff --git a/Makefile b/Makefile index 054c29ca5..f708f4cb5 100644 --- a/Makefile +++ b/Makefile @@ -34,9 +34,12 @@ endif ifneq ($(ignore_test),true) ${CEKIT_CMD} test --overrides-file ${image_name}-overrides.yaml behave ${test_options} endif +# tag with shortened version +ifneq ($(ignore_tag),true) ifneq ($(findstring rc,$(IMAGE_VERSION)),rc) ${BUILD_ENGINE} tag quay.io/kiegroup/${image_name}:${IMAGE_VERSION} quay.io/kiegroup/${image_name}:${SHORTENED_LATEST_VERSION} endif +endif # Build all images diff --git a/tests/features/bamoe-kogito-builder-jvm.feature b/tests/features/bamoe-kogito-builder-jvm.feature index 19ec98721..6ba3b4b2a 100644 --- a/tests/features/bamoe-kogito-builder-jvm.feature +++ b/tests/features/bamoe-kogito-builder-jvm.feature @@ -35,7 +35,7 @@ Feature: rhpam-kogito-builder-rhel8 feature. | variable | value | | RUNTIME_TYPE | quarkus | | NATIVE | true | - | KOGITO_VERSION | 2.0.0-SNAPSHOT | + | KOGITO_VERSION | 1.13.1-SNAPSHOT | # Then s2i build log should contain does not supports native builds # looks like it does not work ... Scenario: Verify that the Kogito Maven archetype is generating the project and compiling it correctly @@ -70,7 +70,7 @@ Feature: rhpam-kogito-builder-rhel8 feature. | variable | value | | RUNTIME_TYPE | quarkus | | NATIVE | false | - | KOGITO_VERSION | 1.13.2-SNAPSHOT | + | KOGITO_VERSION | 1.13.1-SNAPSHOT | | PROJECT_GROUP_ID | com.mycompany | | PROJECT_ARTIFACT_ID | myproject | | PROJECT_VERSION | 2.0-SNAPSHOT | From b2b68dfc2d774f8653b70ad3f8172684c6bdf253 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 10:07:50 +0200 Subject: [PATCH 04/12] Setup prod CI for next branch (#1521) (#1524) Co-authored-by: Tristan Radisson --- .ci/jenkins/dsl/jobs.groovy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 89c995dce..2d2e71196 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -26,6 +26,11 @@ if (Utils.isMainBranch(this)) { } setupPrJob() +if (!Utils.isMainBranch(this)) { + setupPrJob(true) + setupPrJob(false, "${Utils.getGitBranch(this)}-next") + setupPrJob(true, "${Utils.getGitBranch(this)}-next") +} // Branch jobs setupDeployJob(FolderUtils.getNightlyFolder(this), KogitoJobType.NIGHTLY) @@ -43,7 +48,7 @@ setupProdUpdateVersionJob() // Methods ///////////////////////////////////////////////////////////////// -void setupPrJob(String branch = "${GIT_BRANCH}") { +void setupPrJob(boolean isProdCI = false, String branch = "${GIT_BRANCH}") { def jobParams = getDefaultJobParams() jobParams.pr.putAll([ run_only_for_branches: [ branch ], From 40cb1600172bc7ac0ce661f0a13d398398fc11db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 11:52:46 +0200 Subject: [PATCH 05/12] Update jobs.groovy (#1525) (#1530) Co-authored-by: Tristan Radisson --- .ci/jenkins/dsl/jobs.groovy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 2d2e71196..1ba061b5c 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -28,8 +28,8 @@ if (Utils.isMainBranch(this)) { setupPrJob() if (!Utils.isMainBranch(this)) { setupPrJob(true) - setupPrJob(false, "${Utils.getGitBranch(this)}-next") - setupPrJob(true, "${Utils.getGitBranch(this)}-next") + setupPrJob(false, true) + setupPrJob(true, true) } // Branch jobs @@ -48,10 +48,10 @@ setupProdUpdateVersionJob() // Methods ///////////////////////////////////////////////////////////////// -void setupPrJob(boolean isProdCI = false, String branch = "${GIT_BRANCH}") { +void setupPrJob(boolean isProdCI = false, boolean isNextBranch = false) { def jobParams = getDefaultJobParams() jobParams.pr.putAll([ - run_only_for_branches: [ branch ], + run_only_for_branches: [ Utils.getGitBranch(this) ], disable_status_message_error: true, disable_status_message_failure: true, ]) @@ -62,6 +62,10 @@ void setupPrJob(boolean isProdCI = false, String branch = "${GIT_BRANCH}") { jobParams.pr.commitContext = 'Prod' jobParams.env.put('PROD_CI', true) } + if (isNextBranch) { + jobParams.job.name += '.next' + jobParams.pr.run_only_for_branches = [ "${Utils.getGitBranch(this)}-next" ] + } KogitoJobTemplate.createPRJob(this, jobParams) } From 4d868ff11afc5757698efbf8675b2cad81749f28 Mon Sep 17 00:00:00 2001 From: Filippe Spolti Date: Wed, 10 May 2023 13:15:36 -0300 Subject: [PATCH 06/12] =?UTF-8?q?[1.13.x-blue-next]=20[RHPAM-4560]=20-=20A?= =?UTF-8?q?djust=20rhpam-kogito-builder-rhel8=20image=20to=20enable=20lice?= =?UTF-8?q?=E2=80=A6=20(#1520)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [RHPAM-4560] - Adjust rhpam-kogito-builder-rhel8 image to enable license compliance via publication of source containers Signed-off-by: Spolti * Update tests/features/bamoe-kogito-builder-jvm.feature * Update tests/features/bamoe-kogito-builder-jvm.feature --------- Signed-off-by: Spolti Co-authored-by: Tristan Radisson --- bamoe-kogito-builder-rhel8-overrides.yaml | 7 ++---- .../kogito-builder/added/kogito-app-launch.sh | 4 ++++ modules/kogito-builder/s2i/bin/assemble | 22 +++++++++---------- modules/kogito-s2i-core/added/s2i-core | 7 +++++- .../kogito-s2i-core/tests/bats/s2i-core.bats | 12 ++++++++++ scripts/common.py | 14 +++++++++++- .../features/bamoe-kogito-builder-jvm.feature | 16 +++++++------- tests/test-apps/clone-repo.sh | 2 +- 8 files changed, 57 insertions(+), 27 deletions(-) diff --git a/bamoe-kogito-builder-rhel8-overrides.yaml b/bamoe-kogito-builder-rhel8-overrides.yaml index e4a72a687..da22c1321 100644 --- a/bamoe-kogito-builder-rhel8-overrides.yaml +++ b/bamoe-kogito-builder-rhel8-overrides.yaml @@ -25,8 +25,8 @@ envs: example: "springboot" description: "Defines the runtime type of your kogito application. Allowed values are 'springboot' or 'quarkus'. Default value is quarkus." - name: NATIVE - example: true - description: If set to true, perform a native build. Only supported for RUNTIME_TYPE is 'quarkus'. + example: false + description: Not supported on BAMOE Kogito Builder image, please refer the documentation. - name: JAVA_OPTIONS example: "-Dquarkus.log.level=DEBUG" description: JVM options passed to the Java command. @@ -46,9 +46,6 @@ modules: - name: org.kie.kogito.system.user - name: org.kie.kogito.logging - name: org.kie.kogito.launch.scripts - - name: org.kie.kogito.graalvm.installer - version: "21.3.1-java-11" - - name: org.kie.kogito.graalvm.scripts - name: org.kie.kogito.openjdk version: "11" - name: org.kie.kogito.dynamic.resources diff --git a/modules/kogito-builder/added/kogito-app-launch.sh b/modules/kogito-builder/added/kogito-app-launch.sh index ad0c65f3d..43874dba2 100644 --- a/modules/kogito-builder/added/kogito-app-launch.sh +++ b/modules/kogito-builder/added/kogito-app-launch.sh @@ -30,6 +30,10 @@ DYNAMIC_RESOURCES_OPTS="$(${JBOSS_CONTAINER_JAVA_JVM_MODULE}/java-default-option case ${runtime_type} in "quarkus") if [ "${NATIVE^^}" == "TRUE" ]; then + if [[ "${JBOSS_IMAGE_NAME}" =~ "bamoe" ]]; 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 -Djava.library.path="${KOGITO_HOME}"/ssl-libs \ diff --git a/modules/kogito-builder/s2i/bin/assemble b/modules/kogito-builder/s2i/bin/assemble index 31c816fc2..64626af47 100644 --- a/modules/kogito-builder/s2i/bin/assemble +++ b/modules/kogito-builder/s2i/bin/assemble @@ -21,25 +21,25 @@ log_info "----> RUNTIME_TYPE has been set to $runtime_type" case ${runtime_type} in "quarkus") - if [ "${NATIVE^^}" == "TRUE" ]; then - CONFIGURE_SCRIPTS=( + if [ "${NATIVE^^}" == "TRUE" ] && [[ ! "${JBOSS_IMAGE_NAME}" =~ "bamoe" ]]; then + CONFIGURE_SCRIPTS=( "${KOGITO_HOME}"/launch/configure-maven.sh "${KOGITO_HOME}"/launch/memory-limit.sh - ) - else - CONFIGURE_SCRIPTS=( + ) + else + CONFIGURE_SCRIPTS=( "${KOGITO_HOME}"/launch/configure-maven.sh ) - fi + fi ;; "springboot") - CONFIGURE_SCRIPTS=( - "${KOGITO_HOME}"/launch/configure-maven.sh - ) + CONFIGURE_SCRIPTS=( + "${KOGITO_HOME}"/launch/configure-maven.sh + ) ;; *) - log_error "${runtime_type} is not supported." - exit 1 + log_error "${runtime_type} is not supported." + exit 1 esac diff --git a/modules/kogito-s2i-core/added/s2i-core b/modules/kogito-s2i-core/added/s2i-core index 9fb73fae6..843d0ace5 100644 --- a/modules/kogito-s2i-core/added/s2i-core +++ b/modules/kogito-s2i-core/added/s2i-core @@ -89,7 +89,12 @@ function build_kogito_app() { nativeBuild="" if [ "${NATIVE^^}" == "TRUE" ]; then - nativeBuild="-Pnative" + if [[ "${JBOSS_IMAGE_NAME}" =~ "bamoe" ]]; 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 diff --git a/modules/kogito-s2i-core/tests/bats/s2i-core.bats b/modules/kogito-s2i-core/tests/bats/s2i-core.bats index 6f2e9e0bf..30d10699e 100644 --- a/modules/kogito-s2i-core/tests/bats/s2i-core.bats +++ b/modules/kogito-s2i-core/tests/bats/s2i-core.bats @@ -468,4 +468,16 @@ teardown() { echo "result : $result" 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="ibm-bamoe/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 ibm-bamoe/kogito-builder does not supports native builds, please refer to the documentation." ] } \ No newline at end of file diff --git a/scripts/common.py b/scripts/common.py index 6d9bc54ae..ea41b8ad2 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -1,7 +1,6 @@ #!/usr/bin/python3 # This script defines some common function that are used by manage-kogito-version.py and push-staging.py script - import os import re @@ -45,6 +44,7 @@ def update_community_image_version(target_version): """ update_image_version_tag_in_yaml_file(target_version, IMAGE_FILENAME) + def update_prod_image_version(target_version): """ Update bamoe-*-overrides.yaml files version tag. @@ -54,6 +54,7 @@ def update_prod_image_version(target_version): file = "{}-overrides.yaml".format(img) update_image_version_tag_in_yaml_file(target_version, file) + def update_image_version_tag_in_yaml_file(target_version, yaml_file): """ Update root version tag in yaml file. @@ -75,6 +76,7 @@ def update_image_version_tag_in_yaml_file(target_version, yaml_file): except TypeError as err: print("Unexpected error:", err) + def update_image_stream(target_version, prod=False): """ Update the imagestream file, it will update the tag name, version and image tag. @@ -127,12 +129,14 @@ def get_community_module_dirs(): """ return get_all_module_dirs(COMMUNITY_PREFIX) + def get_prod_module_dirs(): """ Retrieve the RHPAM module directories """ return get_all_module_dirs(PRODUCT_PREFIX) + def get_images(prefix): """ Retrieve the Kogito images' files @@ -148,18 +152,21 @@ def get_images(prefix): return images + def get_community_images(): """ Retrieve the Community images' names """ return get_images(COMMUNITY_PREFIX) + def get_prod_images(): """ Retrieve the Prod images' names """ return get_images(PRODUCT_PREFIX) + def update_modules_version(target_version, prod=False): """ Update every Kogito module.yaml to the given version. @@ -181,6 +188,7 @@ def update_module_version(module_dir, target_version): :param module_dir: directory where cekit modules are hold :param target_version: version to set into the module """ + try: module_file = os.path.join(module_dir, "module.yaml") with open(module_file) as module: @@ -267,6 +275,7 @@ 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 @@ -299,6 +308,7 @@ def update_maven_repo_in_behave_tests(repo_url, replaceJbossRepository): repo_url) update_in_behave_tests(pattern, replacement) + def update_maven_mirror_url_in_quarkus_plugin_behave_tests(repo_url): """ Update maven repository into behave tests @@ -309,6 +319,7 @@ def update_maven_mirror_url_in_quarkus_plugin_behave_tests(repo_url): replacement = "\g<1>| variable | value |\n | {} | {} |\n | MAVEN_IGNORE_SELF_SIGNED_CERTIFICATE | true |\n | DEBUG | true |".format("MAVEN_MIRROR_URL", repo_url) update_in_behave_tests(pattern, replacement) + def ignore_maven_self_signed_certificate_in_behave_tests(): """ Sets the environment variable to ignore the self-signed certificates in maven @@ -371,6 +382,7 @@ def update_maven_repo_in_clone_repo(repo_url, replace_jboss_repository): replacement = 'export MAVEN_REPO_URL="{}"'.format(repo_url) update_in_file(CLONE_REPO_SCRIPT, pattern, replacement) + def ignore_maven_self_signed_certificate_in_clone_repo(): """ Sets the environment variable to ignore the self-signed certificates in maven diff --git a/tests/features/bamoe-kogito-builder-jvm.feature b/tests/features/bamoe-kogito-builder-jvm.feature index 6ba3b4b2a..63473dafc 100644 --- a/tests/features/bamoe-kogito-builder-jvm.feature +++ b/tests/features/bamoe-kogito-builder-jvm.feature @@ -31,18 +31,18 @@ Feature: rhpam-kogito-builder-rhel8 feature. And file /home/kogito/.m2/settings.xml should contain https://maven.repository.redhat.com/techpreview/all Scenario: Check if the expected message is printed if native build is enabled - Given failing s2i build /tmp/kogito-examples from dmn-example using 1.13.x - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | true | - | KOGITO_VERSION | 1.13.1-SNAPSHOT | + Given failing s2i build /tmp/kogito-examples from dmn-example using nightly-1.13.x-blue + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | true | + | KOGITO_VERSION | 1.13.2-SNAPSHOT | # Then s2i build log should contain does not supports native builds # looks like it does not work ... 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-1.13.x-blue and runtime-image ibm-bamoe/bamoe-kogito-runtime-jvm-rhel8:latest - | variable | value | - | RUNTIME_TYPE | quarkus | - | NATIVE | false | + | variable | value | + | RUNTIME_TYPE | quarkus | + | NATIVE | false | | KOGITO_VERSION | 1.13.2-SNAPSHOT | Then file /home/kogito/bin/quarkus-run.jar should exist And s2i build log should contain Generating quarkus project structure for project... diff --git a/tests/test-apps/clone-repo.sh b/tests/test-apps/clone-repo.sh index 7c294d1ea..3a691332c 100755 --- a/tests/test-apps/clone-repo.sh +++ b/tests/test-apps/clone-repo.sh @@ -3,7 +3,7 @@ # Clone the kogito-examples and edit the rules-quarkus-helloworld and dmn-quarkus-example for testing purposes SCRIPT_DIR=`pwd` -MVN_MODULE="${SCRIPT_DIR}/../../modules/kogito-maven/3.6.x" +MVN_MODULE="${SCRIPT_DIR}/../../modules/kogito-maven/3.8.x" CONTAINER_ENGINE="docker" MAVEN_OPTIONS="-DskipTests -U" MAVEN_QUARKUS_NATIVE_CONTAINER_BUILD_ARGS="-Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=${CONTAINER_ENGINE}" From 2229b4299bb91524840afe88d2c7c0923d3966a0 Mon Sep 17 00:00:00 2001 From: Lucas Bacciotti Date: Mon, 22 May 2023 14:08:38 +0100 Subject: [PATCH 07/12] Updating references to the new kie-ci actions folder. (#1544) --- .github/workflows/pr-backporting.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-backporting.yml b/.github/workflows/pr-backporting.yml index c4b93fde9..ae52e051d 100644 --- a/.github/workflows/pr-backporting.yml +++ b/.github/workflows/pr-backporting.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Set target branches id: set-targets - uses: kiegroup/kogito-pipelines/.ci/actions/parse-labels@main + uses: kiegroup/kie-ci/.ci/actions/parse-labels@main with: labels: ${LABELS} @@ -34,7 +34,7 @@ jobs: REVIEWERS: ${{ toJSON(github.event.pull_request.requested_reviewers) }} steps: - name: Backporting - uses: kiegroup/kogito-pipelines/.ci/actions/backporting@main + uses: kiegroup/kie-ci/.ci/actions/backporting@main with: target-branch: ${{ matrix.target-branch }} additional-reviewers: ${REVIEWERS} \ No newline at end of file From 092ddf3e040b51f8496035ad6268556624824cce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 17:39:11 -0300 Subject: [PATCH 08/12] KOGITO-9259 CI: Update nodes to rhel8 (#1556) (#1557) cherry-pick: https://github.com/kiegroup/kogito-images/pull/1552 Co-authored-by: Tristan Radisson --- .ci/jenkins/Jenkinsfile | 24 ++++++++++++++++++++---- .ci/jenkins/Jenkinsfile.deploy | 24 ++++++++++++++++++++---- .ci/jenkins/Jenkinsfile.promote | 4 ++++ .ci/jenkins/dsl/jobs.groovy | 4 ---- Makefile | 9 +++++---- tests/test-apps/clone-repo.sh | 6 +++--- 6 files changed, 52 insertions(+), 19 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index 5530ca190..97158e572 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -8,7 +8,7 @@ BUILD_FAILED_IMAGES = [] pipeline { agent { - label 'kogito-image-slave && !built-in' + label 'kie-rhel8 && docker && kie-mem24g && !built-in' } tools { jdk 'kie-jdk11' @@ -19,6 +19,10 @@ pipeline { } environment { CI = true + + // Linked to node label + CONTAINER_ENGINE='docker' + CONTAINER_ENGINE_TLS_OPTIONS='' } stages { stage('Initialization') { @@ -162,11 +166,20 @@ void launchParallelForEachImage(stageNamePrefix, executeOnImage) { } void buildImage(String imageName) { - runPythonCommand("make build-image image_name=${imageName} ignore_test=true cekit_option='--work-dir .' ignore_tag=${isProdCI()}") + runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${imageName} ignore_test=true ignore_tag=${isProdCI()}") } void testImage(String imageName) { - runPythonCommand("make build-image image_name=${imageName} ignore_build=true cekit_option='--work-dir .' ignore_tag=${isProdCI()}") + runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${imageName} ignore_build=true ignore_tag=${isProdCI()}") +} + +String getMakeBuildImageArgs() { + List args = [ "cekit_option='--work-dir .'" ] + args.add("BUILD_ENGINE=${CONTAINER_ENGINE}") + if (env.CONTAINER_ENGINE_TLS_OPTIONS) { + args.add("BUILD_ENGINE_TLS_OPTIONS=${CONTAINER_ENGINE_TLS_OPTIONS}") + } + return args.join(' ') } void registerBuildFailedImage(String imageName) { @@ -208,7 +221,10 @@ String[] getImages() { } void runPythonCommand(String cmd, boolean stdout = false) { - return sh(script: "source ~/virtenvs/cekit/bin/activate && ${cmd}", returnStdout: stdout) + return sh(returnStdout: stdout, script: """ +source ~/virtenvs/cekit/bin/activate +${cmd} +""") } boolean isProdCI() { diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index eb3ee33cf..fa1723562 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -10,7 +10,7 @@ TEST_FAILED_IMAGES = [] pipeline { agent { - label 'kogito-image-slave && !built-in' + label 'kie-rhel8 && docker && kie-mem24g && !built-in' } // Needed for local build @@ -34,6 +34,10 @@ pipeline { JAVA_HOME = "${GRAALVM_HOME}" + // Linked to node label + CONTAINER_ENGINE = 'docker' + CONTAINER_ENGINE_TLS_OPTIONS = '' + OPENSHIFT_API = credentials('OPENSHIFT_API') OPENSHIFT_REGISTRY = credentials('OPENSHIFT_REGISTRY') OPENSHIFT_CREDS_KEY = 'OPENSHIFT_CREDS' @@ -364,11 +368,20 @@ void cleanImages() { } void buildImage(String imageName) { - runPythonCommand("make build-image image_name=${imageName} ignore_test=true cekit_option='--work-dir .'") + runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${imageName} ignore_test=true") } void testImage(String imageName) { - runPythonCommand("make build-image image_name=${imageName} ignore_build=true cekit_option='--work-dir .'") + runPythonCommand("make build-image ${getMakeBuildImageArgs()} image_name=${imageName} ignore_build=true") +} + +String getMakeBuildImageArgs() { + List args = [ "cekit_option='--work-dir .'" ] + args.add("BUILD_ENGINE=${CONTAINER_ENGINE}") + if (env.CONTAINER_ENGINE_TLS_OPTIONS) { + args.add("BUILD_ENGINE_TLS_OPTIONS=${CONTAINER_ENGINE_TLS_OPTIONS}") + } + return args.join(' ') } void registerBuiltImage(String imageName) { @@ -629,5 +642,8 @@ boolean isThereAnyChanges() { } void runPythonCommand(String cmd, boolean stdout = false) { - return sh(script: "source ~/virtenvs/cekit/bin/activate && ${cmd}", returnStdout: stdout) + return sh(returnStdout: stdout, script: """ +source ~/virtenvs/cekit/bin/activate +${cmd} +""") } diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index 28ba860b6..43824a0e9 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -20,6 +20,10 @@ pipeline { KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}") + // Linked to node label + CONTAINER_ENGINE='podman' + CONTAINER_TLS_OPTIONS='--tls-verify-false' + OPENSHIFT_API = credentials('OPENSHIFT_API') OPENSHIFT_REGISTRY = credentials('OPENSHIFT_REGISTRY') OPENSHIFT_CREDS_KEY = 'OPENSHIFT_CREDS' diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 1ba061b5c..7538571a1 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -114,8 +114,6 @@ void setupDeployJob(String jobFolder, KogitoJobType jobType) { env('REPO_NAME', 'kogito-images') env('PROPERTIES_FILE_NAME', 'deployment.properties') - env('CONTAINER_ENGINE', 'docker') - env('CONTAINER_TLS_OPTIONS', '') env('MAX_REGISTRY_RETRIES', 3) env('RELEASE', jobType == KogitoJobType.RELEASE) @@ -180,8 +178,6 @@ void setupPromoteJob(String jobFolder, KogitoJobType jobType) { env('REPO_NAME', 'kogito-images') env('PROPERTIES_FILE_NAME', 'deployment.properties') - env('CONTAINER_ENGINE', 'podman') - env('CONTAINER_TLS_OPTIONS', '--tls-verify=false') env('MAX_REGISTRY_RETRIES', 3) env('RELEASE', jobType == KogitoJobType.RELEASE) diff --git a/Makefile b/Makefile index f708f4cb5..91242c477 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ IMAGE_VERSION := $(shell cat image.yaml | egrep ^version | cut -d"\"" -f2) SHORTENED_LATEST_VERSION := $(shell echo $(IMAGE_VERSION) | awk -F. '{print $$1"."$$2}') -BUILD_ENGINE := docker +BUILD_ENGINE ?= docker +BUILD_ENGINE_TLS_OPTIONS ?= '' .DEFAULT_GOAL := build CEKIT_CMD := cekit -v ${cekit_option} NATIVE := true @@ -71,11 +72,11 @@ _push: .PHONY: push-image image_name= push-image: - docker push quay.io/kiegroup/${image_name}:${IMAGE_VERSION} - docker push quay.io/kiegroup/${image_name}:latest + ${BUILD_ENGINE} ${BUILD_ENGINE_TLS_OPTIONS} push quay.io/kiegroup/${image_name}:${IMAGE_VERSION} + ${BUILD_ENGINE} ${BUILD_ENGINE_TLS_OPTIONS} push quay.io/kiegroup/${image_name}:latest ifneq ($(findstring rc,$(IMAGE_VERSION)), rc) @echo "${SHORTENED_LATEST_VERSION} will be pushed" - docker push quay.io/kiegroup/${image_name}:${SHORTENED_LATEST_VERSION} + ${BUILD_ENGINE} ${BUILD_ENGINE_TLS_OPTIONS} push quay.io/kiegroup/${image_name}:${SHORTENED_LATEST_VERSION} endif diff --git a/tests/test-apps/clone-repo.sh b/tests/test-apps/clone-repo.sh index 3a691332c..4ffe8bf45 100755 --- a/tests/test-apps/clone-repo.sh +++ b/tests/test-apps/clone-repo.sh @@ -3,10 +3,10 @@ # Clone the kogito-examples and edit the rules-quarkus-helloworld and dmn-quarkus-example for testing purposes SCRIPT_DIR=`pwd` -MVN_MODULE="${SCRIPT_DIR}/../../modules/kogito-maven/3.8.x" -CONTAINER_ENGINE="docker" +MVN_MODULE="${SCRIPT_DIR}/../../modules/kogito-maven/3.6.x" +CONTAINER_ENGINE=${CONTAINER_ENGINE:-"docker"} MAVEN_OPTIONS="-DskipTests -U" -MAVEN_QUARKUS_NATIVE_CONTAINER_BUILD_ARGS="-Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=${CONTAINER_ENGINE}" +MAVEN_QUARKUS_NATIVE_CONTAINER_BUILD_ARGS=${MAVEN_QUARKUS_NATIVE_CONTAINER_BUILD_ARGS:-"-Dquarkus.native.container-build=true -Dquarkus.native.container-runtime=${CONTAINER_ENGINE}"} # MAVEN_IGNORE_SELF_SIGNED_CERTIFICATE=true NATIVE_BUILD=$1 From c657c6f0ace34b73db58283c90b5ffb22e8b9d4e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:41:34 +0200 Subject: [PATCH 09/12] KOGITO-9259 CI: Fix env variables missing (#1560) (#1563) * CI: Fix env variables missing * corrections Co-authored-by: Tristan Radisson --- .ci/jenkins/Jenkinsfile.deploy | 10 +++++----- .ci/jenkins/Jenkinsfile.promote | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index fa1723562..5179b61a7 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -35,8 +35,8 @@ pipeline { JAVA_HOME = "${GRAALVM_HOME}" // Linked to node label - CONTAINER_ENGINE = 'docker' - CONTAINER_ENGINE_TLS_OPTIONS = '' + CONTAINER_ENGINE='docker' + CONTAINER_ENGINE_TLS_OPTIONS='' OPENSHIFT_API = credentials('OPENSHIFT_API') OPENSHIFT_REGISTRY = credentials('OPENSHIFT_REGISTRY') @@ -453,7 +453,7 @@ void pushImages() { void pushImage(String fullImageName) { retry(env.MAX_REGISTRY_RETRIES) { - sh "${env.CONTAINER_ENGINE} push ${env.CONTAINER_TLS_OPTIONS} ${fullImageName}" + sh "${env.CONTAINER_ENGINE} push ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${fullImageName}" } } @@ -499,12 +499,12 @@ void loginOpenshift() { void loginOpenshiftRegistry() { loginOpenshift() // username can be anything. See https://docs.openshift.com/container-platform/4.4/registry/accessing-the-registry.html#registry-accessing-directly_accessing-the-registry - sh "set +x && ${env.CONTAINER_ENGINE} login -u anything -p \$(oc whoami -t) ${env.CONTAINER_TLS_OPTIONS} ${env.OPENSHIFT_REGISTRY}" + sh "set +x && ${env.CONTAINER_ENGINE} login -u anything -p \$(oc whoami -t) ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${env.OPENSHIFT_REGISTRY}" } void loginContainerRegistry(String registry, String credsId) { withCredentials([usernamePassword(credentialsId: credsId, usernameVariable: 'REGISTRY_USER', passwordVariable: 'REGISTRY_PWD')]) { - sh "${env.CONTAINER_ENGINE} login -u ${REGISTRY_USER} -p ${REGISTRY_PWD} ${env.CONTAINER_TLS_OPTIONS} ${registry}" + sh "${env.CONTAINER_ENGINE} login -u ${REGISTRY_USER} -p ${REGISTRY_PWD} ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${registry}" } } diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index 43824a0e9..55fe9a62c 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -22,7 +22,7 @@ pipeline { // Linked to node label CONTAINER_ENGINE='podman' - CONTAINER_TLS_OPTIONS='--tls-verify-false' + CONTAINER_ENGINE_TLS_OPTIONS='--tls-verify-false' OPENSHIFT_API = credentials('OPENSHIFT_API') OPENSHIFT_REGISTRY = credentials('OPENSHIFT_REGISTRY') @@ -251,7 +251,7 @@ void pullImages() { void pullImage(String fullImageName) { retry(env.MAX_REGISTRY_RETRIES) { - sh "${env.CONTAINER_ENGINE} pull ${env.CONTAINER_TLS_OPTIONS} ${fullImageName}" + sh "${env.CONTAINER_ENGINE} pull ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${fullImageName}" } } @@ -287,7 +287,7 @@ void pushImages() { void pushImage(String fullImageName) { retry(env.MAX_REGISTRY_RETRIES) { - sh "${env.CONTAINER_ENGINE} push ${env.CONTAINER_TLS_OPTIONS} ${fullImageName}" + sh "${env.CONTAINER_ENGINE} push ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${fullImageName}" } } @@ -381,12 +381,12 @@ void loginOpenshift() { void loginOpenshiftRegistry() { loginOpenshift() // username can be anything. See https://docs.openshift.com/container-platform/4.4/registry/accessing-the-registry.html#registry-accessing-directly_accessing-the-registry - sh "set +x && ${env.CONTAINER_ENGINE} login -u anything -p \$(oc whoami -t) ${env.CONTAINER_TLS_OPTIONS} ${env.OPENSHIFT_REGISTRY}" + sh "set +x && ${env.CONTAINER_ENGINE} login -u anything -p \$(oc whoami -t) ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${env.OPENSHIFT_REGISTRY}" } void loginContainerRegistry(String registry, String credsId) { withCredentials([usernamePassword(credentialsId: credsId, usernameVariable: 'REGISTRY_USER', passwordVariable: 'REGISTRY_PWD')]) { - sh "${env.CONTAINER_ENGINE} login -u ${REGISTRY_USER} -p ${REGISTRY_PWD} ${env.CONTAINER_TLS_OPTIONS} ${registry}" + sh "${env.CONTAINER_ENGINE} login -u ${REGISTRY_USER} -p ${REGISTRY_PWD} ${env.CONTAINER_ENGINE_TLS_OPTIONS ?: ''} ${registry}" } } void readDeployProperties() { From 524f07def7f6f7a1269140be241e76e033ff76a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 11:21:37 +0200 Subject: [PATCH 10/12] [KOGITO-9633] - tzdb.dat (No such file or directory) (#1643) (#1645) * [KOGITO-9633] - tzdb.dat (No such file or directory) * Apply suggestions from code review --------- Signed-off-by: Spolti Co-authored-by: Filippe Spolti Co-authored-by: Tristan Radisson --- modules/kogito-openjdk/11-headless/module.yaml | 3 ++- modules/kogito-openjdk/11/module.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/kogito-openjdk/11-headless/module.yaml b/modules/kogito-openjdk/11-headless/module.yaml index ebfb5f79e..1ca311fa6 100644 --- a/modules/kogito-openjdk/11-headless/module.yaml +++ b/modules/kogito-openjdk/11-headless/module.yaml @@ -22,4 +22,5 @@ envs: packages: install: - - java-11-openjdk-headless \ No newline at end of file + - 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/module.yaml b/modules/kogito-openjdk/11/module.yaml index c57600c3e..a6d65ea9a 100644 --- a/modules/kogito-openjdk/11/module.yaml +++ b/modules/kogito-openjdk/11/module.yaml @@ -25,5 +25,6 @@ execute: packages: install: - - java-11-openjdk-devel + - tzdata-java # Fix for new openjdk installations. See https://bugzilla.redhat.com/show_bug.cgi?id=2224411 + - java-11-openjdk-devel From 783f8ed8870e54b238839c81ead56282111cce15 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:42:56 +0200 Subject: [PATCH 11/12] [1.13.x-blue-next] [KOGITO-9465] - Fix behave test for the kogito-s2i-builder image (#1648) * [KOGITO-9465] - Fix behave test for the kogito-s2i-builder image (#1610) * [KOGITO-9465] - Fix behave test for the kogito-s2i-builder image Signed-off-by: Spolti * test config * try 2 builds in one scenario * update * correction * Update tests/features/kogito-common-builder-jvm.feature * Revert "test config" This reverts commit 79eff86300963f4720c82c441e1420cd0655b082. * Update feature files * Update tests/features/kogito-s2i-builder-native.feature * Update tests/test-apps/clone-repo.sh * review Signed-off-by: Spolti --------- Signed-off-by: Spolti Co-authored-by: radtriste Co-authored-by: Tristan Radisson * Update Makefile --------- Signed-off-by: Spolti Co-authored-by: Filippe Spolti Co-authored-by: radtriste Co-authored-by: Tristan Radisson --- tests/features/kogito-builder-native.feature | 28 +++------- .../kogito-common-builder-jvm.feature | 54 +++++++------------ 2 files changed, 25 insertions(+), 57 deletions(-) diff --git a/tests/features/kogito-builder-native.feature b/tests/features/kogito-builder-native.feature index afe7836ea..503462f03 100644 --- a/tests/features/kogito-builder-native.feature +++ b/tests/features/kogito-builder-native.feature @@ -83,32 +83,19 @@ Feature: kogito-builder image native build tests # 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 a incremental s2i build for native test - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using nightly-1.13.x-blue + Scenario: Perform an incremental s2i build for native test + Given s2i build https://github.com/kiegroup/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 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"] | - - # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. - Scenario:Perform a second incremental s2i build for native scenario, this time, with native enabled - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using nightly-1.13.x-blue + And s2i build https://github.com/kiegroup/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 contain Expanding artifacts from incremental build... - And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + 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 | @@ -118,8 +105,7 @@ Feature: kogito-builder image native build tests | content_type | application/json | | request_body | {"strings":["hello"]} | | wait | 80 | - | expected_phrase | ["hello","world"] | - And s2i build log should contain -J-Xmx5153960755 + | expected_phrase | ["hello","world"] | 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-1.13.x-blue and runtime-image quay.io/kiegroup/kogito-runtime-native:latest diff --git a/tests/features/kogito-common-builder-jvm.feature b/tests/features/kogito-common-builder-jvm.feature index 210871fb5..083a21fd0 100644 --- a/tests/features/kogito-common-builder-jvm.feature +++ b/tests/features/kogito-common-builder-jvm.feature @@ -86,31 +86,17 @@ Feature: kogito-builder image JVM build tests | expected_phrase | ["hello","world"] | And file /home/kogito/bin/quarkus-run.jar should exist - Scenario: Perform a incremental s2i build using quarkus runtime type - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using nightly-1.13.x-blue + Scenario: Perform an incremental s2i build using quarkus runtime type + Given s2i build https://github.com/kiegroup/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 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"] | - - # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. - Scenario: Perform a second incremental s2i build using quarkus runtime type - Given s2i build https://github.com/kiegroup/kogito-examples.git from rules-quarkus-helloworld with env and incremental using nightly-1.13.x-blue + And s2i build https://github.com/kiegroup/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 contain Expanding artifacts from incremental build... - And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + 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 | @@ -122,7 +108,6 @@ Feature: kogito-builder image JVM build tests | wait | 80 | | expected_phrase | ["hello","world"] | - #### SpringBoot Scenarios Scenario: Verify if the s2i build is finished as expected with debug enabled @@ -199,30 +184,27 @@ Feature: kogito-builder image JVM build tests And container log should contain Started KogitoSpringbootApplication And run sh -c 'echo $JAVA_OPTIONS' in container and immediately check its output for -Ddebug=true - Scenario: Perform a incremental s2i build using springboot runtime type - Given s2i build https://github.com/kiegroup/kogito-examples.git from ruleunit-springboot-example with env and incremental using nightly-1.13.x-blue + Scenario: Perform an incremental s2i build using springboot runtime type + Given s2i build https://github.com/kiegroup/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 check that page is served - | property | value | - | port | 8080 | - | path | /find-approved | - | wait | 80 | - | request_method | POST | - | request_body | {"maxAmount":5000,"loanApplications":[{"id":"ABC10001","amount":2000,"deposit":100,"applicant":{"age":45,"name":"John"}}]} | - | content_type | application/json | - | expected_status_code | 200 | - And file /home/kogito/bin/ruleunit-springboot-example.jar should exist - - # Since the same image is used we can do a subsequent incremental build and verify if it is working as expected. - Scenario: Perform a second incremental s2i build using springboot runtime type - Given s2i build https://github.com/kiegroup/kogito-examples.git from ruleunit-springboot-example with env and incremental using nightly-1.13.x-blue + And s2i build https://github.com/kiegroup/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 contain Expanding artifacts from incremental build... And s2i build log should not contain WARNING: Clean build will be performed because of error saving previous build artifacts + 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 | Scenario: Verify if the s2i build is finished as expected with uber-jar package type built Given s2i build https://github.com/kiegroup/kogito-examples.git from ruleunit-quarkus-example using nightly-1.13.x-blue and runtime-image quay.io/kiegroup/kogito-runtime-jvm:latest From b43c2b953e902286c9fea1243016ec759b21b782 Mon Sep 17 00:00:00 2001 From: Roberto Oliveira Date: Tue, 29 Aug 2023 15:02:34 +0200 Subject: [PATCH 12/12] Prepare Kogito images for 8.0.4 release (#1681) --- bamoe-kogito-builder-rhel8-overrides.yaml | 2 +- bamoe-kogito-imagestream.yaml | 18 +++++++++--------- bamoe-kogito-runtime-jvm-rhel8-overrides.yaml | 2 +- ...-kogito-runtime-native-rhel8-overrides.yaml | 2 +- modules/bamoe-kogito-profile/module.yaml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bamoe-kogito-builder-rhel8-overrides.yaml b/bamoe-kogito-builder-rhel8-overrides.yaml index da22c1321..cd5ac8ae7 100644 --- a/bamoe-kogito-builder-rhel8-overrides.yaml +++ b/bamoe-kogito-builder-rhel8-overrides.yaml @@ -1,7 +1,7 @@ schema_version: 1 name: "ibm-bamoe/bamoe-kogito-builder-rhel8" -version: "8.0.3" +version: "8.0.4" from: "registry.redhat.io/ubi8/ubi-minimal:latest" description: "IBM BAMOE Platform for building Kogito based on Quarkus or SpringBoot" diff --git a/bamoe-kogito-imagestream.yaml b/bamoe-kogito-imagestream.yaml index c3f89764f..f70aa70ad 100644 --- a/bamoe-kogito-imagestream.yaml +++ b/bamoe-kogito-imagestream.yaml @@ -15,18 +15,18 @@ items: openshift.io/provider-display-name: IBM, Inc. spec: tags: - - name: '8.0.3' + - name: '8.0.4' annotations: description: IBM BAMOE Runtime image for Kogito based on Quarkus or SpringBoot JVM image iconClass: icon-jbpm tags: ibm-bamoe-kogito,runtime,kogito,quarkus,springboot,jvm supports: quarkus - version: '8.0.3' + version: '8.0.4' referencePolicy: type: Local from: kind: DockerImage - name: registry.connect.redhat.com/ibm-bamoe/bamoe-kogito-runtime-jvm-rhel8:8.0.3 + name: registry.connect.redhat.com/ibm-bamoe/bamoe-kogito-runtime-jvm-rhel8:8.0.4 - kind: ImageStream apiVersion: v1 metadata: @@ -36,18 +36,18 @@ items: openshift.io/provider-display-name: IBM, Inc. spec: tags: - - name: '8.0.3' + - name: '8.0.4' annotations: description: IBM BAMOE Runtime image for Kogito based on Quarkus native image iconClass: icon-jbpm tags: ibm-bamoe-kogito,runtime,kogito,quarkus,native supports: quarkus - version: '8.0.3' + version: '8.0.4' referencePolicy: type: Local from: kind: DockerImage - name: registry.connect.redhat.com/ibm-bamoe/bamoe-kogito-runtime-native-rhel8:8.0.3 + name: registry.connect.redhat.com/ibm-bamoe/bamoe-kogito-runtime-native-rhel8:8.0.4 - kind: ImageStream apiVersion: v1 metadata: @@ -57,15 +57,15 @@ items: openshift.io/provider-display-name: IBM, Inc. spec: tags: - - name: '8.0.3' + - name: '8.0.4' annotations: description: IBM BAMOE Platform for building Kogito based on Quarkus or SpringBoot iconClass: icon-jbpm tags: ibm-bamoe-kogito,builder,kogito,quarkus,springboot supports: quarkus - version: '8.0.3' + version: '8.0.4' referencePolicy: type: Local from: kind: DockerImage - name: registry.connect.redhat.com/ibm-bamoe/bamoe-kogito-builder-rhel8:8.0.3 + name: registry.connect.redhat.com/ibm-bamoe/bamoe-kogito-builder-rhel8:8.0.4 diff --git a/bamoe-kogito-runtime-jvm-rhel8-overrides.yaml b/bamoe-kogito-runtime-jvm-rhel8-overrides.yaml index 53993f9a3..19d1349bc 100644 --- a/bamoe-kogito-runtime-jvm-rhel8-overrides.yaml +++ b/bamoe-kogito-runtime-jvm-rhel8-overrides.yaml @@ -1,7 +1,7 @@ schema_version: 1 name: "ibm-bamoe/bamoe-kogito-runtime-jvm-rhel8" -version: "8.0.3" +version: "8.0.4" from: "registry.redhat.io/ubi8/ubi-minimal:latest" description: "IBM BAMOE Runtime image for Kogito based on Quarkus or SpringBoot JVM image" diff --git a/bamoe-kogito-runtime-native-rhel8-overrides.yaml b/bamoe-kogito-runtime-native-rhel8-overrides.yaml index 148a72cf7..f3227fca0 100644 --- a/bamoe-kogito-runtime-native-rhel8-overrides.yaml +++ b/bamoe-kogito-runtime-native-rhel8-overrides.yaml @@ -1,7 +1,7 @@ schema_version: 1 name: "ibm-bamoe/bamoe-kogito-runtime-native-rhel8" -version: "8.0.3" +version: "8.0.4" from: "registry.redhat.io/ubi8/ubi-minimal:latest" description: "IBM BAMOE Runtime image for Kogito based on Quarkus native image" diff --git a/modules/bamoe-kogito-profile/module.yaml b/modules/bamoe-kogito-profile/module.yaml index 422d3477a..b9ecdcb5d 100644 --- a/modules/bamoe-kogito-profile/module.yaml +++ b/modules/bamoe-kogito-profile/module.yaml @@ -1,6 +1,6 @@ schema_version: 1 name: bamoe.prod.profile -version: '8.0.3' +version: '8.0.4' description: Holds custom configurations for BAMOE Kogito images. Add as the last module as it can depend on other modules. envs: