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 <ydayagi@redhat.com>
  • Loading branch information
ydayagi authored and openshift-merge-robot committed Aug 10, 2023
1 parent 8f4c8f3 commit 33c73f6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ jobs:
run: |
make build-images
- name: Upload image
uses: ishworkh/docker-image-artifact-upload@v1
with:
image: "docker-compose_examples-service:latest"

- name: Upload image
uses: ishworkh/docker-image-artifact-upload@v1
with:
Expand Down Expand Up @@ -175,6 +180,11 @@ jobs:
with:
image: "docker-compose_workflow-service:latest"

- name: Download images
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "docker-compose_examples-service:latest"

- name: Load images inside kind
run: |
make push-images-to-kind
Expand All @@ -185,6 +195,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: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ MAVEN ?= /usr/bin/mvn
ORG=quay.io/parodos-dev/
WORKFLOW_SERVICE_IMAGE=workflow-service
NOTIFICATION_SERVICE_IMAGE=notification-service
EXAMPLES_SERVICE_IMAGE=examples-service

# get version from pom
VERSION = $(shell sed -n "s/<revision>\(.*\)<\/revision>/\1/p" $(PWD)/pom.xml | sed 's/\ *//g')
Expand Down Expand Up @@ -145,9 +146,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_examples-service:latest $(ORG)$(EXAMPLES_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_examples-service:latest $(ORG)$(EXAMPLES_SERVICE_IMAGE):$(GIT_BRANCH)

deploy-local-registry:
ifneq ($(shell $(DOCKER) container inspect -f '{{.State.Running}}' registry 2> /dev/null), true)
Expand Down Expand Up @@ -228,14 +231,18 @@ push-images: ## Push docker images to quay.io registry
$(eval TAG?=$(GIT_HASH))
$(DOCKER) push $(ORG)$(WORKFLOW_SERVICE_IMAGE):$(TAG)
$(DOCKER) push $(ORG)$(NOTIFICATION_SERVICE_IMAGE):$(TAG)
$(DOCKER) push $(ORG)$(EXAMPLES_SERVICE_IMAGE):$(TAG)

$(DOCKER) push $(ORG)$(WORKFLOW_SERVICE_IMAGE):$(GIT_BRANCH)
$(DOCKER) push $(ORG)$(NOTIFICATION_SERVICE_IMAGE):$(GIT_BRANCH)
$(DOCKER) push $(ORG)$(EXAMPLES_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_examples-service:latest $(ORG)$(EXAMPLES_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)$(EXAMPLES_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

examples-service:
build:
context: ../
dockerfile: ./integration-tests/Dockerfile
container_name: examples-service
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/examples-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 docker-compose_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
5 changes: 1 addition & 4 deletions workflow-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,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 33c73f6

Please sign in to comment.