Skip to content

build and push BrineyLab Docker images #85

build and push BrineyLab Docker images

build and push BrineyLab Docker images #85

name: build and push BrineyLab Docker images
on:
release:
types: [published]
workflow_dispatch:
jobs:
# ------------------
# BASE
# ------------------
base:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# ------------------
# CODESERVER
# ------------------
# codeserver depends on python and needs to wait to be built
kubeflow-codeserver:
runs-on: ubuntu-latest-brineylab-large
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# ------------------
# JUPYTERHUB
# ------------------
jupyterhub-base:
runs-on: ubuntu-latest
needs: [base]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# jupyter depends on base and needs to wait to be built
jupyterhub-jupyter:
runs-on: ubuntu-latest
needs: [jupyterhub-base]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# datascience image depends on jupyter
jupyterhub-datascience:
runs-on: ubuntu-latest-brineylab-large
needs: [jupyterhub-jupyter]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# deeplearning image depends on datascience
jupyterhub-deeplearning:
runs-on: ubuntu-latest-brineylab-large
needs: [jupyterhub-datascience]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# ------------------
# KUBEFLOW
# ------------------
kubeflow-base:
runs-on: ubuntu-latest
needs: [base]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# python depends on base and needs to wait to be built
kubeflow-python:
runs-on: ubuntu-latest
needs: [kubeflow-base]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# jupyter depends on python and needs to wait to be built
kubeflow-jupyter:
runs-on: ubuntu-latest
needs: [kubeflow-python]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# datascience image depends on jupyter
kubeflow-datascience:
runs-on: ubuntu-latest-brineylab-large
needs: [kubeflow-jupyter]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}
# deeplearning image depends on datascience
kubeflow-deeplearning:
runs-on: ubuntu-latest-brineylab-large
needs: [kubeflow-datascience]
permissions:
contents: read
packages: write
steps:
- name: Delete huge unnecessary tools folder
run: |
echo "Disk space before deleting huge unnecessary tools folder:"
sudo df -h
rm -rf /opt/hostedtoolcache
echo "Disk space after deleting huge unnecessary tools folder:"
sudo df -h
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v6
with:
context: ./base
cache-to: type=registry,ref=brineylab/${{ github.job }}:cache,mode=max
cache-from: type=registry,ref=brineylab/${{ github.job }}:cache
push: ${{ github.event_name == 'release' }}
tags: |
brineylab/${{ github.job }}:latest
brineylab/${{ github.job }}:${{ github.event.release.tag_name || 'no_push' }}