https://dagster.io/ logo
#ask-community
Title
# ask-community
c

clay

02/06/2023, 3:12 PM
Good morning! I have a question about mult-container docker deployment and the setup that will enable the run launcher and/or dagit to detect code changes. I'm reading this: https://docs.dagster.io/deployment/guides/docker I have everything running but code changes aren't detected. I'm following the pattern used in the deploy_docker example here, with docker-compose: https://github.com/dagster-io/dagster/tree/1.1.15/examples/deploy_docker Based on the
deploy_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!
So, I have this in my
docker-compose.yml
file:
Copy code
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:
Copy code
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
Copy code
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.
2 Views