From cca5130e024022d0c28f9e4764f9c2f51018a0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Thu, 31 Mar 2022 19:18:42 +0200 Subject: [PATCH] Use poetry to install fasjson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise it's no use locking the dependency versions. Signed-off-by: Aurélien Bompard --- .../fasjson/templates/Dockerfile | 18 ++++++------------ .../fasjson/templates/httpd.conf | 1 + 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/roles/openshift-apps/fasjson/templates/Dockerfile b/roles/openshift-apps/fasjson/templates/Dockerfile index 99f1fa25f1..c5f6aa859e 100644 --- a/roles/openshift-apps/fasjson/templates/Dockerfile +++ b/roles/openshift-apps/fasjson/templates/Dockerfile @@ -3,13 +3,11 @@ LABEL \ name="fasjson" \ vendor="Fedora Infrastructure" \ license="GPLv3+" -ENV HOME=/tmp +ENV HOME=/opt RUN dnf install -y \ openldap-clients \ vim \ git \ - python3-pip \ - python3-setuptools \ ipa-client \ gcc \ python-devel \ @@ -20,21 +18,17 @@ RUN dnf install -y \ mod_session \ policycoreutils-python-utils \ python3-mod_wsgi \ - python3-dns \ - python3-flask \ - python3-gssapi \ - python3-requests-gssapi \ - python3-ldap \ - python3-pip \ - python3-wheel && \ + python3-pip && \ dnf autoremove -y && \ dnf clean all -y +RUN python3 -m venv /opt/venv +RUN /opt/venv/bin/pip install poetry RUN git clone https://github.com/fedora-infra/fasjson.git && \ pushd fasjson && \ git checkout {{ (env == 'production')|ternary('stable', 'staging') }} && \ - pip-3 install . && \ + /opt/venv/bin/poetry config virtualenvs.create false && \ + /opt/venv/bin/poetry install --no-dev && \ popd && \ - rm -rf fasjson RUN rm -f /etc/krb5.conf && ln -sf /etc/krb5/krb5.conf /etc/krb5.conf && \ rm -f /etc/openldap/ldap.conf && ln -sf /etc/ipa/ldap.conf /etc/openldap/ldap.conf EXPOSE 8080 diff --git a/roles/openshift-apps/fasjson/templates/httpd.conf b/roles/openshift-apps/fasjson/templates/httpd.conf index 6792c022bf..4120edc791 100644 --- a/roles/openshift-apps/fasjson/templates/httpd.conf +++ b/roles/openshift-apps/fasjson/templates/httpd.conf @@ -47,6 +47,7 @@ ErrorLog /httpdir/error.log LogLevel info WSGISocketPrefix run/wsgi +WSGIPythonHome /opt/venv WSGIDaemonProcess fasjson processes=4 threads=1 maximum-requests=500 \ display-name=%{GROUP} socket-timeout=2147483647 \ lang=C.UTF-8 locale=C.UTF-8 home=/httpdir