diff --git a/jupyter/jupyter-web-app/base/config-map.yaml b/jupyter/jupyter-web-app/base/config-map.yaml deleted file mode 100644 index cfb4d47e2f..0000000000 --- a/jupyter/jupyter-web-app/base/config-map.yaml +++ /dev/null @@ -1,134 +0,0 @@ -apiVersion: v1 -data: - spawner_ui_config.yaml: | - # Configuration file for the Jupyter UI. - # - # Each Jupyter UI option is configured by two keys: 'value' and 'readOnly' - # - The 'value' key contains the default value - # - The 'readOnly' key determines if the option will be available to users - # - # If the 'readOnly' key is present and set to 'true', the respective option - # will be disabled for users and only set by the admin. Also when a - # Notebook is POSTED to the API if a necessary field is not present then - # the value from the config will be used. - # - # If the 'readOnly' key is missing (defaults to 'false'), the respective option - # will be available for users to edit. - # - # Note that some values can be templated. Such values are the names of the - # Volumes as well as their StorageClass - spawnerFormDefaults: - image: - # The container Image for the user's Jupyter Notebook - # If readonly, this value must be a member of the list below - value: gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v-base-ef41372-1177829795472347138 - # The list of available standard container Images - options: - - gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 - - gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-gpu:1.0.0 - - gcr.io/kubeflow-images-public/tensorflow-2.1.0-notebook-cpu:1.0.0 - - gcr.io/kubeflow-images-public/tensorflow-2.1.0-notebook-gpu:1.0.0 - # By default, custom container Images are allowed - # Uncomment the following line to only enable standard container Images - readOnly: false - cpu: - # CPU for user's Notebook - value: '0.5' - readOnly: false - memory: - # Memory for user's Notebook - value: 1.0Gi - readOnly: false - workspaceVolume: - # Workspace Volume to be attached to user's Notebook - # Each Workspace Volume is declared with the following attributes: - # Type, Name, Size, MountPath and Access Mode - value: - type: - # The Type of the Workspace Volume - # Supported values: 'New', 'Existing' - value: New - name: - # The Name of the Workspace Volume - # Note that this is a templated value. Special values: - # {notebook-name}: Replaced with the name of the Notebook. The frontend - # will replace this value as the user types the name - value: 'workspace-{notebook-name}' - size: - # The Size of the Workspace Volume (in Gi) - value: '10Gi' - mountPath: - # The Path that the Workspace Volume will be mounted - value: /home/jovyan - accessModes: - # The Access Mode of the Workspace Volume - # Supported values: 'ReadWriteOnce', 'ReadWriteMany', 'ReadOnlyMany' - value: ReadWriteOnce - class: - # The StrageClass the PVC will use if type is New. Special values are: - # {none}: default StorageClass - # {empty}: empty string "" - value: '{none}' - readOnly: false - dataVolumes: - # List of additional Data Volumes to be attached to the user's Notebook - value: [] - # Each Data Volume is declared with the following attributes: - # Type, Name, Size, MountPath and Access Mode - # - # For example, a list with 2 Data Volumes: - # value: - # - value: - # type: - # value: New - # name: - # value: '{notebook-name}-vol-1' - # size: - # value: '10Gi' - # class: - # value: standard - # mountPath: - # value: /home/jovyan/vol-1 - # accessModes: - # value: ReadWriteOnce - # class: - # value: {none} - # - value: - # type: - # value: New - # name: - # value: '{notebook-name}-vol-2' - # size: - # value: '10Gi' - # mountPath: - # value: /home/jovyan/vol-2 - # accessModes: - # value: ReadWriteMany - # class: - # value: {none} - readOnly: false - gpus: - # Number of GPUs to be assigned to the Notebook Container - value: - # values: "none", "1", "2", "4", "8" - num: "none" - # Determines what the UI will show and send to the backend - vendors: - - limitsKey: "nvidia.com/gpu" - uiName: "NVIDIA" - # Values: "" or a `limits-key` from the vendors list - vendor: "" - readOnly: false - shm: - value: true - readOnly: false - configurations: - # List of labels to be selected, these are the labels from PodDefaults - # value: - # - add-gcp-secret - # - default-editor - value: [] - readOnly: false -kind: ConfigMap -metadata: - name: config diff --git a/jupyter/jupyter-web-app/base/configs/spawner_ui_config.yaml b/jupyter/jupyter-web-app/base/configs/spawner_ui_config.yaml new file mode 100644 index 0000000000..f5e63b37b3 --- /dev/null +++ b/jupyter/jupyter-web-app/base/configs/spawner_ui_config.yaml @@ -0,0 +1,128 @@ +# Configuration file for the Jupyter UI. +# +# Each Jupyter UI option is configured by two keys: 'value' and 'readOnly' +# - The 'value' key contains the default value +# - The 'readOnly' key determines if the option will be available to users +# +# If the 'readOnly' key is present and set to 'true', the respective option +# will be disabled for users and only set by the admin. Also when a +# Notebook is POSTED to the API if a necessary field is not present then +# the value from the config will be used. +# +# If the 'readOnly' key is missing (defaults to 'false'), the respective option +# will be available for users to edit. +# +# Note that some values can be templated. Such values are the names of the +# Volumes as well as their StorageClass +spawnerFormDefaults: + image: + # The container Image for the user's Jupyter Notebook + # If readonly, this value must be a member of the list below + value: gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 + # The list of available standard container Images + options: + - gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 + - gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-gpu:1.0.0 + - gcr.io/kubeflow-images-public/tensorflow-2.1.0-notebook-cpu:1.0.0 + - gcr.io/kubeflow-images-public/tensorflow-2.1.0-notebook-gpu:1.0.0 + # By default, custom container Images are allowed + # Uncomment the following line to only enable standard container Images + readOnly: false + cpu: + # CPU for user's Notebook + value: '0.5' + readOnly: false + memory: + # Memory for user's Notebook + value: 1.0Gi + readOnly: false + workspaceVolume: + # Workspace Volume to be attached to user's Notebook + # Each Workspace Volume is declared with the following attributes: + # Type, Name, Size, MountPath and Access Mode + value: + type: + # The Type of the Workspace Volume + # Supported values: 'New', 'Existing' + value: New + name: + # The Name of the Workspace Volume + # Note that this is a templated value. Special values: + # {notebook-name}: Replaced with the name of the Notebook. The frontend + # will replace this value as the user types the name + value: 'workspace-{notebook-name}' + size: + # The Size of the Workspace Volume (in Gi) + value: '10Gi' + mountPath: + # The Path that the Workspace Volume will be mounted + value: /home/jovyan + accessModes: + # The Access Mode of the Workspace Volume + # Supported values: 'ReadWriteOnce', 'ReadWriteMany', 'ReadOnlyMany' + value: ReadWriteOnce + class: + # The StrageClass the PVC will use if type is New. Special values are: + # {none}: default StorageClass + # {empty}: empty string "" + value: '{none}' + readOnly: false + dataVolumes: + # List of additional Data Volumes to be attached to the user's Notebook + value: [] + # Each Data Volume is declared with the following attributes: + # Type, Name, Size, MountPath and Access Mode + # + # For example, a list with 2 Data Volumes: + # value: + # - value: + # type: + # value: New + # name: + # value: '{notebook-name}-vol-1' + # size: + # value: '10Gi' + # class: + # value: standard + # mountPath: + # value: /home/jovyan/vol-1 + # accessModes: + # value: ReadWriteOnce + # class: + # value: {none} + # - value: + # type: + # value: New + # name: + # value: '{notebook-name}-vol-2' + # size: + # value: '10Gi' + # mountPath: + # value: /home/jovyan/vol-2 + # accessModes: + # value: ReadWriteMany + # class: + # value: {none} + readOnly: false + gpus: + # Number of GPUs to be assigned to the Notebook Container + value: + # values: "none", "1", "2", "4", "8" + num: "none" + # Determines what the UI will show and send to the backend + vendors: + - limitsKey: "nvidia.com/gpu" + uiName: "NVIDIA" + # Values: "" or a `limits-key` from the vendors list + vendor: "" + readOnly: false + shm: + value: true + readOnly: false + configurations: + # List of labels to be selected, these are the labels from PodDefaults + # value: + # - add-gcp-secret + # - default-editor + value: [] + readOnly: false \ No newline at end of file diff --git a/jupyter/jupyter-web-app/base/deployment.yaml b/jupyter/jupyter-web-app/base/deployment.yaml index fd379d200e..29409f1f96 100644 --- a/jupyter/jupyter-web-app/base/deployment.yaml +++ b/jupyter/jupyter-web-app/base/deployment.yaml @@ -36,5 +36,5 @@ spec: serviceAccountName: service-account volumes: - configMap: - name: config + name: jupyter-web-app-config name: config-volume diff --git a/jupyter/jupyter-web-app/base/kustomization.yaml b/jupyter/jupyter-web-app/base/kustomization.yaml index 6a2410a3eb..719aa7bb59 100644 --- a/jupyter/jupyter-web-app/base/kustomization.yaml +++ b/jupyter/jupyter-web-app/base/kustomization.yaml @@ -3,7 +3,6 @@ kind: Kustomization resources: - cluster-role-binding.yaml - cluster-role.yaml -- config-map.yaml - deployment.yaml - role-binding.yaml - role.yaml @@ -22,6 +21,11 @@ configMapGenerator: - envs: - params.env name: parameters +# We need the name to be unique without the suffix because the original name is what +# gets used with patches +- name: jupyter-web-app-config + files: + - configs/spawner_ui_config.yaml generatorOptions: disableNameSuffixHash: true vars: diff --git a/tests/jupyter/jupyter-web-app/base/test_data/expected/apps_v1_deployment_jupyter-web-app-deployment.yaml b/tests/jupyter/jupyter-web-app/base/test_data/expected/apps_v1_deployment_jupyter-web-app-deployment.yaml index 9834a51f3c..9d2e6370af 100644 --- a/tests/jupyter/jupyter-web-app/base/test_data/expected/apps_v1_deployment_jupyter-web-app-deployment.yaml +++ b/tests/jupyter/jupyter-web-app/base/test_data/expected/apps_v1_deployment_jupyter-web-app-deployment.yaml @@ -47,5 +47,5 @@ spec: serviceAccountName: jupyter-web-app-service-account volumes: - configMap: - name: jupyter-web-app-config + name: jupyter-web-app-jupyter-web-app-config name: config-volume diff --git a/tests/jupyter/jupyter-web-app/base/test_data/expected/~g_v1_configmap_jupyter-web-app-config.yaml b/tests/jupyter/jupyter-web-app/base/test_data/expected/~g_v1_configmap_jupyter-web-app-jupyter-web-app-config.yaml similarity index 96% rename from tests/jupyter/jupyter-web-app/base/test_data/expected/~g_v1_configmap_jupyter-web-app-config.yaml rename to tests/jupyter/jupyter-web-app/base/test_data/expected/~g_v1_configmap_jupyter-web-app-jupyter-web-app-config.yaml index c031d4ba90..149d14e8d8 100644 --- a/tests/jupyter/jupyter-web-app/base/test_data/expected/~g_v1_configmap_jupyter-web-app-config.yaml +++ b/tests/jupyter/jupyter-web-app/base/test_data/expected/~g_v1_configmap_jupyter-web-app-jupyter-web-app-config.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - spawner_ui_config.yaml: | + spawner_ui_config.yaml: |- # Configuration file for the Jupyter UI. # # Each Jupyter UI option is configured by two keys: 'value' and 'readOnly' @@ -21,7 +21,7 @@ data: image: # The container Image for the user's Jupyter Notebook # If readonly, this value must be a member of the list below - value: gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v-base-ef41372-1177829795472347138 + value: gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 # The list of available standard container Images options: - gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 @@ -134,5 +134,5 @@ metadata: labels: app: jupyter-web-app kustomize.component: jupyter-web-app - name: jupyter-web-app-config + name: jupyter-web-app-jupyter-web-app-config namespace: kubeflow diff --git a/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_apps_v1_deployment_jupyter-web-app-deployment.yaml b/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_apps_v1_deployment_jupyter-web-app-deployment.yaml index 4ecf322504..c15abf7f18 100644 --- a/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_apps_v1_deployment_jupyter-web-app-deployment.yaml +++ b/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_apps_v1_deployment_jupyter-web-app-deployment.yaml @@ -65,5 +65,5 @@ spec: serviceAccountName: jupyter-web-app-service-account volumes: - configMap: - name: jupyter-web-app-config + name: jupyter-web-app-jupyter-web-app-config name: config-volume diff --git a/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_~g_v1_configmap_jupyter-web-app-config.yaml b/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_~g_v1_configmap_jupyter-web-app-jupyter-web-app-config.yaml similarity index 96% rename from tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_~g_v1_configmap_jupyter-web-app-config.yaml rename to tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_~g_v1_configmap_jupyter-web-app-jupyter-web-app-config.yaml index f8894119bf..acb21489d7 100644 --- a/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_~g_v1_configmap_jupyter-web-app-config.yaml +++ b/tests/jupyter/jupyter-web-app/overlays/application/test_data/expected/kubeflow_~g_v1_configmap_jupyter-web-app-jupyter-web-app-config.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - spawner_ui_config.yaml: | + spawner_ui_config.yaml: |- # Configuration file for the Jupyter UI. # # Each Jupyter UI option is configured by two keys: 'value' and 'readOnly' @@ -21,7 +21,7 @@ data: image: # The container Image for the user's Jupyter Notebook # If readonly, this value must be a member of the list below - value: gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v-base-ef41372-1177829795472347138 + value: gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 # The list of available standard container Images options: - gcr.io/kubeflow-images-public/tensorflow-1.15.2-notebook-cpu:1.0.0 @@ -140,5 +140,5 @@ metadata: app.kubernetes.io/part-of: kubeflow app.kubernetes.io/version: v0.7.0 kustomize.component: jupyter-web-app - name: jupyter-web-app-config + name: jupyter-web-app-jupyter-web-app-config namespace: kubeflow