flyte 0.2.0b4__py3-none-any.whl → 0.2.0b5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flyte might be problematic. Click here for more details.

flyte/_build.py CHANGED
@@ -1,10 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
- from ._api_commons import syncer
3
+ from flyte.syncify import syncify
4
+
4
5
  from ._image import Image
5
6
 
6
7
 
7
- @syncer.wrap
8
+ @syncify
8
9
  async def build(image: Image) -> str:
9
10
  """
10
11
  Build an image. The existing async context will be used.
flyte/_deploy.py CHANGED
@@ -7,11 +7,11 @@ from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
7
7
  import rich.repr
8
8
 
9
9
  from flyte.models import SerializationContext
10
+ from flyte.syncify import syncify
10
11
 
11
- from ._api_commons import syncer
12
12
  from ._environment import Environment
13
13
  from ._image import Image
14
- from ._initialize import get_client, get_common_config, requires_client, requires_initialization
14
+ from ._initialize import ensure_client, get_client, get_common_config, requires_initialization
15
15
  from ._logging import logger
16
16
  from ._task import TaskTemplate
17
17
  from ._task_environment import TaskEnvironment
@@ -47,13 +47,13 @@ class Deployment:
47
47
  return f"Deployment(envs=[{env_names}], tasks=[{task_names_versions}])"
48
48
 
49
49
 
50
- @requires_client
51
50
  async def _deploy_task(
52
51
  task: TaskTemplate, serialization_context: SerializationContext, dryrun: bool = False
53
52
  ) -> task_definition_pb2.TaskSpec:
54
53
  """
55
54
  Deploy the given task.
56
55
  """
56
+ ensure_client()
57
57
  from ._internal.runtime.task_serde import translate_task_to_wire
58
58
  from ._protos.workflow import task_definition_pb2, task_service_pb2
59
59
 
@@ -177,7 +177,7 @@ def plan_deploy(*envs: Environment, version: Optional[str] = None) -> Deployment
177
177
  return DeploymentPlan(planned_envs, version=version)
178
178
 
179
179
 
180
- @syncer.wrap
180
+ @syncify
181
181
  async def deploy(
182
182
  *envs: Environment,
183
183
  dryrun: bool = False,
flyte/_initialize.py CHANGED
@@ -8,8 +8,8 @@ from pathlib import Path
8
8
  from typing import TYPE_CHECKING, Callable, List, Literal, Optional, TypeVar
9
9
 
10
10
  from flyte.errors import InitializationError
11
+ from flyte.syncify import syncify
11
12
 
12
- from ._api_commons import syncer
13
13
  from ._logging import initialize_logger
14
14
  from ._tools import ipython_check
15
15
 
@@ -108,7 +108,7 @@ async def _initialize_client(
108
108
  )
109
109
 
110
110
 
111
- @syncer.wrap
111
+ @syncify
112
112
  async def init(
113
113
  org: str | None = None,
114
114
  project: str | None = None,
@@ -298,6 +298,20 @@ def initialize_in_cluster() -> None:
298
298
  T = TypeVar("T", bound=Callable)
299
299
 
300
300
 
301
+ def ensure_client():
302
+ """
303
+ Ensure that the client is initialized. If not, raise an InitializationError.
304
+ This function is used to check if the client is initialized before executing any Flyte remote API methods.
305
+ """
306
+ if _get_init_config() is None or _get_init_config().client is None:
307
+ raise InitializationError(
308
+ "ClientNotInitializedError",
309
+ "user",
310
+ "Client has not been initialized. Call flyte.init() with a valid endpoint"
311
+ " or api-key before using this function.",
312
+ )
313
+
314
+
301
315
  def requires_client(func: T) -> T:
302
316
  """
303
317
  Decorator that checks if the client has been initialized before executing the function.
