Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
separate workflow-examples from workflow-service
Browse files Browse the repository at this point in the history
build workflow-service image without workflow-examples
provide workflow-examples (or user's JAR) via a PVC
for integration tests create a PVC in kind and use a pod to mount it and copy the examples JAR to the PVC.

FLPATH-510 https://issues.redhat.com/browse/FLPATH-510

Signed-off-by: Yaron Dayagi <[email protected]>
  • Loading branch information
ydayagi committed Jul 19, 2023
1 parent 5e6a361 commit 4521f90
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Upload image
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: "docker-compose_workflow-service:latest"
image: "docker-compose_integration-service:latest"

- name: Upload image
uses: ishworkh/docker-image-artifact-upload@v1
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Download images
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "docker-compose_workflow-service:latest"
image: "docker-compose_integration-service:latest"

- name: Load images inside kind
run: |
Expand All @@ -185,6 +185,7 @@ jobs:
kubectl wait --timeout=600s --for=condition=Ready pods --all -n default || {
echo "Timeout waiting for Parodos services to be ready";
kubectl get pods --all-namespaces;
kubectl describe pods
echo "************ workflow-service logs ***************";
kubectl logs -l app=workflow-service --tail=40;
echo "************ notification-service logs ***************";
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ MAVEN ?= /usr/bin/mvn
ORG=quay.io/parodos-dev/
WORKFLOW_SERVICE_IMAGE=workflow-service
NOTIFICATION_SERVICE_IMAGE=notification-service
INTEGRATION_SERVICE_IMAGE=integration-service

# get version from pom
VERSION = $(shell sed -n "s/<revision>\(.*\)<\/revision>/\1/p" $(PWD)/pom.xml | sed 's/\ *//g')
Expand Down Expand Up @@ -143,9 +144,11 @@ tag-images: ## Tag docker images with git hash and branch name
$(eval TAG?=$(GIT_HASH))
$(DOCKER) tag docker-compose_workflow-service:latest $(ORG)$(WORKFLOW_SERVICE_IMAGE):$(TAG)
$(DOCKER) tag docker-compose_notification-service:latest $(ORG)$(NOTIFICATION_SERVICE_IMAGE):$(TAG)
$(DOCKER) tag docker-compose_integration-service:latest $(ORG)$(INTEGRATION_SERVICE_IMAGE):$(TAG)

$(DOCKER) tag docker-compose_workflow-service:latest $(ORG)$(WORKFLOW_SERVICE_IMAGE):$(GIT_BRANCH)
$(DOCKER) tag docker-compose_notification-service:latest $(ORG)$(NOTIFICATION_SERVICE_IMAGE):$(GIT_BRANCH)
$(DOCKER) tag docker-compose_integration-service:latest $(ORG)$(INTEGRATION_SERVICE_IMAGE):$(GIT_BRANCH)

push-images: ## Push docker images to quay.io registry
$(eval TAG?=$(GIT_HASH))
Expand All @@ -156,9 +159,9 @@ push-images: ## Push docker images to quay.io registry
$(DOCKER) push $(ORG)$(NOTIFICATION_SERVICE_IMAGE):$(GIT_BRANCH)

push-images-to-kind: ## Push docker images to kind
$(DOCKER) tag docker-compose_workflow-service:latest $(ORG)$(WORKFLOW_SERVICE_IMAGE):test
$(DOCKER) tag docker-compose_integration-service:latest $(ORG)$(INTEGRATION_SERVICE_IMAGE):test
$(DOCKER) tag docker-compose_notification-service:latest $(ORG)$(NOTIFICATION_SERVICE_IMAGE):test
kind load docker-image $(ORG)$(WORKFLOW_SERVICE_IMAGE):test
kind load docker-image $(ORG)$(INTEGRATION_SERVICE_IMAGE):test
kind load docker-image $(ORG)$(NOTIFICATION_SERVICE_IMAGE):test

install-nginx: ## Install nginx
Expand Down
8 changes: 7 additions & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ services:
environment:
- SPRING_PROFILES_ACTIVE=local
depends_on:
- notification-service
- notification-service

integration-service:
build:
context: ../
dockerfile: ./integration-tests/Dockerfile
container_name: integration-service
1 change: 1 addition & 0 deletions hack/manifests/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ spec:
port: 8080
initialDelaySeconds: 40
timeoutSeconds: 4

1 change: 1 addition & 0 deletions hack/manifests/testing/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ patches:

images:
- name: quay.io/parodos-dev/workflow-service:main
newName: quay.io/parodos-dev/integration-service
newTag: test
- name: quay.io/parodos-dev/notification-service:main
newTag: test
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM quay.io/parodos-dev/workflow-service:latest
WORKDIR /app
COPY workflow-examples/target/*jar-with-dependencies.jar ./workflows.jar
EXPOSE 8080
ENTRYPOINT java -Dloader.path=workflows.jar -jar workflow-service.jar
6 changes: 1 addition & 5 deletions workflow-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ FROM registry.access.redhat.com/ubi9/openjdk-17-runtime

WORKDIR /app

COPY workflow-service/target/workflow-service-*.*.*[^a-z].jar ./workflow-service.jar
COPY workflow-examples/target/*jar-with-dependencies.jar ./workflow-examples.jar

EXPOSE 8080

ENV SYS_PROPS="-Dloader.path=workflow-examples.jar"

ENTRYPOINT java ${SYS_PROPS} -jar workflow-service.jar
ENTRYPOINT java -jar workflow-service.jar

0 comments on commit 4521f90

Please sign in to comment.