This documentation is for Dash Enterprise.
Dash Enterprise is the fastest way to write & deploy Dash apps and
10% of the Fortune 500 uses Dash Enterprise to productionize AI and
data science apps. Find out if your company is using Dash Enterprise.
To set up CI/CD with Dash Enterprise, all you need to do is
git push your code from your CI system to Dash Enterprise. Dash Enterprise handles creating the builds (Docker containers), deploying those containers, and opening up those containers to network traffic. For more details on how deployment works, go to App Structure, Buildpacks, and Deployment Lifecycle.
This set of instructions demonstrates how to write a script that deploys your code to Dash Enterprise from a CI system. In practice, you can modify these scripts to only run when your code has been merged rather than on every branch and pull request.
To set up a CI pipeline for Dash Enterprise:
adminrole that will deploy the apps on behalf of the app owners. This user can be a new or existing one (Creating a new user requires access to Keycloak). You’ll consider this user a service account whose purpose is strictly to deploy apps, while app owners still log in using their individual Dash Enterprise accounts to manage apps outside of deployment.
git pushcommand over SSH. There are many ways to do this. Here is one way:
Encode the SSH private key in base64:
cat id_ed25519 | base64 > id_ed25519.base64
cat id_ed25519 | base64 -w 0 > id_ed25519.base64
certutil -encode id_ed25519 id_ed25519.base64
id_ed25519 with the location of your SSH private key.
-----BEGIN OPENSSH PRIVATE KEY-----
-----END OPENSSH PRIVATE KEY-----
LS0tLS1CRUdJTiBP [...] UEVOU1NIIFBSSVZBV=
Encode your SSH configuration file in base64:
cat config | base64 > config-base64.txt
cat config | base64 -w 0 > config-base64.txt
certutil -encode config config-base64.txt
Vc2VyIGdpdAogHaH [...] ViX3RlbnmlubmdvCg==
Add the following environment variables to your CI tool:
SSH_PRIVATE_KEY: The base64-encoded SSH private key.
SSH_CONFIG: Your base64-encoded SSH configuration file.
Provide the following script to the CI tool. If the CI tool accepts YAML files that
run steps one at a time, then you can provide each of these commands on their own line.
echo ‘-----> Project directory’
echo ‘-----> Creating ssh key’
echo “$SSH_PRIVATE_KEY” | base64 –decode -i > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 # permissioning
eval “$(ssh-agent -s)” # setting ssh environment variable
echo ‘-----> Adding keys to ssh-agent’
echo ‘-----> Creating ssh config’
echo “$SSH_CONFIG” | base64 –decode -i > ~/.ssh/config
echo ‘-----> Adding git remote’
git config remote.plotly.url >&- || git remote add plotly git@<your-dash-enterprise-hostname>:<your-dash-app-name>
echo ‘-----> Deploying app’
git push plotly HEAD:main
You’ll need to make a few changes to this script:
<your-dash-enterprise-hostname>with your Dash Enterprise host name.
<your-dash-app-name>with the name of your Dash app as initialized on Dash Enterprise.
~/.sshmay be different on your CI system. Consult your CI system’s docs on SSH.
Trigger this CI script when code is merged into