From 2554e945910f4f739f7d26875accddebc26f3504 Mon Sep 17 00:00:00 2001 From: Roy Golan Date: Thu, 15 Aug 2024 14:55:03 +0300 Subject: [PATCH] Build workflows with the productized OSL image Signed-off-by: Roy Golan --- .github/workflows/main.yml | 17 --------- Makefile | 5 --- pipeline/workflow-builder-dev.Dockerfile | 46 ------------------------ pipeline/workflow-builder.Dockerfile | 5 +-- 4 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 pipeline/workflow-builder-dev.Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5b82c1a..137285df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,6 @@ jobs: - name: Log in to Red Hat Registry uses: redhat-actions/podman-login@v1 - if: ${{ ! inputs.it_mode }} with: registry: registry.redhat.io username: ${{ secrets.REGISTRY_REDHAT_IO_USER }} @@ -49,22 +48,6 @@ jobs: REGISTRY_PASSWORD=${{ secrets.NEW_QUAY_PASSWORD }} \ build-image - - name: Buildah Action for testing - id: build-dev-image - uses: redhat-actions/buildah-build@v2 - if: ${{ inputs.it_mode }} - with: - image: serverless-workflow-${{ inputs.workflow_id }} - tags: latest ${{ github.sha }} - extra-args: --ulimit nofile=4096:4096 - containerfiles: | - pipeline/workflow-builder-dev.Dockerfile - build-args: | - WF_RESOURCES=${{ inputs.workflow_id }} - FLOW_NAME=${{ inputs.workflow_id }} - FLOW_SUMMARY=${{ inputs.workflow_id }} - FLOW_DESCRIPTION=${{ inputs.workflow_id }} - - name: Buildah push to OCI Arcive if: ${{ inputs.it_mode }} run: | diff --git a/Makefile b/Makefile index 96dd2ed1..091d7c4a 100644 --- a/Makefile +++ b/Makefile @@ -94,8 +94,6 @@ else DOCKERFILE ?= src/main/docker/Dockerfile.jvm endif -DEV_DOCKERFILE ?= pipeline/workflow-builder-dev.Dockerfile - ifeq ($(IS_WORKFLOW),true) IMAGE_NAME = $(REGISTRY)/$(REGISTRY_REPO)/$(IMAGE_PREFIX)-$(WORKFLOW_ID) else @@ -146,9 +144,6 @@ else --tag ${IMAGE_NAME}:${IMAGE_TAG} --tag ${IMAGE_NAME}:latest . endif -build-dev-image: DOCKERFILE=$(DEV_DOCKERFILE) -build-dev-image: build-image - # Target: push-image # Description: Pushes the workflow containerized image to the configured REGISTRY. # Usage: make push-image diff --git a/pipeline/workflow-builder-dev.Dockerfile b/pipeline/workflow-builder-dev.Dockerfile deleted file mode 100644 index fa864cd4..00000000 --- a/pipeline/workflow-builder-dev.Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -FROM docker.io/apache/incubator-kie-sonataflow-builder:main AS builder - -# Temp hack to provide persistence artifacts -# ENV MAVEN_REPO_URL=https://maven.repository.redhat.com/earlyaccess/all - -# variables that can be overridden by the builder -# To add a Quarkus extension to your application -ARG QUARKUS_EXTENSIONS="org.kie:kogito-addons-quarkus-jobs-knative-eventing:999-SNAPSHOT,org.kie:kie-addons-quarkus-persistence-jdbc:999-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.8.4,io.quarkus:quarkus-agroal:3.8.4" -# Args to pass to the Quarkus CLI -# add extension command -# ARG QUARKUS_ADD_EXTENSION_ARGS - -# Additional java/mvn arguments to pass to the builder. -# This are is conventient to pass sonataflow and quarkus build time properties. -ARG MAVEN_ARGS_APPEND="-Dkogito.persistence.type=jdbc -Dquarkus.datasource.db-kind=postgresql -Dkogito.persistence.proto.marshaller=false" - -# Argument for passing the resources folder if not current context dir -ARG WF_RESOURCES - -# Copy from build context to skeleton resources project -COPY --chown=1001 ${WF_RESOURCES} ./resources/ -RUN ls -la ./resources - -ENV swf_home_dir=/home/kogito/serverless-workflow-project -RUN if [[ -d "./resources/src" ]]; then cp -r ./resources/src/* ./src/; fi -RUN /home/kogito/launch/build-app.sh ./resources - -#============================= -# Runtime Run -#============================= -FROM registry.access.redhat.com/ubi8/openjdk-17:1.20-2.1721231681 - -ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' - -# We make four distinct layers so if there are application changes the library layers can be re-used - -COPY --from=builder --chown=185 /home/kogito/serverless-workflow-project/target/quarkus-app/lib/ /deployments/lib/ -COPY --from=builder --chown=185 /home/kogito/serverless-workflow-project/target/quarkus-app/*.jar /deployments/ -COPY --from=builder --chown=185 /home/kogito/serverless-workflow-project/target/quarkus-app/app/ /deployments/app/ -COPY --from=builder --chown=185 /home/kogito/serverless-workflow-project/target/quarkus-app/quarkus/ /deployments/quarkus/ - -EXPOSE 8080 -USER 185 -ENV AB_JOLOKIA_OFF="" -ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" -ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" diff --git a/pipeline/workflow-builder.Dockerfile b/pipeline/workflow-builder.Dockerfile index e9b92b20..f4470e92 100644 --- a/pipeline/workflow-builder.Dockerfile +++ b/pipeline/workflow-builder.Dockerfile @@ -3,14 +3,15 @@ ARG BUILDER_IMAGE -FROM ${BUILDER_IMAGE:-quay.io/kiegroup/kogito-swf-builder:9.99.1.CR1} AS builder +# The default builder image is the released OSL 1.33 https://catalog.redhat.com/software/containers/openshift-serverless-1/logic-swf-builder-rhel8/6614edd826a5be569c111884?container-tabs=gti +FROM ${BUILDER_IMAGE:-registry.redhat.io/openshift-serverless-1/logic-swf-builder-rhel8@sha256:6defe106ef355b2d0bd55224564ae6eafb4bb3ac081f8dc9ee410fb05216112d} AS builder # Temp hack to provide persistence artifacts - with quay.io/kiegroup/kogito-swf-builder:9.99.1.CR1 those dependencies are included in the base image. #ENV MAVEN_REPO_URL=https://maven.repository.redhat.com/earlyaccess/all # variables that can be overridden by the builder # To add a Quarkus extension to your application -ARG QUARKUS_EXTENSIONS="org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:9.99.1.redhat-00003,org.kie.kogito:kogito-addons-quarkus-persistence-jdbc:9.99.1.redhat-00003,org.kie.kogito:kogito-addons-persistence-jdbc:9.99.1.redhat-00003,io.quarkus:quarkus-jdbc-postgresql:3.2.9.Final,io.quarkus:quarkus-agroal:3.2.9.Final" +ARG QUARKUS_EXTENSIONS="QUARKUS_EXTENSIONS=org.kie:kogito-addons-quarkus-jobs-knative-eventing:9.100.0.redhat-00004,org.kie:kie-addons-quarkus-persistence-jdbc:9.100.0.redhat-00004,io.quarkus:quarkus-jdbc-postgresql:3.8.4.redhat-00002,io.quarkus:quarkus-agroal:3.8.4.redhat-00002" # Args to pass to the Quarkus CLI # add extension command