diff --git a/apps/swh-storage-replayer/Dockerfile b/apps/swh-storage-replayer/Dockerfile new file mode 100644 index 0000000..6654953 --- /dev/null +++ b/apps/swh-storage-replayer/Dockerfile @@ -0,0 +1,32 @@ +# 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 && \ + rm -rf /var/lib/dpkg && \ + 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 + +ENV PYTHONPATH=/opt/swh +ENV PATH=/opt/swh/.local/bin:$PATH + +RUN /usr/local/bin/python -m pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements-frozen.txt && \ + pip install gunicorn + +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 LOG_LEVEL INFO +ENV STATSD_PORT=9125 +ENV STATSD_HOST=prometheus-statsd-exporter + +ENTRYPOINT "/opt/swh/entrypoint.sh" diff --git a/apps/swh-storage-replayer/entrypoint.sh b/apps/swh-storage-replayer/entrypoint.sh new file mode 100644 index 0000000..e39a200 --- /dev/null +++ b/apps/swh-storage-replayer/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -z "${SWH_CONFIG_FILENAME}" ]; then + echo "The SWH_CONFIG_FILENAME" environment must be set + exit 1 +fi + +if [ ! -e "${SWH_CONFIG_FILENAME}" ]; then + echo "The config file ${SWH_CONFIG_FILENAME} does not exists" + exit 1 +fi + +# start the replayer +echo "Starting the replayer..." +swh storage replay diff --git a/apps/swh-storage-replayer/requirements-frozen.txt b/apps/swh-storage-replayer/requirements-frozen.txt new file mode 100644 index 0000000..cb2fe9c --- /dev/null +++ b/apps/swh-storage-replayer/requirements-frozen.txt @@ -0,0 +1,65 @@ +aiohttp==3.8.1 +aiohttp-utils==3.1.1 +aiosignal==1.2.0 +async-timeout==4.0.2 +attrs==22.1.0 +attrs-strict==1.0.0 +blinker==1.5 +cassandra-driver==3.25.0 +certifi==2022.6.15 +cffi==1.15.1 +charset-normalizer==2.1.0 +click==8.1.3 +confluent-kafka==1.9.2 +Deprecated==1.2.13 +exceptiongroup==1.0.0rc8 +Flask==2.2.2 +frozenlist==1.3.1 +geomet==0.2.1.post1 +gunicorn==20.1.0 +hypothesis==6.54.3 +idna==3.3 +importlib-metadata==4.12.0 +iniconfig==1.1.1 +iso8601==1.0.2 +itsdangerous==2.1.2 +Jinja2==3.1.2 +MarkupSafe==2.1.1 +mirakuru==2.4.2 +msgpack==1.0.4 +multidict==6.0.2 +mypy-extensions==0.4.3 +packaging==21.3 +pluggy==1.0.0 +port-for==0.6.2 +psutil==5.9.1 +psycopg2==2.9.3 +py==1.11.0 +pycparser==2.21 +pyparsing==3.0.9 +pytest==7.1.2 +pytest-postgresql==3.1.3 +python-dateutil==2.8.2 +python-magic==0.4.27 +python-mimeparse==1.6.0 +PyYAML==6.0 +redis==4.3.4 +requests==2.28.1 +sentry-sdk==1.9.5 +six==1.16.0 +sortedcontainers==2.4.0 +swh.core==2.14.0 +swh.counters==0.9.1 +swh.journal==1.1.0 +swh.model==6.4.0 +swh.objstorage==1.0.5 +swh.perfecthash==0.1.2 +swh.storage==1.6.0 +tenacity==8.0.1 +tomli==2.0.1 +typing_extensions==4.3.0 +urllib3==1.26.11 +Werkzeug==2.2.2 +wrapt==1.14.1 +yarl==1.8.1 +zipp==3.8.1 diff --git a/apps/swh-storage-replayer/requirements.txt b/apps/swh-storage-replayer/requirements.txt new file mode 100644 index 0000000..188e663 --- /dev/null +++ b/apps/swh-storage-replayer/requirements.txt @@ -0,0 +1 @@ +swh.storage[journal]