Skip to content

Commit

Permalink
Merge pull request #18 from flux-framework/add/automated-tutorial-build
Browse files Browse the repository at this point in the history
testing automated container builds for tutorial containers
  • Loading branch information
vsoch committed Aug 30, 2023
2 parents c7c35d8 + 4d01ba3 commit 0c2e134
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 16 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docker-builds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build containers flux-tutorials

on:
pull_request: []
workflow_dispatch:

jobs:
build-containers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: [["2023-RADIUSS-AWS/JupyterNotebook", "docker/Dockerfile.hub", "ghcr.io/flux-framework/flux-jupyter-hub:2023"],
["2023-RADIUSS-AWS/JupyterNotebook", "docker/Dockerfile.spawn", "ghcr.io/flux-framework/flux-jupyter-spawn:2023"]]

steps:
- name: Clone the code
uses: actions/checkout@v3

- name: GHCR Login
if: (github.event_name != 'pull_request')
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Layers (if exist)
env:
container: ${{ matrix.test[2] }}
run: docker pull ${container} || echo "${container} not pushed yet"

- name: Build Container
env:
context: ${{ matrix.test[0] }}
dockerfile: ${{ matrix.test[1] }}
container: ${{ matrix.test[2] }}
run: |
cd ${context}
docker build -f ${dockerfile} -t ${container} .
- name: Deploy Container
if: (github.event_name != 'pull_request')
env:
container: ${{ matrix.test[2] }}
run: docker push ${container}
11 changes: 7 additions & 4 deletions 2023-RADIUSS-AWS/JupyterNotebook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ If you are looking for the raw notebook files, [they are here](https://github.co

## Build Images

Let's build a set of images - one spawner and one hub.
Let's build a set of images - one spawner and one hub.

```bash
docker build -t <desired image name> -f docker/Dockerfile.hub .
docker build -t <desired image name> -f docker/Dockerfile.spawn .
docker build -t ghcr.io/flux-framework/flux-jupyter-hub:2023 -f docker/Dockerfile.hub .
docker build -t ghcr.io/flux-framework/flux-jupyter-spawn:2023 -f docker/Dockerfile.spawn .
```

And be sure to push your images to a public registry (or load them locally to your development cluster).
Note that these are available under the flux-framework organization GitHub packages, so you shouldn't need
to build them unless you are developing or changing them.

If you do build (and use a different name) be sure to push your images to a public registry (or load them locally to your development cluster).
Remember that if you just want to test locally, you can jump to the [local usage](#local-usage) section.

## Deploy to Kubernetes
Expand Down
8 changes: 4 additions & 4 deletions 2023-RADIUSS-AWS/JupyterNotebook/aws/config-aws-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ hub:

# This is the image I built based off of jupyterhub/k8s-hub, 3.0.2 at time of writing this
image:
name: vanessa/flux-jupyter-hub
tag: latest
name: ghcr.io/flux-framework/flux-jupyter-hub
tag: "2023"
pullPolicy: Always

# https://z2jh.jupyter.org/en/latest/administrator/optimization.html#scaling-up-in-time-user-placeholders
Expand All @@ -39,8 +39,8 @@ proxy:
# This is the "spawn" image
singleuser:
image:
name: vanessa/flux-jupyter-spawn
tag: latest
name: ghcr.io/flux-framework/flux-jupyter-spawn
tag: "2023"
pullPolicy: Always
cpu:
limit: 1
Expand Down
8 changes: 4 additions & 4 deletions 2023-RADIUSS-AWS/JupyterNotebook/aws/config-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ hub:

# This is the image I built based off of jupyterhub/k8s-hub, 3.0.2 at time of writing this
image:
name: vanessa/flux-jupyter-hub
tag: latest
name: ghcr.io/flux-framework/flux-jupyter-hub
tag: "2023"
pullPolicy: Always

# https://z2jh.jupyter.org/en/latest/administrator/optimization.html#scaling-up-in-time-user-placeholders
Expand All @@ -31,8 +31,8 @@ scheduling:
# This is the "spawn" image
singleuser:
image:
name: vanessa/flux-jupyter-spawn
tag: latest
name: ghcr.io/flux-framework/flux-jupyter-spawn
tag: "2023"
pullPolicy: Always
cpu:
limit: 1
Expand Down
8 changes: 4 additions & 4 deletions 2023-RADIUSS-AWS/JupyterNotebook/gcp/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ hub:

# This is the image I built based off of jupyterhub/k8s-hub, 3.0.2 at time of writing this
image:
name: vanessa/flux-jupyter-hub
tag: latest
name: ghcr.io/flux-framework/flux-jupyter-hub
tag: "2023"
pullPolicy: Always

# https://z2jh.jupyter.org/en/latest/administrator/optimization.html#scaling-up-in-time-user-placeholders
Expand All @@ -31,8 +31,8 @@ scheduling:
# This is the "spawn" image
singleuser:
image:
name: vanessa/flux-jupyter-spawn
tag: latest
name: ghcr.io/flux-framework/flux-jupyter-spawn
tag: "2023"
pullPolicy: Always
cpu:
limit: 1
Expand Down

0 comments on commit 0c2e134

Please sign in to comment.