Skip to content

Commit

Permalink
Merge pull request #654 from mdellweg/extra_install
Browse files Browse the repository at this point in the history
Install some extra python packages
  • Loading branch information
mdellweg authored Jul 19, 2024
2 parents 8943b86 + 0a3ab9e commit f03e7a0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGES/653.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Install python-nginx on pulp-minimal.
2 changes: 2 additions & 0 deletions images/assets/requirements.extra.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rhsm
django-auth-ldap
1 change: 1 addition & 0 deletions images/assets/requirements.minimal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-nginx # needed by route-paths.py
33 changes: 21 additions & 12 deletions images/assets/route_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
import json
import re
import sys
import nginx
from pathlib import Path

import nginx

nginx_configs = []

for i in pkgutil.iter_modules():
# filter pulp and galaxy packages
if re.search(r'pulp_.*|galaxy_ng',i.name):
snippet_file = i.module_finder.path + "/" + i.name + "/app/webserver_snippets/nginx.conf"
if re.search(r"pulp_.*|galaxy_ng", i.name):
snippet_file = (
i.module_finder.path + "/" + i.name + "/app/webserver_snippets/nginx.conf"
)
# only add the filename to array if it exists
if Path(snippet_file).is_file():
nginx_configs.append(snippet_file)
Expand All @@ -21,7 +24,11 @@
router = []

for plugin_conf in nginx_configs:
app = "galaxy" if "galaxy" in plugin_conf else plugin_conf.split("pulp_")[1].split("/")[0]
app = (
"galaxy"
if "galaxy" in plugin_conf
else plugin_conf.split("pulp_")[1].split("/")[0]
)
conf = nginx.loadf(plugin_conf)
for location in conf.filter("Location"):
path = location.value
Expand All @@ -47,20 +54,22 @@
raise RuntimeError(f"Location {path} doesn't have proxy_pass")

new_path = {
"name":f"{name}-{app}{path.rstrip('/').replace('/', '-').replace('_', '-')}",
"name": f"{name}-{app}{path.rstrip('/').replace('/', '-').replace('_', '-')}",
"path": path,
"targetPort": target_port,
"serviceName": svc_name,
}
if rewrite:
new_path["rewrite"] = rewrite
router.append({
"name":f"{name}-{app}{path.rstrip('/').replace('/', '-').replace('_', '-')}2",
"path": path.rstrip("/"),
"targetPort": target_port,
"serviceName": svc_name,
"rewrite": rewrite,
})
router.append(
{
"name": f"{name}-{app}{path.rstrip('/').replace('/', '-').replace('_', '-')}2",
"path": path.rstrip("/"),
"targetPort": target_port,
"serviceName": svc_name,
"rewrite": rewrite,
}
)

router.append(new_path)

Expand Down
10 changes: 6 additions & 4 deletions images/pulp-minimal/nightly/Containerfile.core
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
ARG FROM_TAG="latest"
FROM pulp/base:${FROM_TAG}

COPY images/assets/requirements.extra.txt /requirements.extra.txt
COPY images/assets/requirements.minimal.txt /requirements.minimal.txt

RUN pip3 install \
pulpcore[s3,google,azure]@git+https://github.com/pulp/pulpcore.git#egg=pulpcore \
pulpcore[s3,google,azure]@git+https://github.com/pulp/pulpcore.git \
git+https://github.com/pulp/pulp_ansible.git \
git+https://github.com/pulp/pulp-certguard.git \
git+https://github.com/pulp/pulp_container.git \
git+https://github.com/pulp/pulp_deb.git \
git+https://github.com/pulp/pulp_file.git \
git+https://github.com/pulp/pulp_gem.git \
git+https://github.com/pulp/pulp_maven.git \
git+https://github.com/pulp/pulp_ostree.git \
git+https://github.com/pulp/pulp_python.git \
git+https://github.com/pulp/pulp_rpm.git \
rhsm \
-r /requirements.extra.txt \
-r /requirements.minimal.txt \
-c /constraints.txt && \
rm -rf /root/.cache/pip

Expand Down
6 changes: 5 additions & 1 deletion images/pulp-minimal/stable/Containerfile.core
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ARG PULP_PYTHON_VERSION=""
ARG PULP_RPM_VERSION=""
ARG PULP_OSTREE_VERSION=""

COPY images/assets/requirements.extra.txt /requirements.extra.txt
COPY images/assets/requirements.minimal.txt /requirements.minimal.txt

RUN pip3 install --upgrade \
pulpcore[s3,google,azure]${PULPCORE_VERSION} \
pulp-ansible${PULP_ANSIBLE_VERSION} \
Expand All @@ -23,7 +26,8 @@ RUN pip3 install --upgrade \
pulp-python${PULP_PYTHON_VERSION} \
pulp-rpm${PULP_RPM_VERSION} \
pulp-ostree${PULP_OSTREE_VERSION} \
rhsm \
-r /requirements.extra.txt \
-r /requirements.minimal.txt \
-c /constraints.txt && \
rm -rf /root/.cache/pip

Expand Down
6 changes: 3 additions & 3 deletions images/pulp/nightly/Containerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
ARG FROM_TAG="latest"
FROM pulp/pulp-ci-centos9:${FROM_TAG}

COPY images/assets/requirements.extra.txt /requirements.extra.txt

RUN pip3 install --upgrade \
pulpcore[s3,google,azure]@git+https://github.com/pulp/pulpcore@main \
git+https://github.com/pulp/pulp_ansible@main \
git+https://github.com/pulp/pulp-certguard@main \
git+https://github.com/pulp/pulp_container@main \
git+https://github.com/pulp/pulp_deb@main \
git+https://github.com/pulp/pulp_file@main \
git+https://github.com/pulp/pulp_gem@main \
git+https://github.com/pulp/pulp_maven@main \
git+https://github.com/pulp/pulp_ostree@main \
git+https://github.com/pulp/pulp_python@main \
git+https://github.com/pulp/pulp_rpm@main \
rhsm \
-r /requirements.extra.txt \
-c /constraints.txt && \
rm -rf /root/.cache/pip

Expand Down
5 changes: 3 additions & 2 deletions images/pulp/stable/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ARG PULP_PYTHON_VERSION=""
ARG PULP_RPM_VERSION=""
ARG PULP_OSTREE_VERSION=""

COPY images/assets/requirements.extra.txt /requirements.extra.txt

RUN pip3 install --upgrade \
pulpcore[s3,google,azure]${PULPCORE_VERSION} \
pulp-ansible${PULP_ANSIBLE_VERSION} \
Expand All @@ -25,8 +27,7 @@ RUN pip3 install --upgrade \
pulp-python${PULP_PYTHON_VERSION} \
pulp-rpm${PULP_RPM_VERSION} \
pulp-ostree${PULP_OSTREE_VERSION} \
rhsm \
requests \
-r /requirements.extra.txt \
-c /constraints.txt && \
rm -rf /root/.cache/pip

Expand Down

0 comments on commit f03e7a0

Please sign in to comment.