Ashwin Jiwane
12/08/2022, 6:22 PMrun_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
postgres_db:
username:
env: DAGSTER_PG_USERNAME
password:
env: DAGSTER_PG_PASSWORD
hostname:
env: DAGSTER_PG_HOSTNAME
db_name:
env: DAGSTER_PG_DB_NAME
port: 5432
container_kwargs:
volumes: # Make docker client accessible to any launched containers as well
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
I'm able to launch a container with same image as grpc server but job always fails with the error inside the container. What am I missing or doing wrong?
Error:
0it [00:00, ?it/s]
0it [00:00, ?it/s]
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/dagster/cli/api.py", line 355, in _execute_step_command_body
check.inst(
File "/venv/lib/python3.8/site-packages/dagster/_check/__init__.py", line 675, in inst
raise _type_mismatch_error(obj, ttype, additional_message)
dagster._check.CheckError: Object None is not a PipelineRun. Got None with type <class 'NoneType'>. Pipeline run with id '5a4d8e00-1bb9-4dd3-a833-f8001222a923' not found for step execution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/venv/bin/dagster", line 8, in <module>
sys.exit(main())
File "/venv/lib/python3.8/site-packages/dagster/cli/__init__.py", line 50, in main
cli(auto_envvar_prefix=ENV_PREFIX) # pylint:disable=E1123
File "/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/venv/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/venv/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/venv/lib/python3.8/site-packages/dagster/cli/api.py", line 335, in execute_step_command
for event in _execute_step_command_body(
File "/venv/lib/python3.8/site-packages/dagster/cli/api.py", line 421, in _execute_step_command_body
yield instance.report_engine_event(
File "/venv/lib/python3.8/site-packages/dagster/core/instance/__init__.py", line 1513, in report_engine_event
check.invariant(
File "/venv/lib/python3.8/site-packages/dagster/_check/__init__.py", line 1455, in invariant
raise CheckError(f"Invariant failed. Description: {desc}")
dagster._check.CheckError: Invariant failed. Description: Must include either pipeline_run or pipeline_name and run_id
owen
12/08/2022, 10:27 PMdagster.yaml
file is not being copied into the image you're using for your code. https://github.com/dagster-io/dagster/tree/1.1.6/examples/deploy_docker has a docker-compose file that will spin up the postgres database on the same network, as well as an example Dockerfile_dagsterAshwin Jiwane
12/09/2022, 1:20 PM0.15.5
for all dagster libraries. May be new version have solved much of these issues 🤔dagster.yaml
available in the grpc-image
at /opt/dagster/dagster_homes/default/dagster.yaml
• I upgraded to dagster==1.0.17
and dagster-docker==0.16.17
• On local machine it's local-storage for dagster.
I still get the same errordaniel
12/09/2022, 5:00 PMAshwin Jiwane
12/09/2022, 5:31 PMdaniel
12/09/2022, 5:36 PMAshwin Jiwane
12/23/2022, 3:59 PMdagster_graphql.client.utils.DagsterGraphQLClientError: ('PythonError', "docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))\n")
error. Docker service is running, all containers are running.
If I remove the run_launcher config from dagster.yaml and relaunch everything, API server is able to launch a dagster job by making API call to dagit.
This is the run_launcher I have
run_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
env_vars:
- DAGSTER_PG_USERNAME
- DAGSTER_PG_PASSWORD
- DAGSTER_PG_DB_NAME
- DAGSTER_PG_HOSTNAME
- IO_MANAGER_S3_BUCKET
container_kwargs:
volumes: # Make docker client accessible to any launched containers as well
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
- /var/run/docker.sock:/var/run/docker.sock
(psycopg2.OperationalError) could not translate host name
run_launcher
run_launcher:
config:
env_vars:
- S3_DATABASE_URL
-. ....
daniel
12/23/2022, 7:29 PMAshwin Jiwane
01/03/2023, 2:49 PMRight now to include those env cars they need to be set in the run launcher yaml and available in the container that launches the run (if you don’t set their values).That's not scalable as we have multiple env variables per grpc server and there are multiple grpc servers. It would run into thousands of env variables.
If you use Kubernetes or ecs there are better ways to pass share secrets between the user code containers and the launched runsWe are using nomad. Yes, shared secrets gets used using those configs and env variables are set like that but when job-container is launched from grpc container those env variables are not available in the job container as you mentioned they need to be available at run launcher yaml. Is there a better way ? 🤔
daniel
01/03/2023, 2:57 PM'{"docker": "env_vars": ["FOO_ENV_VAR=bar_value", "OTHER_ENV_VAR=other_value"] }'
Ashwin Jiwane
01/03/2023, 3:07 PMa) use the DefaultRunLauncher instead of the DockerRunLauncher, which will launch each run on the gRPC server (but has some other downsides - each run will no longer be in a separate container)Yeah, we have this behaviour now and we want to avoid launching jobs in same container. Preferring to launch them in separate container. Thanks! I will look into options b) and c)
b) bake the env var values into the imageah, this option will not work ! breaks all security principles we have 🙂
daniel
01/03/2023, 3:17 PMAshwin Jiwane
01/03/2023, 3:22 PMdaniel
01/03/2023, 3:23 PMAshwin Jiwane
01/03/2023, 3:23 PMdaniel
01/03/2023, 3:24 PM