diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f33a02c..57d71b1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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}}" diff --git a/apps/cogstack-jupyter-hub/.github/workflows/docker-build.yml b/.github/workflows/jupyter-docker-build.yml similarity index 62% rename from apps/cogstack-jupyter-hub/.github/workflows/docker-build.yml rename to .github/workflows/jupyter-docker-build.yml index e0c2d81..d521386 100644 --- a/apps/cogstack-jupyter-hub/.github/workflows/docker-build.yml +++ b/.github/workflows/jupyter-docker-build.yml @@ -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: @@ -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 }} @@ -36,15 +39,14 @@ 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 @@ -52,27 +54,26 @@ jobs: 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 @@ -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 @@ -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 }} @@ -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 @@ -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 @@ -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 } @@ -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 @@ -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 @@ -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) @@ -256,15 +254,14 @@ 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 @@ -272,15 +269,14 @@ jobs: 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 @@ -345,4 +341,4 @@ jobs: --tag "${img}:${tag}" \ "${img}@${AMD64}" \ "${img}@${ARM64}" - done < <(printf "%s" "${{ steps.meta_su.outputs.tags }}") \ No newline at end of file + done < <(printf "%s" "${{ steps.meta_su.outputs.tags }}") diff --git a/apps/cogstack-jupyter-hub/.github/workflows/docker-smoke-test.yml b/.github/workflows/jupyter-docker-smoke-test.yml similarity index 89% rename from apps/cogstack-jupyter-hub/.github/workflows/docker-smoke-test.yml rename to .github/workflows/jupyter-docker-smoke-test.yml index 47c6e39..b23eb04 100644 --- a/apps/cogstack-jupyter-hub/.github/workflows/docker-smoke-test.yml +++ b/.github/workflows/jupyter-docker-smoke-test.yml @@ -4,27 +4,15 @@ 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: @@ -32,6 +20,10 @@ 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 diff --git a/README.md b/README.md index b76ef1b..22c4de9 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,76 @@ +
+
+
+
+ Unlock the power of healthcare data with CogStack AI. +
+ +--- + + + # Cogstack Platform -This repository contains tools and services used to support CogStack deployments +This repository contains applications, tools and services used in cogstack deployments. See the latest documentation on [Readthedocs](https://docs.cogstack.org/en/latest/) ## Project contents + +### Apps + +|
+
+ OCR Service + + + Document and image text extraction built on Tesseract OCR + |
+
+
+ CogStack Jupyter Hub + + + Custom JupyterHub images and notebooks for CogStack analysis + |
+
+
+
+ CogStack Cohorter + + + Cohort definition tooling with NL2DSL and web UI + |
+
+
+ CogStack Dashboards Demo + + + Demo scripts and visualisations for CogStack dashboards + |
+