Skip to content

Commit

Permalink
Add persistence spec in manifests and remove it for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-farache authored and masayag committed Mar 28, 2024
1 parent 0ec3f0a commit 7e6c303
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ jobs:
run: yq -i 'del(.metadata.annotations."sonataflow.org/profile")' ${{ inputs.workflow_id }}/manifests/01-sonataflow*.yaml
- name: Set container image ref in SonataFlow resource
run: yq -i '.spec.podTemplate.container.image="quay.io/orchestrator/serverless-workflow-${{ inputs.workflow_id }}:${{ github.sha }}"' ${{ inputs.workflow_id }}/manifests/01-sonataflow*.yaml
- name: Set persistence spec in SonataFlow resource
run: |
yq -i '.spec.podTemplate.container.image="quay.io/orchestrator/serverless-workflow-${{ inputs.workflow_id }}:${{ github.sha }}"' ${{ inputs.workflow_id }}/manifests/01-sonataflow*.yaml
yq --inplace '.spec |= ( . + {"persistence":{"postgresql":{"secretRef":{"name":"postgres-secrets","userKey":"POSTGRES_USER","passwordKey":"POSTGRES_PASSWORD"},"serviceRef":{"name":"postgres","port":5432,"databaseName":"sonataflow","databaseSchema":"${{ inputs.workflow_id }}"}}}} )' ${{ inputs.workflow_id }}/manifests/01-sonataflow*.yaml
- name: Archive manifests
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/move2kube-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ jobs:
###### end workaround
yq --inplace '.spec.podTemplate.container |= ( . + {"env": [{"name": "K_SINK", "value": "http://broker-ingress.knative-eventing.svc.cluster.local/sonataflow-infra/default"}]} )' manifests/01-sonataflow_m2k.yaml
# Disable persistence for e2e tests
yq --inplace 'del(.spec.persistence)' manifests/01-sonataflow_m2k.yaml
# deploy the manifests created by the ${{ steps.build-image.outputs.image }}"
kubectl apply -f manifests
sleep 5
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/mta-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ jobs:
# Set the endpoint to the tackle-ui service
yq --inplace '.spec.podTemplate.container.env |= ( . + [{"name": "QUARKUS_REST_CLIENT_MTA_JSON_URL", "value": "http://tackle-ui.my-konveyor-operator.svc:8080/hub"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}] )' manifests/01-sonataflow_mtaanalysis.yaml
# Disable persistence for e2e tests
yq --inplace 'del(.spec.persistence)' manifests/01-sonataflow_mtaanalysis.yaml
# deploy the manifests created by the ${{ steps.build-image.outputs.image }}"
kubectl apply -f manifests
sleep 5
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ nb-configuration.xml

# Plugin directory
/.quarkus/cli/plugins/

kn
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ prepare-workdir:
# Depends on: prepare-workdir target.
# Usage: make build-image
ifeq ($(IS_WORKFLOW),true)
build-image: BUILD_ARGS=--build-arg WF_RESOURCES=$(WORKFLOW_ID)
build-image: BUILD_ARGS=--build-arg WF_RESOURCES=$(WORKFLOW_ID) --build-arg QUARKUS_EXTENSIONS=org.kie.kogito:kogito-addons-persistence-jdbc:9.99.0.redhat-00007,io.quarkus:quarkus-jdbc-postgresql:3.2.9.Final,io.quarkus:quarkus-agroal:3.2.9.Final
endif
build-image: EXTRA_ARGS=--ulimit nofile=4096:4096
build-image: prepare-workdir
Expand Down
3 changes: 3 additions & 0 deletions pipeline/workflow-builder-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM quay.io/kiegroup/kogito-swf-builder-nightly:main-2024-02-16 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
Expand Down
4 changes: 4 additions & 0 deletions pipeline/workflow-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM registry.redhat.io/openshift-serverless-1-tech-preview/logic-swf-builder-rhel8@sha256:d19b3ecaeac10e6aa03530008d25c8171254d561dc5519b9efd18dd4f0de5675 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
Expand All @@ -16,6 +19,7 @@ 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

#=============================
Expand Down

0 comments on commit 7e6c303

Please sign in to comment.