Hi, I am working on a self-hosted dagster, deploye...
# integration-dbt
s
Hi, I am working on a self-hosted dagster, deployed with docker. I have been trying to materialize a set of dbt models using the following:
Copy code
@dbt_assets(manifest=MANIFEST_PATH)
def modelling_dbt_asset(context: OpExecutionContext, dbt_resource: DbtCliResource):
    yield from dbt_resource.cli(["run"], context=context).stream()


modelling_selection = build_dbt_asset_selection([modelling_dbt_asset], dbt_select="tag:modelling")

modelling_dbt_schedule = ScheduleDefinition(
    job=define_asset_job("modelling_selection", selection=modelling_selection),
    cron_schedule="@daily",
)
I have also tried using
build_schedule_from_dbt_selection
to build the schedule. However I am getting the following error when building the repository using the
@repository
decorator:
Copy code
DLAKE_REPO_GRPC: dagster._core.errors.DagsterInvalidDefinitionError: Bad return value from repository construction function: all elements of list must be of type JobDefinition, GraphDefinition, ScheduleDefinition, SensorDefinition, AssetsDefinition, or SourceAsset.Got value of type <class 'dagster_dbt.dbt_manifest_asset_selection.DbtManifestAssetSelection'> at index 7.
Does the
@dbt_assets
not work with the self-hosted dagster?
r
Could you share the code for your
@repository
decorated function?
@dbt_assets
works with Dagster open source. My hunch is that you’re passing in
modelling_selection
intstead of
modelling_dbt_schedule
to your
@repository
.
s
Yeah I am passing in both to the
@repository
- so that is where the error is coming from - when I only pass
modelling_dbt_schedule
, the job is registered but has no assets loaded. So I was trying to pass in the AssetDefinitions as well.
@rex any thoughts?
Is there sample project setup for self hosted? Perhaps our definitions are not being passed correctly as I see the dbt resource is not registering either. This hooli example seems to be for Dagster cloud deployments.