Workload kinds
Containers start when work arrives and
stop when idle, and every remote call is a
task. A deploy starts every kind except sandboxes.
Define an app
analyze_page fetches the page
in its own cloud container, so a slow site never holds the request open.
App names use lowercase letters, digits, and underscores, start with a letter,
and run up to 63 characters. Workload names default to the Python name and are
unique per kind within an app. Values that change between workspaces live
outside the decorator, credentials in secrets and files in
volumes.
Deploy
app.deploy() and analyze.deploy() do the same.
Handler references covers the syntax.
Split an app across files
Each module imports the app and registers its own workloads:page_stats.api
imports page_stats.workers, so it reaches both:
page_stats.app alone holds no workloads. When no module imports the rest, a
small entry module that imports each one does.
Remove workloads
A workload deleted from the code stays deployed until a deploy with--prune:
app.deploy(prune=True).
Call deployed workloads from other projects
lazycloud_clients/page_stats, so another
project can call the deployed functions with remote() and the endpoints with
request(), without your source. ASGI routes get typed methods from the app’s
OpenAPI schema, from /openapi.json unless --openapi-path or --openapi
points elsewhere.
The package holds no credentials, since callers sign in with lazycloud login.
Pods and sandboxes aren’t exported, and a contract change needs a new export.
Pause and delete
Workspaces
A workspace holds apps, deployments, tasks, and stored data. Within it, a name always means the same resource, so two apps mounting themodels volume see
the same files. Separate projects, or staging and production, fit separate
workspaces. Tokens, a connected AWS account, joined machines, domains, and your
plan belong to your account and apply to every workspace you own.
LAZYCLOUD_WORKSPACE overrides the stored choice for every command, which
suits CI, and --workspace overrides it for one.
Compute covers where a workspace’s
workloads run, and the dashboard
covers members.