Install npm and celery on Transtats and restore route annotations

Credits go to suanand for providing the patch.
This commit is contained in:
Mikolaj Izdebski 2019-02-21 15:39:23 +01:00
parent 6ea07e8871
commit 1e46efdc75
4 changed files with 18 additions and 4 deletions

View file

@ -39,6 +39,8 @@
file: route.yml file: route.yml
serviceport: web serviceport: web
servicename: transtats-web servicename: transtats-web
annotations:
haproxy.router.openshift.io/timeout: 8m
- role: openshift/object - role: openshift/object
app: transtats app: transtats
file: deploymentconfig.yml file: deploymentconfig.yml

View file

@ -12,7 +12,7 @@ spec:
USER root USER root
RUN useradd -ms /bin/bash tsuser RUN useradd -ms /bin/bash tsuser
RUN dnf -y update && \ RUN dnf -y update && \
dnf -y install git make cpio koji file patch intltool libtool gtk3-devel && \ dnf -y install git make cpio koji file patch intltool libtool gtk3-devel npm supervisor redis && \
dnf clean all dnf clean all
RUN mkdir /workspace RUN mkdir /workspace
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
@ -21,8 +21,15 @@ spec:
RUN pip3 install -r /workspace/requirements/base.txt RUN pip3 install -r /workspace/requirements/base.txt
RUN cp deploy/docker-compose/transtats/launch.sh /usr/bin/transtats.sh RUN cp deploy/docker-compose/transtats/launch.sh /usr/bin/transtats.sh
RUN cp deploy/docker-compose/transtats/wait-for-it.sh /usr/bin/wait-for-it.sh RUN cp deploy/docker-compose/transtats/wait-for-it.sh /usr/bin/wait-for-it.sh
RUN mkdir staticfiles RUN cp deploy/docker/conf/redis.ini /etc/supervisord.d/
RUN chmod g+w transtats/logs dashboard/sandbox staticfiles RUN cp deploy/docker/conf/transtats_celery.ini /etc/supervisord.d/
RUN cp deploy/docker/conf/transtats_celerybeat.ini /etc/supervisord.d/
RUN mkdir staticfiles false run transtats/logs/celery
RUN touch /workspace/transtats/logs/celery/redis.log
RUN touch /workspace/transtats/logs/celery/redis_err.log
RUN touch /workspace/transtats/logs/celery/transtats_worker.log
RUN touch /workspace/transtats/logs/celery/transtats_beat.log
RUN chmod -R g+w transtats/logs transtats/node dashboard/sandbox staticfiles false run
RUN chown -R tsuser /workspace RUN chown -R tsuser /workspace
EXPOSE 8080 EXPOSE 8080
USER tsuser USER tsuser
@ -30,6 +37,7 @@ spec:
type: Dockerfile type: Dockerfile
strategy: strategy:
dockerStrategy: dockerStrategy:
noCache: true
env: env:
- name: UPGRADE_PIP_TO_LATEST - name: UPGRADE_PIP_TO_LATEST
value: "true" value: "true"

View file

@ -23,7 +23,7 @@ spec:
- containerPort: 8080 - containerPort: 8080
env: env:
- name: GUNICORN_CMD_ARGS - name: GUNICORN_CMD_ARGS
value: "--workers 3 --bind 0.0.0.0:8080 --timeout 400" value: "--workers 3 --bind 0.0.0.0:8080 --timeout 500"
- name: DATABASE_ENGINE - name: DATABASE_ENGINE
value: postgresql value: postgresql
- name: DATABASE_NAME - name: DATABASE_NAME

View file

@ -1,6 +1,10 @@
apiVersion: v1 apiVersion: v1
kind: Route kind: Route
metadata: metadata:
{% if annotations is defined %}
annotations:
{{ annotations | to_nice_yaml | indent(4) }}
{% endif %}
name: {{ routename }} name: {{ routename }}
labels: labels:
app: {{ app }} app: {{ app }}