Getting Started
Quickstart
How to use the Beta9 primitives run code in the cloud.
Running code remotely
This tutorial introduces several key concepts:
- You can wrap any code in a
function()
decorator to run it on the cloud - You can invoke a function locally with
.local()
- You can invoke a function remotely with
.remote()
- You can fan out workloads to hundreds or thousands of containers with
.map()
In your shell, run this script by running this command. Make sure to replace app.py
with the name of your file.
When you run this command, your code is containerized and shipped onto a server in the cloud, and the logs are streamed back to your local shell.
The .map()
method in main()
spawns 5 remote containers, but that number is arbitrary.
You can change 5
to 500
, and invoke this function again — you’ll see 500 containers spin up almost instantly.
Was this page helpful?