refactor(background-jobs): remove entrypoint.sh and discovery
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -25,9 +25,3 @@ COPY service/scripts/projects/topic_mapper/ ./service/scripts/projects/topic_map
|
||||
|
||||
# The bund foerderportal crawler (runs with its own dir as cwd for its JSON configs).
|
||||
COPY service/scripts/projects/bund/ ./projects/bund/
|
||||
|
||||
# Small dispatcher that maps a job name to the right command.
|
||||
COPY background-jobs/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
# Job dispatcher for the preprocessing worker.
|
||||
# Usage: <job-name> e.g. docker run <image> news
|
||||
set -eu
|
||||
|
||||
JOB="${1:-}"
|
||||
|
||||
case "$JOB" in
|
||||
news)
|
||||
# Enrich new 'aktuell' articles into 'aktuell_postproc' (relevance, authors, keywords).
|
||||
exec python sync.py --sync-delta
|
||||
;;
|
||||
news-stats)
|
||||
# Print counts for the aktuell / aktuell_postproc indices (read-only).
|
||||
exec python sync.py --stats
|
||||
;;
|
||||
news-crawl)
|
||||
# Crawl UDE 'aktuell' into JSON only. --skip-upload keeps Elasticsearch untouched.
|
||||
exec python news/ude/run_pipeline.py --skip-upload --max-items "${NEWS_CRAWL_MAX_ITEMS:-5}"
|
||||
;;
|
||||
bund-crawl)
|
||||
# Crawl the bund foerderportal export via headless Chrome. --skip-upload keeps ES untouched.
|
||||
cd projects/bund || exit 1
|
||||
exec python gpc.data.py --skip-upload
|
||||
;;
|
||||
project-topics)
|
||||
# Map bund-project keywords to OpenAlex topics. --dry-run reads only, writes nothing.
|
||||
exec python -m service.scripts.projects.topic_mapper.map_project_topics \
|
||||
--dry-run \
|
||||
--max-docs "${PROJECT_TOPICS_MAX_DOCS:-50}" \
|
||||
--source-index projects_bund_v1 \
|
||||
--text-field Leistungsplansystematik_fullname \
|
||||
--output-index projects_bund_openalex_topics \
|
||||
--api-base-url "${PROJECT_TOPICS_API_BASE_URL:-http://host.docker.internal:8000}"
|
||||
;;
|
||||
demo-a)
|
||||
exec python demo.py 20
|
||||
;;
|
||||
demo-b)
|
||||
exec python demo.py 25
|
||||
;;
|
||||
demo-c)
|
||||
exec python demo.py 30
|
||||
;;
|
||||
"")
|
||||
echo "No job given. Available jobs: news, news-stats, news-crawl, project-topics, bund-crawl, demo-a, demo-b, demo-c" >&2
|
||||
exit 2
|
||||
;;
|
||||
*)
|
||||
echo "Unknown job: $JOB. Available jobs: news, news-stats, news-crawl, project-topics, bund-crawl, demo-a, demo-b, demo-c" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user