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 394 forks source link

fixes #937 #938

Open zskulcsar opened 6 years ago

zskulcsar commented 6 years ago
ISSUE TYPE
SUMMARY

The original code had an if condition for the debug flag resulting in a situation when the code was running a different set of api calls.

ansible-container build
Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
ERROR   Unknown exception
Traceback (most recent call last):
  File "/Users/zsoltk/work/iw/petrol-test/venv/lib/python2.7/site-packages/container/cli.py", line 299, in __call__
    getattr(core, u'hostcmd_{}'.format(args.subcommand))(**vars(args))
  File "/Users/zsoltk/work/iw/petrol-test/venv/lib/python2.7/site-packages/container/__init__.py", line 28, in __wrapped__
    return fn(*args, **kwargs)
  File "/Users/zsoltk/work/iw/petrol-test/venv/lib/python2.7/site-packages/container/core.py", line 181, in hostcmd_build
    environment=env_vars
  File "/Users/zsoltk/work/iw/petrol-test/venv/lib/python2.7/site-packages/container/docker/engine.py", line 105, in __wrapped__
    return fn(self, *args, **kwargs)
  File "/Users/zsoltk/work/iw/petrol-test/venv/lib/python2.7/site-packages/container/__init__.py", line 28, in __wrapped__
    return fn(*args, **kwargs)
  File "/Users/zsoltk/work/iw/petrol-test/venv/lib/python2.7/site-packages/container/docker/engine.py", line 1070, in build_conductor_image
    return image.id
AttributeError: 'tuple' object has no attribute 'id'

ansible-container build
Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
Parsing conductor CLI args.
Docker™ daemon integration engine loaded. Build starting.   project=petrol_nginx
Building service... project=petrol_nginx service=web
Applied role nginx from cache   role=nginx service=web
Build complete. service=web
All images successfully built.
Conductor terminated. Preserving as requested.  command_rc=0 conductor_id=75a1f0c0857a4e381763084248fad1faa84cd92d8576ce163c1dd461ae6cd41a save_container=yes
gregdek commented 6 years ago

Thanks @zskulcsar -- would love to see some comments from other contributors on this one.

Voronenko commented 6 years ago

@gregdek I confirm the issue. Have to use --debug in prod pipelines for a while - works robust.

gregdek commented 6 years ago

Hmm, weird travis breakage in all the current jobs...

Voronenko commented 6 years ago

@gregdek Regarding weird breakage on develop - actually ubuntu:bionic caused that due to typo in tag (not sure how it was green in form of PR) - nevertheless - this is chore to address that https://github.com/ansible/ansible-container/pull/943 (again green - @gregdek can you merge chore ?)

Regarding this PR breakage - it should be rebased over recent develop. @zskulcsar can you rebase your PR so it could pass the checks ?

Voronenko commented 6 years ago

@gregdek ^^ Green

Voronenko commented 6 years ago

Generally, approved. Should be pretty safe to merge - depends on releasing approach.

Whenever 0.9.3 is a "service pack" - i.e. mostly 0.9.2 with pip fixes, and that one goes towards 0.9.4 or can go into 0.9.3

Voronenko commented 6 years ago

@zskulcsar I am sorry, can you rebase your PR over recent develop once more? I do expect to see only your scope of changes in diff.