Skip to content
This repository was archived by the owner on Mar 23, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions container/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@
__version__ = '0.9.3rc0'

import os
import sys
import functools

# Many features of Ansible Container are flagged on whether or not we're running
# inside the Conductor container or not. This is the flag.
ENV = 'conductor' if os.environ.get('ANSIBLE_CONTAINER') else 'host'
REMOTE_DEBUGGING = True if os.environ.get('REMOTE_DEBUGGING') else False

if ENV != 'host' and REMOTE_DEBUGGING:
print("Checking for debugging capabilities...")
try:
sys.path.append('/_ansible/build/pycharm-debug.egg')
print("import pydevd && set trace 172.17.0.1 55507")
import pydevd
# 172.17.0.1 host.docker.internal
pydevd.settrace('172.17.0.1', port=55507, stdoutToServer=True, stderrToServer=True)
except ImportError:
pass
except Exception:
pass


def conductor_only(fn):
@functools.wraps(fn)
Expand Down
5 changes: 5 additions & 0 deletions container/docker/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,11 @@ def build_conductor_image(self, base_path, base_image, prebaking=False, cache=Tr
req_yml_dir = (package_dir
if os.path.exists(os.path.join(package_dir, 'conductor-requirements.yml'))
else FILES_PATH)
for filename in ['pycharm-debug.egg']:
file_path = os.path.join(setup_py_dir, filename)
if os.path.exists(file_path):
tarball.add(file_path,
arcname=os.path.join('build-src', filename))
tarball.add(os.path.join(setup_py_dir, 'setup.py'),
arcname='container-src/conductor-build/setup.py')
tarball.add(os.path.join(req_txt_dir, 'conductor-requirements.txt'),
Expand Down
1 change: 1 addition & 0 deletions container/docker/templates/conductor-local-dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM {{ conductor_base }}
{% set distro = original_base.split(':')[0] %}
# The COPY here will break cache if the requirements or ansible.cfg has changed
COPY /build-src /_ansible/build
COPY /container-src /_ansible/container

{% if install_requirements %}
RUN {{ install_requirements }}
Expand Down