ohdsi/broadsea-dbt

Sponsored OSS

dbt command line tools based on ghcr.io/dbt-labs/dbt-postgres

Image
Data Science
Integration & Delivery
Security
1

171

Broadsea-Dbt Docker container

An OHDSI Broadsea Docker container for the open source Data Build Tool

The DBT project code and DBT profiles are shared with the container using Docker volumes. The volume host paths are specified in the .env file.

Configuration

You can configure the paths to your DBT project and profiles by editing the .env file:

DBT_PROJECT_PATH=./project
DBT_PROFILE_PATH=./profiles

The paths are relative to the current directory and will be mounted as volumes in the broadsea-dbt container.

You can configure the database connection by updating the profiles.yml file. See an example in the example_dbt_profiles directory.

Note. Currently the only supoorted DBMS in this Docker container is PostgreSQL. The Dockerfile can be updated to include support for other DBMSs that are supported by dbt, including Snowflake and Redshift.

Usage

You can run DBT commands using Docker Compose:

docker compose run --rm dbt <dbt-command>

Replace <command> with your desired DBT command.

For example, to show the DBT help infot, use the following command:

docker compose run --rm dbt run --help

demo

First, start the broadsea-atlasdb demo database:

docker compose --profile atlasdb up -d

Important: Wait until the atlasdb container shows as 'healthy' state when you run 'docker ps'.

Run the example dbt project using the broadsea-atlasdb demo omop cdm postgreSQL database that contains a single dbt model example_dbt_project/models/example/person_id_model.sql which reads the first 100 person_ids from the demo_cdm schema person table and creates a new table in the public schema called person_id_model:

docker compose run --rm dbt clean
cd example_dbt_project 
docker compose run --rm dbt run

Connect to the atlasdb database using a postgreSQL client to see the new public.person_id_model table.

Shutdown the atlasdb database container when you are finished with the demo:

docker compose --profile atlasdb down

GitHub Repo

https://github.com/OHDSI/Broadsea-Dbt

Docker Pull Command

docker pull ohdsi/broadsea-dbt