GitHub
The 10x Engine employs a GitOps approach to configuration management, offering a secure, version-controlled solution across distributed environments.
The @github launch macro enables the engine to pull YAML config, JavaScript, text/geo lookup, and Symbol library files from GitHub at startup.
The engine can poll the remote branch for changes at a specified interval (e.g., 5min), allowing distributed 10x apps to synchronize and reload updated configurations.
Pulled files are extracted to a temporary directory (archives are automatically unpacked).
k8s
When deploying 10x apps to k8s, the provided Helm charts can use init containers to pull configuration from GitHub, enabling container immutability.
To learn more, see the deployment procedure for your specific app under apps.
Config
To specify a @GitHub launch macro via a YAML config file:
include:
tenx: run
- source: github
options:
# 'enabled' controls whether to enable this pull config
enabled: true
# 'token' specifies an access token for accessing the Github repo.
# To learn more see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
token: $=TenXEnv.get("GH_TOKEN")
# 'repo' specifies the GitHub user/repo name from which to pull files
repo: my-user/my-repo
# 'branch' on 'repo' (if null, use repo default branch)
branch: main
# 'paths' specifies Glob patterns within 'repo' to pull and extract to a temp folder.
paths:
- config/*.yaml # https://doc.log10x.com/config/yaml
- symbols/*.10x.tar # https://doc.log10x.com/run/symbol
- lookups/*.csv # https://doc.log10x.com/api/js/#TenXLookup
- scripts/*.js # https://doc.log10x.com/api/js/
# 'syncInterval' specifies an interval by which to poll the remote branch for updates, set null for none.
syncInterval: 5min
CLI
You can specify a @github launch macro via the CLI
as a JSON object by bash-escaping its contents.
For example:
$ tenx run '@github={"token": "<replace-me-with-gh-token>", "repo": "my-user/my-repo", "branch": "main", "paths": ["config/*.yaml", "symbols/*.10x.tar", "lookups/*.csv", "scripts/*.js"], "syncInterval": "2min"}'
Shipped pulls
The 10x apps ship a GitOps config, gitops/config.yaml, with two @github pulls from one repo. Each is off until its environment variable turns it on. Both read the repo from GH_REPO (owner/repo, required once either pull is on), the branch from GH_BRANCH (default main) and the token from GH_TOKEN, and poll every GH_SYNC_INTERVAL (default 30s).
- Policy files,
GH_ENABLED=true: pullslog10x/policy/*.csv(caps.csv,actions.csv,totals.csvandconfig-generation.csv) and copies them to a stable folder,GH_DEST(default${java.io.tmpdir}/tenx/github). The rate regulator's cap, action, total and config-generation files default to those copies, and each sync rewrites them in place, so the regulator reloads them. Thelog10x/policyfolder must exist on the branch and holdcaps.csvwhen the engine starts. When the Log10x MCP's budget run delivers through git, it commits these files directly to a dedicated branch,log10x-policyby default; setGH_BRANCHto that branch. - Other files,
GH_FILES_ENABLED=true: pulls the CSVs itspathsglob names from the same repo, for lookups such as the compact receiver's or a mute file. The shipped glob istest/*.csv; editpathsin a fork of the config to pull other folders. WithGH_DESTset the files land beside the policy files, and with it unset they stay in the pull cache.
Turn on one source for the regulator's files: with GH_ENABLED=true the policy copies win over the Kubernetes ConfigMap's.