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

services.consensus.deploy.resources.limits value 'pids' does not match any of the regexes: '^x-' #595

Closed
karolpivo opened this issue Mar 1, 2023 · 3 comments
Labels
docker-compose-v1 Docker Compose v1 question Further information is requested

Comments

@karolpivo
Copy link

karolpivo commented Mar 1, 2023

SUMMARY

community.docker.docker_compose module fails to start service when 'deploy.resources.limits.pids' is defined. The same compose service starts when using the 'docker compose' CLI (Docker Compose version v2.16.0).

Please see docker documentation for reference -> https://docs.docker.com/compose/compose-file/deploy/#resources

Relevant docker compose file section:

    deploy:
      resources:
        limits:
          pids: 4096

Ansible error message:
fatal: [instance]: FAILED! => {"changed": false, "msg": "Configuration error - The Compose file 'redacted' is invalid because:\nservices.consensus.deploy.resources.limits value 'pids' does not match any of the regexes: '^x-'"}``

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.docker.docker_compose

ANSIBLE VERSION
ansible [core 2.14.2]
  config file = None
  configured module search path = ['/home/kp/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/kp/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/kp/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/kp/.local/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION

# /home/kp/.local/lib/python3.10/site-packages/ansible_collections
Collection       Version
---------------- -------
community.docker 3.4.0  

# /home/kp/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.docker 3.4.0  
CONFIGURATION
n/a
OS / ENVIRONMENT

Management Host: Ubuntu 22.04

Target hosts: tested on Ubuntu 22.04 and Almalinux9

STEPS TO REPRODUCE

include below section in a compose file and deploy using Ansible

    deploy:
      resources:
        limits:
          pids: 4096
- name: Start  stack - 
  community.docker.docker_compose:
    project_src: "{{ blockchain_docker_compose_path }}"
    files:
      - dc-execution-{{ clients.execution }}.yml
      - dc-consensus-{{ clients.consensus }}.yml
      - dc-validator-{{ clients.validator }}.yml
    remove_orphans: true
EXPECTED RESULTS

Compose stack starts.

ACTUAL RESULTS
`
`fatal: [instance]: FAILED! => {"changed": false, "msg": "Configuration error - The Compose file 'redacted' is invalid because:\nservices.consensus.deploy.resources.limits value 'pids' does not match any of the regexes: '^x-'"}``

@felixfontein
Copy link
Collaborator

This might be because docker-compose 1.x does not support this in Docker Compose definitions. Did you check whether your definition works with the docker-compose 1.x CLI?

@felixfontein felixfontein added question Further information is requested docker-compose-v1 Docker Compose v1 labels Mar 1, 2023
@karolpivo
Copy link
Author

Thanks for the response. You are right. I'm getting the same error when using docker-compose 1.29.2

Error:
services.consensus.deploy.resources.limits value 'pids' does not match any of the regexes: '^x-'


docker-compose version
docker-compose version 1.29.2, build unknown
docker-py version: <module 'docker.version' from '/usr/local/lib/python3.10/dist-packages/docker/version.py'>
CPython version: 3.10.6
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022

Is there a plan to implement support for 2.x in the Ansible module?

@felixfontein
Copy link
Collaborator

That is tracked in #216. There is a WIP PR (#586) but right now there is no ETA when this will be done.

I'll close this issue since I think the question is resolved. If that's not the case please comment so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-compose-v1 Docker Compose v1 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants