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..4c4e8c5 --- /dev/null +++ b/datascience/VERSION @@ -0,0 +1 @@ +ci-test \ No newline at end of file diff --git a/r/VERSION b/r/VERSION new file mode 100644 index 0000000..4c4e8c5 --- /dev/null +++ b/r/VERSION @@ -0,0 +1 @@ +ci-test \ No newline at end of file diff --git a/rstudio/VERSION b/rstudio/VERSION new file mode 100644 index 0000000..4c4e8c5 --- /dev/null +++ b/rstudio/VERSION @@ -0,0 +1 @@ +ci-test \ No newline at end of file diff --git a/scipy/VERSION b/scipy/VERSION new file mode 100644 index 0000000..4c4e8c5 --- /dev/null +++ b/scipy/VERSION @@ -0,0 +1 @@ +ci-test \ No newline at end of file diff --git a/tensorflow/VERSION b/tensorflow/VERSION new file mode 100644 index 0000000..4c4e8c5 --- /dev/null +++ b/tensorflow/VERSION @@ -0,0 +1 @@ +ci-test \ No newline at end of file