How can one code location consume assets issued by another?
What's the issue or suggestion?
We have many code locations:
- common
- client1
- client2
- client3Each of these is a Dagster code location.
Ideally, we'd have client1,client2,client3 be able to depend on assets in common
We've tried a few things, and we got this far:
Each
definitionsobject loads the assets with a key prefix - these beingcommon,client1,client2,client3respectivelyFor each we start a dagster code location via
dagster code-location start ...We have one "master" webserver where the workspace.yaml has
load_locations
- grpc_server:
host: localhost
port: 4266
location_name: common
- grpc_server:
host: localhost
port: 4267
location_name: client1
- grpc_server:
host: localhost
port: 4268
location_name: client2
- grpc_server:
host: localhost
port: 4269
location_name: cleint3At this point we can see all our assets in one dagster-webserver instance, but there are still some issues on how to make them
A) Materialise the assets B) Depend on each other
Regarding the materialisations, so far we've made each code location also start a deamon, so when we use the webserver to kick off a run the "right" deamon picks it up and launches it using the multiprocess_executor (I beleive we'll have to move to a 1 deamon and specify run launchers per code location later)
But the bigger issue is (B)
How can we make client1 depend on common
Our intuition is that this should work:
@dg.asset(ins={'regions': dg.AssetIn(['common', 'regions'])})
def gdp_per_region(regions:list[str])->dict[str, float]:
...But it does not because asset AssetKey(['common', 'regions']) is not produced within client1
Additional information
No response
Message from the maintainers
Impacted by this issue? Give it a ! We factor engagement into prioritization.
Source: dagster-io/dagster