David Jayatillake
11/20/2022, 12:40 AMgit submodule add <https://github.com/metaplane/metaplane-dbt> metaplane-dbt
how do I get something like this to run in my dbt cloud build?sandy
11/21/2022, 4:11 PMrex
11/21/2022, 6:30 PMfrom dagster import repository
from dagster_dbt import dbt_cloud_resource, load_assets_from_dbt_cloud_job
DBT_CLOUD_JOB_ID = <Your job id>
dbt_cloud = dbt_cloud_resource.configured(
{
"auth_token": {"env": "DBT_CLOUD_API_TOKEN"},
"account_id": {"env": "DBT_CLOUD_ACCOUNT_ID"},
}
)
dbt_cloud_assets = load_assets_from_dbt_cloud_job(
dbt_cloud=dbt_cloud, job_id=DBT_CLOUD_JOB_ID
)
@repository
def dbt_cloud_sandbox():
return [dbt_cloud_assets]
dbt run
or dbt build
and we generate the project dependencies from that.
The dbt cloud job runs dbt deps
automatically, so you don’t have to worry about thatDavid Jayatillake
11/21/2022, 6:32 PMrex
11/21/2022, 6:41 PMdbt cloud build
here?
how do I get something like this to run in my dbt cloud build
David Jayatillake
11/21/2022, 6:56 PMrex
11/21/2022, 10:32 PMdbt deps
should be run in the Dockerfile that contains your Dagster code location.
This way, dependencies are installed only once. Dagster shouldn’t need to install dependencies every single time a run is created. All dependencies should present once the run starts.