Skip to content

Commit

Permalink
🐛 fix github workflow to use external provider images
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Jul 11, 2024
1 parent d3b3b7e commit af6d32a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/demo-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Demo Testing

on: ["push", "pull_request"]

env:
IMG_JAVA_PROVIDER: quay.io/konveyor/java-external-provider:latest
IMG_DOTNET_PROVIDER: quay.io/konveyor/dotnet-external-provider:latest
IMG_GENERIC_PROVIDER: quay.io/konveyor/generic-external-provider:latest

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,13 +67,21 @@ jobs:
# build all provider images and the analyzer-lsp image
- name: build images
run: |
make build-external
make \
IMG_JAVA_PROVIDER=$IMG_JAVA_PROVIDER \
IMG_DOTNET_PROVIDER=$IMG_DOTNET_PROVIDER \
IMG_GENERIC_PROVIDER=$IMG_GENERIC_PROVIDER \
build-external
podman build -t quay.io/konveyor/analyzer-lsp:latest -f Dockerfile .
# run the demo in a podman pod
- name: run demo image
run : |
make run-external-providers-pod
make \
IMG_JAVA_PROVIDER=$IMG_JAVA_PROVIDER \
IMG_DOTNET_PROVIDER=$IMG_DOTNET_PROVIDER \
IMG_GENERIC_PROVIDER=$IMG_GENERIC_PROVIDER \
run-external-providers-pod
podman build -f demo-local.Dockerfile -t localhost/testing:latest
make run-demo-image
Expand All @@ -95,7 +108,11 @@ jobs:
working-directory: tackle2-addon-analyzer
run: |
IMG=quay.io/konveyor/tackle2-addon-analyzer:latest make image-podman
podman save -o /tmp/tackle2-addon-analyzer.tar quay.io/konveyor/tackle2-addon-analyzer:latest
podman save -o /tmp/tackle2-addon-analyzer.tar \
quay.io/konveyor/tackle2-addon-analyzer:latest \
$IMG_JAVA_PROVIDER \
$IMG_GENERIC_PROVIDER \
$IMG_DOTNET_PROVIDER
- name: Upload image as artifact
uses: actions/upload-artifact@v3
Expand Down
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
DOCKER_IMAGE = test
IMG_JAVA_PROVIDER ?= java-provider
IMG_DOTNET_PROVIDER ?= dotnet-provider
IMG_GENERIC_PROVIDER ?= generic-provider
IMG_GO_DEP_PROVIDER ?= golang-dep-provider
IMG_YQ_PROVIDER ?= yq-provider
OS := $(shell uname -s)
ifeq ($(OS),Linux)
MOUNT_OPT := :z
Expand Down Expand Up @@ -32,27 +37,27 @@ image-build:
build-external: build-dotnet-provider build-golang-dep-provider build-generic-provider build-java-provider build-yq-provider

build-dotnet-provider:
podman build -f external-providers/dotnet-external-provider/Dockerfile -t dotnet-provider .
podman build -f external-providers/dotnet-external-provider/Dockerfile -t $(IMG_DOTNET_PROVIDER) .

build-generic-provider:
sed -i 's,quay.io/konveyor/golang-dependency-provider,golang-dep-provider,g' external-providers/generic-external-provider/Dockerfile
podman build -f external-providers/generic-external-provider/Dockerfile -t generic-provider .
podman build -f external-providers/generic-external-provider/Dockerfile -t $(IMG_GENERIC_PROVIDER) .

build-golang-dep-provider:
podman build -f external-providers/golang-dependency-provider/Dockerfile -t golang-dep-provider .
podman build -f external-providers/golang-dependency-provider/Dockerfile -t $(IMG_GO_DEP_PROVIDER) .

build-java-provider:
podman build -f external-providers/java-external-provider/Dockerfile -t java-provider .
podman build -f external-providers/java-external-provider/Dockerfile -t $(IMG_JAVA_PROVIDER) .

build-yq-provider:
podman build -f external-providers/yq-external-provider/Dockerfile -t yq-provider .
podman build -f external-providers/yq-external-provider/Dockerfile -t $(IMG_YQ_PROVIDER) .

run-external-providers-local:
podman run --name java-provider -d -p 14651:14651 -v $(PWD)/external-providers/java-external-provider/examples:/examples$(MOUNT_OPT) java-provider --port 14651
podman run --name yq -d -p 14652:14652 -v $(PWD)/examples:/examples yq-provider$(MOUNT_OPT) --port 14652
podman run --name golang-provider -d -p 14653:14653 -v $(PWD)/examples:/examples$(MOUNT_OPT) generic-provider --port 14653
podman run --name nodejs -d -p 14654:14654 -v $(PWD)/examples:/examples$(MOUNT_OPT) generic-provider --port 14654 --name nodejs
podman run --name python -d -p 14655:14655 -v $(PWD)/examples:/examples$(MOUNT_OPT) generic-provider --port 14655 --name pylsp
podman run --name java-provider -d -p 14651:14651 -v $(PWD)/external-providers/java-external-provider/examples:/examples$(MOUNT_OPT) $(IMG_JAVA_PROVIDER) --port 14651
podman run --name yq -d -p 14652:14652 -v $(PWD)/examples:/examples $(IMG_YQ_PROVIDER)$(MOUNT_OPT) --port 14652
podman run --name golang-provider -d -p 14653:14653 -v $(PWD)/examples:/examples$(MOUNT_OPT) $(IMG_GENERIC_PROVIDER) --port 14653
podman run --name nodejs -d -p 14654:14654 -v $(PWD)/examples:/examples$(MOUNT_OPT) $(IMG_GENERIC_PROVIDER) --port 14654 --name nodejs
podman run --name python -d -p 14655:14655 -v $(PWD)/examples:/examples$(MOUNT_OPT) $(IMG_GENERIC_PROVIDER) --port 14655 --name pylsp

stop-external-providers:
podman kill java-provider || true
Expand All @@ -74,11 +79,11 @@ run-external-providers-pod:
podman run --rm -v test-data:/target$(MOUNT_OPT) -v $(PWD)/external-providers/java-external-provider/examples:/src/$(MOUNT_OPT) --entrypoint=cp alpine -a /src/. /target/
# run pods w/ defined ports for the test volumes
podman pod create --name=analyzer
podman run --pod analyzer --name java-provider -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) java-provider --port 14651
podman run --pod analyzer --name yq -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) yq-provider --port 14652
podman run --pod analyzer --name golang-provider -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) generic-provider --port 14653
podman run --pod analyzer --name nodejs -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) generic-provider --port 14654 --name nodejs
podman run --pod analyzer --name python -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) generic-provider --port 14655 --name pylsp
podman run --pod analyzer --name java-provider -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) $(IMG_JAVA_PROVIDER) --port 14651
podman run --pod analyzer --name yq -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) $(IMG_YQ_PROVIDER) --port 14652
podman run --pod analyzer --name golang-provider -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) $(IMG_GENERIC_PROVIDER) --port 14653
podman run --pod analyzer --name nodejs -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) $(IMG_GENERIC_PROVIDER) --port 14654 --name nodejs
podman run --pod analyzer --name python -d -v test-data:/analyzer-lsp/examples$(MOUNT_OPT) $(IMG_GENERIC_PROVIDER) --port 14655 --name pylsp
podman build -f demo-local.Dockerfile -t localhost/testing:latest

run-demo-image:
Expand Down

0 comments on commit af6d32a

Please sign in to comment.