From e2e1aa58601791bdbb4c7e278602b7b1de5f5ff7 Mon Sep 17 00:00:00 2001 From: Paul Marcontell Date: Fri, 16 Aug 2024 09:28:05 -0700 Subject: [PATCH 1/2] added github workflow and VERSION files --- .github/workflows/notebook-images-ci.yaml | 77 +++++++++++++++++++++++ datascience/VERSION | 1 + r/VERSION | 1 + rstudio/VERSION | 1 + scipy/VERSION | 1 + tensorflow/VERSION | 1 + 6 files changed, 82 insertions(+) create mode 100644 .github/workflows/notebook-images-ci.yaml create mode 100644 datascience/VERSION create mode 100644 r/VERSION create mode 100644 rstudio/VERSION create mode 100644 scipy/VERSION create mode 100644 tensorflow/VERSION diff --git a/.github/workflows/notebook-images-ci.yaml b/.github/workflows/notebook-images-ci.yaml new file mode 100644 index 0000000..3b95085 --- /dev/null +++ b/.github/workflows/notebook-images-ci.yaml @@ -0,0 +1,77 @@ +name: rttl-notebook-images-ci + +on: + push: + branches: + - 'main' +env: + GAR_LOCATION: us-west1 + +jobs: + get-changed: + # check for any changes to a worker VERSION file + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.mapped-files.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v44 + with: + files: | + **/VERSION + json: true + write_output_files: true + - + name: Map to JSON + # Get the parent folder and add to an array + id: mapped-files + run: | + set -eux + DATA=$(echo ${{ steps.changed-files.outputs.all_changed_files }} | jq -c '. | map(split("/")[0]) | unique') + echo "matrix=$DATA" >> "$GITHUB_OUTPUT" + build-workers: + needs: get-changed + # Skip if no changes in worker versions in this push + if: needs.get-changed.outputs.matrix != '[]' + runs-on: ubuntu-latest + strategy: + matrix: + versions: ${{ fromJSON(needs.get-changed.outputs.matrix) }} + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Get version number + # Read the version number out of worker_name/VERSION and push to ENV + env: + CTX: ${{ matrix.versions }} + run: | + VER=$(cat ${CTX}/VERSION) + echo "VERSION=$VER" >> $GITHUB_ENV + - + name: Docker login with GCP credentials + id: gcp-login + shell: bash + run: | + echo "${{ secrets.GCP_JSON_KEY }}" | + base64 -d | + docker login --username=_json_key --password-stdin https://${{ env.GAR_LOCATION }}-docker.pkg.dev + - + name: Build and push + # Build docker image using the app folder context. + # Tag with worker name and version string + uses: docker/build-push-action@v5 + with: + context: "{{defaultContext}}:${{ matrix.versions }}" + push: true + tags: | + ${{ env.GAR_LOCATION }}-docker.pkg.dev/uwit-mci-axdd/rttl-images/jupyter-${{ matrix.versions }}-notebook:${{ env.VERSION }} \ No newline at end of file diff --git a/datascience/VERSION b/datascience/VERSION new file mode 100644 index 0000000..f41767d --- /dev/null +++ b/datascience/VERSION @@ -0,0 +1 @@ +2.4.1-B \ No newline at end of file diff --git a/r/VERSION b/r/VERSION new file mode 100644 index 0000000..f41767d --- /dev/null +++ b/r/VERSION @@ -0,0 +1 @@ +2.4.1-B \ No newline at end of file diff --git a/rstudio/VERSION b/rstudio/VERSION new file mode 100644 index 0000000..5b32b47 --- /dev/null +++ b/rstudio/VERSION @@ -0,0 +1 @@ +2.6.4-B \ No newline at end of file diff --git a/scipy/VERSION b/scipy/VERSION new file mode 100644 index 0000000..883f168 --- /dev/null +++ b/scipy/VERSION @@ -0,0 +1 @@ +2.4.4-B \ No newline at end of file diff --git a/tensorflow/VERSION b/tensorflow/VERSION new file mode 100644 index 0000000..f41767d --- /dev/null +++ b/tensorflow/VERSION @@ -0,0 +1 @@ +2.4.1-B \ No newline at end of file From ddac6f86d7eaa56eb0d39363e45b8d7ad75ea144 Mon Sep 17 00:00:00 2001 From: Paul Marcontell Date: Fri, 16 Aug 2024 09:29:57 -0700 Subject: [PATCH 2/2] set initial version to test tag --- datascience/VERSION | 2 +- r/VERSION | 2 +- rstudio/VERSION | 2 +- scipy/VERSION | 2 +- tensorflow/VERSION | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datascience/VERSION b/datascience/VERSION index f41767d..4c4e8c5 100644 --- a/datascience/VERSION +++ b/datascience/VERSION @@ -1 +1 @@ -2.4.1-B \ No newline at end of file +ci-test \ No newline at end of file diff --git a/r/VERSION b/r/VERSION index f41767d..4c4e8c5 100644 --- a/r/VERSION +++ b/r/VERSION @@ -1 +1 @@ -2.4.1-B \ No newline at end of file +ci-test \ No newline at end of file diff --git a/rstudio/VERSION b/rstudio/VERSION index 5b32b47..4c4e8c5 100644 --- a/rstudio/VERSION +++ b/rstudio/VERSION @@ -1 +1 @@ -2.6.4-B \ No newline at end of file +ci-test \ No newline at end of file diff --git a/scipy/VERSION b/scipy/VERSION index 883f168..4c4e8c5 100644 --- a/scipy/VERSION +++ b/scipy/VERSION @@ -1 +1 @@ -2.4.4-B \ No newline at end of file +ci-test \ No newline at end of file diff --git a/tensorflow/VERSION b/tensorflow/VERSION index f41767d..4c4e8c5 100644 --- a/tensorflow/VERSION +++ b/tensorflow/VERSION @@ -1 +1 @@ -2.4.1-B \ No newline at end of file +ci-test \ No newline at end of file