From ce92500bf67678a9d36ae49e42f0b19e1defddcf Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:18:51 -0400 Subject: [PATCH 1/5] adding GH action to copy a image from the renci registry to AWS/ECR --- .github/aws-ecr-load.yml | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/aws-ecr-load.yml diff --git a/.github/aws-ecr-load.yml b/.github/aws-ecr-load.yml new file mode 100644 index 000000000..a52f4b88b --- /dev/null +++ b/.github/aws-ecr-load.yml @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2022 Renaissance Computing Institute. All rights reserved. +# SPDX-FileCopyrightText: 2023 Renaissance Computing Institute. All rights reserved. +# +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-License-Identifier: LicenseRef-RENCI +# SPDX-License-Identifier: MIT + +name: Publish an input docker image to the AWS ECR with the version specified + +on: + workflow_dispatch: + inputs: + in_container: + description: "this is the full path to the input /image:version" + required: true + version: + description: "in addition to latest, this is the image version that will be used in AWS/ECR" + required: true + +# job definition +jobs: + Build-and-publish-image: + runs-on: ubuntu-latest + permissions: + contents: read + + # job steps + steps: + # pull the docker image + - name: pull the docker image + id: pull-it + run: docker pull containers.renci.org/eds/${{ github.event.inputs.in_container }} + + # list the images for confirmation + - name: list images 1 + run: docker images + + # push the image to AWS/ECR + - name: Push to ECR + id: ecr + uses: jwalton/gh-ecr-push@v1 + with: + access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + region: us-east-2 + local-image: containers.renci.org/eds/${{ github.event.inputs.in_container }} + image: ${{ github.event.inputs.in_container }}, ${{ github.event.inputs.in_container }}:${{ github.event.inputs.version }} From f2cc3629d6cd40dda37f7f4932477dc7975ed3e6 Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:22:50 -0400 Subject: [PATCH 2/5] adding the image push to AWS/ECR action --- .github/workflows/image-push.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/image-push.yml b/.github/workflows/image-push.yml index 00adf3029..5a093d273 100644 --- a/.github/workflows/image-push.yml +++ b/.github/workflows/image-push.yml @@ -51,3 +51,14 @@ jobs: tags: | ${{ env.REGISTRY }}:latest ${{ env.REGISTRY }}:${{ steps.get_version.outputs.VERSION }} + + # push the image to AWS/ECR + - name: Push the built image to the AWS/ECR registry + id: ecr + uses: jwalton/gh-ecr-push@v1 + with: + access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + region: us-east-2 + local-image: ${{ env.REGISTRY }}:${{ steps.get_version.outputs.VERSION }} + image: apsviz-terria-map:latest, apsviz-terria-map:${{ steps.get_version.outputs.VERSION }} From 6a8c59c4b010dfb6135b37fd101ae214c889ad46 Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:27:08 -0400 Subject: [PATCH 3/5] putting the file in the right spot --- .github/{ => workflows}/aws-ecr-load.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/aws-ecr-load.yml (100%) diff --git a/.github/aws-ecr-load.yml b/.github/workflows/aws-ecr-load.yml similarity index 100% rename from .github/aws-ecr-load.yml rename to .github/workflows/aws-ecr-load.yml From 7610f255c501a4b61ed18e65ac8d13389af7f285 Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:34:55 -0400 Subject: [PATCH 4/5] fixing the action parameter description --- .github/workflows/aws-ecr-load.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-ecr-load.yml b/.github/workflows/aws-ecr-load.yml index a52f4b88b..229e3e27a 100644 --- a/.github/workflows/aws-ecr-load.yml +++ b/.github/workflows/aws-ecr-load.yml @@ -11,7 +11,7 @@ on: workflow_dispatch: inputs: in_container: - description: "this is the full path to the input /image:version" + description: "this is the name of the input image (image:version)" required: true version: description: "in addition to latest, this is the image version that will be used in AWS/ECR" @@ -26,7 +26,7 @@ jobs: # job steps steps: - # pull the docker image + # pull the docker image, latest is presumed - name: pull the docker image id: pull-it run: docker pull containers.renci.org/eds/${{ github.event.inputs.in_container }} From 046192e84e27ed18f577e69735e41c3a70814c47 Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:37:29 -0400 Subject: [PATCH 5/5] fixing more descriptions --- .github/workflows/aws-ecr-load.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-ecr-load.yml b/.github/workflows/aws-ecr-load.yml index 229e3e27a..8ba5fb41b 100644 --- a/.github/workflows/aws-ecr-load.yml +++ b/.github/workflows/aws-ecr-load.yml @@ -14,7 +14,7 @@ on: description: "this is the name of the input image (image:version)" required: true version: - description: "in addition to latest, this is the image version that will be used in AWS/ECR" + description: "this is the image version (only) that will be used in AWS/ECR" required: true # job definition