niobium_sdk.fog

niobium_sdk.fog — pure-Python Fog cloud client (control plane + CLI).

The fog console script and this module give a pip-only user the full Fog path — login -> provision a job -> submit the recorded project -> unpack -> decrypt — with no C++ transport binary and no scripts/fog on disk.

Single source of truth: the vendored niobium_sdk._fog is a verbatim copy of scripts/fog (the same file the C++ stack ships). This module reuses it directly for login/list/get/cancel/init and for its config/creds/HTTP primitives. The only piece re-expressed here is the provision-and-submit orchestration, because scripts/fog finishes that path by exec()-ing a transport binary the wheel does not carry; the wheel instead does the data hop in-process via niobium_sdk.client.submit(). The fog-api wire logic itself is not forked.

Two planes (see the Fog design): the control plane (POST /jobs/, long-poll, mint the per-job ticket) lives in _fog; the data plane (pack -> POST -> unpack) is niobium_sdk.client.submit(). run() composes them.

provision

def provision(target, *, mode=None, wait=None, maxwait=None)

Provision a Fog job via fog-api; return (worker_url, ticket, job_id).

Mirrors scripts/fog cmd_submit's control-plane hop on _fog's own primitives (request/_api/_require_token/cfg), so the endpoints, auth, and config precedence stay single-source. Exits via _fog.die on an API error, matching the CLI tool's behavior.

run

def run(project_dir, target, *, mode=None, opt_level=None, wait=None, maxwait=None)

Provision a Fog job, then submit project_dir to its worker.

Returns the number of probe files unpacked into <project_dir>/serialized_probes (ready for session.result()).

main

def main(argv=None)

Something not looking right? Suggest a change on GitHub.