From cd54f4dab383481b3dce779acaa7cc29167e694f Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Tue, 12 Dec 2023 13:08:39 -0800 Subject: [PATCH] Working on building sample images --- .github/workflows/test.yaml | 14 ++++++++++---- samples/aws-sqs/sqs.bicep | 6 ++++-- samples/aws/awss3.bicep | 4 +++- samples/dapr/dapr.bicep | 7 +++++-- samples/demo/app.bicep | 4 +++- samples/volumes/app.bicep | 4 +++- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8c22a19e..890d96fd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -37,7 +37,7 @@ jobs: app: demo env: default path: ./samples/demo/app.bicep - args: --application demo + args: --application demo --image localhost:51351/samples/demo uiTestFile: tests/demo/demo.app.spec.ts port: 3000 container: demo @@ -49,13 +49,19 @@ jobs: app: dapr env: default path: ./samples/dapr/dapr.bicep + args: --frontendImage localhost:51351/samples/dapr-frontend --backendImage localhost:51351/samples/dapr-backend enableDapr: true + images: samples/dapr-frontend,samples/dapr-backend + directories: samples/dapr/ui/,samples/dapr/nodeapp/ - name: volumes runOnPullRequest: true app: myapp env: default path: ./samples/volumes/app.bicep + args: --image localhost:51351/samples/volumes enableDapr: false + images: samples/volumes + directories: samples/volumes/ - name: eshop-containers runOnPullRequest: true app: eshop @@ -171,13 +177,13 @@ jobs: timeout-minutes: 60 continue-on-error: false - name: Download k3d - if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential != 'aws' + if: steps.gen-id.outputs.RUN_TEST == 'true' run: wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash - name: Create k3d cluster - if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential != 'aws' + if: steps.gen-id.outputs.RUN_TEST == 'true' run: k3d cluster create --agents 2 -p "80:80@loadbalancer" --k3s-arg "--disable=traefik@server:0" --registry-create reciperegistry:51351 - name: Build images - if: steps.gen-id.outputs.RUN_TEST == 'true' + if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.images != '' run: | images=$(echo ${{ matrix.images }} | sed "s/,/ /g") directories=$(echo ${{ matrix.directories }} | sed "s/,/ /g") diff --git a/samples/aws-sqs/sqs.bicep b/samples/aws-sqs/sqs.bicep index 5902a0a6..5bc7c125 100644 --- a/samples/aws-sqs/sqs.bicep +++ b/samples/aws-sqs/sqs.bicep @@ -10,6 +10,8 @@ param aws_access_key_id string param aws_secret_access_key string param aws_region string +param image string = 'ghcr.io/radius-project/samples/aws-sqs-sample:latest' + var aws_credential = { AWS_ACCESS_KEY_ID: aws_access_key_id AWS_SECRET_ACCESS_KEY: aws_secret_access_key @@ -44,7 +46,7 @@ resource producer 'Applications.Core/containers@2023-10-01-preview' = { }, aws_credential ) - image: 'ghcr.io/radius-project/samples/aws-sqs-sample:latest' + image: image } } } @@ -61,7 +63,7 @@ resource consumer 'Applications.Core/containers@2023-10-01-preview' = { }, aws_credential ) - image: 'ghcr.io/radius-project/samples/aws-sqs-sample:latest' + image: image } } } diff --git a/samples/aws/awss3.bicep b/samples/aws/awss3.bicep index 7e84671d..9f01ac82 100644 --- a/samples/aws/awss3.bicep +++ b/samples/aws/awss3.bicep @@ -13,6 +13,8 @@ param aws_secret_access_key string param aws_region string +param image string = 'ghcr.io/radius-project/samples/aws:latest' + resource s3 'AWS.S3/Bucket@default' = { alias: bucket properties: { @@ -39,7 +41,7 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = { AWS_SECRET_ACCESS_KEY: aws_secret_access_key AWS_DEFAULT_REGION: aws_region } - image: 'ghcr.io/radius-project/samples/aws:latest' + image: image } } } diff --git a/samples/dapr/dapr.bicep b/samples/dapr/dapr.bicep index 978c26fe..60004376 100644 --- a/samples/dapr/dapr.bicep +++ b/samples/dapr/dapr.bicep @@ -6,6 +6,9 @@ param environment string @description('Specifies Kubernetes namespace for redis.') param namespace string = 'default' +param frontendImage string = 'ghcr.io/radius-project/samples/dapr-frontend:latest' +param backendImage string = 'ghcr.io/radius-project/samples/dapr-backend:latest' + resource app 'Applications.Core/applications@2023-10-01-preview' = { name: 'dapr' properties: { @@ -18,7 +21,7 @@ resource backend 'Applications.Core/containers@2023-10-01-preview' = { properties: { application: app.id container: { - image: 'ghcr.io/radius-project/samples/dapr-backend:latest' + image: backendImage ports: { web: { containerPort: 3000 @@ -45,7 +48,7 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = { properties: { application: app.id container: { - image: 'ghcr.io/radius-project/samples/dapr-frontend:latest' + image: frontendImage env: { CONNECTION_BACKEND_APPID: backend.name ASPNETCORE_URLS: 'http://*:8080' diff --git a/samples/demo/app.bicep b/samples/demo/app.bicep index 9ef4a41c..8eabe9dd 100644 --- a/samples/demo/app.bicep +++ b/samples/demo/app.bicep @@ -3,12 +3,14 @@ import radius as radius param application string param environment string +param image string = 'ghcr.io/radius-project/samples/demo:latest' + resource demo 'Applications.Core/containers@2023-10-01-preview' = { name: 'demo' properties: { application: application container: { - image: 'ghcr.io/radius-project/samples/demo:latest' + image: image ports: { web: { containerPort: 3000 diff --git a/samples/volumes/app.bicep b/samples/volumes/app.bicep index 9654f1a3..36504e27 100644 --- a/samples/volumes/app.bicep +++ b/samples/volumes/app.bicep @@ -2,6 +2,8 @@ import radius as rad param environment string +param image string = 'ghcr.io/radius-project/samples/volumes:latest' + resource app 'Applications.Core/applications@2023-10-01-preview' = { name: 'myapp' properties: { @@ -14,7 +16,7 @@ resource container 'Applications.Core/containers@2023-10-01-preview' = { properties: { application: app.id container: { - image: 'ghcr.io/radius-project/samples/volumes:latest' + image: image volumes: { temp: { kind: 'ephemeral'