The three paths
cycls shell file.py and f.build() also build on your machine.
Local build
python:<your version>-slim-bookworm. The Python version is
pinned to your host’s major and minor version, because cloudpickle bytecode does
not cross Python versions.
When to use it: you have Docker, you want no cloud round trip, and your
dependencies are small enough that a rebuild is quick.
When not to use it: the image is large, your machine is slow, or you are on a
laptop without Docker. Use --remote instead.
Remote build for functions
exec-<hash>. Every function
that declares the same image shares it.
cycls ls as exec-*. They scale to zero and cost nothing
while idle. cycls rm removes one.
Remote build for apps and agents
dev-<name> is deployed once. Each save hot swaps the
running application inside it, and the request log streams into your terminal.
This gives you a public HTTPS URL during development, which is what OAuth
callbacks and mobile clients need.
Deploy build
- Checks that the name is available for your account.
- Builds a source archive locally: the generated Dockerfile, your copied files
under
context_files/,function.pklholding the cloudpickled function, and an entrypoint. - Uploads the archive as
tar.gzto the deploy API and streams build events back as NDJSON:BUILDING, thenDEPLOYING, thenDONEorERROR.
Image caching
Cycls hashes the image declaration into the tag. The hash covers:- the base image and Python version
- pip packages, apt packages and run commands
- the path and content hash of every copied file
.rebuild():
Verify what was built
cycls shell builds or reuses the same image and drops you into /app. Use it
to confirm a package landed or a build command worked before adding more.
Timing
Troubleshooting
Docker is not running
Docker is not running
Local builds need the daemon. Start Docker Desktop on macOS or Windows, or
sudo systemctl start docker on Linux. To avoid Docker entirely, use
cycls run --remote and cycls deploy.FileNotFoundError: Path in 'copy' not found
FileNotFoundError: Path in 'copy' not found
.copy() paths are resolved when the image hash is computed, relative to your
working directory. Check the path, or pass an absolute one.ModuleNotFoundError inside the container
ModuleNotFoundError inside the container
A module imported from another file of yours travels by reference, not in the
pickle. Bundle it with
cycls.Image().copy("helpers.py"). Copied files land in
/app, which is on sys.path.The build succeeds but the container exits at boot
The build succeeds but the container exits at boot
Builder code is pickled by value. Module-level names referenced inside class
bodies or dataclasses defined in the deployed function can fail to resolve in the
container. Reproduce with
cycls run before deploying.Port already in use
Port already in use
Pass another port:
cycls run file.py serves on 8080 by default, and
my_app.local(port=3000) changes it.Next
Deploy
Names, sizing, environment variables and what survives a redeploy.