If you prefer, you can include the Teradata SQL kernel and extensions into an existing image you are currently using.
Note
Downloading from downloads.teradata.com requires an authenticated Teradata customer account. Contact your Teradata representative if you do not have one.
- Go to Teradata Modules for Jupyter page to download the zipped Teradata Jupyter extensions package bundle. Assuming your existing docker image is Linux based, you will want to use the Linux version of the download. Otherwise, download for the platform you are using. The
.zipfile contains the Teradata SQL Kernel, extensions and sample notebooks. - Unzip the bundle file to your working directory.
-
Below is an example Dockerfile to add Teradata Jupyter extensions to your existing Docker image. Use the Dockerfile to build a new Docker image, push the image to a designated registry, modify override file as shown above to use the new image as singleuser image, apply the changes to the cluster:
FROM REGISTRY_URL/your-existing-image:tag ENV NB_USER=jovyan \ HOME=/home/jovyan \ EXT_DIR=/opt/teradata/jupyterext/packages USER root ############################################################## # Install kernel and copy supporting files ############################################################## # Copy the kernel COPY ./teradatakernel /usr/local/bin RUN chmod 755 /usr/local/bin/teradatakernel # Copy directory with kernel.json file into image COPY ./teradatasql teradatasql/ ############################################################## # Switch to user jovyan to copy the notebooks and license files. ############################################################## USER $NB_USER # Copy notebooks COPY ./notebooks/ /tmp/JupyterLabRoot/TeradataSampleNotebooks/ # Copy license files COPY ./ThirdPartyLicenses /tmp/JupyterLabRoot/ThirdPartyLicenses/ USER root # Install the kernel file to /opt/conda jupyter lab instance RUN jupyter kernelspec install ./teradatasql --prefix=/opt/conda ############################################################## # Install Teradata extensions ############################################################## COPY ./teradata_*.tgz $EXT_DIR WORKDIR $EXT_DIR # TODO: replace the lines below with the current pip-based installation # commands from https://teradata.github.io/jupyterextensions # The jupyter labextension install approach below is deprecated in # JupyterLab 3+ and will fail without Node.js. See report.md Issue #3. RUN jupyter labextension install --no-build teradata_database* && \ jupyter labextension install --no-build teradata_resultset* && \ jupyter labextension install --no-build teradata_sqlhighlighter* && \ jupyter labextension install --no-build teradata_connection_manager* && \ jupyter labextension install --no-build teradata_preferences* && \ jupyter lab build --dev-build=False --minimize=False && \ rm -rf * WORKDIR $HOME # Give back ownership of /opt/conda to jovyan RUN chown -R jovyan:users /opt/conda # Jupyter will create .local directory RUN rm -rf $HOME/.local -
You can optionally install Teradata package for Python and Teradata package for R. See the following pages for details: