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

Add new swh-toolbox application

This is a deployment toolbox. For starters, it will ease the registering of new
scheduler task type.

Refs. sysadm-environment#5030
parent ec686d68
No related branches found
No related tags found
1 merge request!25Add new swh-toolbox application
# Deeply inspired from the Dockerfile of the swh-graph project
FROM python:3.10-bullseye
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y libcmph-dev librdkafka-dev libsystemd-dev \
opam git r-base-dev \
sed && \
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
ENTRYPOINT "/opt/swh/entrypoint.sh"
#!/bin/bash
set -e
case "$1" in
"shell")
shift
echo "Running command $@"
exec bash -i "$@"
;;
*)
echo "Registering new swh scheduler tasks"
exec python -m swh scheduler \
--config-file ${SWH_CONFIG_FILENAME} \
task-type register
;;
esac
swh.scheduler
swh.lister
swh.loader.core
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