flyte

module
v2.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: Apache-2.0

README

Flyte 2

Flyte 2 is a Python framework that lets you reliably orchestrate ML pipelines, models, and agents at scale — in pure Python. It provides type-safe, async-first orchestration with built-in support for distributed execution, real-time serving, and local development.

If you're looking to use Flyte on a single machine, you don't need this repository — just install the flyte-sdk. It's incredibly useful on its own for orchestrating workflows, running ML pipelines, and serving models locally.

This repository is the backend infrastructure for deploying a distributed, multi-node version of Flyte 2. The backend is Kubernetes-native — it orchestrates workflow execution using Kubernetes primitives, scheduling tasks as pods across clusters with built-in support for multi-cluster routing, service account–based identity, and pod-level log tracking. The core architecture consists of gRPC services (QueueService, RunService, StateService) backed by PostgreSQL, using async processing and real-time streaming via PostgreSQL LISTEN/NOTIFY. See the full Implementation Spec for details.

This repo also defines the protocol buffer schemas for Flyte's APIs and generates client libraries for Go, TypeScript, Python, and Rust. Deploy this when you need Flyte running as a scalable, distributed service across your organization.

⚠️ This backend is a work in progress and not yet ready for production use. If you need an enterprise-ready, highly scalable, production-grade backend for Flyte 2, it is available today on Union.ai. You can also try the in-browser demo of Flyte's local TUI to get a feel for the experience.

Want to contribute? Join us on slack.flyte.org to get involved.

Repository Structure

flyte/
├── flyteidl2/           # Protocol buffer definitions
│   ├── common/          # Common types and utilities
│   ├── core/            # Core Flyte types (tasks, workflows, literals)
│   ├── imagebuilder/    # Image builder service definitions
│   ├── logs/            # Logging types
│   ├── secret/          # Secret management types
│   ├── task/            # Task execution types
│   ├── trigger/         # Trigger service definitions
│   ├── workflow/        # Workflow types
│   └── gen_utils/       # Language-specific generation utilities
├── gen/                 # Generated code (not checked into version control)
│   ├── go/              # Generated Go code
│   ├── ts/              # Generated TypeScript code
│   ├── python/          # Generated Python code
│   └── rust/            # Generated Rust code
├── buf.yaml             # Buf configuration
├── buf.gen.*.yaml       # Language-specific generation configs
└── Makefile             # Build automation

Prerequisites

  • Buf CLI - Protocol buffer tooling
  • Go 1.24.6 or later
  • Node.js/npm (for TypeScript generation)
  • Python 3.9+ with uv package manager (for Python generation)
  • Rust toolchain (for Rust generation)

Quick Start

Generate All Code

To generate code for all supported languages:

make gen

This will:

  1. Update buf dependencies
  2. Format and lint proto files
  3. Generate code for Go, TypeScript, Python, and Rust
  4. Generate mocks for Go
  5. Run go mod tidy
Generate for Specific Languages Locally
make buf-go      # Generate Go code only
make buf-ts      # Generate TypeScript code only
make buf-python  # Generate Python code only
make buf-rust    # Generate Rust code only

Making Changes

1. Modify Protocol Buffers

Edit .proto files in the flyteidl2/ directory following these guidelines:

  • Follow the existing naming conventions
  • Use proper protobuf style (snake_case for fields, PascalCase for messages)
  • Add appropriate comments and documentation
  • Ensure backward compatibility when modifying existing messages
2. Generate Code

After modifying proto files:

make docker-pull   # Pull the docker image for generation
make gen
3. Verify Your Changes

Run the following to ensure everything builds correctly:

# For Go
make go-tidy
go build ./...

# For Rust
make build-crate

# For Python
cd gen/python && uv lock

# For TypeScript
cd gen/ts && npm install
4. Generate Mocks (Go only)

If you've added or modified Go interfaces:

make gen

Development Workflow

  1. Format proto files: make buf-format
  2. Lint proto files: make buf-lint
  3. Generate code: make buf or make gen
  4. Verify builds: Build generated code in your target language
  5. Commit changes: Commit both proto files and generated code

Common Tasks

Update Buf Dependencies
make gen
View Available Commands
make help

Versioning and Releases

See CONTRIBUTING.md for detailed release instructions.

Generated Code

The gen/ directory contains auto-generated code and should not be manually edited. Changes to generated code should be made by:

  1. Modifying the source .proto files in flyteidl2/
  2. Updating generation utilities in flyteidl2/gen_utils/ if needed
  3. Running make gen to regenerate all code

