From c1c96c33baeb99591be9c5278148fba0040c0811 Mon Sep 17 00:00:00 2001 From: vladd-bit Date: Wed, 18 Oct 2023 19:14:54 +0100 Subject: [PATCH] Updated J-hub workflows. --- .../docker-jupyter-singleuser-gpu.yml | 90 +++++++++++++++++++ .../workflows/docker-jupyter-singleuser.yml | 10 --- 2 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/docker-jupyter-singleuser-gpu.yml diff --git a/.github/workflows/docker-jupyter-singleuser-gpu.yml b/.github/workflows/docker-jupyter-singleuser-gpu.yml new file mode 100644 index 00000000..ac9ffeac --- /dev/null +++ b/.github/workflows/docker-jupyter-singleuser-gpu.yml @@ -0,0 +1,90 @@ +name: docker-jupyter-singleuser-gpu + +on: + + push: + branches: [ master ] + pull_request: + branches: [ master ] + + release: + types: [published] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + build: + + runs-on: ubuntu-latest + + env: + working-directory: ./services/jupyter-hub + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + # Checkout the repository to the GitHub Actions runner + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + + # Update references for any submodules + - name: Git Sumbodule Update + run: | + git submodule update --init --recursive + git pull --recurse-submodules origin master + git submodule update --remote --recursive + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: cogstacksystems/jupyter-singleuser:latest + + - name: Get and set release version env var + id: release_version + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo "::set-output name=RELEASE_VERSION::$RELEASE_VERSION" + + - name: output test + run: | + echo ${{ env.RELEASE_VERSION }} + echo $RELEASE_VERSION + + - name: set docker release tag name + id: set_release_version + if: ${{ env.RELEASE_VERSION != 'master' }} + run: echo "RELEASE_VERSION=${RELEASE_VERSION#?}" >> $GITHUB_ENV + + - name: set docker release tag name + id: set_release_version_latest + if: ${{ env.RELEASE_VERSION == 'master' }} + run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV + + - name: Build and push Docker Jupyter singleuser image with GPU support + uses: docker/build-push-action@v2 + with: + context : ./services/jupyter-hub + file : "./services/jupyter-hub/Dockerfile_singleuser_gpu" + allow: network.host + github-token: ${{ github.token }} + tags: cogstacksystems/jupyter-singleuser-gpu:${{ env.RELEASE_VERSION }} + push: true + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/.github/workflows/docker-jupyter-singleuser.yml b/.github/workflows/docker-jupyter-singleuser.yml index 62ebacfb..54b2426b 100644 --- a/.github/workflows/docker-jupyter-singleuser.yml +++ b/.github/workflows/docker-jupyter-singleuser.yml @@ -86,15 +86,5 @@ jobs: tags: cogstacksystems/jupyter-singleuser:${{ env.RELEASE_VERSION }} push: true - - name: Build and push Docker Jupyter singleuser image with GPU support - uses: docker/build-push-action@v2 - with: - context : ./services/jupyter-hub - file : "./services/jupyter-hub/Dockerfile_singleuser_gpu" - allow: network.host - github-token: ${{ github.token }} - tags: cogstacksystems/jupyter-singleuser-gpu:${{ env.RELEASE_VERSION }} - push: true - - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file