Configuration
Every TUKANG_ environment variable, its default and what it changes.
TUKANG_GITHUB_TOKEN_FILE=/run/secrets/github_token
TUKANG_REPOS=you/web,you/api api
TUKANG_JOB_MEMORY=4gThat's a full setup. Everything else has a default. Settings come from the environment of tukang serve. A value that doesn't parse stops serve with an error naming the variable, instead of falling back to the default.
GitHub
| Variable | Default | What it does |
|---|---|---|
TUKANG_GITHUB_TOKEN | none, required | The token Tukang calls GitHub with. See the token. |
TUKANG_GITHUB_TOKEN_FILE | none | Read the token from this file instead, for Docker secrets. Set one of the two, not both. |
TUKANG_GITHUB_API | https://api.github.com | The API base URL. For GitHub Enterprise Server, its /api/v3 URL. |
TUKANG_REPOS | none | Repos to take jobs for, separated by commas or newlines. |
TUKANG_REPOS_FILE | none | A file with more repos, read again on every poll. |
TUKANG_LABEL | tukang | The label a job's runs-on must include. Letters, digits, -, _ and .. |
TUKANG_RUNNER_GROUP | 1 | The runner group id runners join. 1 is the default group. |
You need TUKANG_REPOS, TUKANG_REPOS_FILE or both.
The repo list
One repo per entry: owner/name, then an optional short name.
# repos.txt
you/web
you/api-server api # the short name names the container: tukang-job-apiThe short name is lowercase letters, digits and -, at most 40 characters. Without one, Tukang makes it from the repo name: you/My.Repo becomes my-repo. Two repos can't share a short name. A repo listed twice keeps its first entry.
Adding a line to TUKANG_REPOS_FILE takes effect on the next poll, with no restart.
Polling
| Variable | Default | What it does |
|---|---|---|
TUKANG_POLL | 30s | Time between polls. At least 5s. |
TUKANG_SWEEP_EVERY | 10 | Every Nth poll also checks runs in progress and pending. See How it works. |
TUKANG_IDLE_TIMEOUT | 10m | A runner with no job after this long is removed. |
TUKANG_COOLDOWN | 30s | How long a repo waits after a job before its next poll. |
Durations use Go's format: 30s, 10m, 1h30m.
Jobs
| Variable | Default | What it does |
|---|---|---|
TUKANG_MAX_JOBS | 2 | Most runner containers at once, across all repos. Each repo has at most one. |
TUKANG_JOB_MEMORY | no limit | Memory cap per job container, like 6g or 4096m. Swap is capped at the same value, so a job over it is killed instead of swapping. compose.yaml sets 4g. |
TUKANG_JOB_CPUS | no limit | CPU cap per job container, like 2 or 1.5. |
TUKANG_TOOLCACHE_VOLUME | tukang_toolcache | The Docker volume mounted at /opt/hostedtoolcache in every job. |
TUKANG_MIN_FREE_GB | 0, off | Don't start a runner while the disk at TUKANG_DISK_PATH has less free space than this. The job waits on GitHub. |
TUKANG_DISK_PATH | / | The path the free space check reads, inside serve's container. |
Gate
| Variable | Default | What it does |
|---|---|---|
TUKANG_GATE | none | A command that decides when an assigned job may start. See Gate. |
TUKANG_GATE_WAIT | 50m | How long a job waits for the gate before it's refused. |
Dashboard and serve
| Variable | Default | What it does |
|---|---|---|
TUKANG_LISTEN | :8080 | Address serve listens on. |
TUKANG_PASSWORD | none | Turn on a password for the dashboard. See Dashboard. |
TUKANG_PASSWORD_FILE | none | Read the password from this file instead. |
TUKANG_DATA | /data | Where serve keeps state.json (history and assigned jobs). |
TUKANG_DOCKER_SOCKET | /var/run/docker.sock | The Docker Engine socket. |
Usually found on their own
Serve looks these up from the container it runs in. Set them only when serve runs outside Docker, or the lookup picks the wrong thing.
| Variable | Default | What it does |
|---|---|---|
TUKANG_IMAGE | serve's own image id | The image job containers start from. |
TUKANG_NETWORK | serve's first Docker network | The network job containers join. |
TUKANG_ADVERTISE_URL | http://<serve's IP on that network>:<port> | The URL a job's hook calls back on. |
Check a setup
docker compose exec tukang tukang checkIt reads the same variables and checks the settings, the Docker socket and, for each repo, that the token can manage its runners. It changes nothing, and exits 1 if anything failed.