Skip to content
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 Docker Swarm Jobs #28

Open
Akasurde opened this issue Apr 2, 2020 · 9 comments
Open

Support for Docker Swarm Jobs #28

Akasurde opened this issue Apr 2, 2020 · 9 comments
Assignees
Labels
docker-swarm Docker Swarm enhancement New feature or request

Comments

@Akasurde
Copy link
Member

Akasurde commented Apr 2, 2020

From @alexanderadam on Apr 02, 2020 09:47

SUMMARY

I'm not sure whether Ansible already has support for it but I found nothing so far.
I would be nice if Ansible would have support for Docker Swarm Jobs. The Docker API seems to support this since version v1.41.

ISSUE TYPE
  • Support for Docker Swarm Jobs
ANSIBLE VERSION

2.9.6

COMPONENT NAME

docker_swarm_service

ADDITIONAL INFORMATION

I guess Docker issue 23880 is better suited to give information about the what's and the why's.

Copied from original issue: ansible/ansible#68629

@ansibullbot
Copy link

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@alexanderadam
Copy link

alexanderadam commented Apr 10, 2020

The Ansible GitHub repo is really annoying with the bot which is spamming around and closed discussions leading to an incredible amount of duplicated issues (the ansible repository has nearly 69'000 issue ids) because you can't comment on old issues anymore. If found some problem descriptions in ten issues — without a solution.

But nevermind:

ansible version 2.9.6
python version 3.8.2

Are you happy and entertained now, @ansibullbot?

@gundalow gundalow self-assigned this Apr 14, 2020
@ansibullbot

This comment has been minimized.

@hannseman
Copy link

It’s a very new feature and AFAIK Docker API 1.41 has not been released yet. The latest Docker engine release is supporting 1.40. We also need to have docker-py support for the new API. Couldn’t find an issue there about this.

@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@felixfontein felixfontein transferred this issue from ansible-collections/community.general Nov 1, 2020
@felixfontein felixfontein added the docker-swarm Docker Swarm label Jan 2, 2021
@felixfontein felixfontein added the enhancement New feature or request label Sep 11, 2021
@frwickst
Copy link

frwickst commented Dec 2, 2024

This is also an issue for docker_swarm_info

The code is currently checking for only Replicated and Global as the modes for a service. These are however not the only modes that exists anymore, there is also ReplicatedJob and GlobalJob. When either of those types of services exists at the moment, then docker_swarm_info fails.

def get_essential_facts_services(item):

Traceback:

Traceback (most recent call last):
  File "<stdin>", line 107, in <module>
  File "<stdin>", line 99, in _ansiballz_main
  File "<stdin>", line 47, in invoke_module
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_community.docker.docker_swarm_info_payload_492jgky3/ansible_community.docker.docker_swarm_info_payload.zip/ansible_collections/community/docker/plugins/modules/docker_swarm_info.py", line 388, in <module>
  File "/tmp/ansible_community.docker.docker_swarm_info_payload_492jgky3/ansible_community.docker.docker_swarm_info_payload.zip/ansible_collections/community/docker/plugins/modules/docker_swarm_info.py", line 376, in main
  File "/tmp/ansible_community.docker.docker_swarm_info_payload_492jgky3/ansible_community.docker.docker_swarm_info_payload.zip/ansible_collections/community/docker/plugins/modules/docker_swarm_info.py", line 236, in __init__
  File "/tmp/ansible_community.docker.docker_swarm_info_payload_492jgky3/ansible_community.docker.docker_swarm_info_payload.zip/ansible_collections/community/docker/plugins/modules/docker_swarm_info.py", line 273, in get_docker_items_list
KeyError: 'Mode'

Example of parial output from docker service inspect of ReplicatedJob:

[
    {
        "Spec": {
            "Mode": {
                  "ReplicatedJob": {
                      "MaxConcurrent": 1,
                      "TotalCompletions": 1
                  }
              },
        }
    }
]

@frwickst
Copy link

frwickst commented Dec 2, 2024

I strongly suggest adding the bug tag to this issue, as it is currently preventing running docker_swarm_info (with services: true) if there is a replicated job as the command will lead to a crash.

@gundalow gundalow added the bug Something isn't working label Dec 2, 2024
@felixfontein felixfontein removed the bug Something isn't working label Dec 2, 2024
@felixfontein
Copy link
Collaborator

I moved the bug to #1002 and removed the label. This issue is about a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-swarm Docker Swarm enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants