chrispc
05/15/2022, 4:53 PMrun_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
env_vars:
- DAGSTER_PG_USERNAME
- DAGSTER_PG_PASSWORD
- DAGSTER_PG_HOST
- DAGSTER_PG_DB
- PGPORT_BACKEND
network: dagster_network
container_kwargs:
auto_remove: true
volumes: { 'pipelines_storage':
{ 'bind': '/opt/dagster/app/local_artifact_storage/storage', 'mode': 'rw' },
'finapp/data':
{ 'bind': '/opt/dagster/app/finapp/data', 'mode': 'rw' }}
and in the docker-compose:
services:
finapp_pipelines:
build:
context: .
dockerfile: ./Dockerfile_pipelines
container_name: finapp_pipelines
image: finapp_pipelines
# restart: on-failure:2
expose:
- 4000
ports:
- "4000:4000"
environment:
DAGSTER_PG_PASSWORD: ${DAGSTER_PG_PASSWORD}
DAGSTER_PG_USERNAME: ${DAGSTER_PG_USERNAME}
DAGSTER_PG_DB: ${DAGSTER_PG_DB}
DAGSTER_PG_HOST: ${DAGSTER_PG_HOST}
DAGSTER_PG_OP_DB: ${DAGSTER_PG_OP_DB}
PGPORT_BACKEND : ${POSTGRES_DEV_PORT}
DAGSTER_CURRENT_IMAGE: ${DAGSTER_CURRENT_IMAGE}
FINNUB_KEY: ${FINNUB_KEY}
volumes:
- pipelines_storage:/opt/dagster/app/local_artifact_storage/storage
- ./finapp/data:/opt/dagster/app/finapp/data
networks:
- dagster_network
depends_on:
- op_db
volumes:
pipelines_storage:
external: false
pipelines_storage is a docker volume but ./finapp/data is a bind mount. However when I execute I pipeline that save the data in the bind volume I got this:
docker.errors.APIError: 400 Client Error for <http+docker://localhost/v1.41/containers/create>: Bad Request ("create finapp/data: "finapp/data" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path")
File "/usr/local/lib/python3.8/site-packages/dagster/core/instance/__init__.py", line 1450, in launch_run
self._run_launcher.launch_run(LaunchRunContext(pipeline_run=run, workspace=workspace))
File "/usr/local/lib/python3.8/site-packages/dagster_docker/docker_run_launcher.py", line 176, in launch_run
container = client.containers.create(
File "/usr/local/lib/python3.8/site-packages/docker/models/containers.py", line 878, in create
resp = self.client.api.create_container(**create_kwargs)
File "/usr/local/lib/python3.8/site-packages/docker/api/container.py", line 428, in create_container
return self.create_container_from_config(config, name)
File "/usr/local/lib/python3.8/site-packages/docker/api/container.py", line 439, in create_container_from_config
return self._result(res, True)
File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 274, in _result
self._raise_for_status(response)
File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 270, in _raise_for_status
raise create_api_error_from_http_exception(e)
File "/usr/local/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
How I can set the volumes in DockerRunLauncher without passing the abs path? or is there a way to inject env variables (${PWD}) in Dagster.yaml file? Thank so much!daniel
05/16/2022, 3:45 PMrun_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
env_vars:
- DAGSTER_PG_USERNAME
- DAGSTER_PG_PASSWORD
- DAGSTER_PG_HOST
- DAGSTER_PG_DB
- PGPORT_BACKEND
network: dagster_network
volumes:
pipelines_storage:
bind:
env: PIPELINES_STORAGE_LOCATION
mode: rw
and then you would set in the value of PIPELINES_STORAGE_LOCATION to the right absolute location within the docker-compose file? That's not possible today but I don't think it would be too hardchrispc
05/16/2022, 8:45 PMdaniel
05/16/2022, 10:09 PMchrispc
05/17/2022, 3:47 PMnetwork
keyword in one place and networks
in the other place. Is there any difference between this two?daniel
05/17/2022, 4:05 PMchrispc
05/17/2022, 4:20 PM