Skip to content

Commit

Permalink
Merge pull request #21 from flux-framework/fix-init-user-add-links-to…
Browse files Browse the repository at this point in the history
…-dashboard

fix user ownership of files in jovyan home
  • Loading branch information
vsoch committed Aug 31, 2023
2 parents ed890eb + 1651e33 commit 9717db2
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
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.init", "ghcr.io/flux-framework/flux-jupyter-init:2023"],
["2023-RADIUSS-AWS/JupyterNotebook", "docker/Dockerfile.spawn", "ghcr.io/flux-framework/flux-jupyter-spawn:2023"]]

steps:
Expand Down
1 change: 1 addition & 0 deletions 2023-RADIUSS-AWS/JupyterNotebook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Let's build a set of images - one spawner and one hub.
```bash
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 .
docker build -t ghcr.io/flux-framework/flux-jupyter-init:2023 -f docker/Dockerfile.init .
```

Note that these are available under the flux-framework organization GitHub packages, so you shouldn't need
Expand Down
5 changes: 3 additions & 2 deletions 2023-RADIUSS-AWS/JupyterNotebook/aws/config-aws-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ singleuser:
limit: '4G'
cmd: /entrypoint.sh

# This runs as the root user, who clones and changes ownership to uid 1000
initContainers:
- name: init-myservice
image: alpine/git
command: ["git", "clone", "https://github.com/rse-ops/flux-radiuss-tutorial-2023", "/home/jovyan/flux-tutorial"]
image: ghcr.io/flux-framework/flux-jupyter-init
command: ["/entrypoint.sh"]
volumeMounts:
- name: flux-tutorial
mountPath: /home/jovyan
Expand Down
5 changes: 3 additions & 2 deletions 2023-RADIUSS-AWS/JupyterNotebook/aws/config-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ singleuser:
limit: '4G'
cmd: /entrypoint.sh

# This runs as the root user, who clones and changes ownership to uid 1000
initContainers:
- name: init-myservice
image: alpine/git
command: ["git", "clone", "https://github.com/rse-ops/flux-radiuss-tutorial-2023", "/home/jovyan/flux-tutorial"]
image: ghcr.io/flux-framework/flux-jupyter-init
command: ["/entrypoint.sh"]
volumeMounts:
- name: flux-tutorial
mountPath: /home/jovyan
Expand Down
2 changes: 1 addition & 1 deletion 2023-RADIUSS-AWS/JupyterNotebook/aws/eksctl-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ iam:
aws-usage: "cluster-ops"
app.kubernetes.io/name: cluster-autoscaler

# https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md
# https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md
attachPolicy:
Version: "2012-10-17"
Statement:
Expand Down
13 changes: 13 additions & 0 deletions 2023-RADIUSS-AWS/JupyterNotebook/docker/Dockerfile.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine/git

ENV NB_USER=jovyan \
NB_UID=1000 \
HOME=/home/jovyan

RUN adduser \
-D \
-g "Default user" \
-u ${NB_UID} \
-h ${HOME} \
${NB_USER}
COPY ./docker/init-entrypoint.sh /entrypoint.sh
9 changes: 9 additions & 0 deletions 2023-RADIUSS-AWS/JupyterNotebook/docker/Dockerfile.spawn
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,18 @@ RUN mv ecp_feb_2023 /opt/dyad_demo \
&& CC=$(which gcc) CXX=$(which g++) make all \
&& cd ..

# This customizes the launcher UI
# https://jupyter-app-launcher.readthedocs.io/en/latest/usage.html
RUN python3 -m pip install jupyter_app_launcher && \
python3 -m pip install --upgrade jupyter-server && \
mkdir -p /usr/local/share/jupyter/lab/jupyter_app_launcher
COPY ./docker/jupyter-launcher.yaml /usr/local/share/jupyter/lab/jupyter_app_launcher/config.yaml
ENV JUPYTER_APP_LAUNCHER_PATH /usr/local/share/jupyter/lab/jupyter_app_launcher

# No permission errors here
USER ${NB_USER}
WORKDIR $HOME
COPY ./docker/flux-icon.png $HOME/flux-icon.png

# note that previous examples are added via git volume in config.yaml
ENV SHELL=/usr/bin/bash
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions 2023-RADIUSS-AWS/JupyterNotebook/docker/init-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# Copy the notebook icon
# This would be for the customized launcher, not working yet
# wget https://flux-framework.org/assets/images/Flux-logo-mark-only-full-color.png
# mv Flux-logo-mark-only-full-color.png /home/jovyan/flux-icon.png

# We need to clone to the user home, and then change permissions to uid 1000
# That uid is shared by jovyan here and the spawn container
git clone https://github.com/rse-ops/flux-radiuss-tutorial-2023 /home/jovyan/flux-tutorial
chown -R 1000 /home/jovyan
63 changes: 63 additions & 0 deletions 2023-RADIUSS-AWS/JupyterNotebook/docker/jupyter-launcher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# These don't work, but we can try again next year.
#- title: Flux Tutorial Notebook
# description: This is the main Flux Framework Tutorial
# source: /home/jovyan/flux-tutorial/notebook/flux.ipynb
# cwd: /home/jovyan/flux-tutorial/notebook/
# type: notebook
# catalog: Notebook
# icon: /home/jovyan/flux-icon.png

# - title: Dyad Notebook Tutorial
# description: This is a tutorial for using Dyad
# source: /home/jovyan/flux-tutorial/notebook/dyad.ipynb
# cwd: /home/jovyan/flux-tutorial/notebook/
# type: notebook
# catalog: Notebook
# icon: /home/jovyan/flux-icon.png

- title: Flux Framework Portal
description: Flux Framework portal for projects, releases, and publication.
source: https://flux-framework.org/
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
- title: Flux Documentation
source: https://flux-framework.readthedocs.io/en/latest/
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
- title: Flux Cheat Sheet
source: https://flux-framework.org/cheat-sheet/
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
- title: Flux Glossary of Terms
source: https://flux-framework.readthedocs.io/en/latest/comics/fluxonomicon.html
description: come and meet FluxBird - the pink bird who knows things!
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
- title: Flux Learning Guide
source: https://flux-framework.readthedocs.io/en/latest/guides/learning_guide.html
description: learn about what Flux does, how it works, and real research applications
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
- title: Getting Started with Flux and Go
source: https://converged-computing.github.io/flux-go
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
- title: Getting Started with Flux in C
source: https://converged-computing.github.io/flux-c-examples/
description: ...looking for contributors!
type: url
catalog: Flux Resources
args:
sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']
2 changes: 1 addition & 1 deletion 2023-RADIUSS-AWS/JupyterNotebook/docker/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</a>
<div style="text-align: center; padding-bottom:30px">
<h1 class="text-normal" role="banner" align="center">RADIUSS tutorial running on AWS</h1>
<h6 class="text-normal" role="banner" align="center">After logging in, flux-radiuss-tutorial-2023 -> notebook and double-click radiuss-aws-flux.ipynb to get started</h6>
<h6 class="text-normal" role="banner" align="center">After logging in, flux-tutorial --> notebook and double-click flux.ipynb to get started</h6>
</div>
<form action="{{ authenticator_login_url | safe }}" method="post" role="form" style="margin:0 auto 0 auto; display:block">
<div class="auth-form-header">
Expand Down

0 comments on commit 9717db2

Please sign in to comment.