In this second post in my CloudFoundryFun series, I show you how to leverage Cloud Foundry to forge a new learning environment.
Forging a new learning environment with Jupyter Notebook
The top dog of all interactive learning platforms is by far the Jupyter project. This project has become the de-facto standard learning environment for data scientist around the world. This popularity originates from its close linkage to the languages Python and R.
Btw: did you know what Jupyter stands for “Julia, Python, and R”?
The rising popularity is also reflected by the number of .ipynb files (interactive python notebook - the file format of Jupyter Notebooks) on GitHub.
The rising popularity of Python Notebook on Github (Source)
Notebooks are the core of each Jupyter project and the origin of its simplicity. The code contained in them can be partitioned in small code snippets. The special feature is that those snippets can be enriched with explanations written in Markdown, a lightweight markup language. Beginners can execute the pre-defined snippets section by section. Each section is self-explanatory and thus, generates a unique learning environment.
An example of a Jupyter notebook with explanations and code next to each other
In this post we will run Jupyter Notebooks ON Cloud Foundry, thereby our notebooks will have access to Cloud Foundry services. This way, we can learn how to use Cloud Foundry services using Jupyter Notebook, running on Cloud Foundry.
Bundling the Learning Environment
It might be worth bundling the Notebook app with your training content like notebooks and possibly required datasets. The bundling can be done using with a new Docker image. This Dockerfile shows how new content can be added to an existing image:
RUN rm -d work
RUN mkdir Lesson_1
COPY Lesson_1 ./Lesson_1
Access the Notebook
You’ll notice that you need a token to access the notebook. You can find it in the logs of your application.
Read the logs
cf logs juypter-notebook –recent
Copy and paste the token into the corresponding field.
Login to service
Open the notebook in the folder “Lesson_1” (if you added data to your own docker image)
Have fun learning!
Disclaimer: I recommend using Jupyter Notebooks on Cloud Foundry only for educational purposes. The application itself runs on hardware that wasn’t designed for compute intense tasks (as machine learning is one).
In this edition you have learned:
What Jupyter Notebooks are and where they come from
How Docker images can be enriched with additional files
How to publish your own Docker images to Dockerhub
How to deploy Docker images along with cloud services to SAP Cloud Platform Cloud Foundry
How to read the log files of your Cloud Foundry apps
Would you like to learn more about the detailed steps (with actual training content) in a tutorial in our Developer Center? Let me know in the comments!
About this series
This was the second blog post of my monthly new series #CloudFoundryFun. The name already says all there is to it, this series won’t be about building enterprise apps on Cloud Foundry. I think there are already plenty of great posts about those aspects out there. This series rather thinks outside the box and demonstrates unconventional Cloud Foundry use-cases. And sometimes it might be pure entertainment ?.