-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support for Global Mode #7
Comments
Hi @rjchicago, For now I will fix this nil pointer and I will look to bring support to global mode. |
@rjchicago example to execute |
Hello. Any update supporting global mode? |
Working on it |
Ok I think I have something pretty stable : version: "3.6"
services:
# Swarm cronjob
swarm-cronjob:
image: swarm-cronjob
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- LOG_LEVEL=debug
- LOG_JSON=false
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
global:
image: docker:18.09.7
command: ["docker", "info", "--format=NodeID: {{ json .Swarm.NodeID }}"]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: global
labels:
- "swarm.cronjob.enable=true"
- "swarm.cronjob.schedule=0/10 * * * * *"
- "swarm.cronjob.skip-running=false"
restart_policy:
condition: none
I keep you in touch for the next iteration. |
You can try out the latest beta release. |
I tested this out and cron jobs work with Global mode correctly. Thanks again, @crazy-max! For reference, here is the test service I used:
|
great job @crazy-max :) |
Just to understand the drawback: there seems to be no way to prevent a global service from running once at the moment it is deployed. Right? |
@djmaze Yes that's a drawback of global mode. |
Also, I am experiencing strange restart issues with global mode. Disabled that service on my swarm for now. Anyone else experiencing problems? |
@djmaze I have not encountered this kind of problem. Can you give us more explanations? Maybe trough a new issue? |
@crazy-max I just created #20. Apart from that one, I am experiencing a different problem as well, where swarm-cronjob triggers new tasks again and again in a short amount of time. Will see if I can reproduce. |
Thanks will take a look asap.
I also experienced this issue if triggers < 10sec. I will take a look on this too. |
Hi,
I'd like support for global mode services in swarm.
Our use-case is to run a prune service globally.
Prune Service
Swarm-Cronjob Log
The text was updated successfully, but these errors were encountered: