diff --git a/image/docker-entrypoint.sh b/image/docker-entrypoint.sh index 5d65241..4532fe0 100755 --- a/image/docker-entrypoint.sh +++ b/image/docker-entrypoint.sh @@ -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..." @@ -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 @@ -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" ] diff --git a/slurm-cluster-chart/files/ood-cluster-config.yml b/slurm-cluster-chart/files/ood-cluster-config.yml deleted file mode 100644 index cc0ab76..0000000 --- a/slurm-cluster-chart/files/ood-cluster-config.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -v2: - metadata: - title: "Slurm Cluster" - login: - host: "localhost" - job: - cluster: "linux" - adapter: "slurm" - bin: "/usr/bin" - conf: "/etc/slurm/slurm.conf" \ No newline at end of file diff --git a/slurm-cluster-chart/files/ood_portal.yaml b/slurm-cluster-chart/files/ood_portal.yml similarity index 99% rename from slurm-cluster-chart/files/ood_portal.yaml rename to slurm-cluster-chart/files/ood_portal.yml index d5227b2..b4ce7aa 100644 --- a/slurm-cluster-chart/files/ood_portal.yaml +++ b/slurm-cluster-chart/files/ood_portal.yml @@ -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 @@ -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"' diff --git a/slurm-cluster-chart/files/slurm-cluster-config.yml b/slurm-cluster-chart/files/slurm-cluster-config.yml new file mode 100644 index 0000000..5cd10c0 --- /dev/null +++ b/slurm-cluster-chart/files/slurm-cluster-config.yml @@ -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" + \ No newline at end of file diff --git a/slurm-cluster-chart/templates/cluster-config-configmap.yaml b/slurm-cluster-chart/templates/cluster-config-configmap.yaml index 914a456..0b3fd68 100644 --- a/slurm-cluster-chart/templates/cluster-config-configmap.yaml +++ b/slurm-cluster-chart/templates/cluster-config-configmap.yaml @@ -3,5 +3,5 @@ kind: ConfigMap metadata: name: cluster-config data: - ood-cluster-config.yml: | - {{- .Files.Get "files/ood-cluster-config.yml" | nindent 4 -}} \ No newline at end of file + slurm-cluster.yml: | + {{- .Files.Get "files/slurm-cluster-config.yml" | nindent 4 -}} \ No newline at end of file diff --git a/slurm-cluster-chart/templates/login.yaml b/slurm-cluster-chart/templates/login.yaml index a02d9e0..d77aae2 100644 --- a/slurm-cluster-chart/templates/login.yaml +++ b/slurm-cluster-chart/templates/login.yaml @@ -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 @@ -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: {} diff --git a/slurm-cluster-chart/templates/ood-portal-configmap.yaml b/slurm-cluster-chart/templates/ood-portal-configmap.yaml index 6770d82..ec15af9 100644 --- a/slurm-cluster-chart/templates/ood-portal-configmap.yaml +++ b/slurm-cluster-chart/templates/ood-portal-configmap.yaml @@ -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 -}} \ No newline at end of file diff --git a/slurm-cluster-chart/templates/slurmd-service.yaml b/slurm-cluster-chart/templates/slurmd-service.yaml index b5884fc..d8eebc7 100644 --- a/slurm-cluster-chart/templates/slurmd-service.yaml +++ b/slurm-cluster-chart/templates/slurmd-service.yaml @@ -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 diff --git a/slurm-cluster-chart/templates/slurmd.yaml b/slurm-cluster-chart/templates/slurmd.yaml index bec55ce..fee6018 100644 --- a/slurm-cluster-chart/templates/slurmd.yaml +++ b/slurm-cluster-chart/templates/slurmd.yaml @@ -35,8 +35,9 @@ spec: image: {{ .Values.slurmImage }} name: slurmd ports: + - containerPort: 8888 - containerPort: 6818 - hostPort: 6818 + hostPort: 6818 resources: {} volumeMounts: - mountPath: /etc/slurm/ diff --git a/slurm-cluster-chart/values.yaml b/slurm-cluster-chart/values.yaml index 3d41248..64d5654 100644 --- a/slurm-cluster-chart/values.yaml +++ b/slurm-cluster-chart/values.yaml @@ -1,4 +1,4 @@ -slurmImage: ghcr.io/stackhpc/slurm-docker-cluster:d3daba4 +slurmImage: ghcr.io/stackhpc/slurm-docker-cluster:ac8fe57 login: # Deployment resource name @@ -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'