Configuration¶
Skyward does not read a configuration file. The control plane target is resolved for each client or CLI call.
Control plane resolution¶
The resolution order is:
- an explicit
urlor--url; SKYWARD_URL;- an embedded daemon in the current process.
The embedded daemon stores its SQLite database at ~/.skyward/skyward.sqlite by default. Pass database= to Compute or --database to the CLI to select another path. A database path is ignored when a remote URL is selected.
import skyward as sky
# Embedded daemon, using ~/.skyward/skyward.sqlite.
with sky.Compute(provider=sky.Container()) as compute:
result = train(data) >> compute
# Remote daemon.
with sky.Compute(provider=sky.AWS(), url="http://127.0.0.1:7590") as compute:
result = train(data) >> compute
The Compute client and the CLI use the same resolution rules. Inspect the resolved values with:
Provider accounts¶
Provider accounts resolve credentials in the client process. A provider descriptor contains the provider kind, its non-secret configuration, credentials, and an optional account name. When a compute starts, the descriptor registers the named account with the daemon if it does not exist. Credentials are not returned by provider read operations.
provider = sky.AWS(name="production", region="us-east-1")
with sky.Compute(provider=provider, accelerator="A100") as compute:
train(data) >> compute
Use a distinct name for multiple accounts of the same provider kind. Provider configuration belongs to the account, not to a global singleton.
Compute configuration¶
The public configuration objects are composed at the Compute boundary:
Specdescribes one provider and hardware alternative;Optionscontrols timeouts, retries, health checks, and autoscaling;Executorcontrols task execution on each node;Image,Volume, andPortdescribe the node environment and local tunnels.
See Compute and task dispatch for the full Python surface and Cloud providers for account credentials and offer caching.
skyward.Provider
¶
Bases: Struct
A provider account: which cloud, and what it takes to log in.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The account's alias, and the identity of the provider row. Two accounts of the same kind coexist by having two names. Empty is the kind itself. |
skyward.Image
¶
Bases: Struct
The environment a node builds before it runs anything.
The base, the interpreter, the packages and where they resolve from. What the
user shipped from their own machine is not here — includes is packed into
a blob client-side and only its hash travels, because a spec is written to the
compute row and served back by the API.
base = None
class-attribute
instance-attribute
¶
python = None
class-attribute
instance-attribute
¶
pip = ()
class-attribute
instance-attribute
¶
apt = ()
class-attribute
instance-attribute
¶
pip_indexes = ()
class-attribute
instance-attribute
¶
env = field(default_factory=dict)
class-attribute
instance-attribute
¶
shell_vars = field(default_factory=dict)
class-attribute
instance-attribute
¶
includes = ()
class-attribute
instance-attribute
¶
excludes = ()
class-attribute
instance-attribute
¶
includes_sha256 = None
class-attribute
instance-attribute
¶
The user-code tarball, once the client has built it and put it in the blob
store. includes/excludes are the client's inputs; this is what the node
reads.
metrics = None
class-attribute
instance-attribute
¶
None leaves the built-in collectors in place; a list replaces them.
bootstrap_timeout = 900
class-attribute
instance-attribute
¶
skyward = 'auto'
class-attribute
instance-attribute
¶
warm = False
class-attribute
instance-attribute
¶
Whether a machine that finished bootstrapping is kept as a boot image.
Off because what it creates is never removed: an AMI holds a snapshot that bills
for its storage until it is deregistered, and nothing here deregisters it. Turning
it on is taking that on. What is created carries :meth:content_hash as a tag, on
the image and on the snapshot behind it, so it can be found again and removed.
Only providers that can snapshot a running machine honor it.
__post_init__()
¶
content_hash(source)
¶
Name the environment a bootstrapped machine ends up in.
Covers what the bootstrap installs — the base, the interpreter, the packages
and the indexes they are resolved from — together with source, which is
what stands in for a skyward version now that a node installs whatever the
daemon is running.
Left out is everything the bootstrap re-applies on every boot: the exports, the shell vars, the metric commands, and the user code, which is synced per run. Folding those in would split the images over changes that cost nothing to redo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
:attr: |
required |
Returns:
| Type | Description |
|---|---|
str
|
Twelve hex characters — long enough to name an image, short enough to read in one. |