Running on the devbox
The Flyte devbox is a lightweight local cluster that runs on your machine with Docker. It gives you a full Flyte environment — including the UI, scheduler, and object store — so you can test remote execution without deploying to a real cluster.
What you’ll need
- Python 3.10+ in a virtual environment
- Docker installed and running
Install the SDK
If you haven’t already, install the flyte package:
pip install flyteStart the devbox
Launch the local cluster:
flyte start devbox
This pulls the necessary containers and starts a local Flyte instance. Once ready, the Flyte UI is available at http://localhost:30080.
Configure
Create a config file that points to the devbox:
flyte create config \
--endpoint localhost:30080 \
--project flytesnacks \
--domain development \
--builder local \
--insecureThis creates .flyte/config.yaml configured to talk to your local devbox cluster.
Run a workflow on the devbox
Using the same hello.py from the
Quickstart:
# hello.py
import flyte
# The `hello_env` TaskEnvironment is assigned to the variable `env`.
# It is then used in the `@env.task` decorator to define tasks.
# The environment groups configuration for all tasks defined within it.
env = flyte.TaskEnvironment(name="hello_env")
# We use the `@env.task` decorator to define a task called `fn`.
@env.task
def fn(x: int) -> int: # Type annotations are required
slope, intercept = 2, 5
return slope * x + intercept
# We also use the `@env.task` decorator to define another task called `main`.
# This is the is the entrypoint task of the workflow.
# It calls the `fn` task defined above multiple times using `flyte.map`.
@env.task
def main(x_list: list[int] = list(range(10))) -> float:
y_list = list(flyte.map(fn, x_list)) # flyte.map is like Python map, but runs in parallel.
y_mean = sum(y_list) / len(y_list)
return y_mean
Run it on the devbox:
flyte run hello.py mainWithout the --local flag, the workflow runs on the devbox cluster rather than in your local Python process. Tasks execute inside containers, just like they would on a remote cluster.
View results in the UI
Open http://localhost:30080 to see your workflow execution in the Flyte UI. You can inspect task inputs, outputs, logs, and execution timelines.
Stop the devbox
When you’re done, shut down the cluster:
flyte stop devboxInline configuration
Skip the config file entirely by passing parameters directly.
Use
flyte.init:
flyte.init(
endpoint="localhost:30080",
project="flytesnacks",
domain="development",
insecure=True,
)Some parameters go after flyte, others after the subcommand:
flyte \
--endpoint localhost:30080 \
--insecure \
--builder local \
run \
--domain development \
--project flytesnacks \
hello.py \
mainSee the CLI reference for details.
Delete the devbox
flyte delete devbox # add the --volume flag to delete the Docker volume