From ea8b5f5d9d74aa4c015fbe5d74bd3f9e12964c82 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Mon, 16 Sep 2024 10:15:26 +0500 Subject: [PATCH 1/2] ci: image parameterization via env variables --- .github/workflows/liquidation-reconstitution.yml | 6 +++--- .github/workflows/liquidation.yml | 6 +++--- .github/workflows/reusable-workflow.yml | 7 ++++--- .github/workflows/vaults.yml | 6 +++--- test/e2e/docker-compose-base.yml | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/liquidation-reconstitution.yml b/.github/workflows/liquidation-reconstitution.yml index 26c5ea3b..0404db97 100644 --- a/.github/workflows/liquidation-reconstitution.yml +++ b/.github/workflows/liquidation-reconstitution.yml @@ -37,8 +37,8 @@ on: required: false default: latest type: string - a3p_image_tag: - description: 'Docker image tag for the a3p chain to use in testing' + docker_image: + description: 'Docker image for the a3p chain to use in testing' required: false type: string pull_request: @@ -76,6 +76,6 @@ jobs: bidder_mnemonic: ${{ inputs.bidder_mnemonic }} bidder_address: ${{ inputs.bidder_address }} base_image: ${{ inputs.base_image || 'latest' }} - a3p_image_tag: ${{ inputs.a3p_image_tag || 'latest' }} + docker_image: ${{ inputs.docker_image }} secrets: inherit diff --git a/.github/workflows/liquidation.yml b/.github/workflows/liquidation.yml index 133202ec..8cf5bfbb 100644 --- a/.github/workflows/liquidation.yml +++ b/.github/workflows/liquidation.yml @@ -37,8 +37,8 @@ on: required: false default: latest type: string - a3p_image_tag: - description: 'Docker image tag for the a3p chain to use in testing' + docker_image: + description: 'Docker image for the a3p chain to use in testing' required: false type: string pull_request: @@ -76,6 +76,6 @@ jobs: bidder_mnemonic: ${{ inputs.bidder_mnemonic }} bidder_address: ${{ inputs.bidder_address }} base_image: ${{ inputs.base_image || 'latest' }} - a3p_image_tag: ${{ inputs.a3p_image_tag || 'latest' }} + docker_image: ${{ inputs.docker_image }} secrets: inherit diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml index 098327e9..00b0b994 100644 --- a/.github/workflows/reusable-workflow.yml +++ b/.github/workflows/reusable-workflow.yml @@ -35,9 +35,10 @@ on: required: false default: latest type: string - a3p_image_tag: - description: 'Docker image tag for the a3p chain to use in testing' + docker_image: + description: 'Docker image for the a3p chain to use in testing' required: false + default: ghcr.io/agoric/agoric-3-proposals:latest type: string jobs: @@ -66,7 +67,7 @@ jobs: SYNPRESS_PROFILE: ${{ inputs.AGORIC_NET == 'local' && 'synpress' || 'daily-tests' }} CYPRESS_AGORIC_NET: ${{ inputs.AGORIC_NET }} # for docker-compose.yml - A3P_IMAGE_TAG: ${{ inputs.a3p_image_tag }} + DOCKER_IMAGE: ${{ inputs.docker_image }} COMPOSE_DOCKER_CLI_BUILD: 1 DOCKER_BUILDKIT: 1 DOCKER_DEFAULT_PLATFORM: linux/amd64 diff --git a/.github/workflows/vaults.yml b/.github/workflows/vaults.yml index e573fea9..bf214636 100644 --- a/.github/workflows/vaults.yml +++ b/.github/workflows/vaults.yml @@ -30,8 +30,8 @@ on: description: 'The mnemonic phrase for the account to use in testing' required: false type: string - a3p_image_tag: - description: 'Docker image tag for the a3p chain to use in testing' + docker_image: + description: 'Docker image for the a3p chain to use in testing' required: false type: string @@ -57,6 +57,6 @@ jobs: || 'local' }} mnemonic_phrase: ${{ inputs.phrase }} - a3p_image_tag: ${{ inputs.a3p_image_tag || 'latest' }} + docker_image: ${{ inputs.docker_image || 'latest' }} secrets: inherit diff --git a/test/e2e/docker-compose-base.yml b/test/e2e/docker-compose-base.yml index 3b5fb2ae..1e53ff23 100644 --- a/test/e2e/docker-compose-base.yml +++ b/test/e2e/docker-compose-base.yml @@ -99,7 +99,7 @@ services: profiles: - synpress container_name: agoric_chain - image: ghcr.io/agoric/agoric-3-proposals:${A3P_IMAGE_TAG} + image: ${DOCKER_IMAGE} logging: driver: none platform: linux/amd64 From 2984151e1a814c4311809815436a5c558bbbdff5 Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Mon, 16 Sep 2024 10:30:15 +0500 Subject: [PATCH 2/2] ci: print docker image used for testing --- .github/workflows/liquidation-reconstitution.yml | 2 +- .github/workflows/liquidation.yml | 2 +- .github/workflows/reusable-workflow.yml | 10 +++++++++- .github/workflows/vaults.yml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/liquidation-reconstitution.yml b/.github/workflows/liquidation-reconstitution.yml index 0404db97..7648b78f 100644 --- a/.github/workflows/liquidation-reconstitution.yml +++ b/.github/workflows/liquidation-reconstitution.yml @@ -76,6 +76,6 @@ jobs: bidder_mnemonic: ${{ inputs.bidder_mnemonic }} bidder_address: ${{ inputs.bidder_address }} base_image: ${{ inputs.base_image || 'latest' }} - docker_image: ${{ inputs.docker_image }} + docker_image: ${{ inputs.docker_image || 'ghcr.io/agoric/agoric-3-proposals:latest' }} secrets: inherit diff --git a/.github/workflows/liquidation.yml b/.github/workflows/liquidation.yml index 8cf5bfbb..83abff04 100644 --- a/.github/workflows/liquidation.yml +++ b/.github/workflows/liquidation.yml @@ -76,6 +76,6 @@ jobs: bidder_mnemonic: ${{ inputs.bidder_mnemonic }} bidder_address: ${{ inputs.bidder_address }} base_image: ${{ inputs.base_image || 'latest' }} - docker_image: ${{ inputs.docker_image }} + docker_image: ${{ inputs.docker_image || 'ghcr.io/agoric/agoric-3-proposals:latest' }} secrets: inherit diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml index 00b0b994..956d9be8 100644 --- a/.github/workflows/reusable-workflow.yml +++ b/.github/workflows/reusable-workflow.yml @@ -38,7 +38,6 @@ on: docker_image: description: 'Docker image for the a3p chain to use in testing' required: false - default: ghcr.io/agoric/agoric-3-proposals:latest type: string jobs: @@ -60,6 +59,15 @@ jobs: project_id: 'simulationlab' workload_identity_provider: 'projects/60745596728/locations/global/workloadIdentityPools/github/providers/dapp-inter' + - name: Docker Image Used For E2E Testing + run: | + if [ -z "${{ inputs.docker_image }}" ]; then + echo "Error: Docker image not provided." + exit 1 + else + echo "Docker Image: ${{ inputs.docker_image }}" + fi + - name: Run e2e tests run: ${{ inputs.docker_compose_command }} env: diff --git a/.github/workflows/vaults.yml b/.github/workflows/vaults.yml index bf214636..b3172742 100644 --- a/.github/workflows/vaults.yml +++ b/.github/workflows/vaults.yml @@ -57,6 +57,6 @@ jobs: || 'local' }} mnemonic_phrase: ${{ inputs.phrase }} - docker_image: ${{ inputs.docker_image || 'latest' }} + docker_image: ${{ inputs.docker_image || 'ghcr.io/agoric/agoric-3-proposals:latest' }} secrets: inherit