Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696059
D8500.id30620.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D8500.id30620.diff
View Options
diff --git a/apps/swh-loader-mercurial/Dockerfile b/apps/swh-loader-mercurial/Dockerfile
new file mode 100644
--- /dev/null
+++ b/apps/swh-loader-mercurial/Dockerfile
@@ -0,0 +1,33 @@
+# 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 \
+ 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"
diff --git a/apps/swh-loader-mercurial/entrypoint.sh b/apps/swh-loader-mercurial/entrypoint.sh
new file mode 100644
--- /dev/null
+++ b/apps/swh-loader-mercurial/entrypoint.sh
@@ -0,0 +1,23 @@
+#!/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
diff --git a/apps/swh-loader-mercurial/requirements-frozen.txt b/apps/swh-loader-mercurial/requirements-frozen.txt
new file mode 100644
--- /dev/null
+++ b/apps/swh-loader-mercurial/requirements-frozen.txt
@@ -0,0 +1,88 @@
+aiohttp==3.8.1
+aiohttp-utils==3.1.1
+aiosignal==1.2.0
+amqp==5.1.1
+async-timeout==4.0.2
+attrs==22.1.0
+attrs-strict==1.0.0
+billiard==3.6.4.0
+blinker==1.5
+cassandra-driver==3.25.0
+celery==5.2.7
+certifi==2022.9.14
+cffi==1.15.1
+chardet==5.0.0
+charset-normalizer==2.1.1
+click==8.1.3
+click-didyoumean==0.3.0
+click-plugins==1.1.1
+click-repl==0.2.0
+confluent-kafka==1.9.2
+Deprecated==1.2.13
+exceptiongroup==1.0.0rc9
+Flask==2.2.2
+frozenlist==1.3.1
+geomet==0.2.1.post1
+gunicorn==20.1.0
+humanize==4.3.0
+hypothesis==6.54.6
+idna==3.4
+importlib-metadata==4.12.0
+iniconfig==1.1.1
+iso8601==1.0.2
+itsdangerous==2.1.2
+Jinja2==3.1.2
+kombu==5.2.4
+MarkupSafe==2.1.1
+mercurial==6.2.2
+mirakuru==2.4.2
+msgpack==1.0.4
+multidict==6.0.2
+mypy-extensions==0.4.3
+packaging==21.3
+patool==1.12
+pika==1.3.0
+pkginfo==1.8.3
+pluggy==1.0.0
+port-for==0.6.2
+prompt-toolkit==3.0.31
+psutil==5.9.2
+psycopg2==2.9.3
+py==1.11.0
+pycparser==2.21
+pyparsing==3.0.9
+pytest==7.1.3
+pytest-postgresql==3.1.3
+python-dateutil==2.8.2
+python-debian==0.1.47
+python-hglib==2.6.2
+python-magic==0.4.27
+python-mimeparse==1.6.0
+pytz==2022.2.1
+PyYAML==6.0
+redis==4.3.4
+requests==2.28.1
+sentry-sdk==1.9.8
+six==1.16.0
+sortedcontainers==2.4.0
+swh.core==2.14.1
+swh.counters==0.9.1
+swh.journal==1.1.0
+swh.loader.core==4.1.0
+swh.loader.mercurial==3.1.1
+swh.model==6.4.1
+swh.objstorage==2.0.1
+swh.perfecthash==0.1.2
+swh.scheduler==1.2.2
+swh.storage==1.6.0
+tenacity==8.0.1
+toml==0.10.2
+tomli==2.0.1
+typing_extensions==4.3.0
+urllib3==1.26.12
+vine==5.0.0
+wcwidth==0.2.5
+Werkzeug==2.2.2
+wrapt==1.14.1
+yarl==1.8.1
+zipp==3.8.1
diff --git a/apps/swh-loader-mercurial/requirements.txt b/apps/swh-loader-mercurial/requirements.txt
new file mode 100644
--- /dev/null
+++ b/apps/swh-loader-mercurial/requirements.txt
@@ -0,0 +1,2 @@
+swh-loader-mercurial
+
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 17, 6:47 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3232662
Attached To
D8500: Add new swh-loader-mercurial application
Event Timeline
Log In to Comment