Skip to Content
Tukang

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=4g

That'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

VariableDefaultWhat it does
TUKANG_GITHUB_TOKENnone, requiredThe token Tukang calls GitHub with. See the token.
TUKANG_GITHUB_TOKEN_FILEnoneRead the token from this file instead, for Docker secrets. Set one of the two, not both.
TUKANG_GITHUB_APIhttps://api.github.comThe API base URL. For GitHub Enterprise Server, its /api/v3 URL.
TUKANG_REPOSnoneRepos to take jobs for, separated by commas or newlines.
TUKANG_REPOS_FILEnoneA file with more repos, read again on every poll.
TUKANG_LABELtukangThe label a job's runs-on must include. Letters, digits, -, _ and ..
TUKANG_RUNNER_GROUP1The 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-api

The 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

VariableDefaultWhat it does
TUKANG_POLL30sTime between polls. At least 5s.
TUKANG_SWEEP_EVERY10Every Nth poll also checks runs in progress and pending. See How it works.
TUKANG_IDLE_TIMEOUT10mA runner with no job after this long is removed.
TUKANG_COOLDOWN30sHow long a repo waits after a job before its next poll.

Durations use Go's format: 30s, 10m, 1h30m.

Jobs

VariableDefaultWhat it does
TUKANG_MAX_JOBS2Most runner containers at once, across all repos. Each repo has at most one.
TUKANG_JOB_MEMORYno limitMemory 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_CPUSno limitCPU cap per job container, like 2 or 1.5.
TUKANG_TOOLCACHE_VOLUMEtukang_toolcacheThe Docker volume mounted at /opt/hostedtoolcache in every job.
TUKANG_MIN_FREE_GB0, offDon'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

VariableDefaultWhat it does
TUKANG_GATEnoneA command that decides when an assigned job may start. See Gate.
TUKANG_GATE_WAIT50mHow long a job waits for the gate before it's refused.

Dashboard and serve

VariableDefaultWhat it does
TUKANG_LISTEN:8080Address serve listens on.
TUKANG_PASSWORDnoneTurn on a password for the dashboard. See Dashboard.
TUKANG_PASSWORD_FILEnoneRead the password from this file instead.
TUKANG_DATA/dataWhere serve keeps state.json (history and assigned jobs).
TUKANG_DOCKER_SOCKET/var/run/docker.sockThe 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.

VariableDefaultWhat it does
TUKANG_IMAGEserve's own image idThe image job containers start from.
TUKANG_NETWORKserve's first Docker networkThe network job containers join.
TUKANG_ADVERTISE_URLhttp://<serve's IP on that network>:<port>The URL a job's hook calls back on.

Check a setup

docker compose exec tukang tukang check

It 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.

On this page