@@ -308,7 +322,7 @@ def requires_client(func: T) -> T:
308
322
  """
309
323
 
310
324
  @functools.wraps(func)
311
- def wrapper(*args, **kwargs) -> T:
325
+ async def wrapper(*args, **kwargs) -> T:
312
326
  init_config = _get_init_config()
313
327
  if init_config is None or init_config.client is None:
314
328
  raise InitializationError(
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: workflow/common.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf import descriptor as _descriptor
6
+ from google.protobuf import descriptor_pool as _descriptor_pool
7
+ from google.protobuf import symbol_database as _symbol_database
8
+ from google.protobuf.internal import builder as _builder
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+ from flyteidl.core import interface_pb2 as flyteidl_dot_core_dot_interface__pb2
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15workflow/common.proto\x12\x11\x63loudidl.workflow\x1a\x1d\x66lyteidl/core/interface.proto\"\\\n\x0eNamedParameter\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x36\n\tparameter\x18\x02 \x01(\x0b\x32\x18.flyteidl.core.ParameterR\tparameterB\xb8\x01\n\x15\x63om.cloudidl.workflowB\x0b\x43ommonProtoH\x02P\x01Z+github.com/unionai/cloud/gen/pb-go/workflow\xa2\x02\x03\x43WX\xaa\x02\x11\x43loudidl.Workflow\xca\x02\x11\x43loudidl\\Workflow\xe2\x02\x1d\x43loudidl\\Workflow\\GPBMetadata\xea\x02\x12\x43loudidl::Workflowb\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'workflow.common_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ DESCRIPTOR._serialized_options = b'\n\025com.cloudidl.workflowB\013CommonProtoH\002P\001Z+github.com/unionai/cloud/gen/pb-go/workflow\242\002\003CWX\252\002\021Cloudidl.Workflow\312\002\021Cloudidl\\Workflow\342\002\035Cloudidl\\Workflow\\GPBMetadata\352\002\022Cloudidl::Workflow'
25
+ _globals['_NAMEDPARAMETER']._serialized_start=75
26
+ _globals['_NAMEDPARAMETER']._serialized_end=167
27
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,14 @@
1
+ from flyteidl.core import interface_pb2 as _interface_pb2
2
+ from google.protobuf import descriptor as _descriptor
3
+ from google.protobuf import message as _message
4
+ from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
5
+
6
+ DESCRIPTOR: _descriptor.FileDescriptor
7
+
8
+ class NamedParameter(_message.Message):
9
+ __slots__ = ["name", "parameter"]
10
+ NAME_FIELD_NUMBER: _ClassVar[int]
11
+ PARAMETER_FIELD_NUMBER: _ClassVar[int]
12
+ name: str
13
+ parameter: _interface_pb2.Parameter
14
+ def __init__(self, name: _Optional[str] = ..., parameter: _Optional[_Union[_interface_pb2.Parameter, _Mapping]] = ...) -> None: ...
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -21,7 +21,7 @@ from flyte._protos.validate.validate import validate_pb2 as validate_dot_validat
21
21
  from flyte._protos.workflow import task_definition_pb2 as workflow_dot_task__definition__pb2
22
22
 
23
23
 
24
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dworkflow/run_definition.proto\x12\x11\x63loudidl.workflow\x1a\x17\x63ommon/identifier.proto\x1a\x15\x63ommon/identity.proto\x1a\x1d\x66lyteidl/core/execution.proto\x1a\x1c\x66lyteidl/core/literals.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17validate/validate.proto\x1a\x1eworkflow/task_definition.proto\"\x8d\x01\n\rRunIdentifier\x12\x19\n\x03org\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x03org\x12!\n\x07project\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07project\x12\x1f\n\x06\x64omain\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1d\n\x04name\x18\x04 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\"\x82\x01\n\x06Labels\x12=\n\x06values\x18\x01 \x03(\x0b\x32%.cloudidl.workflow.Labels.ValuesEntryR\x06values\x1a\x39\n\x0bValuesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x8c\x01\n\x0b\x41nnotations\x12\x42\n\x06values\x18\x01 \x03(\x0b\x32*.cloudidl.workflow.Annotations.ValuesEntryR\x06values\x1a\x39\n\x0bValuesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\";\n\x04\x45nvs\x12\x33\n\x06values\x18\x01 \x03(\x0b\x32\x1b.flyteidl.core.KeyValuePairR\x06values\"\x96\x02\n\x07RunSpec\x12\x31\n\x06labels\x18\x01 \x01(\x0b\x32\x19.cloudidl.workflow.LabelsR\x06labels\x12@\n\x0b\x61nnotations\x18\x02 \x01(\x0b\x32\x1e.cloudidl.workflow.AnnotationsR\x0b\x61nnotations\x12+\n\x04\x65nvs\x18\x03 \x01(\x0b\x32\x17.cloudidl.workflow.EnvsR\x04\x65nvs\x12@\n\rinterruptible\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValueR\rinterruptible\x12\'\n\x0foverwrite_cache\x18\x05 \x01(\x08R\x0eoverwriteCache\"8\n\x03Run\x12\x31\n\x06\x61\x63tion\x18\x01 \x01(\x0b\x32\x19.cloudidl.workflow.ActionR\x06\x61\x63tion\"}\n\nRunDetails\x12\x35\n\x08run_spec\x18\x01 \x01(\x0b\x32\x1a.cloudidl.workflow.RunSpecR\x07runSpec\x12\x38\n\x06\x61\x63tion\x18\x02 \x01(\x0b\x32 .cloudidl.workflow.ActionDetailsR\x06\x61\x63tion\"o\n\x10\x41\x63tionIdentifier\x12<\n\x03run\x18\x01 \x01(\x0b\x32 .cloudidl.workflow.RunIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x03run\x12\x1d\n\x04name\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\"d\n\x12TaskActionMetadata\x12\x31\n\x02id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierR\x02id\x12\x1b\n\ttask_type\x18\x02 \x01(\tR\x08taskType\")\n\x13TraceActionMetadata\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"\x9f\x01\n\x17\x43onditionActionMetadata\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x06run_id\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01H\x00R\x05runId\x12&\n\taction_id\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01H\x00R\x08\x61\x63tionId\x12\x18\n\x06global\x18\x04 \x01(\x08H\x00R\x06globalB\x0c\n\x05scope\x12\x03\xf8\x42\x01\"\xf1\x02\n\x0e\x41\x63tionMetadata\x12\x16\n\x06parent\x18\x03 \x01(\tR\x06parent\x12\x14\n\x05group\x18\x05 \x01(\tR\x05group\x12\x42\n\x0b\x65xecuted_by\x18\x06 \x01(\x0b\x32!.cloudidl.common.EnrichedIdentityR\nexecutedBy\x12\x45\n\x04task\x18\x07 \x01(\x0b\x32%.cloudidl.workflow.TaskActionMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\x04task\x12H\n\x05trace\x18\x08 \x01(\x0b\x32&.cloudidl.workflow.TraceActionMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\x05trace\x12T\n\tcondition\x18\t \x01(\x0b\x32*.cloudidl.workflow.ConditionActionMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\tconditionB\x06\n\x04spec\"\xe7\x01\n\x0c\x41\x63tionStatus\x12.\n\x05phase\x18\x01 \x01(\x0e\x32\x18.cloudidl.workflow.PhaseR\x05phase\x12\x39\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartTime\x12:\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x07\x65ndTime\x88\x01\x01\x12#\n\x08\x61ttempts\x18\x04 \x01(\rB\x07\xfa\x42\x04*\x02 \x00R\x08\x61ttemptsB\x0b\n\t_end_time\"\xb5\x01\n\x06\x41\x63tion\x12\x33\n\x02id\x18\x01 \x01(\x0b\x32#.cloudidl.workflow.ActionIdentifierR\x02id\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32!.cloudidl.workflow.ActionMetadataR\x08metadata\x12\x37\n\x06status\x18\x03 \x01(\x0b\x32\x1f.cloudidl.workflow.ActionStatusR\x06status\"\x9e\x02\n\x0e\x45nrichedAction\x12\x31\n\x06\x61\x63tion\x18\x01 \x01(\x0b\x32\x19.cloudidl.workflow.ActionR\x06\x61\x63tion\x12!\n\x0cmeets_filter\x18\x02 \x01(\x08R\x0bmeetsFilter\x12n\n\x15\x63hildren_phase_counts\x18\x03 \x03(\x0b\x32:.cloudidl.workflow.EnrichedAction.ChildrenPhaseCountsEntryR\x13\x63hildrenPhaseCounts\x1a\x46\n\x18\x43hildrenPhaseCountsEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x05R\x05value:\x02\x38\x01\"\x9a\x01\n\tErrorInfo\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12\x35\n\x04kind\x18\x02 \x01(\x0e\x32!.cloudidl.workflow.ErrorInfo.KindR\x04kind\"<\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\r\n\tKIND_USER\x10\x01\x12\x0f\n\x0bKIND_SYSTEM\x10\x02\"e\n\tAbortInfo\x12\x16\n\x06reason\x18\x01 \x01(\tR\x06reason\x12@\n\naborted_by\x18\x02 \x01(\x0b\x32!.cloudidl.common.EnrichedIdentityR\tabortedBy\"\xcd\x03\n\rActionDetails\x12\x33\n\x02id\x18\x01 \x01(\x0b\x32#.cloudidl.workflow.ActionIdentifierR\x02id\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32!.cloudidl.workflow.ActionMetadataR\x08metadata\x12\x37\n\x06status\x18\x03 \x01(\x0b\x32\x1f.cloudidl.workflow.ActionStatusR\x06status\x12=\n\nerror_info\x18\x04 \x01(\x0b\x32\x1c.cloudidl.workflow.ErrorInfoH\x00R\terrorInfo\x12=\n\nabort_info\x18\x05 \x01(\x0b\x32\x1c.cloudidl.workflow.AbortInfoH\x00R\tabortInfo\x12I\n\x12resolved_task_spec\x18\x06 \x01(\x0b\x32\x1b.cloudidl.workflow.TaskSpecR\x10resolvedTaskSpec\x12<\n\x08\x61ttempts\x18\x07 \x03(\x0b\x32 .cloudidl.workflow.ActionAttemptR\x08\x61ttemptsB\x08\n\x06result\"\xa9\x03\n\rActionAttempt\x12.\n\x05phase\x18\x01 \x01(\x0e\x32\x18.cloudidl.workflow.PhaseR\x05phase\x12\x39\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartTime\x12:\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x07\x65ndTime\x88\x01\x01\x12@\n\nerror_info\x18\x04 \x01(\x0b\x32\x1c.cloudidl.workflow.ErrorInfoH\x01R\terrorInfo\x88\x01\x01\x12!\n\x07\x61ttempt\x18\x05 \x01(\rB\x07\xfa\x42\x04*\x02 \x00R\x07\x61ttempt\x12\x31\n\x08log_info\x18\x06 \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x07logInfo\x12=\n\x07outputs\x18\x07 \x01(\x0b\x32#.cloudidl.workflow.OutputReferencesR\x07outputsB\x0b\n\t_end_timeB\r\n\x0b_error_info\"\x95\x05\n\x0b\x41\x63tionEvent\x12=\n\x02id\x18\x01 \x01(\x0b\x32#.cloudidl.workflow.ActionIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x02id\x12!\n\x07\x61ttempt\x18\x02 \x01(\rB\x07\xfa\x42\x04*\x02 \x00R\x07\x61ttempt\x12.\n\x05phase\x18\x03 \x01(\x0e\x32\x18.cloudidl.workflow.PhaseR\x05phase\x12\x18\n\x07version\x18\x04 \x01(\rR\x07version\x12\x39\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartTime\x12=\n\x0cupdated_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0bupdatedTime\x12:\n\x08\x65nd_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x07\x65ndTime\x88\x01\x01\x12@\n\nerror_info\x18\x08 \x01(\x0b\x32\x1c.cloudidl.workflow.ErrorInfoH\x01R\terrorInfo\x88\x01\x01\x12\x31\n\x08log_info\x18\t \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x07logInfo\x12:\n\x0blog_context\x18\n \x01(\x0b\x32\x19.flyteidl.core.LogContextR\nlogContext\x12\x18\n\x07\x63luster\x18\x0b \x01(\tR\x07\x63luster\x12=\n\x07outputs\x18\x0c \x01(\x0b\x32#.cloudidl.workflow.OutputReferencesR\x07outputsB\x0b\n\t_end_timeB\r\n\x0b_error_info\"P\n\x0cNamedLiteral\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x16.flyteidl.core.LiteralR\x05value\"1\n\x10OutputReferences\x12\x1d\n\noutput_uri\x18\x01 \x01(\tR\toutputUri\"E\n\x06Inputs\x12;\n\x08literals\x18\x01 \x03(\x0b\x32\x1f.cloudidl.workflow.NamedLiteralR\x08literals\"F\n\x07Outputs\x12;\n\x08literals\x18\x01 \x03(\x0b\x32\x1f.cloudidl.workflow.NamedLiteralR\x08literals*\xcb\x01\n\x05Phase\x12\x15\n\x11PHASE_UNSPECIFIED\x10\x00\x12\x10\n\x0cPHASE_QUEUED\x10\x01\x12\x1f\n\x1bPHASE_WAITING_FOR_RESOURCES\x10\x02\x12\x16\n\x12PHASE_INITIALIZING\x10\x03\x12\x11\n\rPHASE_RUNNING\x10\x04\x12\x13\n\x0fPHASE_SUCCEEDED\x10\x05\x12\x10\n\x0cPHASE_FAILED\x10\x06\x12\x11\n\rPHASE_ABORTED\x10\x07\x12\x13\n\x0fPHASE_TIMED_OUT\x10\x08\x42\xbf\x01\n\x15\x63om.cloudidl.workflowB\x12RunDefinitionProtoH\x02P\x01Z+github.com/unionai/cloud/gen/pb-go/workflow\xa2\x02\x03\x43WX\xaa\x02\x11\x43loudidl.Workflow\xca\x02\x11\x43loudidl\\Workflow\xe2\x02\x1d\x43loudidl\\Workflow\\GPBMetadata\xea\x02\x12\x43loudidl::Workflowb\x06proto3')
24
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dworkflow/run_definition.proto\x12\x11\x63loudidl.workflow\x1a\x17\x63ommon/identifier.proto\x1a\x15\x63ommon/identity.proto\x1a\x1d\x66lyteidl/core/execution.proto\x1a\x1c\x66lyteidl/core/literals.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17validate/validate.proto\x1a\x1eworkflow/task_definition.proto\"\x8d\x01\n\rRunIdentifier\x12\x19\n\x03org\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x03org\x12!\n\x07project\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07project\x12\x1f\n\x06\x64omain\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1d\n\x04name\x18\x04 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\"\x82\x01\n\x06Labels\x12=\n\x06values\x18\x01 \x03(\x0b\x32%.cloudidl.workflow.Labels.ValuesEntryR\x06values\x1a\x39\n\x0bValuesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x8c\x01\n\x0b\x41nnotations\x12\x42\n\x06values\x18\x01 \x03(\x0b\x32*.cloudidl.workflow.Annotations.ValuesEntryR\x06values\x1a\x39\n\x0bValuesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\";\n\x04\x45nvs\x12\x33\n\x06values\x18\x01 \x03(\x0b\x32\x1b.flyteidl.core.KeyValuePairR\x06values\"\x96\x02\n\x07RunSpec\x12\x31\n\x06labels\x18\x01 \x01(\x0b\x32\x19.cloudidl.workflow.LabelsR\x06labels\x12@\n\x0b\x61nnotations\x18\x02 \x01(\x0b\x32\x1e.cloudidl.workflow.AnnotationsR\x0b\x61nnotations\x12+\n\x04\x65nvs\x18\x03 \x01(\x0b\x32\x17.cloudidl.workflow.EnvsR\x04\x65nvs\x12@\n\rinterruptible\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValueR\rinterruptible\x12\'\n\x0foverwrite_cache\x18\x05 \x01(\x08R\x0eoverwriteCache\"8\n\x03Run\x12\x31\n\x06\x61\x63tion\x18\x01 \x01(\x0b\x32\x19.cloudidl.workflow.ActionR\x06\x61\x63tion\"}\n\nRunDetails\x12\x35\n\x08run_spec\x18\x01 \x01(\x0b\x32\x1a.cloudidl.workflow.RunSpecR\x07runSpec\x12\x38\n\x06\x61\x63tion\x18\x02 \x01(\x0b\x32 .cloudidl.workflow.ActionDetailsR\x06\x61\x63tion\"o\n\x10\x41\x63tionIdentifier\x12<\n\x03run\x18\x01 \x01(\x0b\x32 .cloudidl.workflow.RunIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x03run\x12\x1d\n\x04name\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\"d\n\x12TaskActionMetadata\x12\x31\n\x02id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierR\x02id\x12\x1b\n\ttask_type\x18\x02 \x01(\tR\x08taskType\")\n\x13TraceActionMetadata\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"\x9f\x01\n\x17\x43onditionActionMetadata\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x06run_id\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01H\x00R\x05runId\x12&\n\taction_id\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01H\x00R\x08\x61\x63tionId\x12\x18\n\x06global\x18\x04 \x01(\x08H\x00R\x06globalB\x0c\n\x05scope\x12\x03\xf8\x42\x01\"\xf1\x02\n\x0e\x41\x63tionMetadata\x12\x16\n\x06parent\x18\x03 \x01(\tR\x06parent\x12\x14\n\x05group\x18\x05 \x01(\tR\x05group\x12\x42\n\x0b\x65xecuted_by\x18\x06 \x01(\x0b\x32!.cloudidl.common.EnrichedIdentityR\nexecutedBy\x12\x45\n\x04task\x18\x07 \x01(\x0b\x32%.cloudidl.workflow.TaskActionMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\x04task\x12H\n\x05trace\x18\x08 \x01(\x0b\x32&.cloudidl.workflow.TraceActionMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\x05trace\x12T\n\tcondition\x18\t \x01(\x0b\x32*.cloudidl.workflow.ConditionActionMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\tconditionB\x06\n\x04spec\"\xe7\x01\n\x0c\x41\x63tionStatus\x12.\n\x05phase\x18\x01 \x01(\x0e\x32\x18.cloudidl.workflow.PhaseR\x05phase\x12\x39\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartTime\x12:\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x07\x65ndTime\x88\x01\x01\x12#\n\x08\x61ttempts\x18\x04 \x01(\rB\x07\xfa\x42\x04*\x02 \x00R\x08\x61ttemptsB\x0b\n\t_end_time\"\xb5\x01\n\x06\x41\x63tion\x12\x33\n\x02id\x18\x01 \x01(\x0b\x32#.cloudidl.workflow.ActionIdentifierR\x02id\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32!.cloudidl.workflow.ActionMetadataR\x08metadata\x12\x37\n\x06status\x18\x03 \x01(\x0b\x32\x1f.cloudidl.workflow.ActionStatusR\x06status\"\x9e\x02\n\x0e\x45nrichedAction\x12\x31\n\x06\x61\x63tion\x18\x01 \x01(\x0b\x32\x19.cloudidl.workflow.ActionR\x06\x61\x63tion\x12!\n\x0cmeets_filter\x18\x02 \x01(\x08R\x0bmeetsFilter\x12n\n\x15\x63hildren_phase_counts\x18\x03 \x03(\x0b\x32:.cloudidl.workflow.EnrichedAction.ChildrenPhaseCountsEntryR\x13\x63hildrenPhaseCounts\x1a\x46\n\x18\x43hildrenPhaseCountsEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x05R\x05value:\x02\x38\x01\"\x9a\x01\n\tErrorInfo\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12\x35\n\x04kind\x18\x02 \x01(\x0e\x32!.cloudidl.workflow.ErrorInfo.KindR\x04kind\"<\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\r\n\tKIND_USER\x10\x01\x12\x0f\n\x0bKIND_SYSTEM\x10\x02\"e\n\tAbortInfo\x12\x16\n\x06reason\x18\x01 \x01(\tR\x06reason\x12@\n\naborted_by\x18\x02 \x01(\x0b\x32!.cloudidl.common.EnrichedIdentityR\tabortedBy\"\xcd\x03\n\rActionDetails\x12\x33\n\x02id\x18\x01 \x01(\x0b\x32#.cloudidl.workflow.ActionIdentifierR\x02id\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32!.cloudidl.workflow.ActionMetadataR\x08metadata\x12\x37\n\x06status\x18\x03 \x01(\x0b\x32\x1f.cloudidl.workflow.ActionStatusR\x06status\x12=\n\nerror_info\x18\x04 \x01(\x0b\x32\x1c.cloudidl.workflow.ErrorInfoH\x00R\terrorInfo\x12=\n\nabort_info\x18\x05 \x01(\x0b\x32\x1c.cloudidl.workflow.AbortInfoH\x00R\tabortInfo\x12I\n\x12resolved_task_spec\x18\x06 \x01(\x0b\x32\x1b.cloudidl.workflow.TaskSpecR\x10resolvedTaskSpec\x12<\n\x08\x61ttempts\x18\x07 \x03(\x0b\x32 .cloudidl.workflow.ActionAttemptR\x08\x61ttemptsB\x08\n\x06result\"\xd0\x03\n\rActionAttempt\x12.\n\x05phase\x18\x01 \x01(\x0e\x32\x18.cloudidl.workflow.PhaseR\x05phase\x12\x39\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartTime\x12:\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x07\x65ndTime\x88\x01\x01\x12@\n\nerror_info\x18\x04 \x01(\x0b\x32\x1c.cloudidl.workflow.ErrorInfoH\x01R\terrorInfo\x88\x01\x01\x12!\n\x07\x61ttempt\x18\x05 \x01(\rB\x07\xfa\x42\x04*\x02 \x00R\x07\x61ttempt\x12\x31\n\x08log_info\x18\x06 \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x07logInfo\x12=\n\x07outputs\x18\x07 \x01(\x0b\x32#.cloudidl.workflow.OutputReferencesR\x07outputs\x12%\n\x0elogs_available\x18\x08 \x01(\x08R\rlogsAvailableB\x0b\n\t_end_timeB\r\n\x0b_error_info\"\x95\x05\n\x0b\x41\x63tionEvent\x12=\n\x02id\x18\x01 \x01(\x0b\x32#.cloudidl.workflow.ActionIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x02id\x12!\n\x07\x61ttempt\x18\x02 \x01(\rB\x07\xfa\x42\x04*\x02 \x00R\x07\x61ttempt\x12.\n\x05phase\x18\x03 \x01(\x0e\x32\x18.cloudidl.workflow.PhaseR\x05phase\x12\x18\n\x07version\x18\x04 \x01(\rR\x07version\x12\x39\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartTime\x12=\n\x0cupdated_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0bupdatedTime\x12:\n\x08\x65nd_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x07\x65ndTime\x88\x01\x01\x12@\n\nerror_info\x18\x08 \x01(\x0b\x32\x1c.cloudidl.workflow.ErrorInfoH\x01R\terrorInfo\x88\x01\x01\x12\x31\n\x08log_info\x18\t \x03(\x0b\x32\x16.flyteidl.core.TaskLogR\x07logInfo\x12:\n\x0blog_context\x18\n \x01(\x0b\x32\x19.flyteidl.core.LogContextR\nlogContext\x12\x18\n\x07\x63luster\x18\x0b \x01(\tR\x07\x63luster\x12=\n\x07outputs\x18\x0c \x01(\x0b\x32#.cloudidl.workflow.OutputReferencesR\x07outputsB\x0b\n\t_end_timeB\r\n\x0b_error_info\"P\n\x0cNamedLiteral\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x16.flyteidl.core.LiteralR\x05value\"1\n\x10OutputReferences\x12\x1d\n\noutput_uri\x18\x01 \x01(\tR\toutputUri\"E\n\x06Inputs\x12;\n\x08literals\x18\x01 \x03(\x0b\x32\x1f.cloudidl.workflow.NamedLiteralR\x08literals\"F\n\x07Outputs\x12;\n\x08literals\x18\x01 \x03(\x0b\x32\x1f.cloudidl.workflow.NamedLiteralR\x08literals*\xcb\x01\n\x05Phase\x12\x15\n\x11PHASE_UNSPECIFIED\x10\x00\x12\x10\n\x0cPHASE_QUEUED\x10\x01\x12\x1f\n\x1bPHASE_WAITING_FOR_RESOURCES\x10\x02\x12\x16\n\x12PHASE_INITIALIZING\x10\x03\x12\x11\n\rPHASE_RUNNING\x10\x04\x12\x13\n\x0fPHASE_SUCCEEDED\x10\x05\x12\x10\n\x0cPHASE_FAILED\x10\x06\x12\x11\n\rPHASE_ABORTED\x10\x07\x12\x13\n\x0fPHASE_TIMED_OUT\x10\x08\x42\xbf\x01\n\x15\x63om.cloudidl.workflowB\x12RunDefinitionProtoH\x02P\x01Z+github.com/unionai/cloud/gen/pb-go/workflow\xa2\x02\x03\x43WX\xaa\x02\x11\x43loudidl.Workflow\xca\x02\x11\x43loudidl\\Workflow\xe2\x02\x1d\x43loudidl\\Workflow\\GPBMetadata\xea\x02\x12\x43loudidl::Workflowb\x06proto3')
25
25
 
26
26
  _globals = globals()
27
27
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -67,8 +67,8 @@ if _descriptor._USE_C_DESCRIPTORS == False:
67
67
  _ACTIONEVENT.fields_by_name['id']._serialized_options = b'\372B\005\212\001\002\020\001'
68
68
  _ACTIONEVENT.fields_by_name['attempt']._options = None
69
69
  _ACTIONEVENT.fields_by_name['attempt']._serialized_options = b'\372B\004*\002 \000'
70
- _globals['_PHASE']._serialized_start=4822
71
- _globals['_PHASE']._serialized_end=5025
70
+ _globals['_PHASE']._serialized_start=4861
71
+ _globals['_PHASE']._serialized_end=5064
72
72
  _globals['_RUNIDENTIFIER']._serialized_start=284
73
73
  _globals['_RUNIDENTIFIER']._serialized_end=425
74
74
  _globals['_LABELS']._serialized_start=428
@@ -114,15 +114,15 @@ if _descriptor._USE_C_DESCRIPTORS == False:
114
114
  _globals['_ACTIONDETAILS']._serialized_start=2990
115
115
  _globals['_ACTIONDETAILS']._serialized_end=3451
116
116
  _globals['_ACTIONATTEMPT']._serialized_start=3454
117
- _globals['_ACTIONATTEMPT']._serialized_end=3879
118
- _globals['_ACTIONEVENT']._serialized_start=3882
119
- _globals['_ACTIONEVENT']._serialized_end=4543
120
- _globals['_NAMEDLITERAL']._serialized_start=4545
121
- _globals['_NAMEDLITERAL']._serialized_end=4625
122
- _globals['_OUTPUTREFERENCES']._serialized_start=4627
123
- _globals['_OUTPUTREFERENCES']._serialized_end=4676
124
- _globals['_INPUTS']._serialized_start=4678
125
- _globals['_INPUTS']._serialized_end=4747
126
- _globals['_OUTPUTS']._serialized_start=4749
127
- _globals['_OUTPUTS']._serialized_end=4819
117
+ _globals['_ACTIONATTEMPT']._serialized_end=3918
118
+ _globals['_ACTIONEVENT']._serialized_start=3921
119
+ _globals['_ACTIONEVENT']._serialized_end=4582
120
+ _globals['_NAMEDLITERAL']._serialized_start=4584
121
+ _globals['_NAMEDLITERAL']._serialized_end=4664
122
+ _globals['_OUTPUTREFERENCES']._serialized_start=4666
123
+ _globals['_OUTPUTREFERENCES']._serialized_end=4715
124
+ _globals['_INPUTS']._serialized_start=4717
125
+ _globals['_INPUTS']._serialized_end=4786
126
+ _globals['_OUTPUTS']._serialized_start=4788
127
+ _globals['_OUTPUTS']._serialized_end=4858
128
128
  # @@protoc_insertion_point(module_scope)
@@ -238,7 +238,7 @@ class ActionDetails(_message.Message):
238
238
  def __init__(self, id: _Optional[_Union[ActionIdentifier, _Mapping]] = ..., metadata: _Optional[_Union[ActionMetadata, _Mapping]] = ..., status: _Optional[_Union[ActionStatus, _Mapping]] = ..., error_info: _Optional[_Union[ErrorInfo, _Mapping]] = ..., abort_info: _Optional[_Union[AbortInfo, _Mapping]] = ..., resolved_task_spec: _Optional[_Union[_task_definition_pb2.TaskSpec, _Mapping]] = ..., attempts: _Optional[_Iterable[_Union[ActionAttempt, _Mapping]]] = ...) -> None: ...
239
239
 
240
240
  class ActionAttempt(_message.Message):
241
- __slots__ = ["phase", "start_time", "end_time", "error_info", "attempt", "log_info", "outputs"]
241
+ __slots__ = ["phase", "start_time", "end_time", "error_info", "attempt", "log_info", "outputs", "logs_available"]
242
242
  PHASE_FIELD_NUMBER: _ClassVar[int]
243
243
  START_TIME_FIELD_NUMBER: _ClassVar[int]
244
244
  END_TIME_FIELD_NUMBER: _ClassVar[int]
@@ -246,6 +246,7 @@ class ActionAttempt(_message.Message):
246
246
  ATTEMPT_FIELD_NUMBER: _ClassVar[int]
247
247
  LOG_INFO_FIELD_NUMBER: _ClassVar[int]
248
248
  OUTPUTS_FIELD_NUMBER: _ClassVar[int]
249
+ LOGS_AVAILABLE_FIELD_NUMBER: _ClassVar[int]
249
250
  phase: Phase
250
251
  start_time: _timestamp_pb2.Timestamp
251
252
  end_time: _timestamp_pb2.Timestamp
@@ -253,7 +254,8 @@ class ActionAttempt(_message.Message):
253
254
  attempt: int
254
255
  log_info: _containers.RepeatedCompositeFieldContainer[_execution_pb2.TaskLog]
255
256
  outputs: OutputReferences
256
- def __init__(self, phase: _Optional[_Union[Phase, str]] = ..., start_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., end_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., error_info: _Optional[_Union[ErrorInfo, _Mapping]] = ..., attempt: _Optional[int] = ..., log_info: _Optional[_Iterable[_Union[_execution_pb2.TaskLog, _Mapping]]] = ..., outputs: _Optional[_Union[OutputReferences, _Mapping]] = ...) -> None: ...
257
+ logs_available: bool
258
+ def __init__(self, phase: _Optional[_Union[Phase, str]] = ..., start_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., end_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., error_info: _Optional[_Union[ErrorInfo, _Mapping]] = ..., attempt: _Optional[int] = ..., log_info: _Optional[_Iterable[_Union[_execution_pb2.TaskLog, _Mapping]]] = ..., outputs: _Optional[_Union[OutputReferences, _Mapping]] = ..., logs_available: bool = ...) -> None: ...
257
259
 
258
260
  class ActionEvent(_message.Message):
259
261
  __slots__ = ["id", "attempt", "phase", "version", "start_time", "updated_time", "end_time", "error_info", "log_info", "log_context", "cluster", "outputs"]
@@ -15,9 +15,10 @@ from flyte._protos.common import identifier_pb2 as common_dot_identifier__pb2
15
15
  from flyte._protos.common import identity_pb2 as common_dot_identity__pb2
16
16
  from flyteidl.core import tasks_pb2 as flyteidl_dot_core_dot_tasks__pb2
17
17
  from flyte._protos.validate.validate import validate_pb2 as validate_dot_validate__pb2
18
+ from flyte._protos.workflow import common_pb2 as workflow_dot_common__pb2
18
19
 
19
20
 
20
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eworkflow/task_definition.proto\x12\x11\x63loudidl.workflow\x1a\x17\x63ommon/identifier.proto\x1a\x15\x63ommon/identity.proto\x1a\x19\x66lyteidl/core/tasks.proto\x1a\x17validate/validate.proto\"\x88\x01\n\x08TaskName\x12\x19\n\x03org\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x03org\x12!\n\x07project\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07project\x12\x1f\n\x06\x64omain\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1d\n\x04name\x18\x04 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\"\xb1\x01\n\x0eTaskIdentifier\x12\x19\n\x03org\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x03org\x12!\n\x07project\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07project\x12\x1f\n\x06\x64omain\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1d\n\x04name\x18\x04 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\x12!\n\x07version\x18\x05 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07version\"\\\n\x0cTaskMetadata\x12L\n\x0b\x64\x65ployed_by\x18\x01 \x01(\x0b\x32!.cloudidl.common.EnrichedIdentityB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\ndeployedBy\"\x93\x01\n\x04Task\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x1f.cloudidl.workflow.TaskMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08metadata\"V\n\x08TaskSpec\x12J\n\rtask_template\x18\x01 \x01(\x0b\x32\x1b.flyteidl.core.TaskTemplateB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x0ctaskTemplate\"\xd5\x01\n\x0bTaskDetails\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x1f.cloudidl.workflow.TaskMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08metadata\x12\x39\n\x04spec\x18\x03 \x01(\x0b\x32\x1b.cloudidl.workflow.TaskSpecB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x04specB\xc0\x01\n\x15\x63om.cloudidl.workflowB\x13TaskDefinitionProtoH\x02P\x01Z+github.com/unionai/cloud/gen/pb-go/workflow\xa2\x02\x03\x43WX\xaa\x02\x11\x43loudidl.Workflow\xca\x02\x11\x43loudidl\\Workflow\xe2\x02\x1d\x43loudidl\\Workflow\\GPBMetadata\xea\x02\x12\x43loudidl::Workflowb\x06proto3')
21
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eworkflow/task_definition.proto\x12\x11\x63loudidl.workflow\x1a\x17\x63ommon/identifier.proto\x1a\x15\x63ommon/identity.proto\x1a\x19\x66lyteidl/core/tasks.proto\x1a\x17validate/validate.proto\x1a\x15workflow/common.proto\"\x88\x01\n\x08TaskName\x12\x19\n\x03org\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x03org\x12!\n\x07project\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07project\x12\x1f\n\x06\x64omain\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1d\n\x04name\x18\x04 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\"\xb1\x01\n\x0eTaskIdentifier\x12\x19\n\x03org\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x03org\x12!\n\x07project\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07project\x12\x1f\n\x06\x64omain\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x06\x64omain\x12\x1d\n\x04name\x18\x04 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x1eR\x04name\x12!\n\x07version\x18\x05 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01R\x07version\"\\\n\x0cTaskMetadata\x12L\n\x0b\x64\x65ployed_by\x18\x01 \x01(\x0b\x32!.cloudidl.common.EnrichedIdentityB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\ndeployedBy\"\x93\x01\n\x04Task\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x1f.cloudidl.workflow.TaskMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08metadata\"\xa0\x01\n\x08TaskSpec\x12J\n\rtask_template\x18\x01 \x01(\x0b\x32\x1b.flyteidl.core.TaskTemplateB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x0ctaskTemplate\x12H\n\x0e\x64\x65\x66\x61ult_inputs\x18\x02 \x03(\x0b\x32!.cloudidl.workflow.NamedParameterR\rdefaultInputs\"\xd5\x01\n\x0bTaskDetails\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\x12\x45\n\x08metadata\x18\x02 \x01(\x0b\x32\x1f.cloudidl.workflow.TaskMetadataB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08metadata\x12\x39\n\x04spec\x18\x03 \x01(\x0b\x32\x1b.cloudidl.workflow.TaskSpecB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x04specB\xc0\x01\n\x15\x63om.cloudidl.workflowB\x13TaskDefinitionProtoH\x02P\x01Z+github.com/unionai/cloud/gen/pb-go/workflow\xa2\x02\x03\x43WX\xaa\x02\x11\x43loudidl.Workflow\xca\x02\x11\x43loudidl\\Workflow\xe2\x02\x1d\x43loudidl\\Workflow\\GPBMetadata\xea\x02\x12\x43loudidl::Workflowb\x06proto3')
21
22
 
22
23
  _globals = globals()
23
24
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -57,16 +58,16 @@ if _descriptor._USE_C_DESCRIPTORS == False:
57
58
  _TASKDETAILS.fields_by_name['metadata']._serialized_options = b'\372B\005\212\001\002\020\001'
58
59
  _TASKDETAILS.fields_by_name['spec']._options = None
59
60
  _TASKDETAILS.fields_by_name['spec']._serialized_options = b'\372B\005\212\001\002\020\001'
60
- _globals['_TASKNAME']._serialized_start=154
61
- _globals['_TASKNAME']._serialized_end=290
62
- _globals['_TASKIDENTIFIER']._serialized_start=293
63
- _globals['_TASKIDENTIFIER']._serialized_end=470
64
- _globals['_TASKMETADATA']._serialized_start=472
65
- _globals['_TASKMETADATA']._serialized_end=564
66
- _globals['_TASK']._serialized_start=567
67
- _globals['_TASK']._serialized_end=714
68
- _globals['_TASKSPEC']._serialized_start=716
69
- _globals['_TASKSPEC']._serialized_end=802
70
- _globals['_TASKDETAILS']._serialized_start=805
71
- _globals['_TASKDETAILS']._serialized_end=1018
61
+ _globals['_TASKNAME']._serialized_start=177
62
+ _globals['_TASKNAME']._serialized_end=313
63
+ _globals['_TASKIDENTIFIER']._serialized_start=316
64
+ _globals['_TASKIDENTIFIER']._serialized_end=493
65
+ _globals['_TASKMETADATA']._serialized_start=495
66
+ _globals['_TASKMETADATA']._serialized_end=587
67
+ _globals['_TASK']._serialized_start=590
68
+ _globals['_TASK']._serialized_end=737
69
+ _globals['_TASKSPEC']._serialized_start=740
70
+ _globals['_TASKSPEC']._serialized_end=900
71
+ _globals['_TASKDETAILS']._serialized_start=903
72
+ _globals['_TASKDETAILS']._serialized_end=1116
72
73
  # @@protoc_insertion_point(module_scope)
@@ -2,9 +2,11 @@ from flyte._protos.common import identifier_pb2 as _identifier_pb2
2
2
  from flyte._protos.common import identity_pb2 as _identity_pb2
3
3
  from flyteidl.core import tasks_pb2 as _tasks_pb2
4
4
  from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
5
+ from flyte._protos.workflow import common_pb2 as _common_pb2
6
+ from google.protobuf.internal import containers as _containers
5
7
  from google.protobuf import descriptor as _descriptor
6
8
  from google.protobuf import message as _message
7
- from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
9
+ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
8
10
 
9
11
  DESCRIPTOR: _descriptor.FileDescriptor
10
12
 
@@ -49,10 +51,12 @@ class Task(_message.Message):
49
51
  def __init__(self, task_id: _Optional[_Union[TaskIdentifier, _Mapping]] = ..., metadata: _Optional[_Union[TaskMetadata, _Mapping]] = ...) -> None: ...
50
52
 
51
53
  class TaskSpec(_message.Message):
52
- __slots__ = ["task_template"]
54
+ __slots__ = ["task_template", "default_inputs"]
53
55
  TASK_TEMPLATE_FIELD_NUMBER: _ClassVar[int]
56
+ DEFAULT_INPUTS_FIELD_NUMBER: _ClassVar[int]
54
57
  task_template: _tasks_pb2.TaskTemplate
55
- def __init__(self, task_template: _Optional[_Union[_tasks_pb2.TaskTemplate, _Mapping]] = ...) -> None: ...
58
+ default_inputs: _containers.RepeatedCompositeFieldContainer[_common_pb2.NamedParameter]
59
+ def __init__(self, task_template: _Optional[_Union[_tasks_pb2.TaskTemplate, _Mapping]] = ..., default_inputs: _Optional[_Iterable[_Union[_common_pb2.NamedParameter, _Mapping]]] = ...) -> None: ...
56
60
 
57
61
  class TaskDetails(_message.Message):
58
62
  __slots__ = ["task_id", "metadata", "spec"]
flyte/_run.py CHANGED
@@ -5,8 +5,9 @@ import uuid
5
5
  from typing import TYPE_CHECKING, Any, Literal, Optional, Tuple, Union, cast
6
6
 
7
7
  from flyte.errors import InitializationError
8
+ from flyte.models import ActionID, Checkpoints, CodeBundle, RawDataPath, SerializationContext, TaskContext
9
+ from flyte.syncify import syncify
8
10
 
9
- from ._api_commons import syncer
10
11
  from ._context import contextual_run, internal_ctx
11
12
  from ._environment import Environment
12
13
  from ._initialize import (
@@ -20,7 +21,6 @@ from ._initialize import (
20
21
  from ._logging import logger
21
22
  from ._task import P, R, TaskTemplate
22
23
  from ._tools import ipython_check
23
- from .models import ActionID, Checkpoints, CodeBundle, RawDataPath, SerializationContext, TaskContext
24
24
 
25
25
  if TYPE_CHECKING:
26
26
  from flyte.remote import Run
@@ -38,7 +38,7 @@ async def _get_code_bundle_for_run(name: str) -> CodeBundle | None:
38
38
  from flyte._internal.runtime.task_serde import extract_code_bundle
39
39
  from flyte.remote import Run
40
40
 
41
- run = await Run.get.aio(Run, name=name)
41
+ run = await Run.get.aio(name=name)
42
42
  if run:
43
43
  run_details = await run.details()
44
44
  spec = run_details.action_details.pb2.resolved_task_spec
@@ -46,7 +46,6 @@ async def _get_code_bundle_for_run(name: str) -> CodeBundle | None:
46
46
  return None
47
47
 
48
48
 
49
- @syncer.wrap
50
49
  class _Runner:
51
50
  def __init__(
52
51
  self,
@@ -323,6 +322,7 @@ class _Runner:
323
322
  return cast(R, await convert_outputs_to_native(obj.native_interface, out))
324
323
  return cast(R, None)
325
324
 
325
+ @syncify
326
326
  async def run(self, task: TaskTemplate[P, Union[R, Run]], *args: P.args, **kwargs: P.kwargs) -> Union[R, Run]:
327
327
  """
