Skip to main content

Flyte SDK System Context

The Flyte SDK System Context diagram illustrates the interactions between users, the Flyte SDK, and the various external systems involved in data and ML orchestration.

The Flyte SDK (comprising both the Python library and the CLI) serves as the primary interface for Data Scientists and Developers to author, manage, and execute workflows and tasks.

Key interactions discovered in the codebase:

  • Flyte Admin (Backend): The SDK communicates with the Flyte control plane via gRPC using flyteidl2 clients. This includes services for project management, task registration, execution control, and log retrieval.
  • Cloud Storage: The SDK performs data I/O (S3, GCS, Azure Blob Storage) by first requesting signed URLs from the DataProxy service (part of Flyte Admin) and then performing direct HTTP uploads/downloads using httpx or fsspec.
  • Container Registry: For task execution, the SDK builds container images locally (via Docker/Podman) or remotely (via a backend service) and pushes them to registries like GHCR, ECR, or GCR.
  • Kubernetes Cluster: While the SDK defines Kubernetes-native objects (like Pod specs), the actual orchestration and execution on Kubernetes are managed by the Flyte backend (specifically Flyte Propeller).
  • Local Runtime: The SDK includes a sandbox environment (using pydantic_monty) for local execution and testing of tasks without requiring a full Flyte deployment.

Key Architectural Findings:

  • The SDK uses gRPC (via flyteidl2) to communicate with Flyte Admin services (Project, Task, Run, etc.).
  • Data persistence in S3/GCS/Azure is achieved through a 'DataProxy' pattern: the SDK gets signed URLs from Admin and uploads/downloads directly to cloud storage.
  • Image building is modular, supporting local Docker/Podman builds or remote builds via a backend task.
  • Local execution (Sandbox) is a core feature, allowing users to run workflows locally before deploying to a cluster.
  • The SDK acts as a translator, converting Python code and Kubernetes-native specs into Flyte-compatible Protobuf messages.
Loading diagram...