Deploying NVIDIA AI Enterprise Containers#
Create a Image Pull secret with your NGC key
oc create secret docker-registry regcred --docker-server=nvcr.io/nvaie --docker-username=\$oauthtoken --docker-password=<YOUR_NGC_KEY> --docker-email=<your_email_id> -n default
Apply the custom yaml files accessing NVAIE Jupyter notebooks
In this example a TensorFlow container is leveraged to launch a Jupyter notebook. Create a new yaml file with contents below called
tensorflow.yaml
Warning
Where
<NVAIE-MAJOR-VERSION>:<NVAIE-CONTAINER-TAG>
fill the version and tag. Example:2-3:22.09-tf2-nvaie-2.3-py3
1apiVersion: apps/v1 2kind: Deployment 3metadata: 4name: tensorflow-jupyter-notebook 5labels: 6 app: tensorflow-jupyter-notebook 7spec: 8replicas: 1 9selector: 10 matchLabels: 11 app: tensorflow-jupyter-notebook 12template: 13 metadata: 14 labels: 15 app: tensorflow-jupyter-notebook 16 spec: 17 containers: 18 - name: tensorflow-container 19 image: nvcr.io/nvaie/tensorflow-<NVAIE-MAJOR-VERSION>:<NVAIE-CONTAINER-TAG> 20 ports: 21 - containerPort: 8888 22 command: ["jupyter-notebook"] 23 args: ["--NotebookApp.token=''"] 24 resources: 25 requests: 26 nvidia.com/gpu: 1 27 limits: 28 nvidia.com/gpu: 1 29 imagePullSecrets: 30 - name: regcred 31--- 32kind: Service 33apiVersion: v1 34metadata: 35name: tensorflow-jupyter-notebook 36spec: 37type: NodePort 38selector: 39 app: tensorflow-jupyter-notebook 40ports: 41- protocol: TCP 42 nodePort: 30040 43 port: 8888 44 targetPort: 8888
Warning
Leverage routes in instead of Node Port for production deployments. Leverage the Red Hat Route Configuration document for route creation.
Run the command below to apply the yaml file.
oc apply -f tensorflow.yaml
Access the Jupyter notebook
Once the pod is started describe it with the following:
oc describe pod tensorflow-jupyter-notebook-6c87cb86f7-9hvpm
Note the FQDN or IP of the node it is running on and construct the URL for accessing the notebook.
http://<NODE_FQDN_OR_IP>:30040
Note
Additional information for launching Jupyter Notebooks with OpenShift can be found in the Using Jupyter Project Images blog. Additional examples can be found in the Jupyter-Stack OpenShift Exampels Gitlab page.