fog
fog — one CLI for the Niobium Fog "jobs-as-a-service" replay path. Replaces the former fog_token.py / fog_replay.py / fog_jobs.py trio.
submit has two shapes. Given a leading program — fog submit ./app --target=T … (outer/wrapper mode) — it POSTs {mode,target} to fog-api, waits for a worker, sets NBCC_FHETCH_SERVER + NBCC_FHETCH_TOKEN, and exec()s your OpenFHE app. It also sets NBCC_FHETCH_REPLAY to the resolved transport client (NBCC_FHETCH_REPLAY_BIN / PATH / build dir) so the app's replay() spawns that client — finding it even when it's only in build/, and never re-entering fog — and the client inherits the worker env. With no leading program fog exec()s the transport client itself (bare fog submit …, or via Driver mode below).
Driver mode: set NBCC_FHETCH_REPLAY=fog so fhetch's Compiler::replay() spawns this tool directly — as fog --project=<dir> --target=<t> …, with no subcommand word. A leading option is therefore treated as an implicit submit. fog then exec()s the real nbcc_fhetch_replay transport client, which is a different binary (NBCC_FHETCH_REPLAY_BIN / PATH), so there's no recursion. NBCC_FHETCH_REPLAY selects fog; NBCC_FHETCH_REPLAY_BIN selects the client fog hands off to — keep them pointing at different binaries.
stdlib only — no requests/httpx/curl. TLS uses certifi's CA bundle when it is installed (python.org builds ship no CA store, so the default context can verify nothing); otherwise it falls back to the default context, which still honors a working OS store and $SSL_CERT_FILE. pip install certifi fixes a bare host.
Usage
usage: fog <command> [args]
init write ~/.fog/config with default values (edit to taste)
login [-u EMAIL] [-n NAME] provision a named API key, save it to ~/.fog/credentials
submit ./app --target=T […] provision a job, then run your OpenFHE app against it
submit --target=T […] (no app) exec the transport client directly
list list all your jobs
get ID [ID…] full JSON for specific job(s)
cancel ID [ID…] cancel/release specific job(s)
cancel --pending cancel every in-flight job
Config: ~/.fog/config + ~/.fog/credentials (INI).Commands
fog init
fog initCreate ~/.fog/config with default values.
Options
| Option | Description |
|---|---|
-f, --force | overwrite an existing config file |
fog login
fog login [-u EMAIL] [-n NAME]Log in and provision a named Fog API key.
Options
| Option | Description |
|---|---|
-u, --username | account email (else prompt) |
-n, --name | label for the new key (else fog@<hostname>) |
fog submit
fog submit ./app --target=T […]
fog submit --target=T […]fog submit ./app --target=T […]: provision a job, then run your OpenFHE app against itfog submit --target=T […]: (no app) exec the transport client directly
Options
| Option | Description |
|---|---|
--target |
fog list
fog listList all your jobs.
fog get
fog get ID [ID…]Full JSON for specific job(s).
fog cancel
fog cancel ID [ID…]
fog cancel --pendingfog cancel ID [ID…]: cancel/release specific job(s)fog cancel --pending: cancel every in-flight job
Options
| Option | Description |
|---|---|
--pending |
Configuration
Config (INI, all optional; precedence: env var > config file > built-in):
~/.fog/config [fog] api_url, mode, wait, maxwait (hand-edited)
~/.fog/credentials [fog] api_token (written by `login`, 0600)
Override the dir with $FOG_HOME.Built-in defaults, which fog init also writes to the config file:
| Key | Default |
|---|---|
api_url | https://api.niobium.co |
mode | batch |
wait | 20 |
maxwait | 600 |
Environment variables
| Variable | Meaning | Default |
|---|---|---|
FOG_API_URL | base URL of fog-api | https://api.niobium.co |
FOG_API_TOKEN | API token (sent as X-Api-Token) | else read from credentials |
FOG_JOB_MODE | batch | persistent | batch |
FOG_JOB_WAIT | per-request long-poll seconds | 20 |
FOG_JOB_MAXWAIT | total seconds to keep polling a queue | 600 |
NBCC_FHETCH_REPLAY_BIN | path to nbcc_fhetch_replay | PATH / build dir |
FOG_HOME | Override the dir with $FOG_HOME. |
fog submit sets these for the program it runs:
NBCC_FHETCH_REPLAYNBCC_FHETCH_SERVERNBCC_FHETCH_TOKEN
Something not looking right? Suggest a change on GitHub.