Skip to main content

Flytekit SDK Ecosystem Context

This context diagram is grounded in the Python package and its declared entry points. A Developer can use the flyte Click CLI (pyproject.toml exposes flyte = flyte.cli.main:main) or call the Flytekit Python SDK directly to author tasks/workflows, run and deploy them, build images, serve apps, and inspect resources. The CLI creates SDK configuration and exposes commands including run, deploy, build, serve, get, and prefetch.\n\nThe SDK initializes a ClientSet with ConnectRPC clients for project/domain, task, app, run, run logs, secrets, identity, triggers, cluster, and the cluster-aware DataProxy services. These clients communicate with the Flyte Backend / Control Plane for registration, execution, app and trigger management, logs, metadata, and status. API-key initialization reads FLYTE_API_KEY, decodes endpoint and client credentials, and establishes the authenticated session.\n\nThe SDK's storage layer explicitly supports S3, GCS, and Azure Blob/ABFS through obstore/fsspec-style access. Run creation uploads offloaded inputs through the DataProxy service, while files, directories, dataframes, code bundles, checkpoints, and model artifacts use remote object-storage URIs. Image definitions support registries and both local and remote image builders; the remote builder uses the backend image-builder service and checks image availability in a registry. The model-loader extra has a real PyTorch dependency and converts streamed safetensors data into PyTorch tensors. Finally, local notification sending uses HTTP webhooks for Slack, Teams, and custom webhooks plus SMTP, while remote notification rules are represented and submitted through the backend.\n\nThe diagram intentionally groups the numerous backend RPCs and storage providers into context-level systems rather than exposing internal classes. Tasks and Environments and Remote Execution and Inspection are the principal SDK usage concepts represented by the flows.

Key Architectural Findings:

  • pyproject.toml packages the project as flyte and exposes flyte, a0, fserve, and c0 command-line entry points.
  • ClientSet constructs ConnectRPC clients for project, task, app, run, logs, secrets, identity, trigger, cluster, and DataProxy backend services.
  • Run creation explicitly uploads inputs through DataProxyServiceClient before calling RunServiceClient.create_run.
  • Storage configuration and implementation explicitly support S3, GCS, and Azure Blob/ABFS; S3 can use boto3-backed credential resolution.
  • Image definitions include registry targets and local/remote image builders; the remote builder calls the Flyte image-builder service and checks remote registry images.
  • The model-loader extra imports PyTorch and streams safetensors/model data from object storage into PyTorch tensors.
  • Local notifications make HTTP calls to Slack, Teams, and custom webhook URLs and connect to SMTP on localhost:25.
Loading diagram...