clay
02/06/2023, 3:12 PMdeploy_docker
example, would the Dockerfile_user_code
(link) need to be using the VOLUME
command for code changes to be detected? Or is the issue that the docker_example_user_code
service is lacking a reference to the volume?
Any assistance modifying that example to have dagit and the docker daemon detect code changes would be much appreciated!clay
02/06/2023, 4:40 PMdocker-compose.yml
file:
user_code:
env_file:
- .env
build:
context: .
dockerfile: ./Dockerfile_user_code
container_name: user_code
image: user_code_image
restart: always
environment:
DAGSTER_POSTGRES_USER: "postgres_user"
DAGSTER_POSTGRES_PASSWORD: "postgres_password"
DAGSTER_POSTGRES_DB: "postgres_db"
DAGSTER_CURRENT_IMAGE: "user_code_image"
networks:
- dagster_docker_network
volumes:
- /path/to/user_code:/opt/dagster/app
and my run_launcher in dagster.yaml
also specifies the volume:
run_launcher:
module: dagster_docker
class: DockerRunLauncher
config:
env_vars:
- DAGSTER_POSTGRES_USER
- DAGSTER_POSTGRES_PASSWORD
- DAGSTER_POSTGRES_DB
network: dagster_docker_network
container_kwargs:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
- /path/to/user_code:/opt/dagster/app
and my workspace.yaml
file has
load_from:
- grpc_server:
host: user_code
port: 4000
location_name: "user_code"
Nevertheless, the daemon does not appear to pick up on code changes in the user_code repository. I have to do docker-compose down
and docker-compose up
for it to pick up changes.