Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing automated container builds for tutorial containers #18

Merged
merged 1 commit into from
Aug 30, 2023
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
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