Using Workspaces

This documentation is for Dash Enterprise.
Dash Enterprise is the fastest way to write & deploy Dash apps and
Jupyter notebooks.
10% of the Fortune 500 uses Dash Enterprise to productionize AI and
data science apps. Find out if your company is using Dash Enterprise.

Workspaces provides a VS Code-like IDE in your browser for developing a Dash app or running Jupyter notebooks.

Creating a Workspace

Workspaces are associated with apps and each app can have one workspace. To add a workspace, first select an app from the App Manager page and go to the Workspace tab.

Workspace Creation Options

There are two ways to create a workspace:

Creating a blank workspace

If you haven’t yet deployed this app, select Create blank workspace to get started.

Initialize from a recent commit

If you have deployed this app, you also have the option to build the workspace based on the latest or a previous commit. This is great if you want to run the current (or a previous) version of your deployed app. To do this, choose a Commit and select Create from a commit.

When you create a workspace, Dash Enterprise creates an SSH public key internally. Dash Enterprise uses this key
to authenticate your Git session with the server, allowing you to deploy from your workspace. Note that this key does not appear in your SSH Public Keys list.

View the logs for your new workspace by selecting Show Workspace Logs. Note that it can take a few seconds for the logs to appear.

<img>

Opening a Workspace

Once your new workspace is finished building, select Open Workspace to go to the workspace IDE.

Visiting the Workspace’s Development Site

The development site is where you can view the development app (your app running in a workspace).

You can access the development site by selecting Visit Development Site in the Workspace Information section. Don’t forget to run python app.py in the workspace terminal to start the development app.

Restarting a Workspace

In some cases when working with your workspace, you’ll want to restart it. For example, to:
- Have access to environment variables you’ve added since you created the workspace.
- Have access to services (Redis and Postgres) you’ve added since you created the workspace.
- Stop all processes you’ve started in the workspace’s terminal.
- Resolve issues, such as an unresponsive workspace.

To restart a workspace, select the Restart button from the Workspace tab:

<img>

Uncommitted file changes in /home/workspaceuser/app and packages installed in the workspace terminal are persisted with restarts.

For more details on what restarting a workspace means, see the Restart, Rebuild, and Delete & Recreate Compared section below.

Rebuilding a Workspace

In some cases when working with your workspace, you’ll want to rebuild it. For example, to:
- Reinstall Python based on updates you’ve made to the project.toml file.
- Run pre-deploy scripts again.

To rebuild a workspace, select Rebuild Workspace from the Workspace tab.

When you rebuild your workspace, Python packages are installed from the requirements.txt file. Any packages previously installed with pip in the workspace terminal are persisted, unless your app contains a project.toml file that specifies a Python version. Uncommitted file changes in /home/workspaceuser/app and packages installed in the terminal with sudo apt-get install and sudo apt install are also persisted.

For more details on what rebuilding a workspace means, see the Restart, Rebuild, and Delete & Recreate Compared section below.

Stopping a Workspace

You can stop a workspace to free up CPU and memory:

<img>

Deleting a Workspace

If you no longer need your workspace, you can delete it. Deleting removes all files in the workspace. These files are not recoverable.

If you don’t want to lose changes you made to files in the workspace, you can either:
- Deploy those changes to your Dash app (if those changes are ready for production).
- Push those changes to an external Git server like GitHub if your organization has one available.
- Download the files to your local machine.

Restart, Rebuild, and Delete & Recreate Compared

Behavior Restart Rebuild Delete and Recreate
Makes environment variables available
Links services (Redis and Postgres)
Stops processes started in the terminal
Preserves Python pip packages installed in the terminal ✓ (1)
Logs you out of the Dash Enterprise CLI
Preserves APT packages installed in the terminal ✓ (2) ✓ (2)
Installs Python pip packages from requirements.txt
Preserves Python Conda packages
Reinstalls APT packages from Aptfile ✓ (2) ✓ (2)
Reinstalls Python based on project.toml file
Runs pre-deploy scripts
Preserves saved (uncommitted) files in /home/workspaceuser/app directory
Preserves persistent filesystem

(1) If your app contains a project.toml file that specifies a Python version, then the Python packages will not persist on rebuild.

(2) APT packages that you install in the terminal with sudo apt-get install or sudo apt install are automatically added to your Aptfile, meaning they are available when you restart or rebuild the workspace. Known issue: If you are specifying an additional repository (in the terminal or Aptfile) to install APT packages from, those packages are not preserved on restart or rebuild, so you’ll need to reinstall them.

Other Things to Keep in Mind

git clone &lt;https:&gt; .

Notice the . at the end of the git clone statement. You’ll need to delete existing files first. See Cloning Into Workspaces for more.