Skip to main content

Automating Deployments

You can deploy models programmatically using AtScale's sml-cli. This enables you to automate deployments using CI/CD pipelines. For example, organizations with multiple environments (e.g., development and production) may want to have deployments to one environment automatically trigger deployments to the others to ensure consistent configurations across all of them.

sml-cli can deploy models to both AtScale and Tableau Server.

The following sections describe how to get started with sml-cli.

Installing sml-cli

sml-cli is available from the npm registry. To install the CLI, follow the instructions on the registry page.

Prerequisites for running sml-cli

Before using sml-cli, be sure you have the following:

  • A clone of the Git repository that contains the models you want to deploy. You must have read permissions for this repository.

    note

    The repository you deploy does not need to be connected to AtScale. If it is not, AtScale will automatically add it on deploy.

  • The AtScale API URL (typically https://<atscale_domain>/api). This must be set as an environment variable named ATSCALE_API_URL, as shown in the example below.

  • An AtScale API token. Note that this requires you to have generated one beforehand. This must be set as an environment variable named ATSCALE_API_TOKEN, as shown in the example below.

  • If you are deploying to Tableau Server, the servers/sites you want to deploy to must be connected to AtScale. For instructions, see Configuring Connections to Tableau Server.

Example

The following example demonstrates a full workflow of using sml-cli to deploy a catalog to AtScale.

# Install the sml-cli package globally
npm install -g sml-cli

# Export the ENV variables needed for deploying to AtScale
export ATSCALE_API_URL="https://{domain}/api"
export ATSCALE_API_TOKEN="{token}"

# Clone the SML git repository
git clone https://github.com/{organization}/{repo}.git

# Go to the repository directory
cd {repo}

# Deploy to AtScale
sml-cli atscale-deploy

Additional information

Additional information on using sml-cli is available on the npm registry page.