Skip to main content
A workspace holds apps, and an app holds workloads. A workload’s decorator is its whole definition: image, resources, volumes, secrets, schedule, and scaling. Deploying makes the workspace match the code, with no dashboard setting or CLI flag on top, so infrastructure changes arrive as one reviewable diff.

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

The endpoint answers at once with a task ID, and 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

From Python, 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:
The CLI finds workloads by importing the module you name. 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:
Pruning stops every deployed workload the app no longer declares and removes its schedules and routes. It needs the whole app, so a single-workload reference can’t prune. Volumes, secrets, and stored data stay, even when you delete the whole app. From Python, app.deploy(prune=True).

Call deployed workloads from other projects

This writes a typed package to 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 the models 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.