Flyte 2 is a next-generation IDL (Interface Definition Language) repository that defines the protocol buffer schemas for Flyte's APIs. This repository generates client libraries and type definitions for Go, TypeScript, Python, and Rust.
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
- Buf CLI - Protocol buffer tooling
- Go 1.24.6 or later
- Node.js/npm (for TypeScript generation)
- Python 3.9+ with
uvpackage manager (for Python generation) - Rust toolchain (for Rust generation)
To generate code for all supported languages:
make genThis will:
- Update buf dependencies
- Format and lint proto files
- Generate code for Go, TypeScript, Python, and Rust
- Generate mocks for Go
- Run
go mod tidy
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 onlyEdit .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
After modifying proto files:
make docker-pull # Pull the docker image for generation
make genRun 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 installIf you've added or modified Go interfaces:
make gen- Format proto files:
make buf-format - Lint proto files:
make buf-lint - Generate code:
make buformake gen - Verify builds: Build generated code in your target language
- Commit changes: Commit both proto files and generated code
make genmake helpSee CONTRIBUTING.md for detailed release instructions.
The gen/ directory contains auto-generated code and should not be manually edited. Changes to generated code should be made by:
- Modifying the source
.protofiles inflyteidl2/ - Updating generation utilities in
flyteidl2/gen_utils/if needed - Running
make gento regenerate all code
- Ensure you have the latest version of Buf:
buf --version - Update dependencies:
make buf-dep - Check
buf.lockfor dependency conflicts
- Run
make go-tidyto clean up dependencies - Ensure you're using Go 1.24.6 or later
- Ensure
uvis installed:pip install uv - Set the environment variable:
export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
- Update Rust toolchain:
rustup update - Navigate to
gen/rustand runcargo update
We welcome contributions to Flyte 2! Please follow the guide here.