Skip to content

Commit e4b92e0

Browse files
authored
Install ansible-runner-http as local python package (#172)
Signed-off-by: chiragkyal <ckyal@redhat.com>
1 parent 27bbbbb commit e4b92e0

File tree

7 files changed

+172
-90
lines changed

7 files changed

+172
-90
lines changed

.goreleaser.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dockers:
4444
extra_files:
4545
- "images/ansible-operator/Pipfile"
4646
- "images/ansible-operator/Pipfile.lock"
47+
- "images/ansible-operator/ansible_runner_http"
4748
- image_templates:
4849
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
4950
dockerfile: images/ansible-operator/Dockerfile
@@ -58,6 +59,7 @@ dockers:
5859
extra_files:
5960
- "images/ansible-operator/Pipfile"
6061
- "images/ansible-operator/Pipfile.lock"
62+
- "images/ansible-operator/ansible_runner_http"
6163
- image_templates:
6264
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
6365
dockerfile: images/ansible-operator/Dockerfile
@@ -72,6 +74,7 @@ dockers:
7274
extra_files:
7375
- "images/ansible-operator/Pipfile"
7476
- "images/ansible-operator/Pipfile.lock"
77+
- "images/ansible-operator/ansible_runner_http"
7578
- image_templates:
7679
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
7780
dockerfile: images/ansible-operator/Dockerfile
@@ -86,6 +89,7 @@ dockers:
8689
extra_files:
8790
- "images/ansible-operator/Pipfile"
8891
- "images/ansible-operator/Pipfile.lock"
92+
- "images/ansible-operator/ansible_runner_http"
8993
docker_manifests:
9094
- name_template: "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}"
9195
image_templates:

images/ansible-operator/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ RUN rustc --version
1111

1212
# Copy python dependencies (including ansible) to be installed using Pipenv
1313
COPY images/ansible-operator/Pipfile* ./
14+
# Copy our local ansible-runner-http replacement module
15+
COPY images/ansible-operator/ansible_runner_http ./ansible_runner_http
1416
# Instruct pip(env) not to keep a cache of installed packages,
1517
# to install into the global site-packages and
1618
# to clear the pipenv cache as well
1719
ENV PIP_NO_CACHE_DIR=1 \
18-
PIPENV_SYSTEM=1 \
19-
PIPENV_CLEAR=1
20+
PIPENV_SYSTEM=1 \
21+
PIPENV_CLEAR=1
2022
# Ensure fresh metadata rather than cached metadata, install system and pip python deps,
2123
# and remove those not needed at runtime.
2224
RUN set -e && dnf clean all && rm -rf /var/cache/dnf/* \
@@ -27,6 +29,7 @@ RUN set -e && dnf clean all && rm -rf /var/cache/dnf/* \
2729
&& pip3 install --upgrade pip~=23.3.2 \
2830
&& pip3 install pipenv==2023.11.15 \
2931
&& pipenv install --deploy \
32+
&& pip3 install ansible_runner_http/ \
3033
&& pipenv check \
3134
&& dnf remove -y gcc libffi-devel openssl-devel python3.12-devel \
3235
&& dnf clean all \
@@ -63,8 +66,8 @@ RUN curl -L -o /tini https://github.com/krallin/tini/releases/download/${TINI_VE
6366
FROM base AS final
6467

6568
ENV HOME=/opt/ansible \
66-
USER_NAME=ansible \
67-
USER_UID=1001
69+
USER_NAME=ansible \
70+
USER_UID=1001
6871

6972
# Ensure directory permissions are properly set
7073
RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd \

images/ansible-operator/Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ name = "pypi"
55

66
[packages]
77
ansible-runner = "~=2.4.0"
8-
ansible-runner-http = "~=1.0.0"
8+
requests = "~=2.32.5"
9+
requests-unixsocket = "==0.4.1"
910
ansible-core = "~=2.18.3"
1011
urllib3 = "~=2.5.0"
1112
kubernetes = "==33.1.0"
12-
requests = "~=2.32.5"
1313

1414
[dev-packages]
1515

images/ansible-operator/Pipfile.lock

Lines changed: 94 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .events import status_handler, event_handler # noqa

0 commit comments

Comments
 (0)