diff --git a/apps/swh-deposit/Dockerfile b/apps/swh-deposit/Dockerfile index d674ff86cea9a8add94e6f7a5daa7e559b223ca9..7f1ae6847840aa472c11ae7b367bbf4f41b75289 100644 --- a/apps/swh-deposit/Dockerfile +++ b/apps/swh-deposit/Dockerfile @@ -10,15 +10,15 @@ RUN apt-get -y update && \ mkdir /etc/swh USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --chown=swh:swh entrypoint.sh /opt/swh RUN chmod u+x /opt/swh/entrypoint.sh diff --git a/apps/swh-graph/Dockerfile b/apps/swh-graph/Dockerfile index a15d9fb3da74a8fa8a2e9c9014b1636439b8b7bf..24a23831c0f2047cd1ef6360de2920467a0b2c5a 100644 --- a/apps/swh-graph/Dockerfile +++ b/apps/swh-graph/Dockerfile @@ -36,15 +36,15 @@ RUN chown $UID:$GID /srv/graph /srv/dataset VOLUME /srv/graph /srv/dataset USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/bin/python3 -m pip install --upgrade pip --break-system-packages && \ - pip install --no-cache-dir -r requirements-frozen.txt --break-system-packages +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --from=rust_build /usr/local/cargo/bin/swh-graph* /usr/local/bin/ ENV SWH_CONFIG_FILENAME=/etc/swh/config.yml diff --git a/apps/swh-graphql/Dockerfile b/apps/swh-graphql/Dockerfile index c24d8cad82c599048e73dd941e0c59d91805d90e..ac62dd6c159a4af2e373af4c6830af50c38adbb1 100644 --- a/apps/swh-graphql/Dockerfile +++ b/apps/swh-graphql/Dockerfile @@ -6,22 +6,22 @@ RUN apt-get -y update && \ apt-get install -y libcmph-dev librdkafka-dev && \ apt clean && \ addgroup --gid 1000 swh && \ - useradd --gid 1000 --uid 1000 -m -d /opt/graphql swh && \ + useradd --gid 1000 --uid 1000 -m -d /opt/swh swh && \ mkdir /etc/swh USER swh -WORKDIR /opt/graphql +RUN /usr/local/bin/python -m venv /opt/swh/venv +WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/graphql +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -ENV PYTHONPATH=/opt/graphql -ENV PATH=/opt/graphql/.local/bin:$PATH +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh/ +RUN uv pip sync --no-cache requirements-frozen.txt -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt - -COPY --chown=swh:swh entrypoint.sh /opt/graphql -RUN chmod u+x /opt/graphql/entrypoint.sh +COPY --chown=swh:swh entrypoint.sh /opt/swh/ +RUN chmod u+x /opt/swh/entrypoint.sh ENV SWH_CONFIG_FILENAME=/etc/swh/config.yml ENV PORT 5013 @@ -30,4 +30,4 @@ ENV THREADS 4 ENV WORKERS 2 ENV TIMEOUT 3600 -ENTRYPOINT ["/opt/graphql/entrypoint.sh"] +ENTRYPOINT ["/opt/swh/entrypoint.sh"] diff --git a/apps/swh-loader-bzr/Dockerfile b/apps/swh-loader-bzr/Dockerfile index bc37a1722a217dde0e3a9ff99c84d9d74a20fd2f..aa52b3e1f6cd44f7a6063271cb4479f16128ee4f 100644 --- a/apps/swh-loader-bzr/Dockerfile +++ b/apps/swh-loader-bzr/Dockerfile @@ -11,15 +11,15 @@ RUN apt-get -y update && \ mkdir /etc/swh USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --chown=swh:swh entrypoint.sh /opt/swh RUN chmod u+x /opt/swh/entrypoint.sh diff --git a/apps/swh-loader-bzr/entrypoint.sh b/apps/swh-loader-bzr/entrypoint.sh index 564221961dadd1dda294ccf37d209898a7933847..f36a373570864ebd2337f05176e2d369982b61bf 100644 --- a/apps/swh-loader-bzr/entrypoint.sh +++ b/apps/swh-loader-bzr/entrypoint.sh @@ -16,6 +16,7 @@ case "$1" in # workdir as the ephemeral volumes are not recreated echo "Cleaning /tmp..." rm -rf /tmp/* + echo Starting the swh Celery worker for ${SWH_WORKER_INSTANCE} exec python -m celery \ --app=swh.scheduler.celery_backend.config.app \ diff --git a/apps/swh-loader-package/Dockerfile b/apps/swh-loader-package/Dockerfile index 55bea9984a47023af150b3ce842d95a88047e7f4..72cc48834bd3bfcafde5bc18a97c60aa9392e8f0 100644 --- a/apps/swh-loader-package/Dockerfile +++ b/apps/swh-loader-package/Dockerfile @@ -12,15 +12,15 @@ RUN apt-get -y update && \ mkdir /etc/swh USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --chown=swh:swh entrypoint.sh /opt/swh RUN chmod u+x /opt/swh/entrypoint.sh diff --git a/apps/swh-loader-savecodenow/Dockerfile b/apps/swh-loader-savecodenow/Dockerfile index 2c5091542bcbd6ba83f885593b3aad21a5bfdde4..71bca8ebe6f56b7a352c9eca6b9686b38dab8d28 100644 --- a/apps/swh-loader-savecodenow/Dockerfile +++ b/apps/swh-loader-savecodenow/Dockerfile @@ -17,15 +17,15 @@ RUN apt-get -y update && \ mkdir /etc/swh USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --chown=swh:swh entrypoint.sh /opt/swh RUN chmod u+x /opt/swh/entrypoint.sh @@ -35,4 +35,4 @@ ENV SWH_WORKER_INSTANCE=loader ENV CONCURRENCY=1 ENV MAX_TASKS_PER_CHILD=5 -ENTRYPOINT ["/opt/swh/entrypoint.sh"] +ENTRYPOINT [ "/opt/swh/entrypoint.sh" ] diff --git a/apps/swh-loader-svn/Dockerfile b/apps/swh-loader-svn/Dockerfile index 718f42af5077671c9577f21a98aa80c61005edd3..62bdf585885b71b7259c1275872a8de7d09d8b97 100644 --- a/apps/swh-loader-svn/Dockerfile +++ b/apps/swh-loader-svn/Dockerfile @@ -16,15 +16,15 @@ RUN apt-get -y update && \ mkdir /etc/swh USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --chown=swh:swh entrypoint.sh /opt/swh RUN chmod u+x /opt/swh/entrypoint.sh diff --git a/apps/swh-toolbox/Dockerfile b/apps/swh-toolbox/Dockerfile index 03c13ff0985f12694d26e747589130048710b025..33fe3aecb99aa55bd180ffbce98f40b59f645f8b 100644 --- a/apps/swh-toolbox/Dockerfile +++ b/apps/swh-toolbox/Dockerfile @@ -19,15 +19,15 @@ RUN wget -q https://github.com/fullstorydev/grpcurl/releases/download/v1.9.1/grp dpkg -i grpcurl_1.9.1_linux_amd64.deb USER swh +RUN /usr/local/bin/python -m venv /opt/swh/venv WORKDIR /opt/swh -COPY --chown=swh:swh requirements-frozen.txt /opt/swh - -ENV PYTHONPATH=/opt/swh -ENV PATH=/opt/swh/.local/bin:$PATH +ENV PYTHONPATH=/opt/swh/venv +ENV PATH=/opt/swh/venv/bin:$PATH -RUN /usr/local/bin/python -m pip install --upgrade pip && \ - pip install --no-cache-dir -r requirements-frozen.txt +RUN python -m pip install uv +COPY --chown=swh:swh requirements-frozen.txt /opt/swh +RUN uv pip sync --no-cache requirements-frozen.txt COPY --chown=swh:swh entrypoint.sh /opt/swh RUN chmod u+x /opt/swh/entrypoint.sh