From c5acfa5f5ddd31405a700b7534f9f5a978b1e0e7 Mon Sep 17 00:00:00 2001 From: Adrien Chapelet Date: Fri, 4 Oct 2024 09:44:02 +0200 Subject: [PATCH] ci: test tyr-worker --- docker/debian11/Dockerfile-tyr-worker | 29 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/docker/debian11/Dockerfile-tyr-worker b/docker/debian11/Dockerfile-tyr-worker index 5b64044c74..148d3548b6 100644 --- a/docker/debian11/Dockerfile-tyr-worker +++ b/docker/debian11/Dockerfile-tyr-worker @@ -1,5 +1,7 @@ FROM debian:bullseye-slim +# COPY ./source . + RUN apt-get update \ && apt install -y python git libgeos-c1v5 libpq5 curl gcc pkg-config libssl-dev @@ -24,22 +26,22 @@ RUN cd tartare-tools \ && cp target/release/enrich-ntfs-with-addresses /usr/bin/ \ && cp target/release/split-trip-geometries /usr/bin/ \ && cd .. \ - && rm -rf tartare-tools + && rm -rf tartare-tools \ + && mkdir /usr/src \ + && mkdir /usr/src/app \ + && mkdir /usr/src/app/tyr \ + && cp source/tyr /usr/src/app/tyr # COPY navitia-common_*deb navitia-tyr_*.deb navitia-ed_*.deb navitia-cities_*.deb mimirsbrunn7_jessie-*.deb cosmogony2cities_*.deb mimirsbrunn-config-*.deb ./ # # install navitia-common package # RUN dpkg -i ./navitia-common_*.deb || exit 0 - # # install navitia-tyr package # RUN dpkg -i ./navitia-tyr_*.deb || exit 0 - # # install navitia-ed package # RUN dpkg -i ./navitia-ed_*.deb || exit 0 - # # install navitia-cities package # RUN dpkg -i ./navitia-cities_*.deb || exit 0 - # # install navitia-mimirsbrunn package # RUN dpkg -i ./mimirsbrunn7_jessie-*.deb \ # # install cosmogony2cities package @@ -57,22 +59,27 @@ RUN cd tartare-tools \ # mimirsbrunn7_jessie-*.deb \ # cosmogony2cities_*.deb + +WORKDIR /usr/src/app/ + # install tyr requirements -RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt +RUN pip install --no-cache-dir -r /usr/src/app/tyr/requirements.txt RUN apt install -y --force-yes unzip RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" RUN unzip awscliv2.zip RUN ./aws/install - EXPOSE 5000 - -WORKDIR /usr/src/app/ -RUN cp /usr/bin/manage_tyr.py /usr/src/app/manage_tyr.py +# RUN cp /usr/bin/manage_tyr.py /usr/src/app/manage_tyr.py # TODO change the user to remove this ugly C_FORCE_ROOT ENV C_FORCE_ROOT=1 ENV TYR_WORKER_N_PROC=1 -ENTRYPOINT ["celery", "worker", "-A", "tyr.tasks", "-O", "fair"] + +# COPY docker/run_tyr_worker.sh /usr/src/app/ +# RUN chmod +x /usr/src/app/run_tyr_worker.sh +# ENTRYPOINT ["bash", "/usr/src/app/run_tyr_worker.sh"] + +ENTRYPOINT ["celery", "worker", "-A", "tyr.tasks", "-O", "fair"] \ No newline at end of file