Hey all I’m trying to get a Dagster hybrid environ...
# ask-community
n
Hey all I’m trying to get a Dagster hybrid environment up and running, however whenever I try to specify a ‘directory’ and ‘registry’ under ‘build’ in the dagster_cloud.yaml it through an error “Received unexpected config entry “build” at the root.” Its like it doesn’t even accept build as a possible entry in the yaml at all…? This is the documentation I am trying to follow, any ideas, thanks! https://docs.dagster.io/dagster-cloud/managing-deployments/dagster-cloud-yaml#build # dagster_cloud.yaml locations: - location_name: ph-bi-elt code_source: package_name: quickstart_elt build: directory: ./ registry: europe-west1-docker.pkg.dev/********
s
Hey Nic, those entries all need to be under the location_name, so I think this is just an indent error
Copy code
locations:
  - location_name: ph-bi-elt
    code_source:
      package_name: quickstart_elt
    build:
     directory: ./
     registry: europe-west1-docker.pkg.dev/********
n
@Sean Lopp even in dagster cloud directly I’m still getting the error, is this indent incorrect..? Screenshot of my code locally is below too, looks to be indented correct no?
s
@Shalabh Chaturvedi if you have a chance could you take a look at this?
s
The config looks correct to me as well. Nic - can you please copy paste the
dagster_cloud.yaml
here in a code block? Are you getting this error from CI/CD or a specific command?
n
Copy code
locations:
  - location_name: ph-bi-elt
    code_source:
      package_name: quickstart_elt
    build:
     directory: ./
     registry: europe-west1-docker.pkg.dev/********
this is my yaml @Shalabh Chaturvedi, running the command below gives me the error
Copy code
% dagster-cloud workspace sync -w dagster_cloud.yaml
s
Hi @Nicholas Lilleyman, can you try using this command instead:
Copy code
dagster-cloud workspace add-location --location-file=dagster_cloud.yaml --location-name=ph-bi-elt
This is one used in our CICD deploy workflows. I'll look into why the
sync
command seems to be broken right now.
n
Copy code
Error: Some locations failed to load after being synced by the agent:
Error loading ph-bi-elt: {'__typename': 'PythonError', 'message': "Exception: Your agent's configuration requires you to specify an image. Use the `--image` flag when specifying your location to tell the agent which image to use to load your code.\n", 'stack': ['  File "/dagster-cloud/dagster_cloud/workspace/user_code_launcher/user_code_launcher.py", line 1301, in _reconcile\n    self._check_for_image(code_deployment_metadata)\n', '  File "/dagster-cloud/dagster_cloud/workspace/user_code_launcher/user_code_launcher.py", line 1064, in _check_for_image\n    raise Exception(\n']}
@Shalabh Chaturvedi getting the error above now, any ideas?
s
You'll need to specify an
--image
in your registry that you want to deploy. Have you built and published a dagster image to your registry?
Here is a sample Dockerfile you can use to build a basic dagster project image. You'll need to build and push this to your registry above. Whatever tag you publish this to can then be provided in the
--image
parameter for
add-location
.
n
Thanks for the help @Shalabh Chaturvedi. I ran the below and it worked
Copy code
dagster-cloud workspace add-location --location-file=dagster_cloud.yaml --location-name=ph-bi-elt --image=europe-west1-docker.pkg.dev/prj-ops-artifact-registry-707c/container/bi/dagster:5e142d4234fa1e2010eb0d86e1cdef08c434c9bf-5599647162-1-quickstart_etl
That said, I’m overall pretty confused what the Dagster development workflow looks like… Struggling to conceptualise it and explain it to my team, do we: • Make changes to code locally • commit to branch • push to remote • create PR to master • PR triggers GitHub action that dumps an image of my branch into the registry • Run ‘dagster-cloud workspace add-location’ command locally to load this specific image into Dagster Cloud?? • Execute jobs in Dagster Cloud, verify their success • Merge to Master • ...???
s
Hi Nic, You don't need to run
dagster-cloud workspace add-location
locally unless you want to update something one-off outside CICD. The github workflow will do everything necessary to update the code location: create the branch deployment for the PR if needed, build and upload the docker image, update the code location to point to the new image. Other than that the workflow above sounds reasonable. If you want to set up GitHub the best template to follow is here: https://github.com/dagster-io/dagster-cloud-hybrid-quickstart/
n
Hey @Shalabh Chaturvedi I’m using that cloud hybrid quickstart currently. I’ve just created a PR in github and: • image was built and put into the registry • i can see the branch deployment in dagster cloud, but the code location is blank, do I need to manually add the location of the image in the dagster Cloud UI??? Seems a bit odd
s
Hi Nic - can you share the logs from the action in GitHub?
n
@Shalabh Chaturvedi logs attached 🙂
s
Hi Nic, I'm seeing all the logs except the final deploy to dagster cloud. I've attached a screenshot of how it should look in GitHub. I see logs for
Update build session with image tag
but no logs for
Deploy to dagster cloud
. Can you please verify you have this section in your workflow yaml: https://github.com/dagster-io/dagster-cloud-hybrid-quickstart/blob/46bfd6c31966cda[…]0fba852f5cb2777343a4/.github/workflows/dagster-cloud-deploy.yml
n
@Shalabh Chaturvedi ahh my bad, I forgot that section was commented out….
s
Looks like the branch deployment is updating now?
n
It fails due to some agent issue, I have a running agent in prod but not in the branch deployment
s
I see
Error: No Dagster Cloud agent is actively heartbeating. Make sure that you have a Dagster Cloud agent running
. Have you enabled branch deployments on this agent? For eg there's a flag in ECS: https://docs.dagster.io/dagster-cloud/deployment/agents/amazon-ecs/creating-ecs-agent-new-vpc#step-3-configure-the-agent
n
😄 😄 Its working @Shalabh Chaturvedi, thanks so much for you support mate!
🎉 1