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 init

Create ~/.fog/config with default values.

Options

OptionDescription
-f, --forceoverwrite an existing config file

fog login

fog login [-u EMAIL] [-n NAME]

Log in and provision a named Fog API key.

Options

OptionDescription
-u, --usernameaccount email (else prompt)
-n, --namelabel for the new key (else fog@<hostname>)

fog submit

fog submit ./app --target=T […]
fog submit --target=T […]

Options

OptionDescription
--target

fog list

fog list

List all your jobs.

fog get

fog get ID [ID…]

Full JSON for specific job(s).

fog cancel

fog cancel ID [ID…]
fog cancel --pending

Options

OptionDescription
--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:

KeyDefault
api_urlhttps://api.niobium.co
modebatch
wait20
maxwait600

Environment variables

VariableMeaningDefault
FOG_API_URLbase URL of fog-apihttps://api.niobium.co
FOG_API_TOKENAPI token (sent as X-Api-Token)else read from credentials
FOG_JOB_MODEbatch | persistentbatch
FOG_JOB_WAITper-request long-poll seconds20
FOG_JOB_MAXWAITtotal seconds to keep polling a queue600
NBCC_FHETCH_REPLAY_BINpath to nbcc_fhetch_replayPATH / build dir
FOG_HOMEOverride the dir with $FOG_HOME.

fog submit sets these for the program it runs:

Something not looking right? Suggest a change on GitHub.