Skip to content

Commit

Permalink
preparing workflows for moving images to europe-north1
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvatt committed Aug 30, 2023
1 parent 720597d commit a647795
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/airflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
schedule:
- cron: '0 9 * * *'

env:
BASE_IMAGE_TAG: 2.6.3-python3.10

jobs:
build:
name: Build Airflow image
Expand Down Expand Up @@ -48,9 +51,9 @@ jobs:

- name: Check if apache/airflow has updated
run: |
knada=$(gcloud artifacts docker images list europe-west1-docker.pkg.dev/knada-gcp/knada/${{ env.IMAGE }} --include-tags --sort-by=~Update_Time --limit=1 --format=json)
knada=$(gcloud artifacts docker images list europe-north1-docker.pkg.dev/knada-gcp/knada-north/${{ env.IMAGE }} --include-tags --sort-by=~Update_Time --limit=1 --format=json)
python3 .github/scripts/compare_tags.py airflow "$knada" "2.5.3-python3.10"
python3 .github/scripts/compare_tags.py airflow "$knada" "${{ env.BASE_IMAGE_TAG }}"
if [ $? -eq 100 ]
then
echo "OUTDATED=true" >> $GITHUB_ENV
Expand All @@ -59,7 +62,7 @@ jobs:
- uses: docker/login-action@v2
with:
registry: europe-west1-docker.pkg.dev
registry: europe-north1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

Expand All @@ -77,5 +80,6 @@ jobs:
if: env.OUTDATED == 'true' || contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
with:
file: "airflow/${{ matrix.image }}/Dockerfile"
build-args: base_image_tag=${{ env.BASE_IMAGE_TAG }}
push: true
tags: "europe-west1-docker.pkg.dev/knada-gcp/knada/${{ env.IMAGE }}:${{ env.TAG }}"
tags: "europe-north1-docker.pkg.dev/knada-gcp/knada-north/${{ env.IMAGE }}:${{ env.TAG }}"
8 changes: 5 additions & 3 deletions .github/workflows/jupyter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Jupyter"

on:
push:
branches:
- main
paths:
- .github/workflows/jupyter.yaml
- jupyter/Dockerfile
Expand Down Expand Up @@ -50,7 +52,7 @@ jobs:

- name: Check if jupyter/base-image has updated
run: |
knada=$(gcloud artifacts docker images list europe-west1-docker.pkg.dev/knada-gcp/knada/jupyter --include-tags --filter TAGS:-${{ matrix.version }} --sort-by=~Update_Time --limit=1 --format=json)
knada=$(gcloud artifacts docker images list europe-north1-docker.pkg.dev/knada-gcp/knada-north/jupyter --include-tags --filter TAGS:-${{ matrix.version }} --sort-by=~Update_Time --limit=1 --format=json)
python3 .github/scripts/compare_tags.py jupyterhub "$knada" "python-${{ matrix.version }}" || out=$?
if [ $out -eq 100 ]
Expand All @@ -61,7 +63,7 @@ jobs:
- uses: docker/login-action@v2
with:
registry: europe-west1-docker.pkg.dev
registry: europe-north1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

Expand All @@ -80,5 +82,5 @@ jobs:
push: true
build-args: python_version=${{ matrix.version }}
tags: |
europe-west1-docker.pkg.dev/knada-gcp/knada/${{ env.IMAGE }}:${{ env.TAG }}-${{ matrix.version }}
europe-north1-docker.pkg.dev/knada-gcp/knada-north/${{ env.IMAGE }}:${{ env.TAG }}-${{ matrix.version }}
ghcr.io/${{ github.repository }}/${{ env.IMAGE }}:${{ env.TAG }}-${{ matrix.version }}
4 changes: 3 additions & 1 deletion airflow/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM apache/airflow:2.6.3-python3.10
ARG base_image_tag

FROM apache/airflow:base_image_tag

COPY airflow/base/requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
4 changes: 3 additions & 1 deletion airflow/papermill/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM apache/airflow:2.6.3-python3.10
ARG base_image_tag

FROM apache/airflow:base_image_tag

USER root

Expand Down

0 comments on commit a647795

Please sign in to comment.