-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
docs: add missing deploy modes for compose file reference #21606
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
What you've done is better than not having them (assuming they are meant to be permanently supposed and are not just temporary supported). |
From what I understand, is that Also I think i overlooked the yaml spec, some options are not supported on the the yaml. the CLI side has documented it, i believe it should be documented like this ### Mode
`mode` defines the replication model used to run a service or job. Options include:
1. **`global`**: Ensures exactly one tasks runs per physical node.
2. **`replicated`**: Runs a specified number of tasks across nodes (default).
3. **`replicated-job`**: Executes a defined number of tasks with a finite end state. Tasks launch simultaneously by default.
- Total tasks are determined by `replicas`.
- Concurrency can be limited using the `max-concurrent` option (CLI only).
4. **`global-job`**: Executes one task per physical node with a finite end state.
- Automatically runs on new nodes as they are added.
````yml
services:
frontend:
image: example/webapp
deploy:
mode: global
batch-job:
image: example/processor
deploy:
mode: replicated-job
replicas: 5
maintenance:
image: example/updater
deploy:
mode: global-job
```
**Note**:
- Job modes (`replicated-job` and `global-job`) are designed for tasks with a clear completion state.
- Completed tasks remain until explicitly removed.
- Options like `max-concurrent` for controlling concurrency are supported only via the CLI and are not available in Compose YAML. Is it clearer for you ? |
It is clearer |
Good idea, What do you think we settle with this: ### mode
`mode` defines the replication model used to run a service or job. Options include:
1. **`global`**: Ensures exactly one task continuously runs per physical node until stopped.
2. **`replicated`**: Continuously runs a specified number of tasks across nodes until stopped (default).
3. **`replicated-job`**: Executes a defined number of tasks with a completion state (exits with code 0).
- Total tasks are determined by `replicas`.
- Concurrency can be limited using the `max-concurrent` option (CLI only).
4. **`global-job`**: Executes one task per physical node with a completion state (exits with code 0).
- Automatically runs on new nodes as they are added.
```yml
services:
frontend:
image: example/webapp
deploy:
mode: global
batch-job:
image: example/processor
deploy:
mode: replicated-job
replicas: 5
maintenance:
image: example/updater
deploy:
mode: global-job
```
**Note**:
- Job modes (`replicated-job` and `global-job`) are designed for tasks that complete and exit with code 0.
- Completed tasks remain until explicitly removed.
- Options like `max-concurrent` for controlling concurrency are supported only via the CLI and are not available in Compose YAML.
- For more detailed information about job options and behavior, see the [Docker CLI documentation](/reference/cli/docker/service/create/#replicated-jobs).
``` |
Almost consider: |
I think its perfect, I will copy paste it once you are back, btw, thanks for the feedback :) ### mode
`mode` defines the replication model used to run a service or job. Options include:
1. **`global`**: Ensures exactly one task continuously runs per physical node until stopped.
2. **`replicated`**: Continuously runs a specified number of tasks across nodes until stopped (default).
3. **`replicated-job`**: Executes a defined number of tasks until a completion state (exits with code 0)'.
- Total tasks are determined by `replicas`.
- Concurrency can be limited using the `max-concurrent` option (CLI only).
4. **`global-job`**: Executes one task per physical node with a completion state (exits with code 0).
- Automatically runs on new nodes as they are added.
```yml
services:
frontend:
image: example/webapp
deploy:
mode: global
batch-job:
image: example/processor
deploy:
mode: replicated-job
replicas: 5
maintenance:
image: example/updater
deploy:
mode: global-job
```
**Note**:
- Job modes (`replicated-job` and `global-job`) are designed for tasks that complete and exit with code 0.
- Completed tasks remain until explicitly removed.
- Options like `max-concurrent` for controlling concurrency are supported only via the CLI and are not available in Compose YAML.
- For more detailed information about job options and behavior, see the [Docker CLI documentation](/reference/cli/docker/service/create/#running-as-a-job)
|
Looks great! |
PR updated (after a while) |
Description
Noticed that on the source code we had two more modes:
https://github.com/moby/swarmkit/blob/e8ecf83ee08e14a05e28992dc304576079d403c7/api/specs.proto#L106
https://github.com/moby/moby/blob/9633556bef3eb20dfe888903660c3df89a73605b/daemon/cluster/convert/service.go#L142
Related issues or tickets
Reviews