Conversation
|
Mostly running this PR as WIP because my local dev box is giving me trouble, and I want to run against CI a bit to see if the problem is more general. |
fff938e to
bb94bda
Compare
c930baa to
dbd0ef6
Compare
|
It seems that in CI, the Jobs test takes too long to complete 20 iterations. I've cut down the total to 7, which is less than the minimum completion I saw, which was 8. |
|
@derny this needs a rebase now |
|
@thaJeztah Yes, it does, but in any case, the development on Jobs has happened all in a feature branch in Swarmkit, and that feature branch has not quite yet been merged into swarmkit master. |
|
No longer WIP. |
cpuguy83
left a comment
There was a problem hiding this comment.
What happens when requested number of completions is hit and there are still others running?
|
Swarmkit will only schedule the number of Tasks needed to reach |
Adds support for ReplicatedJob and GlobalJob service modes. These modes allow running service which execute tasks that exit upon success, instead of daemon-type tasks. Signed-off-by: Drew Erny <drew.erny@docker.com>
|
Would love to blog around this. Which Docker release is it coming with? Beta bits? |
|
CLI PR is open, pending the merge of this PR. |
|
Amazing. Thank you for the work! When is this planned to be released? |
|
👏 👏 💯 |
|
Very nice, thanks for this! I'll soon be able to archive swarm-cronjob 😅 |
|
@dperny Thanks for this new feature 👏 |
|
@dperny you're a blessing to open source. thank you. |
|
This is really good stuff! Question: Would it be possible to specify jobs via compose/stack file too? or this will only work via CLI? Edit: Moving the question to docker/cli#2262 which is where it was being discussed. |
|
Nice work! I would have loved this three years ago 😄 I've actually seen a rise in interest in alexellis/jaas so I think this will be well received by the community of users still on Swarm. |
|
Is it possible to create cron job with swarm? |
proposal (in swarmkit): moby/swarmkit#2852
- What I did
Adds support for Jobs in Swarm Mode
Jobs are Services which run some number of Tasks to completion (the container exiting with code 0) and then stop executing new Tasks.
- How I did it
ReplicatedJobandGlobalJob.ReplicatedJobhas two fields:MaxConcurrent, which sets the maximum number of tasks to run at the same time for the job, andTotalCompletions, which is the number ofCompletedtasks desired for the job. IfMaxConcurrentis not set, it will default to1. IfTotalCompletionsis not set, it will default to the value ofMaxConcurrentGlobalJobhas no fields. Like a global service, global jobs are scheduled on every node in the cluster matching placement constraints.Serviceobject, present when the Service is a job:JobStatus, which includes a counter for running the same job multiple times.Taskobject, present when it belongs to a job:JobIteration, which is identical to the value ofJobStatus.JobIterationon the Service that spawned this Taskswagger.ymlwith documentation for all new fields.version-history.mdto include information about new jobs fields.- How to verify it
Includes new integration tests for jobs functionality.
- Description for the changelog
Swarm Mode now supports running Jobs.