https://dagster.io/ logo
Title
r

Roei Jacobovich

11/15/2022, 3:20 PM
Hey, we’d like to create a sensor that reloads the workspace upon some event (we have dynamic repositories to generate jobs). What would be the best way to invoke the reload operation through the daemon? I know it can be done using
DagsterGraphQLClient.reload_repository_location
but I have to get somehow Dagit’s IP and all the repository locations. Is there a way to extract these from the sensor context? (maybe from the
DagsterInstance
)? If there’s another way (not using GraphQL and Dagit) that could be great too! Thanks!
👍 1
c

claire

11/15/2022, 9:22 PM
Hi Roei, out of curiosity, why do you need Dagit's IP? It seems that
reload_repository_location
accepts a repository location name, so maybe we can just add an endpoint to fetch the repository location names
r

Roei Jacobovich

11/15/2022, 10:18 PM
Hi @claire , as that’s a GraphQL request (through the Python client) it needs a Dagit host and port to send the requests to (the GraphQL endpoint). It’d be awesome to get that information out of the box 😄
c

claire

11/17/2022, 2:20 AM
Unfortunately, to my knowledge there is no way to programmatically fetch Dagit's IP and the repository locations via the sensor context. I think the easiest way may still be to use DagsterGraphQLClient. I can file a feature request to add an endpoint on
DagsterGraphQLClient
that returns the repository locations though, which should at least help with the programmatically generated repositories
@Dagster Bot issue add endpoint to return repository location names from DagsterGraphQLClient
d

Dagster Bot

11/17/2022, 2:20 AM