328
328
  Run an async `@env.task` or `TaskTemplate` instance. The existing async context will be used.
@@ -398,6 +398,8 @@ def with_runcontext(
398
398
  interactive mode, while scripts are not. This is used to determine how the code bundle is created.
399
399
  :param raw_data_path: Use this path to store the raw data for the run. Currently only supported for local runs,
400
400
  and can be used to store raw data in specific locations. TODO coming soon for remote runs as well.
401
+ :param run_base_dir: Optional The base directory to use for the run. This is used to store the metadata for the run,
402
+ that is passed between tasks.
401
403
  :return: runner
402
404
  """
403
405
  if mode == "hybrid" and not name and not run_base_dir:
@@ -416,7 +418,7 @@ def with_runcontext(
416
418
  )
417
419
 
418
420
 
419
- @syncer.wrap
421
+ @syncify
420
422
  async def run(task: TaskTemplate[P, R], *args: P.args, **kwargs: P.kwargs) -> Union[R, Run]:
421
423
  """
422
424
  Run a task with the given parameters
flyte/_trace.py CHANGED
@@ -87,17 +87,12 @@ def trace(func: Callable[..., T]) -> Callable[..., T]:
87
87
  items = []
88
88
  result = func(*args, **kwargs)
89
89
  # TODO ideally we should use streaming into the type-engine so that it stream uploads large blocks
90
- if inspect.isasyncgen(result):
90
+ if inspect.isasyncgen(result) or is_async_iterable(result):
91
91
  # If it's directly an async generator
92
92
  async_iter = result
93
93
  async for item in async_iter:
94
94
  items.append(item)
95
95
  yield item
96
- elif is_async_iterable(result):
97
- # If it's an async iterable (has __aiter__)
98
- async for item in result:
99
- items.append(item)
100
- yield item
101
96
  duration = time.time() - start_time
102
97
  info.add_outputs(items, timedelta(seconds=duration))
103
98
  await controller.record_trace(info)
flyte/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.2.0b4'
21
- __version_tuple__ = version_tuple = (0, 2, 0, 'b4')
20
+ __version__ = version = '0.2.0b5'
21
+ __version_tuple__ = version_tuple = (0, 2, 0, 'b5')
flyte/io/_dir.py CHANGED
@@ -244,7 +244,7 @@ class Dir(BaseModel, Generic[T], SerializableType):
244
244
 
245
245
  shutil.copytree(self.path, local_dest, dirs_exist_ok=True)
246
246
 
247
- # Figure this out when we figure out the final synchronicity story
247
+ # Figure this out when we figure out the final sync story
248
248
  raise NotImplementedError("Sync download is not implemented for remote paths")
249
249
 
250
250
  @classmethod
@@ -287,7 +287,7 @@ class Dir(BaseModel, Generic[T], SerializableType):
287
287
  remote_dir = Dir[DataFrame].from_local_sync('/tmp/data_dir/', 's3://bucket/data/')
288
288
  ```
289
289
  """
290
- # Implement this after we figure out the final synchronicity story
290
+ # Implement this after we figure out the final sync story
291
291
  raise NotImplementedError("Sync upload is not implemented for remote paths")
292
292
 
293
293
  async def exists(self) -> bool:
flyte/io/_file.py CHANGED
@@ -22,7 +22,6 @@ from fsspec.asyn import AsyncFileSystem
22
22
  from fsspec.utils import get_protocol
23
23
  from mashumaro.types import SerializableType
24
24
  from pydantic import BaseModel, model_validator
25
- from synchronicity import Synchronizer
26
25
 
27
26
  import flyte.storage as storage
28
27
  from flyte._context import internal_ctx
@@ -33,8 +32,6 @@ from flyte.types import TypeEngine, TypeTransformer, TypeTransformerFailedError
33
32
  # Type variable for the file format
34
33
  T = TypeVar("T")
35
34
 
36
- synced = Synchronizer()
37
-
38
35
 
39
36
  class File(BaseModel, Generic[T], SerializableType):
40
37
  """
@@ -314,7 +311,7 @@ class File(BaseModel, Generic[T], SerializableType):
314
311
  with fs.open(self.path, **open_kwargs) as f:
315
312
  yield f
316
313
 
317
- # @synced.wrap - enabling this did not work - synchronicity/pydantic issue
314
+ # TODO sync needs to be implemented
318
315
  async def download(self, local_path: Optional[Union[str, Path]] = None) -> str:
319
316
  """
320
317
  Asynchronously download the file to a local path.
flyte/remote/_data.py CHANGED
@@ -15,7 +15,7 @@ import httpx
15
15
  from flyteidl.service import dataproxy_pb2
16
16
  from google.protobuf import duration_pb2
17
17
 
18
- from flyte._initialize import CommonInit, get_client, get_common_config, requires_client
18
+ from flyte._initialize import CommonInit, ensure_client, get_client, get_common_config
19
19
  from flyte.errors import RuntimeSystemError
20
20
 
21
21
  _UPLOAD_EXPIRES_IN = timedelta(seconds=60)
@@ -109,7 +109,6 @@ async def _upload_single_file(
109
109
  return str_digest, resp.native_url
110
110
 
111
111
 
112
- @requires_client
113
112
  async def upload_file(fp: Path, verify: bool = True) -> Tuple[str, str]:
114
113
  """
115
114
  Uploads a file to a remote location and returns the remote URI.
@@ -119,13 +118,13 @@ async def upload_file(fp: Path, verify: bool = True) -> Tuple[str, str]:
119
118
  :return: A tuple containing the MD5 digest and the remote URI.
120
119
  """
121
120
  # This is a placeholder implementation. Replace with actual upload logic.
121
+ ensure_client()
122
122
  cfg = get_common_config()
123
123
  if not fp.is_file():
124
124
  raise ValueError(f"{fp} is not a single file, upload arg must be a single file.")
125
125
  return await _upload_single_file(cfg, fp, verify=verify)
126
126
 
127
127
 
128
- @requires_client
129
128
  async def upload_dir(dir_path: Path, verify: bool = True) -> str:
130
129
  """
131
130
  Uploads a directory to a remote location and returns the remote URI.
@@ -135,6 +134,7 @@ async def upload_dir(dir_path: Path, verify: bool = True) -> str:
135
134
  :return: The remote URI of the uploaded directory.
136
135
  """
137
136
  # This is a placeholder implementation. Replace with actual upload logic.
137
+ ensure_client()
138
138
  cfg = get_common_config()
139
139
  if not dir_path.is_dir():
140
140
  raise ValueError(f"{dir_path} is not a directory, upload arg must be a directory.")
flyte/remote/_logs.py CHANGED
@@ -9,11 +9,11 @@ from rich.live import Live
9
9
  from rich.panel import Panel
10
10
  from rich.text import Text
11
11
 
12
- from flyte._api_commons import syncer
13
- from flyte._initialize import get_client, requires_client
12
+ from flyte._initialize import ensure_client, get_client
14
13
  from flyte._protos.logs.dataplane import payload_pb2
15
14
  from flyte._protos.workflow import run_definition_pb2, run_logs_service_pb2
16
15
  from flyte.errors import LogsNotYetAvailableError
16
+ from flyte.syncify import syncify
17
17
 
18
18
  style_map = {
19
19
  payload_pb2.LogLineOriginator.SYSTEM: "bold magenta",
@@ -78,6 +78,8 @@ class AsyncLogViewer:
78
78
  pass
79
79
  except KeyboardInterrupt:
80
80
  pass
81
+ except StopAsyncIteration:
82
+ self.console.print("[dim]Log stream ended.[/dim]")
81
83
  except LogsNotYetAvailableError as e:
82
84
  self.console.print(f"[red]Error:[/red] {e}")
83
85
  live.update("")
@@ -86,35 +88,47 @@ class AsyncLogViewer:
86
88
 
87
89
  @dataclass
88
90
  class Logs:
91
+ @syncify
89
92
  @classmethod
90
- @requires_client
91
- @syncer.wrap
92
93
  async def tail(
93
- cls, action_id: run_definition_pb2.ActionIdentifier, attempt: int = 1
94
+ cls,
95
+ action_id: run_definition_pb2.ActionIdentifier,
96
+ attempt: int = 1,
97
+ retry: int = 3,
94
98
  ) -> AsyncGenerator[payload_pb2.LogLine, None]:
95
99
  """
96
100
  Tail the logs for a given action ID and attempt.
97
101
  :param action_id: The action ID to tail logs for.
98
102
  :param attempt: The attempt number (default is 0).
99
103
  """
100
- try:
101
- resp = get_client().logs_service.TailLogs(
102
- run_logs_service_pb2.TailLogsRequest(action_id=action_id, attempt=attempt)
103
- )
104
- async for log_set in resp:
105
- if log_set.logs:
106
- for log in log_set.logs:
107
- for line in log.lines:
108
- yield line
109
- except asyncio.CancelledError:
110
- pass
111
- except KeyboardInterrupt:
112
- pass
113
- except grpc.aio.AioRpcError as e:
114
- if e.code() == grpc.StatusCode.NOT_FOUND:
115
- raise LogsNotYetAvailableError(
116
- f"Log stream not available for action {action_id.name} in run {action_id.run.name}."
104
+ ensure_client()
105
+ retries = 0
106
+ while True:
107
+ try:
108
+ resp = get_client().logs_service.TailLogs(
109
+ run_logs_service_pb2.TailLogsRequest(action_id=action_id, attempt=attempt)
117
110
  )
111
+ async for log_set in resp:
112
+ if log_set.logs:
113
+ for log in log_set.logs:
114
+ for line in log.lines:
115
+ yield line
116
+ return
117
+ except asyncio.CancelledError:
118
+ return
119
+ except KeyboardInterrupt:
120
+ return
121
+ except StopAsyncIteration:
122
+ return
123
+ except grpc.aio.AioRpcError as e:
124
+ retries += 1
125
+ if retries >= retry:
126
+ if e.code() == grpc.StatusCode.NOT_FOUND:
127
+ raise LogsNotYetAvailableError(
128
+ f"Log stream not available for action {action_id.name} in run {action_id.run.name}."
129
+ )
130
+ else:
131
+ await asyncio.sleep(1)
118
132
 
119
133
  @classmethod
120
134
  async def create_viewer(
@@ -136,15 +150,17 @@ class Logs:
136
150
  :param raw: if True, return the raw log lines instead of a viewer.
137
151
  :param filter_system: Whether to filter log lines based on system logs.
138
152
  """
153
+ if attempt < 1:
154
+ raise ValueError("Attempt number must be greater than 0.")
139
155
  if raw:
140
156
  console = Console()
141
- async for line in cls.tail.aio(cls, action_id=action_id, attempt=attempt):
157
+ async for line in cls.tail.aio(action_id=action_id, attempt=attempt):
142
158
  line_text = _format_line(line, show_ts=show_ts, filter_system=filter_system)
143
159
  if line_text:
144
160
  console.print(line_text, end="")
145
161
  return
146
162
  viewer = AsyncLogViewer(
147
- log_source=cls.tail.aio(cls, action_id=action_id, attempt=attempt),
163
+ log_source=cls.tail.aio(action_id=action_id, attempt=attempt),
148
164
  max_lines=max_lines,
149
165
  show_ts=show_ts,
150
166
  name=f"{action_id.run.name}:{action_id.name} ({attempt})",