Skip to content

App Deployments

Dashboards and docset pipelines are deployed to Google Cloud Run from Github Actions.

The custom solutions team typically deploys applications to three applications tiers;

  • dev - this is where most work happens. It will change frequently. The GCP project is ds-esd-dev. Apps deployed here are typically configured in demo.dimensions.ai.
  • staging - this is where nearly ready to release versions of apps can be deployed and possible shared with customers. The GCP project is ds-esd-staging.
  • prod - this is the production version of an app. The GCP project is ds-esd-prod. These apps are generally configured in customer private Dimensions instances or app.dimensions.ai.

Basics of an app deployment

An app deployment, at a high level, is made up of two components: the Docker image and a service.yaml file.

The Docker image contains the application code and an operating system for running the app. This isn't specific to Google Cloud Run and we do deploy apps to multiple environments.

The service.yaml defines the Cloud Run service. It includes the Docker image as described above, CPU and memory allocation, and environment variables.

In the custom solutions app environment, we the Jinja templating language to create the service file. This lets us use variables and conditionals in the service file to define things like the application name, GCP project name, GBQ dataset. Our ds-deploy tool reads arguments from the command line and passes them to the template. This allows us to have one service file for all three stages of an app deployment.

Secrets and environment variables

Application secrets or configuration values are typically defined as environment variables and read from the environment by the deployed application.

Non-sensitive environment variables can be stored inline in the service file.

Sensitive environment variables should be stored as GCP secrets and referenced in the service file, as below:

- name: DIMENSIONS_API_KEY
    valueFrom:
    secretKeyRef:
        key: latest
        name: {{ name }}-DIMENSIONS_API_KEY

To update these values, there's two options:

Update directly via the GCP console

Navigate to secret manager, find the value and update it. Note that you will have to do this for each stage where the app is deployed. These are direct links to the secret manager in each stage: - ds-esd-dev - ds-esd-staging - ds-esd-prod

Use ds-deploy

Create a .env file with the variable you want to update:

DIMENSIONS_API_KEY=123

Then use ds-deploy to set this secret value in all stages:

ds-deploy set-secret --app-name my-app --stage all --input-env /path/to/.env

The ds-deploy command takes a stage - dev, staging, prod - or all, which will update all three stages.

See the ds-deploy documentation for directions for installing ds-deploy.

Deployment via Github Actions

Deployment is handled by our ds-deploy tool.

Todo: describe deployment