Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,31 @@ updates:
directory: "/"
schedule:
interval: weekly

# Keep GitHub Actions (in .github/workflows) up to date
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"


# Keep Dockerfile base images (in repo root) up to date
- package-ecosystem: "docker"
directory: "/apps/cogstack-jupyter-hub"
schedule:
interval: "weekly"
registries:
- dockerhub

# Keep uv.lock Python dependencies up to date
- package-ecosystem: "uv"
directory: "/apps/cogstack-jupyter-hub"
schedule:
interval: "weekly"

registries:
dockerhub:
type: "docker-registry"
url: "https://index.docker.io"
username: "${{secrets.DOCKERHUB_USERNAME}}"
password: "${{secrets.DOCKERHUB_TOKEN}}"
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ permissions:

on:
push:
branches: ['**']
tags: ['v*.*.*']
branches: [main]
tags: ['cogstack-jupyter-hub-v*.*.*']
paths:
- "apps/cogstack-jupyter-hub/**"
- ".github/workflows/docker-build.yml"
pull_request:
branches: ['**']
release:
types: [published]
paths:
- "apps/cogstack-jupyter-hub/**"
- ".github/workflows/docker-build.yml"
workflow_dispatch:

concurrency:
Expand All @@ -21,7 +24,7 @@ jobs:
# ---------- AMD64 ----------
build-amd64:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name == 'push'
outputs:
hub_digest: ${{ steps.hub.outputs.digest }}
su_digest: ${{ steps.su.outputs.digest }}
Expand All @@ -36,43 +39,41 @@ jobs:
with:
images: cogstacksystems/jupyter-hub
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip leading "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main and on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branch tag for non-PR branches
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false

- name: Docker meta (singleuser)
id: meta_su
uses: docker/metadata-action@v6
with:
images: cogstacksystems/jupyter-singleuser
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main AND on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branches (non-PR)
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short

type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false

- uses: docker/login-action@v4.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build & push hub (amd64)
id: hub
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_hub
context: apps/cogstack-jupyter-hub
file: apps/cogstack-jupyter-hub/Dockerfile_hub
platforms: linux/amd64
build-args: |
CPU_ARCHITECTURE=amd64
Expand All @@ -89,8 +90,8 @@ jobs:
id: su
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_singleuser
context: apps/cogstack-jupyter-hub
file: apps/cogstack-jupyter-hub/Dockerfile_singleuser
platforms: linux/amd64
build-args: |
CPU_ARCHITECTURE=amd64
Expand All @@ -106,7 +107,7 @@ jobs:
# ---------- ARM64 ----------
build-arm64:
runs-on: ubuntu-22.04-arm
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name == 'push'
outputs:
hub_digest: ${{ steps.hub.outputs.digest }}
su_digest: ${{ steps.su.outputs.digest }}
Expand All @@ -121,44 +122,42 @@ jobs:
with:
images: cogstacksystems/jupyter-hub
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main AND on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branches (non-PR)
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short

type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false

- name: Docker meta (singleuser)
id: meta_su
uses: docker/metadata-action@v6
with:
images: cogstacksystems/jupyter-singleuser
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main AND on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branches (non-PR)
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short

type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false


- uses: docker/login-action@v4.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build & push hub (arm64)
id: hub
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_hub
context: apps/cogstack-jupyter-hub
file: apps/cogstack-jupyter-hub/Dockerfile_hub
platforms: linux/arm64
build-args: |
CPU_ARCHITECTURE=arm64
Expand All @@ -174,8 +173,8 @@ jobs:
id: su
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_singleuser
context: apps/cogstack-jupyter-hub
file: apps/cogstack-jupyter-hub/Dockerfile_singleuser
platforms: linux/arm64
build-args: |
CPU_ARCHITECTURE=arm64
Expand All @@ -191,7 +190,7 @@ jobs:
# ---------- GPU (unchanged, amd64-only) ----------
build-gpu:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v7
with: { submodules: recursive, fetch-depth: 0 }
Expand All @@ -203,15 +202,14 @@ jobs:
with:
images: cogstacksystems/jupyter-singleuser-gpu
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main AND on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branches (non-PR)
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android
Expand All @@ -220,14 +218,14 @@ jobs:

- uses: docker/login-action@v4.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build & push singleuser GPU (amd64)
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile_singleuser
context: apps/cogstack-jupyter-hub
file: apps/cogstack-jupyter-hub/Dockerfile_singleuser
platforms: linux/amd64
build-args: |
CPU_ARCHITECTURE=amd64
Expand All @@ -241,13 +239,13 @@ jobs:

manifest:
runs-on: ubuntu-22.04
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name == 'push'
needs: [build-amd64, build-arm64]
steps:
- uses: docker/login-action@v4.6.0
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Recompute tags (must match both builds)
- name: Docker meta (hub)
Expand All @@ -256,31 +254,29 @@ jobs:
with:
images: cogstacksystems/jupyter-hub
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main AND on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branches (non-PR)
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false

- name: Docker meta (singleuser)
id: meta_su
uses: docker/metadata-action@v6
with:
images: cogstacksystems/jupyter-singleuser
tags: |
# vX.Y.Z -> X.Y.Z and X.Y (strip "v")
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
# latest on main AND on v-tags
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# branches (non-PR)
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
# short sha
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,enable={{is_default_branch}}
type=match,pattern=cogstack-jupyter-hub-v(\d+\.\d+\.\d+),group=1
flavor: latest=false

- name: Create hub multi-arch manifests
shell: bash
Expand Down Expand Up @@ -345,4 +341,4 @@ jobs:
--tag "${img}:${tag}" \
"${img}@${AMD64}" \
"${img}@${ARM64}"
done < <(printf "%s" "${{ steps.meta_su.outputs.tags }}")
done < <(printf "%s" "${{ steps.meta_su.outputs.tags }}")
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,26 @@ permissions:
contents: read

on:
pull_request:
push:
branches: [main]
tags: ['cogstack-jupyter-hub-v*.*.*']
paths:
- "Dockerfile_hub"
- "Dockerfile_singleuser"
- "docker/**"
- "env/**"
- "config/**"
- "scripts/**"
- "export_env_vars.sh"
- "apps/cogstack-jupyter-hub/**"
- ".github/workflows/docker-smoke-test.yml"
push:
branches:
- "main"
pull_request:
paths:
- "Dockerfile_hub"
- "Dockerfile_singleuser"
- "docker/**"
- "env/**"
- "config/**"
- "scripts/**"
- "export_env_vars.sh"
- "apps/cogstack-jupyter-hub/**"
- ".github/workflows/docker-smoke-test.yml"
workflow_dispatch:

concurrency:
group: docker-smoke-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: apps/cogstack-jupyter-hub

jobs:
smoke:
runs-on: ubuntu-22.04
Expand Down
Loading
Loading