moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.72k stars 18.67k forks source link

Swarm Jobs in Compose YAML support #41895

Open ghost opened 3 years ago

ghost commented 3 years ago

After 20.10 release which has #40307 merged in it looks like only cli has support for ReplicatedJob mode. It would be great to have it supported in compose stack as well.

Steps to reproduce the issue:

  1. Install Docker 20.10.2
  2. Initialize Swarm Mode
  3. Deploy a stack with mode: job-replicated

Describe the results you received: Unknown mode: replicated-job

Describe the results you expected: The service in stack is successfully created and started

Additional information you deem important (e.g. issue happens only occasionally): The stack deployed:

version: '3.9'
services:
  testjob:
    image: docker/whalesay:latest
    command: cowsay test
    deploy:
      mode: replicated-job
      replicas: 1

Output of docker version:

Client: Docker Engine - Community
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:17:43 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:19 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
 Containers: 27
  Running: 27
  Paused: 0
  Stopped: 0
 Images: 36
 Server Version: 20.10.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: active
  NodeID: exx5828l4yjas6f8aiibqm1j9
  Is Manager: true
  ClusterID: li5igcw6ph33808fpjq9xq1rq
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.10.0.24
  Manager Addresses:
   10.10.0.24:2377
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-58-generic
 Operating System: Ubuntu 20.04.1 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.64GiB
 Name: equeo-dev
 ID: UAWO:V3YN:B5Q4:BCGW:QQPV:N2YN:QVX6:RFSN:2ZXZ:Q3TR:NXFJ:DMKO
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
imdwq commented 3 years ago

Seems this PR implements the feature: https://github.com/docker/cli/pull/2907

xunto commented 1 year ago

It seemed to be merged but what version will it be included?

olljanat commented 1 year ago

Should now released as part of Docker 23.0.0

dazinator commented 1 year ago

close