Skip to content

Deploy & cron

CodeDeploy flow

appspec.yml triggers scripts/after_install, which:

  1. Creates Python 3.12 venv at /srv/tasks-scheduler/env/
  2. pip install -r requirements.txt (includes fs_config from GitHub)
  3. Writes /srv/tasks-scheduler/.env with ENVIRONMENT=stg|prd from $DEPLOYMENT_GROUP_NAME

execute.sh

Cron and operators invoke Luigi through the wrapper:

/srv/tasks-scheduler/execute.sh <module> <TaskClass> <workers>

Example (staging news_fetch):

/srv/tasks-scheduler/execute.sh pipes.tasks.alerts.news_fetch NewsFetchScheduler 1

The script:

  1. cd /srv/tasks-scheduler
  2. Sources .env if present
  3. Runs PYTHONPATH=$SKYNETPATH env/bin/python -m luigi --module …

execute_gen_python.sh

For non-Luigi scripts (e.g. series_uploader_google_sheets.py):

/srv/tasks-scheduler/execute_gen_python.sh pipes/tasks/series_uploader_google_sheets.py

Crontab

Schedules live under crontab/:

File Purpose
stage-crons.txt Staging tasks-scheduler entries
prd-harvest-05-sources.txt Mixed references (mostly harvester)

Verify the active news_fetch line before editing production cron.

Luigi daemon (optional)

config/luigi/server/luigi.cfg + luigid.service configure a central scheduler on port 8082. Local laptop runs typically use --local-scheduler instead.

Docs publish

After merging this package, hq/infrastructure/docs-site/build-and-deploy.sh builds the MkDocs site to https://docs.skyneto.com/tasks-scheduler/.