Hi All! I have setup a small CI/CD pipeline for Da...
# ask-community
s
Hi All! I have setup a small CI/CD pipeline for Dagster with Jenkins. Might be a dumb question but after automatically pulling the latest changes from
master
the user still needs to “Reload” the repositories, is there another way it can be automated completely?
r
The repository should be automatically reloaded when the gRPC server is being restarted (Dagster tracks the gRPC server ID and each time the gRPC server is starting it’s generating a new ID) . Do you use a user code deployment?
d
Hi Sanidhya, what deos your workspace.yaml look like, are you running your own grpc server? If you are, then Roei is correct and it should automatically reload when the gRPC server restarts
dagster spin 1
s
I’m not running my own gRPC server
d
what happens in your CI/CD pipeline?
s
The CD piece pulls the latest code from a GitHub repo onto a VM. The code comes through fine but still need to reload workspace for the new jobs to show up
d
there's a graphql call that you can make to tell dagit to reload your repositories: https://docs.dagster.io/concepts/dagit/graphql-client#reloading-all-repositories-in-a-repository-location
s
Thanks Daniel! will try to add this to the CI/CD pipeline. Would you recommend doing this or running a gRPC server?
is there a way I can get all repo location names from GraphQL?
d
there's also a reloadWorkspace call that you can make that will reload them all
s
Thanks for the inputs Daniel! That worked like a charm!
condagster 1
Hi @daniel, could you tell me how to call
reloadWorkspace
with GraphQL? Facing this error
Copy code
{
  "error": {
    "data": null,
    "errors": [
      {
        "message": "Field \"reloadWorkspace\" of type \"ReloadWorkspaceMutationResult!\" must have a sub selection.",
        "locations": [
          {
            "line": 2,
            "column": 3
          }
        ]
      }
    ]
  }
}
d
what query are you running?
s
Copy code
mutation{
  reloadWorkspace {
    
  }
}
PS: new to GraphQL
d
Copy code
mutation{
  reloadWorkspace {
    __typename__
  }
}
is one way to do it
s
thanks for the reply! still throws an error
Copy code
{
  "error": {
    "data": null,
    "errors": [
      {
        "message": "Cannot query field \"_typename_\" on type \"ReloadWorkspaceMutationResult\".",
        "locations": [
          {
            "line": 3,
            "column": 5
          }
        ]
      }
    ]
  }
}
This works!
Copy code
mutation{
  reloadWorkspace {
    __typename
  }
}
d
ah sorry
yes that
s
Thanks mate! have a good night!
condagster 1