From f81afda35840fb616c6061f77874b22b30e9f446 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Sat, 11 May 2019 01:29:07 +0200 Subject: [PATCH] Attempt to set up gunicorn Signed-off-by: Patrick Uiterwijk --- roles/fas_server/templates/configmap.yml | 14 ++++++++++++++ .../fas/templates/buildconfig-fas.yml | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/roles/fas_server/templates/configmap.yml b/roles/fas_server/templates/configmap.yml index d5f7785c0a..0183377d69 100644 --- a/roles/fas_server/templates/configmap.yml +++ b/roles/fas_server/templates/configmap.yml @@ -80,6 +80,20 @@ data: app_start.sh: |- set -xe + python /etc/fas/app_gunicorn.py --bind :8000 --chdir /app app + app_gunicorn.py: |- + # We need a custom gunicorn script because we need to inject various requires + import __main__ + __main__.__requires__ = [] + __main__.__requires__.append('SQLAlchemy >= 0.5, <= 0.6') + __main__.__requires__.append('TurboGears[future]') + __main__.__requires__.append('gunicorn==18.0') + import sys + from pkg_resources import load_entry_point + if __name__ == '__main__': + sys.exit( + load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')() + ) fas_sync_cert.pem: |- {{ lookup('file', '{{ roles_path }}/fas_server/files/ipa.{{env}}.pem') | indent() }} fas-log.cfg: |- diff --git a/roles/openshift-apps/fas/templates/buildconfig-fas.yml b/roles/openshift-apps/fas/templates/buildconfig-fas.yml index 8a17ea30af..5ef165e160 100644 --- a/roles/openshift-apps/fas/templates/buildconfig-fas.yml +++ b/roles/openshift-apps/fas/templates/buildconfig-fas.yml @@ -34,9 +34,12 @@ spec: rm -f /usr/lib/python2.6/site-packages/fas/config/log.cfg && \ ln -sf /etc/fas/krb5.conf /etc/krb5.conf && \ ln -sf /etc/fas/fas.cfg /etc/fas.cfg && \ - ln -sf /etc/fas/fas-log.cfg /usr/lib/python2.6/site-packages/fas/config/log.cfg + ln -sf /etc/fas/fas-log.cfg /usr/lib/python2.6/site-packages/fas/config/log.cfg && \ + mkdir -p /app && \ + ln -sf /usr/sbin/fas.wsgi /app/app.py EXPOSE 8080 + EXPOSE 8000 ENTRYPOINT bash type: Dockerfile strategy: