From a416375c618ddfd1c02b9cfd0510f1cacb4d7344 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 4 Sep 2024 16:34:32 +0500 Subject: [PATCH 01/22] refactor: deprecate devstack from registrar IDA --- .github/workflows/push-registrar-image.yml | 54 ++++++++++++ docker-compose.yml | 2 +- dockerfiles/registrar.Dockerfile | 95 ++++++++++++++++++++++ 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/push-registrar-image.yml create mode 100644 dockerfiles/registrar.Dockerfile diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml new file mode 100644 index 0000000000..ccb4694c48 --- /dev/null +++ b/.github/workflows/push-registrar-image.yml @@ -0,0 +1,54 @@ +name: Build and Push Docker Images + +on: + workflow_dispatch: + + pull_request: + branches: + - '**' + + schedule: + - cron: "0 4 * * *" + +jobs: + push: + runs-on: ubuntu-latest + + steps: + - name: Checkout current repo + uses: actions/checkout@v4 + + - name: Get tag name + id: get-tag-name + uses: actions/github-script@v5 + with: + script: | + const branchName = context.ref.split('/').slice(-1)[0]; + const tagName = 'latest'; + console.log('Will use tag: ' + tagName); + return tagName; + result-encoding: string + + - name: Build and push Dev Docker image + uses: docker/build-push-action@v1 + with: + dockerfile: dockerfiles/registrar.Dockerfile + push: true + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + target: dev + repository: edxops/registrar-devstack-dev + tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + + - name: Send failure notification + if: failure() + uses: dawidd6/action-send-mail@v3 + with: + server_address: email-smtp.us-east-1.amazonaws.com + server_port: 465 + username: ${{secrets.edx_smtp_username}} + password: ${{secrets.edx_smtp_password}} + subject: Push Image to docker.io/edxops failed in registrar + to: hunia.fatima@arbisoft.com + from: github-actions + body: Push Image to docker.io/edxops for registrar failed! For details see "github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/docker-compose.yml b/docker-compose.yml index 550ab9f321..fab34c7932 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -535,7 +535,7 @@ services: CELERY_BROKER_PASSWORD: password DJANGO_WATCHMAN_TIMEOUT: 30 ANALYTICS_DASHBOARD_CFG: /edx/etc/registrar.yml - image: edxops/registrar-dev:${OPENEDX_RELEASE:-latest} + image: edxops/registrar-devstack-dev working_dir: /edx/app/registrar networks: default: diff --git a/dockerfiles/registrar.Dockerfile b/dockerfiles/registrar.Dockerfile new file mode 100644 index 0000000000..7c76d86ca5 --- /dev/null +++ b/dockerfiles/registrar.Dockerfile @@ -0,0 +1,95 @@ +FROM ubuntu:focal as app + +# ENV variables for Python 3.12 support +ARG PYTHON_VERSION=3.12 +ENV TZ=UTC +ENV TERM=xterm-256color +ENV DEBIAN_FRONTEND=noninteractive + +# software-properties-common is needed to setup Python 3.12 env +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + apt-add-repository -y ppa:deadsnakes/ppa + +# System requirements. +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -qy \ + git-core \ + language-pack-en \ + build-essential \ + # libmysqlclient-dev header files needed to use native C implementation for MySQL-python for performance gains. + libmysqlclient-dev \ + # mysqlclient wont install without libssl-dev + libssl-dev \ + # mysqlclient>=2.2.0 requires pkg-config (https://github.com/PyMySQL/mysqlclient/issues/620) + pkg-config \ + curl \ + python3-pip \ + python${PYTHON_VERSION} \ + python${PYTHON_VERSION}-dev \ + python${PYTHON_VERSION}-distutils + +# need to use virtualenv pypi package with Python 3.12 +RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} +RUN pip install virtualenv + +# delete apt package lists because we do not need them inflating our image +RUN rm -rf /var/lib/apt/lists/* + +# Python is Python3. +RUN ln -s /usr/bin/python3 /usr/bin/python + +# Setup zoneinfo for Python 3.12 +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Use UTF-8. +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +ARG COMMON_CFG_DIR="/edx/etc" +ARG COMMON_APP_DIR="/edx/app" +ARG REGISTRAR_APP_DIR="${COMMON_APP_DIR}/registrar" +ARG REGISTRAR_VENV_DIR="${COMMON_APP_DIR}/venvs/registrar" +ARG REGISTRAR_CODE_DIR="${REGISTRAR_APP_DIR}" + +ENV PATH="$REGISTRAR_VENV_DIR/bin:$PATH" +ENV REGISTRAR_APP_DIR ${REGISTRAR_APP_DIR} +ENV REGISTRAR_CODE_DIR ${REGISTRAR_CODE_DIR} + +# Working directory will be root of repo. +WORKDIR ${REGISTRAR_CODE_DIR} + +# cloning git repo +RUN curl -L https://github.com/openedx/registrar/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1 + + +RUN virtualenv -p python${PYTHON_VERSION} --always-copy ${REGISTRAR_VENV_DIR} + +RUN pip install --upgrade pip setuptools + +ENV REGISTRAR_CFG="${COMMON_CFG_DIR}/registrar.yml" + +# Expose ports. +EXPOSE 18734 +EXPOSE 18735 + +FROM app as dev + +RUN pip install --no-cache-dir -r requirements/devstack.txt + +ENV DJANGO_SETTINGS_MODULE registrar.settings.devstack + +CMD while true; do python ./manage.py runserver 0.0.0.0:18734; sleep 2; done + +FROM app as prod + +RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/requirements/production.txt + +ENV DJANGO_SETTINGS_MODULE registrar.settings.production + +# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. +CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "registrar.wsgi:application"] + + From 24528eef6e840dc97431e94cc3698a3bc0e875a4 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Fri, 6 Sep 2024 11:17:24 +0500 Subject: [PATCH 02/22] fix: add branch factor in tag name --- .github/workflows/push-registrar-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index ccb4694c48..106c7eb7fa 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -1,7 +1,7 @@ name: Build and Push Docker Images on: - workflow_dispatch: + workflow_call: pull_request: branches: @@ -24,7 +24,7 @@ jobs: with: script: | const branchName = context.ref.split('/').slice(-1)[0]; - const tagName = 'latest'; + const tagName = branchName === 'master' ? 'latest' : branchName; console.log('Will use tag: ' + tagName); return tagName; result-encoding: string From 418fa587cab90fc79b9e7002abf5671e92df7dc4 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Fri, 6 Sep 2024 12:28:01 +0500 Subject: [PATCH 03/22] perf: removed pull request trigger for image build workflow --- .github/workflows/push-registrar-image.yml | 6 +----- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 106c7eb7fa..e4e279aafe 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -1,11 +1,7 @@ name: Build and Push Docker Images on: - workflow_call: - - pull_request: - branches: - - '**' + workflow_dispatch: schedule: - cron: "0 4 * * *" diff --git a/docker-compose.yml b/docker-compose.yml index fab34c7932..634d87041e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -535,7 +535,7 @@ services: CELERY_BROKER_PASSWORD: password DJANGO_WATCHMAN_TIMEOUT: 30 ANALYTICS_DASHBOARD_CFG: /edx/etc/registrar.yml - image: edxops/registrar-devstack-dev + image: edxops/registrar-devstack-dev:${OPENEDX_RELEASE:-latest} working_dir: /edx/app/registrar networks: default: From 3599883c8e7eea528bf34f3cef9f04343825e37f Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 10 Sep 2024 13:59:28 +0500 Subject: [PATCH 04/22] chore: resolved feedback against the PR --- .github/workflows/push-registrar-image.yml | 4 ++-- dockerfiles/registrar.Dockerfile | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index e4e279aafe..04c4c56df1 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: schedule: - - cron: "0 4 * * *" + - cron: "0 4 * * 1-5" # UTC Time jobs: push: @@ -26,7 +26,7 @@ jobs: result-encoding: string - name: Build and push Dev Docker image - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v6 with: dockerfile: dockerfiles/registrar.Dockerfile push: true diff --git a/dockerfiles/registrar.Dockerfile b/dockerfiles/registrar.Dockerfile index 7c76d86ca5..cf43cbebe2 100644 --- a/dockerfiles/registrar.Dockerfile +++ b/dockerfiles/registrar.Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update && \ # System requirements. RUN apt-get update -RUN DEBIAN_FRONTEND=noninteractive apt-get install -qy \ +RUN apt-get install -qy \ git-core \ language-pack-en \ build-essential \ @@ -89,7 +89,4 @@ RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/requirements/production ENV DJANGO_SETTINGS_MODULE registrar.settings.production -# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. -CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "registrar.wsgi:application"] - - +CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--max-requests=1000", "registrar.wsgi:application"] From 22891bd408d431a202f9a486b2db2a45224ef9d4 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 10 Sep 2024 14:13:20 +0500 Subject: [PATCH 05/22] chore: temp code for running workflow on pull request --- .github/workflows/push-registrar-image.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 04c4c56df1..03ca56e1c7 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -3,6 +3,10 @@ name: Build and Push Docker Images on: workflow_dispatch: + pull_request: + branches: + - '**' + schedule: - cron: "0 4 * * 1-5" # UTC Time From 980281b38fedcf2b357edf8d39f399e518aa9a2c Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 10 Sep 2024 14:34:08 +0500 Subject: [PATCH 06/22] fix: update the build and push action --- .github/workflows/push-registrar-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 03ca56e1c7..bc07df2b08 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -32,7 +32,7 @@ jobs: - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: - dockerfile: dockerfiles/registrar.Dockerfile + file: dockerfiles/registrar.Dockerfile push: true username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} From 7ba9c8748b2ad0da54e6e5cf1c71dee507c64b17 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 10 Sep 2024 17:27:21 +0500 Subject: [PATCH 07/22] fix: updating the keys according to the newer version --- .github/workflows/push-registrar-image.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index bc07df2b08..15fd7713bb 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -29,16 +29,19 @@ jobs: return tagName; result-encoding: string + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: file: dockerfiles/registrar.Dockerfile push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} target: dev - repository: edxops/registrar-devstack-dev - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - name: Send failure notification if: failure() From e2117d67046b8d67b91e1eb6382b706139a81ed5 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 10 Sep 2024 17:37:33 +0500 Subject: [PATCH 08/22] fix: adding context --- .github/workflows/push-registrar-image.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 15fd7713bb..23b43b07d8 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -15,9 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout current repo - uses: actions/checkout@v4 - - name: Get tag name id: get-tag-name uses: actions/github-script@v5 @@ -38,6 +35,7 @@ jobs: - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: + context: . file: dockerfiles/registrar.Dockerfile push: true target: dev From c282f45430586047fd2d6bf372fb1a6ec110c2fc Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 10 Sep 2024 17:40:07 +0500 Subject: [PATCH 09/22] fix: adding context --- .github/workflows/push-registrar-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 23b43b07d8..44982c90aa 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -30,7 +30,7 @@ jobs: uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Build and push Dev Docker image uses: docker/build-push-action@v6 From bb7741d936307505d7754674af29c8b55c2cf8ed Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 11:46:19 +0500 Subject: [PATCH 10/22] fix: added debugging step --- .github/workflows/push-registrar-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 44982c90aa..f2c6459cba 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -32,6 +32,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: List files for debugging + run: ls -R + - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: From 9ce84cf51c430c409ae31d0a461a2992807e4262 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 12:56:13 +0500 Subject: [PATCH 11/22] fix: ubuntu issue resolved. added git checkout --- .github/workflows/push-registrar-image.yml | 3 +++ dockerfiles/registrar.Dockerfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index f2c6459cba..aefdb49a8e 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -15,6 +15,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout + - uses: actions/checkout@v4 + - name: Get tag name id: get-tag-name uses: actions/github-script@v5 diff --git a/dockerfiles/registrar.Dockerfile b/dockerfiles/registrar.Dockerfile index cf43cbebe2..0ff55fe689 100644 --- a/dockerfiles/registrar.Dockerfile +++ b/dockerfiles/registrar.Dockerfile @@ -62,7 +62,7 @@ ENV REGISTRAR_CODE_DIR ${REGISTRAR_CODE_DIR} WORKDIR ${REGISTRAR_CODE_DIR} # cloning git repo -RUN curl -L https://github.com/openedx/registrar/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1 +RUN curl -L https://github.com/edx/registrar/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1 RUN virtualenv -p python${PYTHON_VERSION} --always-copy ${REGISTRAR_VENV_DIR} From 5a179b9d248b5d2be0d2df26cac9ea2d9299f19c Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:07:01 +0500 Subject: [PATCH 12/22] fix: changed key --- .github/workflows/push-registrar-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index aefdb49a8e..2a75140969 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -42,7 +42,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: dockerfiles/registrar.Dockerfile + dockerfile: dockerfiles/registrar.Dockerfile push: true target: dev tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }},${{ github.sha }} From c3ee07beeb79062d2b6c868198ff5d4ceb6354a8 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:29:57 +0500 Subject: [PATCH 13/22] fix: changed key --- .github/workflows/push-registrar-image.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 2a75140969..3e93f62f19 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -29,6 +29,12 @@ jobs: return tagName; result-encoding: string + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -42,7 +48,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - dockerfile: dockerfiles/registrar.Dockerfile + file: dockerfiles/registrar.Dockerfile push: true target: dev tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }},${{ github.sha }} From 6966b5b9cef8e353ebb322870888575bd3ec1994 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:38:16 +0500 Subject: [PATCH 14/22] fix: removing the context --- .github/workflows/push-registrar-image.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 3e93f62f19..5200b06d6b 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -29,12 +29,6 @@ jobs: return tagName; result-encoding: string - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -47,8 +41,7 @@ jobs: - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: - context: . - file: dockerfiles/registrar.Dockerfile + file: ./dockerfiles/registrar.Dockerfile push: true target: dev tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }},${{ github.sha }} From a8be5671d85f2278491f435e104d0d6eedce9bdd Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:39:58 +0500 Subject: [PATCH 15/22] fix: removed test step --- .github/workflows/push-registrar-image.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 5200b06d6b..0f4c17fd6b 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -35,9 +35,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: List files for debugging - run: ls -R - - name: Build and push Dev Docker image uses: docker/build-push-action@v6 with: From c5f3bbec53a15492ef4c6ce950bde5770eb67a22 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:41:49 +0500 Subject: [PATCH 16/22] fix: fix fix --- .github/workflows/push-registrar-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 0f4c17fd6b..31143f9bda 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: Get tag name id: get-tag-name From 9b8978b4d496b70b79510b59870e74cd74f3a7aa Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:45:44 +0500 Subject: [PATCH 17/22] fix: check if the git checkout is required --- .github/workflows/push-registrar-image.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 31143f9bda..546d76cc26 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -15,9 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Get tag name id: get-tag-name uses: actions/github-script@v5 From 81e5bdf04758342a9c36eb0a9a1e1007f6299a50 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:55:10 +0500 Subject: [PATCH 18/22] fix: check if the git checkout is required --- .github/workflows/push-registrar-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 546d76cc26..8c5531cc5e 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -38,7 +38,8 @@ jobs: file: ./dockerfiles/registrar.Dockerfile push: true target: dev - tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + registry: edxops/registrar-devstack-dev + tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - name: Send failure notification if: failure() From 95317c413da6e1a3772db9b3cbcbae04c3deaeba Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 15:58:50 +0500 Subject: [PATCH 19/22] fix: check if the git checkout is required --- .github/workflows/push-registrar-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 8c5531cc5e..4eecdcef99 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -38,7 +38,7 @@ jobs: file: ./dockerfiles/registrar.Dockerfile push: true target: dev - registry: edxops/registrar-devstack-dev + repository: edxops/registrar-devstack-dev tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - name: Send failure notification From 0458ff81c097a81af4f0a0ed9a8033f03ecbf72c Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 16:19:00 +0500 Subject: [PATCH 20/22] fix: output --- .github/workflows/push-registrar-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 4eecdcef99..c9017cb6d3 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -38,7 +38,7 @@ jobs: file: ./dockerfiles/registrar.Dockerfile push: true target: dev - repository: edxops/registrar-devstack-dev + outputs: type=registry,name=edxops/registrar-devstack-dev,push=true tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - name: Send failure notification From 34388f7942ed27711a569b9288b5bdea19da1784 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 16:30:01 +0500 Subject: [PATCH 21/22] fix: output --- .github/workflows/push-registrar-image.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index c9017cb6d3..7a797231cc 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -26,7 +26,13 @@ jobs: return tagName; result-encoding: string - - name: Login to Docker Hub + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -38,8 +44,8 @@ jobs: file: ./dockerfiles/registrar.Dockerfile push: true target: dev - outputs: type=registry,name=edxops/registrar-devstack-dev,push=true - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} + tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }}, + edxops/registrar-devstack-dev:${{ github.sha }} - name: Send failure notification if: failure() From 3c94441d9a499121a12dc29c2f8a6f8797c8a896 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 11 Sep 2024 16:35:05 +0500 Subject: [PATCH 22/22] fix: output --- .github/workflows/push-registrar-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-registrar-image.yml b/.github/workflows/push-registrar-image.yml index 7a797231cc..8a21a30c6d 100644 --- a/.github/workflows/push-registrar-image.yml +++ b/.github/workflows/push-registrar-image.yml @@ -44,8 +44,8 @@ jobs: file: ./dockerfiles/registrar.Dockerfile push: true target: dev - tags: edxops/registrar-devstack-dev:${{ steps.get-tag-name.outputs.result }}, - edxops/registrar-devstack-dev:${{ github.sha }} + tags: edxops/registrar-test-dev:latest, + edxops/registrar-test-dev:${{ github.sha }} - name: Send failure notification if: failure()