geoHeil
06/06/2022, 5:19 AMenv_vars
section seems to be global for the agent and not working per deployment.geoHeil
06/06/2022, 6:19 AMYevhen Samoilenko
06/07/2022, 2:09 PMgeoHeil
06/08/2022, 7:21 AMSeth Kimmel
06/14/2022, 4:10 PMAaron Ortega
06/21/2022, 8:11 PMimport os
import requests
TOKEN = os.getenv("DAGSTER_USER_TOKEN")
company = "my-company"
env = "prod"
url = f"https://{company}.dagster.cloud/{env}/graphql"
headers = {"Dagster-Cloud-Api-Token": f"{TOKEN}"}
body_json = {"query": "", "variables: ""} # omitted for shortness
response = <http://requests.post|requests.post>(url, json=body_json, headers=headers)
response.raise_for_status()
# updated with fix
any thoughts on what might be the issue?Stephen Bailey
06/22/2022, 5:02 PMCharlie Bini
06/28/2022, 4:40 PMZach
06/30/2022, 5:15 PMYevhen Samoilenko
07/01/2022, 2:29 PMDagster Jarred
07/01/2022, 4:00 PMuser_code_launcher:
config:
server_ttl:
enabled: true
ttl_seconds: 7200 # 2 hours
Dagster Jarred
07/01/2022, 8:13 PMZach
07/07/2022, 5:15 PMOperation name: JobMetadataQuery
Message: Internal Server Error (Trace ID: 7566522664540813052)
Path: ["pipelineRunsOrError","results",3,"assets"]
Locations: [{"line":76,"column":3}]
Stephen Bailey
07/09/2022, 2:52 PMOmar Khan
07/12/2022, 3:26 PMDagster Jarred
07/12/2022, 9:14 PMuser
07/12/2022, 11:00 PMCharlie Bini
07/15/2022, 8:09 PMMax Wong
07/19/2022, 12:02 PMCharlie Bini
07/20/2022, 8:46 PMgeoHeil
07/22/2022, 9:26 PMgeoHeil
07/27/2022, 5:14 PMgeoHeil
07/27/2022, 7:08 PMuser: "{{ env_var('WAREHOUSE_POSTGRES_USER') }}"
The dagster.yaml
file of the dagster-cloud runner actually provides these env vars:
run_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
env_vars:
- WAREHOUSE_POSTGRES_DB=secret_value
- WAREHOUSE_POSTGRES_USER=secret_value
- WAREHOUSE_POSTGRES_PASSWORD=secret_value
However, the pipeline for:
name: myname
on: [pull_request]
jobs:
preview:
env:
WAREHOUSE_POSTGRES_DB: secret_value
WAREHOUSE_POSTGRES_PASSWORD: secret_value
WAREHOUSE_POSTGRES_USER: secret_value
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Create Dagster Cloud Code Preview
uses: dagster-io/dagster-cloud-cicd-action/preview@v0.2.5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
location-file: ./locations.yaml
dagit-url: https://${{ secrets.DAGSTER_CLOUD_ORGANIZATION }}.dagster.cloud/${{ secrets.DAGSTER_CLOUD_DEPLOYMENT }}
api-token: ${{ secrets.DAGSTER_CLOUD_AGENT_TOKEN }}
fails with:
/usr/bin/docker run <http://ghcr.io/my_org/my_project:git_hash|ghcr.io/my_org/my_project:git_hash> dagster-cloud workspace snapshot ***_cloud hash_token --url https://***.dagster.cloud/*** --api-token *** --image <http://ghcr.io/my_org/my_project:git_hash|ghcr.io/my_org/my_project:git_hash> --python-file MWF/repository.py --attribute ***_cloud
Encountered an error:
Parsing Error
Env var required but not provided: 'WAREHOUSE_POSTGRES_USER'
Where do I need to specify the env variables so they can be found when creating the preview?
The reason is that dagster-dbt and the CLI there needs these to import the DBT-based assets. It otherwise fails with an errorcode.geoHeil
07/28/2022, 3:10 PMgeoHeil
07/28/2022, 6:18 PMMark Fickett
07/28/2022, 6:48 PMCharlie Bini
07/28/2022, 6:55 PMCorey Capel
08/01/2022, 11:09 PMKevin Mullins
08/02/2022, 2:06 PMUnauthorizedError
I’m manually invoking dagster-cloud branch-deployment create-or-update
as I’m not using github. I’ve tried with both agent tokens and my user token (I’m an org admin). Any ideas on things to check/try? Right now I’m using a user token configured with dagster-cloud config setup
and am able to interact with other parts of the cloud environment without error.
Exception: Unable to create or update branch deployment: {'data': {'createOrUpdateBranchDeployment': {'__typename': 'UnauthorizedError'}}}
Sterling Paramore
08/03/2022, 6:28 PM