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

Jupyter Notebook as interactive app #22

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion image/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ then
ulimit -n 131072
ulimit -a

# Exposes for https://github.com/stackhpc/bc_containerised_jupyter/tree/v0.1.1
echo "POD_NAME=$POD_NAME" >> /etc/environment

start_munge

echo "---> Waiting for slurmctld to become active before starting slurmd..."
Expand Down Expand Up @@ -125,7 +128,7 @@ then
echo "" >> /home/rocky/.ssh/authorized_keys #Adding newline to avoid breaking authorized_keys file
cat /home/rocky/.ssh/id_rsa.pub >> /home/rocky/.ssh/authorized_keys

echo "---> Starting Apache Server"
echo "---> Setting up Apache Server"

# mkdir --parents /etc/ood/config/apps/shell
# env > /etc/ood/config/apps/shell/env
Expand All @@ -135,6 +138,12 @@ then
mkdir --parents /opt/rh/httpd24/root/etc/httpd/

/usr/bin/htdbm -cb /opt/rh/httpd24/root/etc/httpd/.htpasswd.dbm rocky $ROCKY_OOD_PASS

echo "---> Setting up Jupyter App"
mkdir --parents /var/www/ood/apps/sys/jupyter
git clone $JUPYTER_REPO --branch $JUPYTER_TAG /var/www/ood/apps/sys/jupyter

echo "---> Starting Apache server"
/usr/sbin/httpd -k start -X -e debug

elif [ "$1" = "check-queue-hook" ]
Expand Down
11 changes: 0 additions & 11 deletions slurm-cluster-chart/files/ood-cluster-config.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ ssl:
# host_regex: '[\w.-]+\.example\.com'
# Default: '[^/]+' (allow reverse proxying to all hosts, this allows external
# hosts as well)
#host_regex: '[^/]+'
#host_regex: 'slurmd-[0-1]'

# Sub-uri used to reverse proxy to backend web server running on node that
# knows the full URI path
# Example:
# node_uri: '/node'
# Default: null (disable this feature)
#node_uri: null
node_uri: "/node"

# Sub-uri used to reverse proxy to backend web server running on node that
# ONLY uses *relative* URI paths
# Example:
# rnode_uri: '/rnode'
# Default: null (disable this feature)
#rnode_uri: null
rnode_uri: "/rnode"

#
# Per-user NGINX Passenger apps
Expand Down Expand Up @@ -240,7 +240,6 @@ ssl:
# Default: null (display error to user if mapping fails)
#register_root: null

host_regex: 'head'
auth:
- 'AuthType Basic'
- 'AuthName "private"'
Expand Down
21 changes: 21 additions & 0 deletions slurm-cluster-chart/files/slurm-cluster-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
v2:
metadata:
title: "slurm-cluster"
login:
host: "localhost"
bc_queue: all
job:
cluster: "linux"
adapter: "slurm"
bin: "/usr/bin"
conf: "/etc/slurm/slurm.conf"
batch_connect:
template: "basic"
script:
native:
- "-N"
- "<%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"
- "-C"
- "c12"

4 changes: 2 additions & 2 deletions slurm-cluster-chart/templates/cluster-config-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: ConfigMap
metadata:
name: cluster-config
data:
ood-cluster-config.yml: |
{{- .Files.Get "files/ood-cluster-config.yml" | nindent 4 -}}
slurm-cluster.yml: |
{{- .Files.Get "files/slurm-cluster-config.yml" | nindent 4 -}}
8 changes: 6 additions & 2 deletions slurm-cluster-chart/templates/login.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
env:
- name: ROCKY_OOD_PASS
value: {{ .Values.openOnDemand.password }}
- name: JUPYTER_REPO
value: {{ .Values.jupyterApp.repoURL }}
- name: JUPYTER_TAG
value: {{ .Values.jupyterApp.repoTag }}
ports:
- containerPort: 22
- containerPort: 80
Expand All @@ -54,8 +58,8 @@ spec:
mountPath: /etc/httpd/conf/httpd.conf
subPath: httpd.conf
- name: cluster-config
mountPath: /etc/ood/config/clusters.d/ood-cluster-config.yml
subPath: ood-cluster-config.yml
mountPath: /etc/ood/config/clusters.d/slurm-cluster.yml
subPath: slurm-cluster.yml
- name: host-keys
mountPath: /tempmounts/etc/ssh
resources: {}
Expand Down
2 changes: 1 addition & 1 deletion slurm-cluster-chart/templates/ood-portal-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: ood-portal-configmap
data:
ood_portal.yml: |
{{- .Files.Get "files/ood_portal.yaml" | nindent 4 -}}
{{- .Files.Get "files/ood_portal.yml" | nindent 4 -}}

3 changes: 3 additions & 0 deletions slurm-cluster-chart/templates/slurmd-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ spec:
- name: slurmd
port: 6818
targetPort: 6818
- name: "jupyter"
port: 8888
targetPort: 8888
selector:
app.kubernetes.io/name: slurm
app.kubernetes.io/component: slurmd
Expand Down
3 changes: 2 additions & 1 deletion slurm-cluster-chart/templates/slurmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ spec:
image: {{ .Values.slurmImage }}
name: slurmd
ports:
- containerPort: 8888
- containerPort: 6818
hostPort: 6818
hostPort: 6818
resources: {}
volumeMounts:
- mountPath: /etc/slurm/
Expand Down
6 changes: 5 additions & 1 deletion slurm-cluster-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
slurmImage: ghcr.io/stackhpc/slurm-docker-cluster:d3daba4
slurmImage: ghcr.io/stackhpc/slurm-docker-cluster:ac8fe57

login:
# Deployment resource name
Expand Down Expand Up @@ -73,6 +73,10 @@ sshPublicKey:
# Secret resource names
secrets:
mungeKey: munge-key-secret

jupyterApp:
repoURL: "https://github.com/stackhpc/bc_containerised_jupyter.git"
repoTag: "v0.1.1"

openOnDemand:
#Password for default Open OnDemand user 'rocky'
Expand Down
Loading