diff --git a/jupyterhub/jupyterhub/base/jupyterhub-notebook-image-puller-rb.yaml b/jupyterhub/jupyterhub/base/jupyterhub-notebook-image-puller-rb.yaml index 62f236ee4..938cc74ab 100644 --- a/jupyterhub/jupyterhub/base/jupyterhub-notebook-image-puller-rb.yaml +++ b/jupyterhub/jupyterhub/base/jupyterhub-notebook-image-puller-rb.yaml @@ -3,6 +3,12 @@ apiVersion: rbac.authorization.k8s.io/v1 metadata: name: 'system:image-pullers' subjects: + # This group is always created by default when a new project is created but we have to explicitly include it to + # prevent image pull authorization denials when images are built from source in the JH server namespace + - kind: Group + apiGroup: rbac.authorization.k8s.io + name: 'system:serviceaccounts:$(namespace)' + # This will produce a dead group when notebook_destination is not specified - kind: Group apiGroup: rbac.authorization.k8s.io name: 'system:serviceaccounts:$(notebook_destination)' diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/README.md b/jupyterhub/notebook-images/overlays/cuda-11.0.3/README.md index 070fadfb7..fc86016e1 100644 --- a/jupyterhub/notebook-images/overlays/cuda-11.0.3/README.md +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/README.md @@ -1,24 +1,15 @@ # CUDA Build Chain -This overlay contains CUDA build chain to produce CUDA based images for TensorFlow, PyTorch, and Minimal jupyter notebooks. +This overlay contains CUDA build chain to produce CUDA 11.0.3 based images for TensorFlow, PyTorch, and Minimal jupyter notebooks. -## Version Details: +When this overlay is applied, the BuildConfigs and Imagestreams required for the build chain will be created by an OpenShift [job](./cuda-build-job.yaml). Once the BuildConfigs and ImageStreams are deployed, the Open Data Hub operator will no longer reconcile or re-deploy these objects unless the job and buildchain objects are manually deleted by the user. Any changes you make will persist until you manually delete all associated build chain objects and job. -``` -notebook = ">=6.0.2" -jupyterhub = ">=1.3" -jupyterlab = ">=3.0.0" - -TensorFlow: v2.4.1 -PyTorch: v1.8.0 - -CUDA: 11.0.3 -``` ## Build Details: -- [CUDA-ubi8-build-chain](./cuda-ubi8-build-chain.yaml): This yaml contains CUDA build chain which creates the base image which is used by the jupyter notebook images. +The CUDA build chain is stored in the cuda-build-chain [configMap](./cuda-buildchain.configmap.yaml). This configmap contains the yaml files for deploying the BuildConfigs and Imagestreams for the CUDA build chain and GPU notebooks. +- `cuda-ubi8-build-chain.yaml`: This yaml contains CUDA build chain which creates the base image which is used by the jupyter notebook images. -- [gpu-notebook](./gpu-notebook.yaml): This yaml contains CUDA build chain which creates the GPU supported jupyter notebook images like s2i-minimal-gpu-notebook, s2i-tensorflow-gpu-notebook, and s2i-pytorch-gpu-notebook. +- `gpu-notebook.yaml`: This yaml contains CUDA build chain which creates the GPU supported jupyter notebook images like s2i-minimal-gpu-notebook, s2i-tensorflow-gpu-notebook, and s2i-pytorch-gpu-notebook. ## Resource Requirements: @@ -26,15 +17,26 @@ CUDA: 11.0.3 ### Minimal GPU Notebook -The Minimal notebook requires atleast **3GB** of memory while build-time as the minimal notebook installs `jupyterhub`, `jupyterlab` and `jupyter notebook` packages along with the supported extension that requires this much amount of memory. +The Minimal notebook requires atleast **3GB** of memory while build-time as the minimal notebook installs `jupyterhub`, `jupyterlab` and `jupyter notebook` packages along with the supported extension that requires this much amount of memory. we have added **4GB** generously to avoid issues. ### TensorFlow GPU Notebook -The TensorFlow notebook requires atleast **6GB** of memory while build-time as the TensorFlow notebook installs `jupyterlab` and `jupyter notebook` supported extension and `jupyterlab build` requires this much amount of memory. +The TensorFlow notebook requires atleast **6GB** of memory while build-time as the TensorFlow notebook installs `jupyterlab` and `jupyter notebook` supported extension and `jupyterlab build` requires this much amount of memory. we have added **6GB** generously to avoid issues. ### PyTorch GPU Notebook -The PyTorch notebook requires atleast **6GB** of memory while build-time as the PyTorch notebook installs `jupyterlab` and `jupyter notebook` supported extension and `jupyterlab build` requires this much amount of memory. +The PyTorch notebook requires atleast **6GB** of memory while build-time as the PyTorch notebook installs `jupyterlab` and `jupyter notebook` supported extension and `jupyterlab build` requires this much amount of memory. we have added **6GB** generously to avoid issues. + +## Deleting CUDA build objects +All the job and all objects created by the job have the `cuda-version = 11.0.3` label applied. This label can be used to purge all of the CUDA objects so that the operator can restore the original CUDA build chain + +``` +oc delete build -l cuda-version=11.0.3 +oc delete bc -l cuda-version=11.0.3 +oc delete is -l cuda-version=11.0.3 +oc delete cm -l cuda-version=11.0.3 +oc delete job -l cuda-version=11.0.3 +``` diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-job.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-job.yaml new file mode 100644 index 000000000..0eccd4fcf --- /dev/null +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-job.yaml @@ -0,0 +1,51 @@ +apiVersion: batch/v1 +kind: Job +metadata: + annotations: + name: cuda-11-0-3-build + labels: + cuda-version: "$(cuda_version)" +spec: + backoffLimit: 2 + template: + spec: + containers: + - image: registry.redhat.io/openshift4/ose-cli:v4.7 + volumeMounts: + - name: cuda-ubi8-build-chain + mountPath: /tmp/ + + # work around unwriteable HOME dir / for unprivileged pods causing OC commands to be slow in pods + env: + - name: HOME + value: /tmp + - name: BUILD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: + metadata.namespace + + command: + - /bin/bash + - -c + - | + set -x + echo "PWD: $PWD" + oc create -n ${BUILD_NAMESPACE} -f /tmp/gpu-notebook.yaml + oc create -n ${BUILD_NAMESPACE} -f /tmp/cuda-ubi8-build-chain.yaml + imagePullPolicy: IfNotPresent + name: cuda-11-0-3-build + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: cuda-11.0.3-build-job + serviceAccountName: cuda-11.0.3-build-job + terminationGracePeriodSeconds: 30 + volumes: + - name: cuda-ubi8-build-chain + configMap: + name: cuda-build-chain + items: + - key: gpu-notebook.yaml + path: gpu-notebook.yaml + - key: cuda-ubi8-build-chain.yaml + path: cuda-ubi8-build-chain.yaml diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-role.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-role.yaml new file mode 100644 index 000000000..02f0f6d9a --- /dev/null +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-role.yaml @@ -0,0 +1,80 @@ +apiVersion: authorization.openshift.io/v1 +kind: Role +metadata: + labels: + app: cuda-11.0.3-build-job + name: cuda-11.0.3-build-job +rules: + - apiGroups: + - "" + - build.openshift.io + resources: + - builds + verbs: + - get + - list + - watch + - apiGroups: + - "" + - image.openshift.io + resources: + - imagestreams + verbs: + - create + - patch + - update + - get + - list + - watch + - apiGroups: + - "" + resources: + - configmaps + - secrets + - events + - persistentvolumeclaims + - pods + - services + - endpoints + verbs: + - get + - list + - watch + - apiGroups: + - "" + - template.openshift.io + resources: + - processedtemplates + - templateconfigs + - templateinstances + - templates + verbs: + - create + - delete + - deletecollection + - patch + - update + - apiGroups: + - "" + - template.openshift.io + resources: + - processedtemplates + - templateconfigs + - templateinstances + - templates + verbs: + - get + - list + - watch + - apiGroups: + - build.openshift.io + resources: + - builds + - buildconfigs + verbs: + - create + - patch + - update + - get + - list + - watch diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-rolebinding.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-rolebinding.yaml new file mode 100644 index 000000000..3de993611 --- /dev/null +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build-rolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cuda-11.0.3-build-job +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: cuda-11.0.3-build-job +subjects: + - kind: ServiceAccount + name: cuda-11.0.3-build-job + namespace: $(namespace) diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build.serviceaccount.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build.serviceaccount.yaml new file mode 100644 index 000000000..beb44b172 --- /dev/null +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-build.serviceaccount.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cuda-11.0.3-build-job diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-buildchain.configmap.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-buildchain.configmap.yaml new file mode 100644 index 000000000..87d7b6f72 --- /dev/null +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-buildchain.configmap.yaml @@ -0,0 +1,342 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: cuda-build-chain + labels: + cuda-version: "$(cuda_version)" +data: + cuda-ubi8-build-chain.yaml: | + apiVersion: v1 + items: + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: "nvidia-cuda-$(cuda_version)" + labels: + cuda-version: "$(cuda_version)" + spec: + lookupPolicy: + local: true + tags: + - name: latest + from: + kind: DockerImage + name: "nvcr.io/nvidia/cuda:$(cuda_version)-cudnn8-devel-ubi8" + importPolicy: {} + referencePolicy: + type: Local + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-core-ubi8" + labels: + cuda-version: "$(cuda_version)" + spec: + lookupPolicy: + local: true + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-base-ubi8" + labels: + cuda-version: "$(cuda_version)" + spec: + lookupPolicy: + local: true + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-py38-ubi8" + labels: + cuda-version: "$(cuda_version)" + spec: + lookupPolicy: + local: true + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-thoth-ubi8-py38" + labels: + cuda-version: "$(cuda_version)" + spec: + lookupPolicy: + local: true + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-core-ubi8" + labels: + cuda-version: "$(cuda_version)" + spec: + triggers: + - imageChange: {} + type: ImageChange + source: + type: Git + git: + uri: "https://github.com/sclorg/s2i-base-container" + ref: "d777ab3" + contextDir: "core/" + strategy: + type: Docker + dockerStrategy: + noCache: true + dockerfilePath: "Dockerfile.rhel8" + from: + kind: ImageStreamTag + name: nvidia-cuda-$(cuda_version):latest + output: + to: + kind: ImageStreamTag + name: $(cuda_version)-cuda-s2i-core-ubi8:latest + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-base-ubi8" + labels: + cuda-version: "$(cuda_version)" + spec: + triggers: + - imageChange: {} + type: ImageChange + source: + type: Git + git: + uri: "https://github.com/sclorg/s2i-base-container" + ref: "d777ab3" + contextDir: "base/" + strategy: + type: Docker + dockerStrategy: + noCache: true + dockerfilePath: "Dockerfile.rhel8" + from: + kind: ImageStreamTag + name: $(cuda_version)-cuda-s2i-core-ubi8:latest + output: + to: + kind: ImageStreamTag + name: $(cuda_version)-cuda-s2i-base-ubi8:latest + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-py38-ubi8" + labels: + cuda-version: "$(cuda_version)" + spec: + triggers: + - imageChange: {} + type: ImageChange + source: + type: Git + git: + uri: "https://github.com/sclorg/s2i-python-container" + ref: "4d85c35" + contextDir: "3.8/" + strategy: + type: Docker + dockerStrategy: + noCache: true + dockerfilePath: "Dockerfile.rhel8" + from: + kind: ImageStreamTag + name: $(cuda_version)-cuda-s2i-base-ubi8:latest + output: + to: + kind: ImageStreamTag + name: $(cuda_version)-cuda-s2i-py38-ubi8:latest + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: "$(cuda_version)-cuda-s2i-thoth-ubi8-py38" + labels: + cuda-version: "$(cuda_version)" + spec: + triggers: + - imageChange: {} + type: ImageChange + source: + type: Git + git: + uri: "https://github.com/thoth-station/s2i-thoth" + ref: "v0.28.0" + contextDir: "ubi8-py38/" + strategy: + type: Docker + dockerStrategy: + noCache: true + dockerfilePath: "Dockerfile" + from: + kind: ImageStreamTag + name: "$(cuda_version)-cuda-s2i-py38-ubi8:latest" + output: + to: + kind: ImageStreamTag + name: "$(cuda_version)-cuda-s2i-thoth-ubi8-py38:latest" + kind: List + metadata: {} + gpu-notebook.yaml: | + apiVersion: v1 + kind: List + items: + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + labels: + cuda-version: "$(cuda_version)" + component.opendatahub.io/name: jupyterhub + opendatahub.io/component: 'true' + opendatahub.io/notebook-image: 'true' + annotations: + opendatahub.io/notebook-image-url: "https://github.com/thoth-station/s2i-minimal-notebook" + opendatahub.io/notebook-image-name: "CUDA" + opendatahub.io/notebook-image-desc: "Jupyter notebook image with GPU support and minimal dependency set to start experimenting with Jupyter environment." + name: "minimal-gpu" + spec: + lookupPolicy: + local: true + tags: + - annotations: + opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.8.6"},{"name":"CUDA","version":"11.0.3"}]' + opendatahub.io/notebook-python-dependencies: '[{"name":"JupyterLab","version":"3.0.14"},{"name":"Notebook","version":"6.3.0"}]' + name: "py3.8-cuda-11.0.3" + referencePolicy: + type: Local + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + labels: + cuda-version: "$(cuda_version)" + component.opendatahub.io/name: jupyterhub + opendatahub.io/component: 'true' + opendatahub.io/notebook-image: 'true' + annotations: + opendatahub.io/notebook-image-url: "https://github.com/thoth-station/s2i-tensorflow-gpu-notebook" + opendatahub.io/notebook-image-name: "TensorFlow" + opendatahub.io/notebook-image-desc: "Jupyter notebook image with GPU support and includes TensorFlow libraries and dependencies to start experimenting with advanced AI/ML notebooks." + name: "tensorflow-gpu" + spec: + lookupPolicy: + local: true + tags: + - annotations: + opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.8.6"},{"name":"TensorFlow","version":"==2.4.1"},{"name":"CUDA","version":"11.0.3"}]' + opendatahub.io/notebook-python-dependencies: '[{"name":"TensorFlow","version":"==2.4.1"},{"name":"Tensorboard","version":"2.4.1"},{"name":"Boto3","version":"1.17.11"},{"name":"Kafka-Python","version":"2.0.2"},{"name":"Matplotlib","version":"3.1.3"},{"name":"Numpy","version":"1.19.5"},{"name":"Pandas","version":"0.25.3"},{"name":"Scipy","version":"1.6.2"}]' + name: "py3.8-cuda-11.0.3" + referencePolicy: + type: Local + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + labels: + cuda-version: "$(cuda_version)" + component.opendatahub.io/name: jupyterhub + opendatahub.io/component: 'true' + opendatahub.io/notebook-image: 'true' + annotations: + opendatahub.io/notebook-image-url: "https://github.com/thoth-station/s2i-pytorch-notebook" + opendatahub.io/notebook-image-name: "PyTorch" + opendatahub.io/notebook-image-desc: "Jupyter notebook image with GPU support and includes PyTorch libraries and dependencies to start experimenting with advanced AI/ML notebooks." + name: "pytorch-gpu" + spec: + lookupPolicy: + local: true + tags: + - annotations: + opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.8.6"},{"name":"PyTorch","version":"==1.8.1"},{"name":"CUDA","version":"11.0.3"}]' + opendatahub.io/notebook-python-dependencies: '[{"name":"PyTorch","version":"==1.8.1"},{"name":"Tensorboard","version":"1.15.0"},{"name":"Boto3","version":"1.17.11"},{"name":"Kafka-Python","version":"2.0.2"},{"name":"Matplotlib","version":"3.4.1"},{"name":"Numpy","version":"1.20.2"},{"name":"Pandas","version":"1.2.3"},{"name":"Scipy","version":"1.6.2"}]' + name: "py3.8-cuda-11.0.3" + referencePolicy: + type: Local + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: s2i-minimal-gpu-cuda-$(cuda_version)-notebook + labels: + cuda-version: "$(cuda_version)" + spec: + output: + to: + kind: ImageStreamTag + name: 'minimal-gpu:py3.8-cuda-$(cuda_version)' + strategy: + type: Docker + dockerStrategy: + from: + kind: ImageStreamTag + name: '$(cuda_version)-cuda-s2i-thoth-ubi8-py38:latest' + noCache: true + dockerfilePath: Dockerfile + source: + type: Git + git: + ref: python38 + uri: 'https://github.com/thoth-station/s2i-minimal-notebook' + triggers: + - type: ConfigChange + - type: ImageChange + resources: + limits: + memory: 4Gi + requests: + memory: 4Gi + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: s2i-tensorflow-gpu-cuda-$(cuda_version)-notebook + labels: + cuda-version: "$(cuda_version)" + spec: + output: + to: + kind: ImageStreamTag + name: 'tensorflow-gpu:py3.8-cuda-$(cuda_version)' + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + name: 'minimal-gpu:py3.8-cuda-$(cuda_version)' + source: + type: Git + git: + ref: python38 + uri: 'https://github.com/thoth-station/s2i-tensorflow-gpu-notebook' + triggers: + - type: ConfigChange + - type: ImageChange + resources: + limits: + memory: 8Gi + requests: + memory: 6Gi + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: s2i-pytorch-gpu-cuda-$(cuda_version)-notebook + labels: + cuda-version: "$(cuda_version)" + spec: + output: + to: + kind: ImageStreamTag + name: 'pytorch-gpu:py3.8-cuda-$(cuda_version)' + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + name: 'minimal-gpu:py3.8-cuda-$(cuda_version)' + source: + type: Git + git: + ref: python38 + uri: 'https://github.com/thoth-station/s2i-pytorch-notebook' + triggers: + - type: ConfigChange + - type: ImageChange + resources: + limits: + memory: 8Gi + requests: + memory: 6Gi diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-ubi8-build-chain.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-ubi8-build-chain.yaml deleted file mode 100644 index f907cf006..000000000 --- a/jupyterhub/notebook-images/overlays/cuda-11.0.3/cuda-ubi8-build-chain.yaml +++ /dev/null @@ -1,151 +0,0 @@ -apiVersion: v1 -items: -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: "nvidia-cuda-$(cuda_version)" - spec: - lookupPolicy: - local: true - tags: - - name: latest - from: - kind: DockerImage - name: "nvcr.io/nvidia/cuda:$(cuda_version)-cudnn8-devel-ubi8" - importPolicy: {} - referencePolicy: - type: Local -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-core-ubi8" - spec: - lookupPolicy: - local: true -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-base-ubi8" - spec: - lookupPolicy: - local: true -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-py38-ubi8" - spec: - lookupPolicy: - local: true -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-thoth-ubi8-py38" - spec: - lookupPolicy: - local: true -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-core-ubi8" - spec: - triggers: - - imageChange: {} - type: ImageChange - source: - type: Git - git: - uri: "https://github.com/sclorg/s2i-base-container" - ref: "d777ab3" - contextDir: "core/" - strategy: - type: Docker - dockerStrategy: - noCache: true - dockerfilePath: "Dockerfile.rhel8" - from: - kind: ImageStreamTag - name: nvidia-cuda-$(cuda_version):latest - output: - to: - kind: ImageStreamTag - name: $(cuda_version)-cuda-s2i-core-ubi8:latest -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-base-ubi8" - spec: - triggers: - - imageChange: {} - type: ImageChange - source: - type: Git - git: - uri: "https://github.com/sclorg/s2i-base-container" - ref: "d777ab3" - contextDir: "base/" - strategy: - type: Docker - dockerStrategy: - noCache: true - dockerfilePath: "Dockerfile.rhel8" - from: - kind: ImageStreamTag - name: $(cuda_version)-cuda-s2i-core-ubi8:latest - output: - to: - kind: ImageStreamTag - name: $(cuda_version)-cuda-s2i-base-ubi8:latest -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-py38-ubi8" - spec: - triggers: - - imageChange: {} - type: ImageChange - source: - type: Git - git: - uri: "https://github.com/sclorg/s2i-python-container" - ref: "4d85c35" - contextDir: "3.8/" - strategy: - type: Docker - dockerStrategy: - noCache: true - dockerfilePath: "Dockerfile.rhel8" - from: - kind: ImageStreamTag - name: $(cuda_version)-cuda-s2i-base-ubi8:latest - output: - to: - kind: ImageStreamTag - name: $(cuda_version)-cuda-s2i-py38-ubi8:latest -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: "$(cuda_version)-cuda-s2i-thoth-ubi8-py38" - spec: - triggers: - - imageChange: {} - type: ImageChange - source: - type: Git - git: - uri: "https://github.com/thoth-station/s2i-thoth" - ref: "v0.28.0" - contextDir: "ubi8-py38/" - strategy: - type: Docker - dockerStrategy: - noCache: true - dockerfilePath: "Dockerfile" - from: - kind: ImageStreamTag - name: "$(cuda_version)-cuda-s2i-py38-ubi8:latest" - output: - to: - kind: ImageStreamTag - name: "$(cuda_version)-cuda-s2i-thoth-ubi8-py38:latest" -kind: List -metadata: {} diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/gpu-notebook.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/gpu-notebook.yaml deleted file mode 100644 index e8ff8ee36..000000000 --- a/jupyterhub/notebook-images/overlays/cuda-11.0.3/gpu-notebook.yaml +++ /dev/null @@ -1,155 +0,0 @@ -apiVersion: v1 -kind: List -items: -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - labels: - component.opendatahub.io/name: jupyterhub - opendatahub.io/component: 'true' - opendatahub.io/notebook-image: 'true' - annotations: - opendatahub.io/notebook-image-url: "https://github.com/thoth-station/s2i-minimal-notebook" - opendatahub.io/notebook-image-name: "CUDA" - opendatahub.io/notebook-image-desc: "Jupyter notebook image with GPU support and minimal dependency set to start experimenting with Jupyter environment." - name: "minimal-gpu" - spec: - lookupPolicy: - local: true - tags: - - annotations: - opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.8.6"},{"name":"CUDA","version":"11.0.3"}]' - opendatahub.io/notebook-python-dependencies: '[{"name":"JupyterLab","version":"3.0.14"},{"name":"Notebook","version":"6.3.0"}]' - name: "py3.8-cuda-11.0.3" - referencePolicy: - type: Local -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - labels: - component.opendatahub.io/name: jupyterhub - opendatahub.io/component: 'true' - opendatahub.io/notebook-image: 'true' - annotations: - opendatahub.io/notebook-image-url: "https://github.com/thoth-station/s2i-tensorflow-gpu-notebook" - opendatahub.io/notebook-image-name: "TensorFlow" - opendatahub.io/notebook-image-desc: "Jupyter notebook image with GPU support and includes TensorFlow libraries and dependencies to start experimenting with advanced AI/ML notebooks." - name: "tensorflow-gpu" - spec: - lookupPolicy: - local: true - tags: - - annotations: - opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.8.6"},{"name":"TensorFlow","version":"==2.4.1"},{"name":"CUDA","version":"11.0.3"}]' - opendatahub.io/notebook-python-dependencies: '[{"name":"TensorFlow","version":"==2.4.1"},{"name":"Tensorboard","version":"2.4.1"},{"name":"Boto3","version":"1.17.11"},{"name":"Kafka-Python","version":"2.0.2"},{"name":"Matplotlib","version":"3.1.3"},{"name":"Numpy","version":"1.19.5"},{"name":"Pandas","version":"0.25.3"},{"name":"Scipy","version":"1.6.2"}]' - name: "py3.8-cuda-11.0.3" - referencePolicy: - type: Local -- kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - labels: - component.opendatahub.io/name: jupyterhub - opendatahub.io/component: 'true' - opendatahub.io/notebook-image: 'true' - annotations: - opendatahub.io/notebook-image-url: "https://github.com/thoth-station/s2i-pytorch-notebook" - opendatahub.io/notebook-image-name: "PyTorch" - opendatahub.io/notebook-image-desc: "Jupyter notebook image with GPU support and includes PyTorch libraries and dependencies to start experimenting with advanced AI/ML notebooks." - name: "pytorch-gpu" - spec: - lookupPolicy: - local: true - tags: - - annotations: - opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.8.6"},{"name":"PyTorch","version":"==1.8.1"},{"name":"CUDA","version":"11.0.3"}]' - opendatahub.io/notebook-python-dependencies: '[{"name":"PyTorch","version":"==1.8.1"},{"name":"Tensorboard","version":"1.15.0"},{"name":"Boto3","version":"1.17.11"},{"name":"Kafka-Python","version":"2.0.2"},{"name":"Matplotlib","version":"3.4.1"},{"name":"Numpy","version":"1.20.2"},{"name":"Pandas","version":"1.2.3"},{"name":"Scipy","version":"1.6.2"}]' - name: "py3.8-cuda-11.0.3" - referencePolicy: - type: Local -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: s2i-minimal-gpu-cuda-$(cuda_version)-notebook - spec: - output: - to: - kind: ImageStreamTag - name: 'minimal-gpu:py3.8-cuda-$(cuda_version)' - strategy: - type: Docker - dockerStrategy: - from: - kind: ImageStreamTag - name: '$(cuda_version)-cuda-s2i-thoth-ubi8-py38:latest' - noCache: true - dockerfilePath: Dockerfile - source: - type: Git - git: - ref: python38 - uri: 'https://github.com/thoth-station/s2i-minimal-notebook' - triggers: - - type: ConfigChange - - type: ImageChange - resources: - limits: - memory: 4Gi - requests: - memory: 4Gi -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: s2i-tensorflow-gpu-cuda-$(cuda_version)-notebook - spec: - output: - to: - kind: ImageStreamTag - name: 'tensorflow-gpu:py3.8-cuda-$(cuda_version)' - strategy: - type: Source - sourceStrategy: - from: - kind: ImageStreamTag - name: 'minimal-gpu:py3.8-cuda-$(cuda_version)' - source: - type: Git - git: - ref: python38 - uri: 'https://github.com/thoth-station/s2i-tensorflow-gpu-notebook' - triggers: - - type: ConfigChange - - type: ImageChange - resources: - limits: - memory: 8Gi - requests: - memory: 6Gi -- kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: s2i-pytorch-gpu-cuda-$(cuda_version)-notebook - spec: - output: - to: - kind: ImageStreamTag - name: 'pytorch-gpu:py3.8-cuda-$(cuda_version)' - strategy: - type: Source - sourceStrategy: - from: - kind: ImageStreamTag - name: 'minimal-gpu:py3.8-cuda-$(cuda_version)' - source: - type: Git - git: - ref: python38 - uri: 'https://github.com/thoth-station/s2i-pytorch-notebook' - triggers: - - type: ConfigChange - - type: ImageChange - resources: - limits: - memory: 8Gi - requests: - memory: 6Gi diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/kustomization.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/kustomization.yaml index 1dee9efa5..9a60646d0 100644 --- a/jupyterhub/notebook-images/overlays/cuda-11.0.3/kustomization.yaml +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/kustomization.yaml @@ -1,24 +1,33 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization bases: -- ../../base + - ../../base resources: -- cuda-ubi8-build-chain.yaml -- gpu-notebook.yaml - + - cuda-build.serviceaccount.yaml + - cuda-build-role.yaml + - cuda-build-rolebinding.yaml + - cuda-buildchain.configmap.yaml + - cuda-build-job.yaml configMapGenerator: -- name: parameters - env: params.env + - env: params.env + name: parameters generatorOptions: disableNameSuffixHash: true vars: -- name: cuda_version - objref: - kind: ConfigMap - name: parameters - apiVersion: v1 - fieldref: - fieldpath: data.cuda_version + - name: namespace + objref: + kind: ConfigMap + name: parameters + apiVersion: v1 + fieldref: + fieldpath: metadata.namespace + - name: cuda_version + objref: + kind: ConfigMap + name: parameters + apiVersion: v1 + fieldref: + fieldpath: data.cuda_version configurations: -- params.yaml + - params.yaml diff --git a/jupyterhub/notebook-images/overlays/cuda-11.0.3/params.yaml b/jupyterhub/notebook-images/overlays/cuda-11.0.3/params.yaml index 054b07bd7..8b0bfce80 100644 --- a/jupyterhub/notebook-images/overlays/cuda-11.0.3/params.yaml +++ b/jupyterhub/notebook-images/overlays/cuda-11.0.3/params.yaml @@ -7,7 +7,8 @@ varReference: kind: ImageStream - path: spec/tags/from/name kind: ImageStream - +- path: data + kind: ConfigMap - path: metadata/labels/* kind: BuildConfig - path: metadata/name @@ -20,3 +21,5 @@ varReference: kind: BuildConfig - path: spec/strategy/sourceStrategy/from/name kind: BuildConfig +- path: subjects/namespace + kind: RoleBinding diff --git a/kfdef/kfctl_openshift.yaml b/kfdef/kfctl_openshift.yaml index 8e95756bb..66d334db2 100644 --- a/kfdef/kfctl_openshift.yaml +++ b/kfdef/kfctl_openshift.yaml @@ -68,7 +68,7 @@ spec: name: jupyterhub - kustomizeConfig: overlays: - #- cuda + #- cuda-11.0.3 - additional repoRef: name: manifests