Cloning Repositories into a Workspace

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 are initialized as empty or with the deployed Dash app’s code (latest or previous commit).

To clone code from another repository into a workspace:

  1. Open your workspace.

  2. Open a terminal in the workspace and verify that you are in the /home/workspaceuser/app directory:
    $ pwd /home/workspaceuser/app

  3. Delete all the files in the /home/workspaceuser/app directory, including the hidden files prefixed with .:

    rm -rf * rm .gitignore rm -rf .git

  4. Clone your repository to the /home/workspaceuser/app directory:

    git clone <your-remote-repository> .

    Replacing <your-remote-repository> with the clone URL of your 3rd party repository.

    Heads up! Don’t forget the . (the period at the end of the command).
    This will replace the current directory’s contents with the contents of the cloned repository.
    If you omit the ., then your project will be in a new directory under /home/workspaceuser/app
    and the important Application Structure
    files like requirements.txt will not be detected and used by the workspace when restarted.

  5. Verify that the code was cloned to the correct location:

    The current working directory should be /home/workspaceuser/app:
    $ pwd /home/workspaceuser/app

    Your Application Structure files
    like Procfile, requirements.txt (pip) or environment.yml (Conda) should
    be in this folder and not in a separate nested folder.

    For example:
    $ ls Procfile requirements.txt

    (The contents of your ls command may be different).

  6. When you rebuild your workspace, Dash Enterprise detects the
    Application Structure files
    and use these files to install Python, Conda, or system-level (Apt) dependencies
    and run pre-deploy scripts.

  7. Re-add the plotly git remote.

    When the .git folder was deleted in Step 3, this also deleted the plotly git remote.

    Re-add this remote with:
    $ git remote add plotly git@<your-plotly-domain>:<your-dash-app-name>

    Replacing <your-plotly-domain> and <your-dash-app-name> appropriately. This URL can be found in the App Overview tab.

    This adds back the SSH remote. You can add back the HTTPS remote with:
    $ git remote add plotly-https <a href="https://&lt;your-dash-enterprise-server&gt;/GIT/&lt;your-dash-app-name&gt;">https://&lt;your-dash-enterprise-server&gt;/GIT/&lt;your-dash-app-name&gt;</a>
    This URL is also listed on the App Overview tab.

  8. Deploy to the main branch.

    The plotly remote currently only listens to changes on the main branch.

    If your remote git repository has a different default branch (e.g. master), then you can deploy to the plotly remote and main branch with:

    $ git push plotly master:main

    Replacing master with the branch that you are using.

    You also have the option to deploy your changes in one click by selecting the Deploy button. See the Deploying Changes chapter for more information on deployment options.