diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..40d958f946409d40123c6bdbe7d40764c45a0b78 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 5bf8829ceb4c542dde24e3c4f20ece127a517cd4..0b1103f12f1bb919a48d9697106f17ae9596692d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -values.template2.yaml \ No newline at end of file +values.template2.yaml +.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0300e38a9a24085be0172c9ff27c2a5d76abe01b..fe78a53416b86c3764fb0928d49ee05eb1067709 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,10 +13,13 @@ deploy-helm: --install hpchub jupyterhub/jupyterhub --namespace csusb-hpc --version=1.2 --values values.yaml - --set-file hub.extraFiles.image_select_idp.binaryData=./select_idp_cilogon.png.b64 - --set-file hub.extraFiles.custom_spawner_profile.stringData=./my_spawner.html - --set-file hub.extraFiles.custom_spawner.stringData=./my_spawner.py - + --set-file hub.extraFiles.custom_spawner_profile.stringData=./extraFiles/my_spawner.html + --set-file hub.extraFiles.custom_spawner.stringData=./extraFiles/my_spawner.py + --set-file hub.extraFiles.image_select_idp.binaryData=./extraFiles/select_idp_cilogon.png.b64 + --set-file hub.extraFiles.custom_login_html.stringData=./extraFiles/login.html + --set-file hub.extraFiles.custom_page_html.stringData=./extraFiles/page.html + --set-file hub.extraFiles.custom_spawn_pending_html.stringData=./extraFiles/spawn_pending.html + environment: #Check the namespace name: csusb-hpc diff --git a/extraFiles/.DS_Store b/extraFiles/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..58e2c86eed0753333e59c68691022f561befe268 Binary files /dev/null and b/extraFiles/.DS_Store differ diff --git a/configMap-shared.yaml b/extraFiles/configMap-shared.yaml similarity index 100% rename from configMap-shared.yaml rename to extraFiles/configMap-shared.yaml diff --git a/extraFiles/login.html b/extraFiles/login.html new file mode 100644 index 0000000000000000000000000000000000000000..861f132aac9a9efe2fabf89f1306f926bab2588d --- /dev/null +++ b/extraFiles/login.html @@ -0,0 +1,60 @@ +{# https://github.com/jupyterhub/jupyterhub/issues/1385 #} +{# https://github.com/jupyterhub/jupyterhub/issues/1385#issuecomment-738447175 #} +{% extends "templates/login.html" %} + +<!-- {% set announcement = 'We are testing customized style / The server works the same way as before' %} --> +{% set csusb_hub_title = 'Welcome to Cal State San Bernardino JupyterHub' %} +{% set csusb_cilogon = 'The login process (the orange button) uses CSUSB\'s DUO system' %} + +{% block login %} +<div class="container text-center"> + <h2>{{ csusb_hub_title }}</h2> + <h5> + <p>{{ csusb_cilogon | safe }}</p> + {# <p>Visit <a href="https://www.csusb.edu/high-performance-computing" target="_blank">CSUSB High Performance Computing Initiative</a> for more information about CSUSB HPCI + </p> #} + </h5> +</div> +<p>   </p> +<p>   </p> +<p>   </p> +{{ super() }} +<p>   </p> +<div id="login-cilogon-info" class="service-login"> + <h5> + <p>Be sure to choose <ins>California State University San Bernardino</ins> on the next page instead of <del>ORCID</del> + </h5> +</div> +<div class="container text-center"> +<details> + <summary>Click here for more details</summary> + <img id="idp_selector_info" style="width: 70%" src="{{ static_url("select_idp_cilogon.png") }}" alt="CILogon-CSUSB-Select"> +</details> +</div> +{% endblock %} + +{% block stylesheet %} +{{ super() }} +<style> +#login-main{ + margin-top: 1%; + height: 100%; +} +#login-cilogon-info{ + text-align: center; + display: table; + vertical-align: middle; + margin: 1% auto auto auto; + padding-left: 0%; + width: 380px; +} +#idp_selector_info { + max-width:100%; + height:auto; + max-height:100%; +} +p.extra-space { + line-height: 0.7; +} +</style> +{% endblock %} \ No newline at end of file diff --git a/my_spawner.html b/extraFiles/my_spawner.html similarity index 95% rename from my_spawner.html rename to extraFiles/my_spawner.html index 5ccae5bc4e22ab9189d332922fda8b7fb22fb979..a741df5d99dd095f602f29f22a39663c30a7ea7c 100644 --- a/my_spawner.html +++ b/extraFiles/my_spawner.html @@ -1,10 +1,4 @@ <style> -<!-- -/* The profile description should not be bold, even though it is inside the <label> tag */ - font-weight: normal; -} ---> - input[type="range"] { display: inline; width: 40%; diff --git a/my_spawner.py b/extraFiles/my_spawner.py similarity index 98% rename from my_spawner.py rename to extraFiles/my_spawner.py index ef7b37f15d79cde3e319dfc51f1b0919ae602b22..49fbbbe9ae754863c6c13000f8fadcf382821109 100644 --- a/my_spawner.py +++ b/extraFiles/my_spawner.py @@ -110,7 +110,7 @@ class MySpawner(KubeSpawner): { 'display_name': 'Stack SageMath', 'kubespawner_override': { - 'image_spec': 'gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-jupyter-stack/stack-sagemath:b353d66b', + 'image_spec': 'gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-jupyter-stack/stack-sagemath', } }, ] diff --git a/extraFiles/page.html b/extraFiles/page.html new file mode 100644 index 0000000000000000000000000000000000000000..171e8b8f3dacbc5df10acebc2e4ca6ef2b442711 --- /dev/null +++ b/extraFiles/page.html @@ -0,0 +1,27 @@ +{% extends "templates/page.html" %} + +<!-- {% set announcement = 'Please contact Youngsu Kim at youngsu.kim@csusb.edu for support' %} --> + +{% block stylesheet %} +{{ super() }} +<style> +.footer-bottom { + position: auto; + bottom: 0px; + text-align: center; + width: 100%; + z-index: -1; +} +</style> +{% endblock %} + +{% block footer %} +<p>   <br>   </p> +<p>   <br>   </p> +<div class="footer-bottom"> + <hr style="width:35%; margin-bottom: 5px;"> + <p style="font-size: 100%">This JupyterHub is provided by the <a href="https://www.csusb.edu/high-performance-computing" target="_blank">High Performance Computing Initiative </a> at <a href="https://www.csusb.edu/" target="_blank">California State Univeristy San Bernardino</a> and <a href="https://pacificresearchplatform.org/" target="_blank">Pacific Research Platform</a> <br> + If you obtain any results by utilizing our resources, please include <a href="https://www.csusb.edu/academic-technologies-innovation/xreal-lab-and-high-performance-computing/high-performance-computing#acknowledgement" target="_blank">acknowledgements of our service</a> in your work e.g., presentations or papers. <br> + It will help us maintain the funding for our resources. + </p></div> +{% endblock %} \ No newline at end of file diff --git a/pvc-jupyterhub-course-test.yaml b/extraFiles/pvc-jupyterhub-course-test.yaml similarity index 100% rename from pvc-jupyterhub-course-test.yaml rename to extraFiles/pvc-jupyterhub-course-test.yaml diff --git a/select_idp_cilogon.png.b64 b/extraFiles/select_idp_cilogon.png.b64 similarity index 100% rename from select_idp_cilogon.png.b64 rename to extraFiles/select_idp_cilogon.png.b64 diff --git a/extraFiles/spawn_pending.html b/extraFiles/spawn_pending.html new file mode 100644 index 0000000000000000000000000000000000000000..394c5e157aabfa04de02ec0762d4e9d0daacb057 --- /dev/null +++ b/extraFiles/spawn_pending.html @@ -0,0 +1,8 @@ +{% extends "templates/spawn_pending.html" %} +{% block message %} +{# {{ super() }} #} +<p>Your server is starting up and it may take several minutes</p> +<p>Most issues are related to the server upgrade or temporary maintanance</p> +<p>If it does not start for an extended period of time, please contact the <a href="https://www.csusb.edu/high-performance-computing/#team" target="_blank"> CSUSB HPC team </a></p> +<p>   <br>   </p> +{% endblock %} \ No newline at end of file diff --git a/start-local.sh b/extraFiles/start-local.sh similarity index 100% rename from start-local.sh rename to extraFiles/start-local.sh diff --git a/values.template.yaml b/values.template.yaml index 78902762b5f1b84aadf0aaee77b32220200016e7..0b7b168fbaffa34eabaa893308f3ca37230c652f 100644 --- a/values.template.yaml +++ b/values.template.yaml @@ -30,33 +30,12 @@ hub: - 003087200@csusb.edu - 000030081@csusb.edu - dmishin@ucsd.edu - initContainers: - - name: git-clone-templates - image: alpine/git - args: - - clone - - --single-branch - - --branch=main - - --depth=1 - - -- - - https://gitlab.nrp-nautilus.io/csusb-prp/csusb-jupyterhub-templates.git - - /etc/jupyterhub/custom - securityContext: - runAsUser: 0 - volumeMounts: - - name: custom-templates - mountPath: /etc/jupyterhub/custom - extraVolumes: - - name: custom-templates - emptyDir: {} - extraVolumeMounts: - - name: custom-templates - mountPath: /etc/jupyterhub/custom extraConfig: templates: | c.JupyterHub.template_paths = ['/etc/jupyterhub/custom'] # https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/1990 + # To use these .gitlab-ci.yml needs to be updated accordingly extraFiles: image_select_idp: mountPath: /usr/local/share/jupyterhub/static/select_idp_cilogon.png @@ -72,6 +51,47 @@ hub: custom_spawner_profile: mountPath: /etc/jupyterhub/custom/my_spawner.html + # Additional custom html files + custom_login_html: + mountPath: /etc/jupyterhub/custom/login.html + custom_page_html: + mountPath: /etc/jupyterhub/custom/page.html + custom_spawn_pending_html: + mountPath: /etc/jupyterhub/custom/spawn_pending.html + + + + nodeSelector: + topology.kubernetes.io/region: "us-west" + kubernetes.io/hostname: "perfsonar.csusb.edu" + # env: system + + image: + name: jupyterhub/k8s-hub + tag: '1.2.0' + pullPolicy: '' + pullSecrets: [] + + livenessProbe: + # The livenessProbe's aim to give JupyterHub sufficient time to startup but + # be able to restart if it becomes unresponsive for ~5 min. + enabled: true + initialDelaySeconds: 300 + periodSeconds: 10 + failureThreshold: 30 + timeoutSeconds: 3 + readinessProbe: + # The readinessProbe's aim is to provide a successful startup indication, + # but following that never become unready before its livenessProbe fail and + # restarts it if needed. To become unready following startup serves no + # purpose as there are no other pod to fallback to in our non-HA deployment. + enabled: true + initialDelaySeconds: 0 + periodSeconds: 2 + failureThreshold: 1000 + timeoutSeconds: 1 + + service: type: ClusterIP annotations: {} @@ -131,20 +151,21 @@ singleuser: pvcNameTemplate: claim-{username}{servername} volumeNameTemplate: volume-{username}{servername} storageAccessModes: [ReadWriteOnce] - extraVolumes: - - name: csusb-hpc-share - persistentVolumeClaim: - claimName: csusb-hpc-share - - name: mkshare-script - configMap: - name: mkshare-script - defaultMode: 0777 - extraVolumeMounts: - - name: csusb-hpc-share - mountPath: /home/shared - - name: mkshare-script - mountPath: /usr/local/bin/before-notebook.d/mkshare.sh - subPath: mkshare.sh + # extraVolumes(Mounts) are overriden by the custom spawner -> extraFiles/my_spawner.py + # extraVolumes: + # - name: csusb-hpc-share + # persistentVolumeClaim: + # claimName: csusb-hpc-share + # - name: mkshare-script + # configMap: + # name: mkshare-script + # defaultMode: 0777 + # extraVolumeMounts: + # - name: csusb-hpc-share + # mountPath: /home/shared + # - name: mkshare-script + # mountPath: /usr/local/bin/before-notebook.d/mkshare.sh + # subPath: mkshare.sh image: name: localhost:30081/prp/jupyter-stack/prp tag: latest @@ -166,50 +187,6 @@ singleuser: # default: true # kubespawner_override: # image_spec: localhost:30081/prp/jupyter-stack/minimal -# - display_name: Stack Minimal + Desktop GUI + Relion -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/relion-desktop -# - display_name: Stack All Spark -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/all-spark -# extra_resource_limits: -# nvidia.com/gpu: "2" -# - display_name: Stack Datascience -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/datascience -# extra_resource_limits: -# nvidia.com/gpu: "2" -# - display_name: Stack Tensorflow [2GPUs] -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/prp -# extra_resource_limits: -# nvidia.com/gpu: "2" -# - display_name: Stack Tensorflow [4GPUs] -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/prp -# extra_resource_limits: -# nvidia.com/gpu: "4" -# - display_name: Stack R-Studio [4.1.2] -# kubespawner_override: -# image_spec: gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-jupyter-stack/stack-rstudio:sr-r1 -# - display_name: Stack R-Studio -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/r-studio -# # extra_resource_limits: -# # nvidia.com/gpu: "1" -# - display_name: Stack Pyspark [2GPUs] -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/pyspark -# extra_resource_limits: -# nvidia.com/gpu: "2" -# - display_name: Stack Pyspark [4GPUs] -# kubespawner_override: -# image_spec: localhost:30081/prp/jupyter-stack/pyspark -# extra_resource_limits: -# nvidia.com/gpu: "4" -# - display_name: Stack SageMath -# kubespawner_override: -# image_spec: gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-jupyter-stack/stack-sagemath:b353d66b scheduling: userScheduler: enabled: false