Pipelines & crons
Run a pipeline every night
A cron expression on a function. Every night the whole prep, train, evaluate chain runs unattended and its outputs land on a volume; the dashboard shows each run as a task.
Whatever the scheduled function asks for; the stages it calls run on their own containers.
How it works
- 1@cron(when="0 2 * * *") deploys a function that the controlplane invokes on the cron (UTC).
- 2Inside it, call other functions with .remote() and .map(); each stage is its own task and container.
- 3Outputs go to a volume; a versioned folder per run keeps yesterday's results next to today's.
- 4levers9 deployment list shows the cron; stop it to pause, start to resume.
The code
demo/cron/app.py
from levers9 import cron @cron(when="0 2 * * *", cpu=1, memory="512Mi") def nightly(): data = prep.remote() models = list(train.map(configs)) package.remote(evaluate.remote(models)["best"])
run it
cd demo/cron levers9 deploy app.py:nightly --name nightly
Where to go next
Related
Train four models in parallel on L40S
Prep on CPU, fan out training to one GPU container per config, evaluate, package: a pipeline in plain Python.
Background jobs with retries
A queue you feed from Python or a webhook; each task gets its own container and a retry policy.
Share files between jobs on a volume
Persistent folders mounted into every container; browse, upload and download from the dashboard or the CLI.