Troubleshooting

Buf Errors
  • Ensure you have the latest version of Buf: buf --version
  • Update dependencies: make buf-dep
  • Check buf.lock for dependency conflicts
Go Module Issues
  • Run make go-tidy to clean up dependencies
  • Ensure you're using Go 1.24.6 or later
Python Generation Issues
  • Ensure uv is installed: pip install uv
  • Set the environment variable: export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
Rust Build Issues
  • Update Rust toolchain: rustup update
  • Navigate to gen/rust and run cargo update

Contributing

We welcome contributions to Flyte 2! Please follow the guide here.

Directories

Path Synopsis
cmd command
k8s
cmd command
cmd command
api/v1
Package v1 contains API Schema definitions for the flyte.org v1 API group.
Package v1 contains API Schema definitions for the flyte.org v1 API group.
cmd command
cmd
data
This module contains Flyte CoPilot related code.
This module contains Flyte CoPilot related code.
flyteidl2
clients/go/coreutils
Contains convenience methods for constructing core types.
Contains convenience methods for constructing core types.
flyteplugins
go/tasks/aws
Package aws contains AWS-specific logic to handle execution and monitoring of batch jobs.
Package aws contains AWS-specific logic to handle execution and monitoring of batch jobs.
go/tasks/pluginmachinery/core/template
Package template exports the Render method Render Evaluates templates in each command with the equivalent value from passed args.
Package template exports the Render method Render Evaluates templates in each command with the equivalent value from passed args.
go/tasks/pluginmachinery/flytek8s/config
Package config contains configuration for the flytek8s module - which is global configuration for all Flyte K8s interactions.
Package config contains configuration for the flytek8s module - which is global configuration for all Flyte K8s interactions.
go/tasks/pluginmachinery/ioutils
Package ioutils contains utilities for interacting with the IO Layer of FlytePropeller Metastore For example, utilities like reading inputs, writing outputs, computing output paths, prefixes.
Package ioutils contains utilities for interacting with the IO Layer of FlytePropeller Metastore For example, utilities like reading inputs, writing outputs, computing output paths, prefixes.
go/tasks/pluginmachinery/k8s
Simple implementation of a KubeClient that caches reads and falls back to make direct API calls on failure.
Simple implementation of a KubeClient that caches reads and falls back to make direct API calls on failure.
go/tasks/pluginmachinery/webapi
Defines the interfaces to implement to add a Web API Plugin (AsyncPlugin and SyncPlugin) to the Flyte system.
Defines the interfaces to implement to add a Web API Plugin (AsyncPlugin and SyncPlugin) to the Flyte system.
flytestdlib
bitarray
Contains efficient array that stores small-range values (up to uint64) in a bit array to optimize storage.
Contains efficient array that stores small-range values (up to uint64) in a bit array to optimize storage.
config
A strongly-typed config library to parse configs from PFlags, Env Vars and Config files.
A strongly-typed config library to parse configs from PFlags, Env Vars and Config files.
contextutils
Package contextutils contains common flyte context utils.
Package contextutils contains common flyte context utils.
errors
Contains utilities to use to create and consume simple errors.
Contains utilities to use to create and consume simple errors.
fastcheck
This package contains implementation for checking if an item has been seen previously.
This package contains implementation for checking if an item has been seen previously.
futures
Package futures implements a simple Async Futures for golang
Package futures implements a simple Async Futures for golang
k8s
logger
Defines global context-aware logger.
Defines global context-aware logger.
pbhash
This is a package that provides hashing utilities for Protobuf objects.
This is a package that provides hashing utilities for Protobuf objects.
promutils
Source: https://raw.githubusercontent.com/kubernetes/kubernetes/3dbbd0bdf44cb07fdde85aa392adf99ea7e95939/pkg/util/workqueue/prometheus/prometheus.go
Source: https://raw.githubusercontent.com/kubernetes/kubernetes/3dbbd0bdf44cb07fdde85aa392adf99ea7e95939/pkg/util/workqueue/prometheus/prometheus.go
storage
Package storage defines extensible storage interface.
Package storage defines extensible storage interface.
gen
go/gateway/flyteidl2/connector
Package connector is a reverse proxy.
Package connector is a reverse proxy.
go/gateway/flyteidl2/dataproxy
Package dataproxy is a reverse proxy.
Package dataproxy is a reverse proxy.
go/gateway/flyteidl2/secret
Package secret is a reverse proxy.
Package secret is a reverse proxy.
manager
cmd command
testclient command
cmd command
testclient command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL