Developing and Deploying Apps when Dash Enterprise Is Internet-Restricted

If your administrator has isolated Dash Enterprise from public and unsecured networks, Dash Enterprise does not have access to the internet.
Systems that don’t have access to the internet are often called airgapped. This guide can help you write and deploy apps that
are suited for an airgapped Dash Enterprise instance.

Note about accessing documentation: Documentation about Dash and Dash Enterprise is available in Dash Enterprise. Everyone who is logged in
and has a license seat can select Documentation from the Dash Enterprise sidebar to open these docs. However, note that documentation about other
Plotly products, such as the Python graphing library, are not included. An internet connection is required to view documentation
that is not included in Dash Enterprise.

To write apps that you want to deploy to an airgapped Dash Enterprise instance, we recommend using Dash Enterprise Workspaces. Because
Workspaces uses the same environment as the deployed app, you can avoid app behavior discrepancies caused by different environments—For example,
if your workstation has internet access and Dash Enterprise does not, your app might run well locally but encounter issues when deployed to Dash Enterprise.
In addition, deploying from Workspaces does not make an external network request, whereas running git push from your workstation requires HTTPS or SSH,
which your administrator may have disabled.

Handling Dependencies

To deploy Dash apps to an airgapped Dash Enterprise instance, your app files need to instruct Dash Enterprise to fetch
packages from the right location.

Dash Enterprise libraries such as Dash Design Kit are available on the same host as Dash Enterprise. When you develop your app in Workspaces or deploy it, Dash Enterprise automatically configures your app to fetch any
Dash Enterprise libraries it requires from Dash Enterprise itself.

Python Packages

Your app needs to fetch all other Python packages it requires from a private Python package index like Artifactory that Dash Enterprise
has network access to (by default, public packages installed with pip are fetched from PyPI.org, which airgapped Dash Enterprise instances cannot access)—unless you opt to put the packages directly in your app files.

Important: Dash Enterprise requires that your private Python package index have a TLS/SSL certificate from a globally trusted certificate authority (CA).

Dash Enterprise administrators typically configure a private Python package index at the system level,
which means no action is needed for your apps to fetch packages from it. If this is not in place, you can configure your apps individually.

To configure your app to fetch packages from your private Python package index, add the following at the top of its
requirements.txt file:

--extra-index-url <private-package-index> --trusted-host <private-package-index>

where <private-package-index> is the URL to your organization’s private Python package index. You can omit the --trusted-host flag if the index uses HTTPS.

Your app will install any Dash Enterprise libraries it requires from the Dash Enterprise host, and look for all other packages in the index defined with the --extra-index-url flag. Note
that you can have more than one --extra-index-url.

If you’re working locally and want to use Dash Enterprise libraries in your app, you’ll need to add your Dash Enterprise packages URL as another --extra-index-url in order for your app to install those libraries. The first line
of your requirements.txt would then look like:

---extra-index-url <your-dash-enterprise-packages-url> --extra-index-url <private-package-index> --trusted-host <private-package-index>

where <private-package-index> is the URL to your organization’s private Python package index. You can omit the --trusted-host flag if the index uses HTTPS.

If your app requires a package that is not available in your organization’s private Python package index, include the package as a tar.gz (tarball) or .whl (wheel)
file in your app’s code and list its file name in your requirements.txt. Note that if the package depends on other packages that are similarly not available in your organization’s private Python package index,
you’ll need to add them to your app as well.

APT Packages

Similarly, if your app depends on APT packages, you need to specify a custom APT repository that Dash Enterprise has network access to inside your Aptfile.

Important: Dash Enterprise requires that your custom APT repository have a TLS/SSL certificate from a globally trusted certificate authority (CA).

Your Aptfile should look like:

:repo:deb <a href="https://apt.example.com/">https://apt.example.com/</a> bionic main universe bionic-updates bionic-security
:repo:deb <a href="https://apt.example.com/">https://apt.example.com/</a> bionic-updates main universe
apt-package1
apt-package2
...

Replace https://apt.example.com/ with the URL of the custom APT repository that your organization has provided, but keep the rest of the information on the first two lines—it is mandatory for Dash Enterprise to build your app.

Known issue: When installing packages from a custom APT repository, your app’s build logs display a connection timeout error to Ubuntu.com. The packages are still fetched from the
custom APT repository, so this error message is safe to ignore.

Known issue: In Dash Enterprise Workspaces, APT packages that you install from a custom repository are not preserved when you restart or rebuild the workspace. Reinstall those packages after a workspace restart or rebuild.

Using Local References Instead of External Requests

Any code in your app that requires an internet connection will fail when you deploy it to an airgapped Dash Enterprise instance.

When your app needs access to external resources such as datasets, we recommend adding the files to your code and referencing
them using their file paths. Consider using the persistent filesystem feature if your datasets are very large.

Remember that you can check your app logs in Dash Enterprise to troubleshoot an app that experiences issues due to the airgapped environment.

Deploying Your App

If you’re working in Dash Enterprise Workspaces, you can deploy your app from within the IDE by selecting Deploy or running Git commands
in the terminal. Learn more about deploying from a workspace.

If you’re working locally, ask your administrator whether git push over HTTPS or SSH is allowed for Dash Enterprise. If so, follow the
deployment instructions (also available in your app’s Overview in Dash Enterprise).

Limitations


Troubleshooting