From 2c7460e55c8ead23322d6f68104538125faab79a Mon Sep 17 00:00:00 2001 From: "Mahadik, Mukul Chandrakant" Date: Sat, 21 Sep 2024 01:15:04 -0700 Subject: [PATCH] Task A-8: Prefix branch name + Task A-7: Removed certificates from external Task A-8: Prefixing branch name to the docker tag along with the date. In the internal script we will not need to maintain the different branch lists as the images will be completely tagged in the external workflows themselves. We can simply use the tags without modifications then. For now, not prefixing the tag to the artifact since we will be removing the artifact anyways. And current internal script works with artifacts. Once I update the internal script, will come back and remove artifacts. Also removing prefixed branch name from frontend image artifact in case of workflow dispatch event since it uses the existing frontend image tag generated during push event which already has prefixed branch name In Dockerfile, removing hardcoded branch name, since in this change, we are already included the branch name in image tag. ---------- Task A-7: Certifcates added to internal Dockerfiles. Refer to issue comment for details: Task A-7: https://github.com/e-mission/e-mission-docs/issues/1082#issuecomment-2364315699 The certificates are relevant to our internal AWS configuration and not needed externally. They can be present externally too without having any major effect. But removing them helps keeping the base image clean. Additionally, anyone working with the code can customize with their own certificates if needed or adopt an approach which doesn't even need certificates in the first place. --- .github/workflows/image_build_push.yml | 9 +++------ viz_scripts/Dockerfile | 4 +--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/image_build_push.yml b/.github/workflows/image_build_push.yml index 52a40d8..f028e14 100644 --- a/.github/workflows/image_build_push.yml +++ b/.github/workflows/image_build_push.yml @@ -13,9 +13,6 @@ env: jobs: build: runs-on: ubuntu-latest - - env: - DOCKER_TAG_FROM_WORKFLOW_DISPATCH: ${{ github.event.inputs.docker_image_tag }} steps: - uses: actions/checkout@v4 @@ -73,13 +70,13 @@ jobs: - name: Update .env file run: | - echo "PUBLIC_DASH_NOTEBOOK_IMAGE_TAG=${{ steps.date.outputs.date }}" > .env + echo "PUBLIC_DASH_NOTEBOOK_IMAGE_TAG=${GITHUB_REF##*/}_${{ steps.date.outputs.date }}" > .env if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "Workflow_dispatch: Reuse existing frontend image tag" echo "PUBLIC_DASH_FRONTEND_IMAGE_TAG=${{ steps.set-tags.outputs.PUBLIC_DASH_FRONTEND_IMAGE_TAG }}" >> .env else echo "Push event: Update frontend image tag" - echo "PUBLIC_DASH_FRONTEND_IMAGE_TAG=${{ steps.date.outputs.date }}" >> .env + echo "PUBLIC_DASH_FRONTEND_IMAGE_TAG=${GITHUB_REF##*/}_${{ steps.date.outputs.date }}" >> .env fi echo "SERVER_IMAGE_TAG=${{ steps.get-server-tag.outputs.SERVER_IMAGE_TAG }}" >> .env @@ -100,7 +97,7 @@ jobs: if [ "${{ github.event_name }}" == "push" ]; then echo ${{ steps.date.outputs.date }} > frontend_tag_file.txt else - echo ${{ steps.set-tags.outputs.PUBLIC_DASH_FRONTEND_IMAGE_TAG }} > frontend_tag_file.txt + echo ${{ steps.set-tags.outputs.PUBLIC_DASH_FRONTEND_IMAGE_TAG }} | cut -d'_' -f2 > frontend_tag_file.txt fi echo ${{ steps.date.outputs.date }} > notebook_tag_file.txt echo "Created tag text files" diff --git a/viz_scripts/Dockerfile b/viz_scripts/Dockerfile index 52c5aa5..5d1978b 100644 --- a/viz_scripts/Dockerfile +++ b/viz_scripts/Dockerfile @@ -1,8 +1,6 @@ # python 3 ARG SERVER_IMAGE_TAG -FROM shankari/e-mission-server:master_${SERVER_IMAGE_TAG} - -ADD https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem /etc/ssl/certs/ +FROM shankari/e-mission-server:${SERVER_IMAGE_TAG} VOLUME /plots