Skip to content

Tasks-Scheduler

Offline cron jobs that fetch data from external APIs and persist results to MySQL and S3. Built on Luigi and deployed via AWS CodeDeploy to /srv/tasks-scheduler/.

The active production task is news_fetch — paginates a news API, uploads article images to S3, and upserts rows into the shared tiktok MySQL database.

Stack

Layer Technology
Runtime Python 3.12
Scheduler Luigi 3.x
Data MySQL (tiktok DB), S3, Redis, RabbitMQ
HTTP requests, curl_cffi (image fallback)
Config AWS Secrets Manager + SSM via fs_config
Deploy CodeDeploy + execute.sh cron wrappers

Documentation map

Page What it covers
Setup Prerequisites, venv, AWS
Local development Run Luigi locally without Docker
Configuration & secrets ENVIRONMENT, secret paths
news_fetch pipeline Scheduler, fetcher, pagination
Image fallback curl_cffi for Cloudflare-blocked images
Deploy & cron CodeDeploy, execute.sh, crontab

Task lineage

  • AISD-131 — org documentation portal at docs.skyneto.com
  • AISD-143 — this documentation package
  • AISD-138 — news_fetch early-stop pagination validation

Build these docs locally

cd Tasks-Scheduler
python3.12 -m venv .venv_docs && source .venv_docs/bin/activate
pip install -r requirements-docs.txt
mkdocs build --strict
mkdocs serve   # http://127.0.0.1:8000/

Quick start

export ENVIRONMENT=local
PYTHONPATH="." .venv/bin/python -m luigi \
  --module pipes.tasks.alerts.news_fetch NewsFetchScheduler \
  --workers 1 --log-level DEBUG

See Local development.