Jupyter Notebook FAQ
Hello! This is a basic FAQ for Jupyter notebooks in YT.
What is a Jupyter notebook in YT?
This is a custom interface and compute environment for the Jupyter server, with additional features that allow you to easily interact with the YT cluster.
Useful notebook examples:
- Notebook with various cells - This demo shows you different kinds of cell outputs that we currently support.
- Notebook with Python client for YTsaurus - This demo shows how you can interact with the cluster via notebook cells.
How to create notebook
You can create a new notebook via navigation.
- Click on "Create object"
- Click on "Notebook"
- Choose the notebook path and click "Confim"
Done! New notebook is ready.
How to create YT kernel
In YT, the jupyter cells are running on special compute resources, we name them Kernels. If you want to run a cell you need to create one for yourself.
You can do that:
- On the notebook page, click the "Create kernel" button.
- On kernels list page.
How to run notebook cell
You can run notebook cell in different ways:
- Via the "Run" button on the cell
- Via shift+enter shortcut
- Via ctrl+ enter shortcut
- Via the "Run all" button in the toolbar
How-to add a secret to YT kernel
Sometimes you need to pass a secret to your notebook cell. We suggest you store your secrets in YT kernel, a notebook cell will get access to all YT kernel secrets.
How-to get access to a YT kernel secret in notebook
Let's say that you added a secret with the name SOME_SECRET to your kernel.
In that case, you will get the next env variables in your jupyter cell:
YT_SECURE_VAULT={"SOME_SECRET"="secret value is here";}YT_SECURE_VAULT_SOME_SECRET=secret value is here
Important note:
Do not log your secrets in your jupyter cell. If you do so, your secrets will be saved in a notebook and anyone with access to your notebook can read them.
We do log these env variables in the video below just for demonstration.