Hi. In this video we will learn what are the options to share our notebooks.
We covered already some of them and some of them are obvious,
but let's list them first.
For options is sharing just the output without the possibility of executing
code. We can share the notebook via a GitHub repository.
When you open a notebook from GitHub, we can see its output,
but it is not rendering, uh, Plotly charts,
table of contents or Jupyter Widgets.
Let us open this one.
We can see the code, we can see the data frames
mark down latex as well,
but the plotly chart is missing.
Then we can share our notebooks in the form of the exported files like H T
M L or P D F and so on.
We can make them available as Val dashboards, uh,
deployed on a server.
Then we can share our notebook via n b Weaver. We can try it now,
uh, but it is not rendering table of contents, uh,
but plotly charts are fine. We
just copy the link of our notebook in the GitHub and paste it to the n b
weaver
and the portal charts are generated nicely.
Next options cover the execution of the notebook as well. Uh,
not only the outputs,
we can provide the notebook by itself or in arpo with exported conda or
PEEP environment.
So the user will use it on his own Jupyter Server where he
recreates the environment and runs the notebook. Here,
the system level dependencies might cause issues.
Then we can, uh, use, uh, Docker image to handle the environment rules. Uh,
GitHub repo with this Docker solves the system level dependencies.
Basically. Then we can use Bender.
Bender builds the Docker image by itself from a GitHub repository.
One thing what is needed is a text file like yaml, uh,
for installing the dependencies. Uh, we can try. Now,
I have already prepared the repository,
which has our notebook configuration, YAML for the notebook,
our data files and environment YAML file.
This is the file which uses vendor to create the environment with our Python
packages and its versions.
I have created this requirements file with this command conduct and export to
environment ofl.
Now, we just copied the link and paste it binder
and click launch.
Then the image will be built. We can see the logs here, and after that,
uh, the container will be launched. In our case, it'll be around 10 minutes.
Uh, you can access the container via the same link,
which you will paste into the middle website.
The containers are after some time destroyed,
but next time if you pass the same link, the image creation tab will be skipped,
so it'll be much faster.
One thing I would like to mention, uh,
that I replaced the R P Y two package, uh,
from PIP to conduct. A reason for this was that during the building,
the image being there showed me an error, probably because of our installation.
And this helped.
And when you will try this by yourself. Uh,
check the Anaconda base environment, uh, this package version,
add it to the conduct dependencies and remove, uh,
the R p I two package from the PIP dependencies.
Okay, our,
our container has started and now we are redirected to our Jupiter lab.
We can try, if everything works.
It seems good.
Now the execution of this R cell will take some time because, uh,
it has to install the Gigi Pro two package
maybe around five to 10 minutes.
But after that, the execution of the notebook, uh, should, uh, go perfectly.
We did a lot of things in this module. I hope you enjoyed it.
And to summarize it, we learned how to work with the notebook,
how to execute code cells, how to debug code.
We learned how to work with the kernel,
how to execute R and Python code in one notebook.
We learned also how to execute and export the notebook in various ways from the
UI terminal and Python. We created new Anaconda environment.
We learned how to turn the notebook into a dashboard with voa.
We played a little bit with the interactive widgets.
We also learned how to parameterize the notebook and how to share our notebooks.
And in addition to the Jupyter Knowhow,
we also learned the basics of linear regression.
We have touched also libraries like Pandas Stick, learn, t, and plotly.
In our next video,
we will start our new module focused on Jupiter Lab.