flytekit.extend.get_serializable

flytekit.extend.get_serializable(entity_mapping, settings, entity, options=None)[source]

The flytekit authoring code produces objects representing Flyte entities (tasks, workflows, etc.). In order to register these, they need to be converted into objects that Flyte Admin understands (the IDL objects basically, but this function currently translates to the layer above (e.g. SdkTask) - this will be changed to the IDL objects directly in the future).

Parameters:
  • entity_mapping (OrderedDict) – This is an ordered dict that will be mutated in place. The reason this argument exists is because there is a natural ordering to the entities at registration time. That is, underlying tasks have to be registered before the workflows that use them. The recursive search done by this function and the functions above form a natural topological sort, finding the dependent entities and adding them to this parameter before the parent entity this function is called with.

  • settings (SerializationSettings) – used to pick up project/domain/name - to be deprecated.

  • entity (PythonTask | BranchNode | Node | LaunchPlan | WorkflowBase | ReferenceWorkflow | ReferenceTask | ReferenceLaunchPlan | ReferenceEntity) – The local flyte entity to try to convert (along with its dependencies)

  • options (Options | None) – Optionally pass in a set of options that can be used to add additional metadata for Launchplans

Returns:

The resulting control plane entity, in addition to being added to the mutable entity_mapping parameter is also returned.

Return type:

TaskSpec | LaunchPlan | WorkflowSpec | Node | BranchNode | ArrayNode