(For a tutorial on running Python in batch mode click here)
Getting started with Jupyter Notebooks in Galileo
Getting started with Jupyter in Galileo
The downloaded file consists of a .ipynb file and a .csv file. We will run this folder in Galileo, first, and then take a look at what’s happening behind the scenes.
Let’s have a look at our files
The jupyter_example.ipynb conducts some exploratory data analysis and visualizes the decision boundaries of various machine learning algorithms using the supplied iris.csv data set. It also demonstrates how to use data sets loaded from an online source or from a library.
Understanding the user interface
When you log into Galileo, the first thing you’ll see is your Dashboard:
To run the Jupyter_example.ipynb file, we will make use of the Missions feature. Within the Missions tab, there is an option to create a custom mission.
When creating a custom mission, you can specify the mission’s environment and name. Choose “Jupyter Notebook (Beta)” and enter a mission name.
Additionally, you will need to add any dependencies to the mission environment. There is a list of commonly-used dependencies to choose from and it is also possible to specify dependencies manually:
With the mission created, there are a few more steps required before using the Jupyter notebook environment. From the Missions tab, find the mission you just created and click the “Update Mission” option. You will be presented with the following interface:
Navigate to the “Mission Settings” tab. You will see the following:
There are three settings we need to specify in order to access the notebook. First, select a default station for the mission (“Linux” is a good choice). Next, enable tunneling by turning the “Enable Tunnel” switch on. Finally, enter the tunnel port as “8888”. With these settings, we are ready to launch a job in the Jupyter mission we created.
Launch a job by clicking the “Run” button in the upper right corner of the interface. Navigate to the “Jobs & Results” tab. After the job has entered the queue and the Docker container has been built, click on the “Job In Progress” message. There you will see the following information:
Accessing Jupyter using Galileo
To access Jupyter, click on the Tunnel Url. This will open a new tab in your browser, showing a Jupyter logo and a request for an authentication token. Retrieve this token from the standard logs of the job, indicated in the “Job & Results” tab interface with this icon:
Clicking this icon will show something similar to this:
The token is found on the third line from the bottom, after “token=”. Copy the token and enter it in the field next to the “Log in” button in the upper right corner of the Jupyter tab, as seen below:
Click “Log in”. This will show the familiar Jupyter interface, you can upload jupyter_example.ipynb and iris.csv files to continue the tutorial or upload your own custom files.
Once both files are uploaded, click on jupyter_example.ipynb to open the notebook. The notebook demonstrates how using Jupyter in Galileo is just like using Jupyter on a local machine, with the ability to use data from any uploaded files, online sources, or dependencies.
When you are finished with the Jupyter session, close the notebook tab in your browser, and hit the “Quit” button in the upper right corner of the Jupyter Home Page interface.
You can now close that tab and return to the Galileo tab. You will see that the example job has completed:
To download the results of any calculations made in Jupyter, hit the download button under Action to download the results:
The results folder will be downloaded as a .zip that contains an output.log file and a folder called results containing a subfolder called work where plots and other files that were created by the analysis are stored.