/template-dbt-bigquery

A dbt template, configured to launch a dbt Project in the Cloud for a user specified BigQuery project

dbt + BigQuery in Gitpod Demo Project

This demo project showcases how to run dbt's core module on top of a BigQuery warehouse inside a Gitpod Cloud Development Environment. The project is based on the well-known jaffle_shop example.

Configuration

In order to connect with BigQuery, the following environment variables need to be set inside inside the development environment:

  • DBT_SERVICE_ACCOUNT: the content of a valid service account JSON. Required permissions are BigQuery User and BigQuery Data Editor
  • DBT_PROJECT: ID of the GCP project in which the models will be persisted
  • DBT_DEV_DATASET: Name of the dataset in which the models will be persisted, e.g. dbt_dev
  • DBT_LOCATION: multi-regional or regional location of the data, e.g.: US, EU, us-west2

The easiest way to achieve this is by setting user-specific environment variables in Gitpod. Find out more about environment variables in Gitpod here.

The values of the environment variables are used inside dbt's profiles.yml. For more information about setting up dbt with BigQuery, click here.

Next Steps

Click the button below to start a new development environment:

Open in Gitpod

The validity of the dbt configuration will be tested inside the workspace. Run the following commands to test the functionality of the Jaffle shop demo:

  1. dbt seed: to materialize the CSVs
  2. dbt run: to run the models
  3. dbt test: to test all models

If all commands run succesfully, you have completed the setup of a working dbt development environment on a BigQuery warehouse with Gitpod!🎉

Get Started With Your Own Project

A new project

Click the above "Open in Gitpod" button to start a new workspace. Once you're ready to push your first code changes, Gitpod will guide you to fork this project so you own it.

An existing project

To get started with dbt on Gitpod, add a .gitpod.yml to any of your existing dbt projects. To learn more, please see the Getting Started documentation.