run creates child Calls in the current Run instead of new Runs.
run_id
property
me
method
create_secret
method
get_secret
method
list_secrets
method
update_secret
method
delete_secret
method
access_secret
method
create_volume
method
get_volume
method
list_nodes
method
list_volumes
method
update_volume
method
delete_volume
method
generate_temporary_volume_credentials
method
run
method
fn without waiting and return its handle.
Outside a Run this creates a Run; a client scoped to an Attempt creates
a child Call of it instead. memory_bytes defaults to 2 GiB per CPU,
gpu to one when gpu_type is set, and retry_strategy to three
attempts. env_vars values are
literals or stored Secrets. name labels the Run or child Call.
port is a port fn serves while it runs, which its URL
(Run.get_url, or Call.get_url for a child Call) serves to
anyone. timeout is how many seconds each Attempt may run, up to 24
hours, the default. Volume mounts stop working an hour after an Attempt
starts, so run warns when it mounts volumes without a timeout of
an hour or less.
Each Attempt imports fn by name from a file mount of its top-level
package, or else its module’s file, so fn must be
defined at module level, and its module must not call run when
imported. A Run also publishes the local files of every
module-level Image in fn’s module, which its Attempts then submit
child Calls with by name; other Images upload their local files when
submitted. Children from the current source package reuse its published
snapshot. Volumes accept VolumeHandle objects, volume names, or UUIDs.
create_sandbox
method
args in image, once it runs.
It lives until terminated, or for timeout seconds. name, such
as "dev", must be unique in the deployment; without one, the sandbox
is named for its id. memory_bytes defaults to 2 GiB per CPU, and
gpu to one when gpu_type is set. Volumes accept VolumeHandle
objects, volume names, or UUIDs. With port, the sandbox’s url
serves that port to anyone, and it runs once the port answers.
get_sandbox
method
list_sandboxes
method
map
method
fn concurrently and yield results in input order.
Input iterables supply positional arguments, paired by position until
the shortest iterable ends.
First iteration submits every paired invocation before yielding.
Outside a Run these are independent Runs; inside
an Attempt they are child Calls. Terminal failures raise when their
input is reached. Closing the iterator leaves submitted work running,
subject to the Attempt’s usual child cleanup. name is a shared
display label for every submitted Run or Call, and timeout applies
to each, as in run.