ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 392 forks source link

pip install of ansible-container fails, appears successful, cause unknown #933

Open dchsueh opened 6 years ago

dchsueh commented 6 years ago
ISSUE TYPE
container.yml
not applicable
OS / ENVIRONMENT
centos 7
SUMMARY

Under certain circumstances, the pip install of ansible-container can fail in the 'docker' portion, and I am unsure why. No 'ansible-container' script ends up being created.

I think the cause is some other python library in an incompatible version, but I have not been able to determine what, if so.

STEPS TO REPRODUCE
pip install -U pip==9.0.3  # workaround for "No module named req"
pip install -U setuptools  # gets 39.2 # workaround for find_packages() ...
pip install docker==2.7.0   # yet another workaround
pip install ansible-container[docker]==0.9.2
EXPECTED RESULTS

expect a lot of downloaded packages, and a successful install with 'ansible-container' script present; a good run produces stdout:

Collecting ansible-container[docker]==0.9.2
  Downloading https://files.pythonhosted.org/packages/bc/2a/b1252de3931173d26a30fc965be33c9cc0044cf7b23ce4c707f55d86830c/ansible-container-0.9.2.tar.gz (1.4MB)
    100% |################################| 1.4MB 746kB/s 
Collecting Jinja2>=2.9 (from ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
    100% |################################| 133kB 2.6MB/s 
Requirement already satisfied: pip>=6.0 in /usr/lib/python2.7/site-packages (from ansible-container[docker]==0.9.2)
Collecting PyYAML>=3.12 (from ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz (253kB)
    100% |################################| 256kB 2.8MB/s 
Requirement already satisfied: requests>=2 in /usr/lib/python2.7/site-packages (from ansible-container[docker]==0.9.2)
Collecting ruamel.yaml>=0.14.2 (from ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/0e/27/40c3af76e767285917319531f885109ad7bcb6a2715fe5116a9931219a26/ruamel.yaml-0.15.37-cp27-cp27mu-manylinux1_x86_64.whl (589kB)
    100% |################################| 593kB 1.2MB/s 
Requirement already satisfied: six>=1.10 in /usr/lib/python2.7/site-packages (from ansible-container[docker]==0.9.2)
Collecting structlog[dev]>=16.1 (from ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/e9/ea/0d4fd621c7e797ad9fa2cd0e4bd1b4b613364ecfeca39512e1fb30f43394/structlog-18.1.0-py2.py3-none-any.whl
Requirement already satisfied: docker>=2.4.0 in /usr/lib/python2.7/site-packages (from ansible-container[docker]==0.9.2)
Collecting MarkupSafe>=0.23 (from Jinja2>=2.9->ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/site-packages (from requests>=2->ansible-container[docker]==0.9.2)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.7/site-packages (from requests>=2->ansible-container[docker]==0.9.2)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.7/site-packages (from requests>=2->ansible-container[docker]==0.9.2)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.7/site-packages (from requests>=2->ansible-container[docker]==0.9.2)
Collecting ruamel.ordereddict; platform_python_implementation == "CPython" and python_version <= "2.7" (from ruamel.yaml>=0.14.2->ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/f3/2c/fa6d75dc459b371ed3b88fdbf8042785ce1655073c884fd97bdbb9f48e01/ruamel.ordereddict-0.4.13-cp27-cp27mu-manylinux1_x86_64.whl (99kB)
    100% |################################| 102kB 5.8MB/s 
Collecting colorama; extra == "dev" (from structlog[dev]>=16.1->ansible-container[docker]==0.9.2)
  Downloading https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl
Requirement already satisfied: websocket-client>=0.32.0 in /usr/lib/python2.7/site-packages (from docker>=2.4.0->ansible-container[docker]==0.9.2)
Requirement already satisfied: backports.ssl-match-hostname>=3.5; python_version < "3.5" in /usr/lib/python2.7/site-packages (from docker>=2.4.0->ansible-container[docker]==0.9.2)
Requirement already satisfied: ipaddress>=1.0.16; python_version < "3.3" in /usr/lib/python2.7/site-packages (from docker>=2.4.0->ansible-container[docker]==0.9.2)
Requirement already satisfied: docker-pycreds>=0.2.1 in /usr/lib/python2.7/site-packages (from docker>=2.4.0->ansible-container[docker]==0.9.2)
Installing collected packages: MarkupSafe, Jinja2, PyYAML, ruamel.ordereddict, ruamel.yaml, colorama, structlog, ansible-container
  Running setup.py install for MarkupSafe ... done
  Running setup.py install for PyYAML ... done
  Running setup.py install for ansible-container ... done
Successfully installed Jinja2-2.10 MarkupSafe-1.0 PyYAML-3.12 ansible-container-0.9.2 colorama-0.3.9 ruamel.ordereddict-0.4.13 ruamel.yaml-0.15.37 structlog-18.1.0
ACTUAL RESULTS

a failing run will produce rc==0, stdout:

Collecting ansible-container[docker]==0.9.2
  Downloading https://files.pythonhosted.org/packages/bc/2a/b1252de3931173d26a30fc965be33c9cc0044cf7b23ce4c707f55d86830c/ansible-container-0.9.2.tar.gz (1.4MB)
Installing collected packages: ansible-container
  Running setup.py install for ansible-container: started
    Running setup.py install for ansible-container: finished with status 'done'
Successfully installed ansible-container-0.9.2

and stderr:

  ansible-container 0.9.2 does not provide the extra 'docker'

and no 'ansible-container' script, only the 'conductor' script

dchsueh commented 6 years ago

louisXperiel, the issue you describe in the previous comment is NOT the issue I filed this ticket for

-- edit ; looks like louisXperiel deleted his/her comment

Voronenko commented 6 years ago

@dchsueh if you have system in faulty condition, can you produce pip freeze and attach output here? I tried few times - seem ok. (Note: I never install ansible-container globally but instead use it in virtual env).

I am not sure - at the beginning I had smth similar on ubuntu, when older (or newer) docker-compose was installed, because both have dependency on docker.

BurningFool commented 6 years ago

I too am running into this issue. What's strange is that this only seems to be happening when using a dockerfile or ansible-container. Manually spawning a container and then executing the commands by typing them in doesn't seem to trigger this issue. I've tested on both CentOS and Alpine Linux and got the same results.