FlyteAdmin

Admin Structure

FlyteAdmin serves the main Flyte API. It processes all client requests to the system. Clients include the FlyteConsole, which calls FlyteAdmin to list workflows, get execution details, etc., and FlyteKit, which calls FlyteAdmin to registering workflows, launch workflows etc.

Below, we’ll dive into each component defined in admin in more detail.

RPC

FlyteAdmin uses the grpc-gateway library to serve incoming gRPC and HTTP requests with identical handlers. For a more detailed overview of the API, including request and response entities, see the admin service definition. The RPC handlers are a thin shim that enforce some request structure validation and call out to appropriate manager. methods to process requests.

A detailed explanation of the service can be found in the admin service page.

Managers

The Admin API is broken up into entities:

  • Executions

  • Launch plans

  • Node Executions

  • Projects (and their respective domains)

  • Task Executions

  • Tasks

  • Workflows

Each API entity has an entity manager in FlyteAdmin reposible for implementing business logic for the entity. Entity managers handle full validation for create, update and get requests, and data persistence in the backing store (see the Repository section).

Additional Components

The managers utilize additional components to process requests. These additional components include:

  • :ref:`workflow engine <divedeep-admin-workflowengine>`: compiles workflows and launches workflow executions from launch plans.

  • :ref:`data <divedeep-admin-data>` (remote cloud storage): offloads data blobs to the configured cloud provider.

  • :ref:`runtime <divedeep-admin-config>`: loads values from a config file to assign task resources, initialization values, execution queues and more.

  • :ref:`async processes <divedeep-admin-async>`: provides functions for scheduling and executing workflows as well as enqueuing and triggering notifications

Repository

Serialized entities (tasks, workflows, launch plans) and executions (workflow-, node- and task-) are stored as protos defined here. We use the excellent gorm library to interface with our database, which currently supports a postgres implementation. The actual code for issuing queries with gorm can be found in the gormimpl directory.

Models

Database models are defined in the models directory and correspond 1:1 with database tables 0.

The full set of database tables includes:

  • executions

  • execution_events

  • launch_plans

  • node_executions

  • node_execution_events

  • tasks

  • task_executions

  • workflows

These database models inherit primary keys and indexes as defined in the corresponding models file.

The repositories code also includes transformers. These convert entities from the database format to a response format for the external API. If you change either of these structures, you will find you must change the corresponding transformers.

Component Details

This section dives into detail for each top-level directories defined in pkg/.

Asynchronous Components

Notifications and schedules are handled by async routines that are reponsible for enqueing and subsequently processing dequeued messages.

Flyteadmin uses the gizmo toolkit to abstract queueing implementation. Gizmo’s pubsub library offers implementations for Amazon SNS/SQS, Google’s Pubsub, Kafka topics and publishing over HTTP.

For the sandbox development, no-op implementations of the notifications and schedule handlers are used to remove external cloud dependencies.

Common

As the name implies, common houses shared components used across different flyteadmin components in a single, top-level directory to avoid cyclic dependencies. These components include execution naming and phase utils, query filter definitions, query sorting definitions, and named constants.

Data

Data interfaces are primarily handled by the storage library implemented in flytestdlib. However, neither this nor the underlying stow library expose HEAD support so the data package in admin exists as the layer responsible for additional, remote data operations.

Errors

The errors directory contains centrally defined errors that are designed for compatibility with gRPC statuses.

Runtime

Values specific to the flyteadmin application as well as task and workflow registration and execution are configured in the runtime directory. These interfaces expose values configured in the flyteadmin top-level key in the application config.

Workflowengine

This directory contains interfaces to build and execute workflows leveraging flytepropeller compiler and client components.

0

Unfortunately, given unique naming constraints, some models are redefined in migration_models to guarantee unique index values.