From 4b138bda2e76ba44b0c823a3f13be58681a2b21e Mon Sep 17 00:00:00 2001 From: neagualexa Date: Mon, 28 Oct 2024 14:17:31 +0000 Subject: [PATCH 1/3] allow testing branch to deploy --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/build-base-image.yml | 1 + 2 files changed, 1 insertion(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c8182c7071a620514718dbc99d41cd519bd713b6 GIT binary patch literal 6148 zcmeHK%}T>S5T0!#4GPkW;BlWo=o`cmuU>jn57Hl6p(Vw(;4$wZf{)-+c=M*vn`Xq$ZkC8ld(m$ZHHj$3V2pO5HVFH9RHP;rPBuKpc-ZRn zvdOd(sRm_08TgG1xDTI>Xh>Hy558aXbcTkb!Z*p%v^&nau*J)p{nOk2<8kQkf9s!) zN^3)8kxGqXZW_^oxEF0E}REf_wg@;2bNM2<9H)ff%0(^r=RU z7{;f=ZY3@e%su*aGIIDZQrXA}#klI2-@0%ziAUASfHDv=Q1_2b-v3XwpZ~)oeNqOL zfj`B7iPBEm#w*F*T6sC%Yc0kl1`EgK9$gBQY{%|~x8g$#C-7Om0VaaEM_3^GBj9LI Jr40Ni1E2DVg+~AY literal 0 HcmV?d00001 diff --git a/.github/workflows/build-base-image.yml b/.github/workflows/build-base-image.yml index 8542f62..e33b4da 100755 --- a/.github/workflows/build-base-image.yml +++ b/.github/workflows/build-base-image.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - testing workflow_dispatch: jobs: From 40de115e59f53e916bdc6a3eb177c9079f26f725 Mon Sep 17 00:00:00 2001 From: neagualexa Date: Mon, 28 Oct 2024 14:32:39 +0000 Subject: [PATCH 2/3] upload images on gihub packages showing the branch origin --- .github/workflows/build-base-image.yml | 68 ++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-base-image.yml b/.github/workflows/build-base-image.yml index e33b4da..0f6995b 100755 --- a/.github/workflows/build-base-image.yml +++ b/.github/workflows/build-base-image.yml @@ -9,25 +9,73 @@ on: jobs: push_to_registry: - name: Build and Push to DockerHub Registry + name: Build and Push Docker Image runs-on: ubuntu-latest - + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + permissions: + contents: read + packages: write + id-token: write steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v1 + uses: actions/checkout@v4 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + fetch-depth: 0 + - name: Login to Github Packages + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker Metadata + id: meta + uses: docker/metadata-action@v5 + with: + flavor: | + suffix=-${{ matrix.python-version }} + tags: | + type=ref,event=branch + type=raw,value=${{ github.ref_name }} + type=raw,value=latest,suffix=,enable=${{ github.ref_name == github.event.repository.default_branch }} + images: | + name=${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer,enable=false + name=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }} + - name: Build and Push Base Image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: push: true - tags: ${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} build-args: | + PYTHON_VERSION=${{ matrix.python-version }} INVOKER_ID=${{ secrets.INVOKER_ID }} INVOKER_KEY=${{ secrets.INVOKER_KEY }} INVOKER_REGION=${{ secrets.INVOKER_REGION }} + + # name: Build and Push to DockerHub Registry + # runs-on: ubuntu-latest + + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + + # - name: Log in to Docker Hub + # uses: docker/login-action@v1 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + + # - name: Build and Push Base Image + # uses: docker/build-push-action@v2 + # with: + # push: true + # tags: ${{ secrets.DOCKER_USERNAME }}/python-base-eval-layer + # build-args: | + # INVOKER_ID=${{ secrets.INVOKER_ID }} + # INVOKER_KEY=${{ secrets.INVOKER_KEY }} + # INVOKER_REGION=${{ secrets.INVOKER_REGION }} From fc0e29fc24226d782c6fc839ecbe62b33d760cf3 Mon Sep 17 00:00:00 2001 From: neagualexa Date: Mon, 28 Oct 2024 15:05:52 +0000 Subject: [PATCH 3/3] docker file updated to use different python aws images --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbb6b23..afb296a 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ -# Base image is Python 3.8 provided by AWS Lambda in Docker Hub -FROM public.ecr.aws/lambda/python:3.8 +ARG PYTHON_VERSION + +# Base image is Python 3.X provided by AWS Lambda in Docker Hub +FROM public.ecr.aws/lambda/python:${PYTHON_VERSION} WORKDIR /app