Skip to main content

Getting started

Flyte is a highly extensible Python-native platform for authoring and executing distributed workflows. It allows you to define tasks with specific resource requirements and execution environments that can run locally or on a remote cluster.

Prerequisites

  • Python: Version 3.10 or higher.
  • Docker: A running Local Runtime is required to build images and wheels.
  • uv: The recommended package manager for this project.

Install

Clone the repository and use uv to set up the development environment and build the package:

git clone https://github.com/flyteorg/flyte
cd flyte
uv sync
make dist

This installs the package in editable mode and builds a wheel so that the default Image() can use your local changes.

Hello world

Create a file named hello.py to define a simple task and environment:

import flyte
import asyncio

# Define an execution environment
env = flyte.TaskEnvironment(name="getting-started")

@env.task
async def greet(name: str) -> str:
"""A simple Flyte task."""
return f"Hello, {name}!"

async def main():
# Execute the task locally
result = await greet(name="Developer")
print(result)

if __name__ == "__main__":
asyncio.run(main())

Run the script using uv:

uv run python hello.py

Verify

To ensure your environment is correctly configured and the core components are functioning, run the unit tests:

make unit_test

You can also verify code quality and type safety:

make fmt
make mypy

Next steps

  • Explore the CLI: Use the flyte command-line tool to interact with the system.
    uv run flyte --help
  • Authoring Tasks: Learn about Task authoring experience to define complex logic.
  • Plugins: Extend functionality by exploring available Distributed Compute Plugins for Spark, Ray, or BigQuery.
  • Serving: Use flyte.serve() to deploy long-running applications like FastAPI.

Troubleshooting

Docker Daemon

If make dist fails, ensure your Docker daemon is running. Flyte requires Docker to build the local wheel into a container image for consistent execution.

Module Imports

If you encounter import errors, ensure you are running commands via uv run to use the synchronized virtual environment. Avoid importing internal modules (prefixed with _); always use the public API exported in flyte.*.