-
-
Notifications
You must be signed in to change notification settings - Fork 167
Allow supplying container name when creating a container with docker executor run #853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am thinking that we could reuse the |
@vnghia Sounds like a great idea! Yes, please! |
@vnghia would stopping the containers then become a responsibility of the workflow orchestrator, rather than step? I'd have thought docker steps would stop containers once the step is complete. Always curious to learn more. |
My main use case for dagu is spawning ephemeral containers. I have a lot of dags which shares the same executor configuration and has only one step for a single, well-define intention. You can imagine something like this. steps:
- command: backup
executor:
config:
autoRemove: true
container:
env:
- RESTIC_CACHE_DIR=/cache
- RESTIC_REPOSITORY=${RESTIC_REPOSITORY}
- RESTIC_PASSWORD=${RESTIC_PASSWORD}
host:
binds:
- restic-cache:/cache:rw
- backup-volume-1:/volume-1:rw
- backup-volume-2:/volume-2:rw
image: restic
type: docker
name: backup This works great and the fact that we can write down a container configuration for later execution (just like Sometime, I need to run some less common commands or to debug my executor, so I have this dag. steps:
- command: sleep 30m
executor:
config:
autoRemove: true
container:
entrypoint: []
env:
- RESTIC_CACHE_DIR=/cache
- RESTIC_REPOSITORY=${RESTIC_REPOSITORY}
- RESTIC_PASSWORD=${RESTIC_PASSWORD}
host:
binds:
- restic-cache:/cache:rw
- backup-volume-1:/volume-1:rw
- backup-volume-2:/volume-2:rw
image: restic
type: docker
name: hang And then I can just For your question, I still think that stopping the containers should be the responsibility of a step. Because we can not reuse the docker executor:
Furthermore, the main philosophy of docker is somewhat running only one process per container which can count as one step in Dagu. |
Hello. This functions also take a name for the newly created container. Could you add an option to supply that option ?
dagu/internal/digraph/executor/docker.go
Line 145 in 7bbb13d
Thank you very much for this project :D
The text was updated successfully, but these errors were encountered: