Archie Kennedy
05/15/2023, 5:42 PMdeploy_models
• use_models
The deploy_models
job contains an op that materializes an asset:
context.log_event(
AssetMaterialization(
asset_key="my_cool_model",
description=f"Deployed ML model for code inference",
metadata={
"target_uri": "<s3://bucket/model.tar.gz>",
},
)
)
This adds the my_cool_model
asset to the catalog, nice!
Now, from inside the use_models
job, I want to load the metadata (“target_uri”) of the latest materialization of the my_cool_model
asset.
Is this possible?jamie
05/15/2023, 5:52 PM@op
def use_models(context):
context.instance.get_latest_materialization_event(AssetKey(["my_cool_model"])).dagster_event.event_specific_data.materialization.metadata
Archie Kennedy
05/15/2023, 6:00 PM