Skip to content

Eyevinn/python-job-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Job Runner

A one-shot Python job container for OSC. On each invocation it clones a Git repository, installs dependencies, and executes a script — then exits. Scheduling is handled externally by the OSC platform (cron trigger), not inside the container.

Environment variables

Variable Required Description
SOURCE_URL Yes HTTPS URL of the Git repository to clone (supports #branch and /tree/branch fragments)
WORKER_CMD No Shell command to run instead of the default entry point
SUB_PATH No Subdirectory within the cloned repo to use as the working directory
GIT_TOKEN / GITHUB_TOKEN No Personal access token for private repositories
CONFIG_SVC No OSC config service name — exports its key/value pairs as env vars before the job runs
OSC_ACCESS_TOKEN No OSC PAT required when CONFIG_SVC is set
OSC_ENV No OSC environment (prod/dev); auto-detected from OSC_MCP_URL if unset

Entry point resolution

The runner looks for an entry point in this order:

  1. WORKER_CMD — if set, executes it as a shell command
  2. job.py — executed with python job.py
  3. main.py — executed with python main.py

If none are found the container exits with an error.

Dependency installation

Detected automatically in this order: pyproject.tomlrequirements.txtsetup.py. A setup.sh in the repo root is executed after pip install if present.

Local usage

docker build -t python-job-runner .
docker run --rm \
  -e SOURCE_URL=https://github.com/your-org/your-job-repo \
  -e WORKER_CMD="python myjob.py --date 2026-01-01" \
  python-job-runner

License

MIT

About

Cron-scheduled Python job runner for OSC — clones a repo and executes a script on a configurable schedule

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors