Welcome, Guest Login

Enterprise Support

Interacting with Web Applications in Notebook Sessions

Last Updated: Aug 10, 2018 12:56PM CDT
Version: 5.2.0

Overview

This article describes how to use Anaconda Enterprise to interact with and develop web applications from within a notebook session. This approach can be used to evaluate real-time accuracy metrics when training models, monitor the progress of parallel computing tasks via dashboards, or interactively develop web applications.

In previous versions of Anaconda Enterprise 5, data scientists were required to deploy web applications to view or interact with any web interfaces (HTML, CSS, or JavaScript) in a project. Starting in AE 5.2.0, data scientists can run an arbitrary web server or application from within a running notebook session and access its web interface within a separate browser tab.

How It Works

Anaconda Enterprise 5.2.0 includes a Jupyter Notebook extension called nbserverproxy. This extension forwards network traffic from web services running within a notebook session and allows data scientists to interact directly with web interfaces without the need to deploy their projects each time a change is made. The notebook extension is included in the Python-based project templates in AE 5.2 and does not require any additional configuration by the end user.

To view and interact with a web application, a data scientist can run a web server in their notebook session, construct a URL that refers to the web server, and view the web interface in a web browser tab. The following examples demonstrate how data scientists can run various web applications and frameworks and access them from their browser.

Example: Simple Web Server

1. From within a running notebook session, open a terminal and start a local web server using Python:
python -m http.server  


2. Locate the URL of your notebook session.

Using Jupyter Notebook: Right click on the Jupyter icon on the top left of the notebook to obtain the notebook URL:
https://abc123.ae.anaconda.com/xyz456/tree  




Using JupyterLab: Right click on any file in the project home directory, then select the option for “Copy Shareable Link”:

https://abc123.ae.anaconda.com/xyz456/lab/tree/anaconda-project.yml  




3. Paste the link in a new browser tab.

4. Modify the URL to only include the full hostname and first URL path (that includes the random hash) by deleting the text on the right side of the URL, which should result in a URL similar to the following:
https://abc123.ae.anaconda.com/xyz456/  


5. Add “/proxy/” to the right side of the URL as well as the port that corresponds to the running web server (port 8000 in this case):
https://abc123.ae.anaconda.com/xyz456/proxy/8000  


6. View the web interface in your browser. As you edit and save files within your project, you can refresh the browser to view the latest changes.



Example: Dask Dashboard for Parallel Tasks

Dask provides advanced parallelism for analytics, enabling performance at scale for the tools you love. Dask includes an interactive dashboard that allows users to view the progress of computations, memory usage, and task completion. Users can launch a web interface from Dask when performing computations.

When using Dask on your local machine, the Dask dashboard is typically available at a URL such as http://localhost:8787/status. Similar to the steps outlined in the previous example, users can modify the URL of their running notebook session in a new tab to access the Dask dashboard from AE.

1. From within a running notebook session, open a terminal and start a Dask Distributed client:
from dask.distributed import Client, progress
client = Client(processes=False, threads_per_worker=4, n_workers=1, memory_limit='2GB')
client
 


2. Determine the port number from the Dask Dashboard URL
http://localhost:8787/status  


3. Locate the URL of your notebook session using the steps described in the previous example:
https://abc123.ae.anaconda.com/xyz456/tree  


4. Modify the URL to only include the full hostname and first URL path (that includes the random hash), then add “/proxy/8787/status” to the right side of the URL, which should result in a URL similar to the following:
https://abc123.ae.anaconda.com/xyz456/proxy/8787/status  


5. View and interact with the Dask Dashboard in your browser.

Example: Interactive Model Training Dashboard With Tensorboard

Tensorboard is a suite of visualization tools that makes it easy for data scientists to understand, debug, and tune Tensorflow models.

Tensorboard is especially useful when training long-running models by providing valuable feedback to the data scientist in real-time while the model is training.

1. From within a running notebook session, open a terminal and start Tensorboard:
tensorboard --logdir ./mnist_tutorial --reload_interval 1  


2. Determine the port number from the Tensorboard URL
http://anaconda-session-b10:6006  


3. Locate the URL of your notebook session using the steps described in the first example:
https://abc123.ae.anaconda.com/xyz456/tree  


4. Modify the URL to only include the full hostname and first URL path (that includes the random hash), then add “/proxy/6006/” to the right side of the URL, which should result in a URL similar to the following:
https://abc123.ae.anaconda.com/xyz456/proxy/6006/  


5. View and interact with Tensorboard in your browser.

Note: Be sure to include the trailing slash (“/”) after the port number or Tensorboard will return an error that it “Failed to load the set of active dashboards.”
support@continuum.io
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete