Skip to content
Snippets Groups Projects
Verified Commit e8e51b5b authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Add savecodenow image

This will deprecate the use of the highpriority image.

Refs. swh/infra/sysadm-environment#4881
parent 8e9e1c5b
No related branches found
No related tags found
No related merge requests found
This used to be the "highpriority" image used by the save-code-now functionality
(bundling multiple [d]vcs loaders into one docker image). It's been deprecated in favor
of the "savecodenow" image.
# Deeply inspired from the Dockerfile of the swh-graph project
ARG REGISTRY=container-registry.softwareheritage.org/swh/infra/swh-apps/
ARG RSVNDUMP=/usr/local/bin/rsvndump
FROM ${REGISTRY}rsvndump-base:latest AS rsvndump_image
FROM python:3.10-bullseye
COPY --from=rsvndump_image ${RSVNDUMP} ${RSVNDUMP}
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y libcmph-dev librdkafka-dev \
libsvn-dev libapr1-dev libaprutil1-dev subversion \
cvs bzr opam git patool mercurial && \
apt clean && \
addgroup --gid 1000 swh && \
useradd --gid 1000 --uid 1000 -m -d /opt/swh swh && \
mkdir /etc/swh
USER swh
WORKDIR /opt/swh
COPY --chown=swh:swh requirements-frozen.txt /opt/swh
COPY --chown=swh:swh entrypoint.sh /opt/swh
ENV PYTHONPATH=/opt/swh
ENV PATH=/opt/swh/.local/bin:$PATH
RUN chmod u+x /opt/swh/entrypoint.sh && \
/usr/local/bin/python -m pip install --upgrade pip && \
pip install --no-cache-dir -r requirements-frozen.txt && \
pip install gunicorn
ENV SWH_CONFIG_FILENAME=/etc/swh/config.yml
ENV SWH_WORKER_INSTANCE=loader
ENV CONCURRENCY=1
ENV MAX_TASKS_PER_CHILD=5
ENV LOGLEVEL=INFO
ENTRYPOINT "/opt/swh/entrypoint.sh"
This image is used for the save code now functionality.
It regroups a number of (d)vcs loaders into a single docker image.
#!/bin/bash
set -e
case "$1" in
"shell")
shift
echo "Running command $@"
exec bash -i "$@"
;;
*)
echo Starting the swh Celery worker for ${SWH_WORKER_INSTANCE}
exec python -m celery \
--app=swh.scheduler.celery_backend.config.app \
worker \
--pool=prefork --events \
--concurrency=${CONCURRENCY} \
--max-tasks-per-child=${MAX_TASKS_PER_CHILD} \
-Ofair --loglevel=${LOGLEVEL} \
--without-gossip --without-mingle --without-heartbeat \
--hostname "${SWH_WORKER_INSTANCE}@%h"
;;
esac
swh-loader-bzr
swh-loader-core
swh-loader-cvs
swh-loader-git
swh-loader-svn
swh-loader-mercurial
swh-loader-metadata
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment