flyte 0.2.0b11__py3-none-any.whl → 0.2.0b13__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/_bin/runtime.py +11 -2
- flyte/_deploy.py +29 -0
- flyte/_initialize.py +7 -6
- flyte/_internal/controllers/remote/_action.py +5 -0
- flyte/_internal/controllers/remote/_controller.py +43 -3
- flyte/_internal/controllers/remote/_core.py +7 -0
- flyte/_internal/runtime/convert.py +61 -7
- flyte/_internal/runtime/task_serde.py +1 -1
- flyte/_protos/common/list_pb2.py +3 -3
- flyte/_protos/common/list_pb2.pyi +2 -0
- flyte/_protos/workflow/environment_pb2.py +29 -0
- flyte/_protos/workflow/environment_pb2.pyi +12 -0
- flyte/_protos/workflow/environment_pb2_grpc.py +4 -0
- flyte/_protos/workflow/queue_service_pb2.py +30 -29
- flyte/_protos/workflow/queue_service_pb2.pyi +5 -2
- flyte/_protos/workflow/run_definition_pb2.py +61 -61
- flyte/_protos/workflow/run_definition_pb2.pyi +4 -2
- flyte/_protos/workflow/run_service_pb2.py +20 -24
- flyte/_protos/workflow/run_service_pb2.pyi +2 -6
- flyte/_protos/workflow/state_service_pb2.py +36 -28
- flyte/_protos/workflow/state_service_pb2.pyi +19 -15
- flyte/_protos/workflow/state_service_pb2_grpc.py +28 -28
- flyte/_protos/workflow/task_definition_pb2.py +28 -22
- flyte/_protos/workflow/task_definition_pb2.pyi +16 -4
- flyte/_protos/workflow/task_service_pb2.py +27 -11
- flyte/_protos/workflow/task_service_pb2.pyi +29 -1
- flyte/_protos/workflow/task_service_pb2_grpc.py +34 -0
- flyte/_run.py +6 -0
- flyte/_trace.py +0 -2
- flyte/_utils/__init__.py +4 -0
- flyte/_utils/org_discovery.py +26 -0
- flyte/_version.py +2 -2
- flyte/cli/_abort.py +4 -2
- flyte/cli/_common.py +8 -2
- flyte/cli/_create.py +4 -3
- flyte/cli/_deploy.py +15 -8
- flyte/cli/_get.py +13 -12
- flyte/cli/_run.py +1 -2
- flyte/cli/main.py +1 -1
- flyte/remote/__init__.py +2 -1
- flyte/remote/_client/_protocols.py +2 -0
- flyte/remote/_task.py +141 -9
- flyte/syncify/_api.py +1 -2
- flyte/types/_type_engine.py +83 -9
- flyte-0.2.0b13.dist-info/METADATA +249 -0
- {flyte-0.2.0b11.dist-info → flyte-0.2.0b13.dist-info}/RECORD +49 -46
- flyte-0.2.0b11.dist-info/METADATA +0 -181
- {flyte-0.2.0b11.dist-info → flyte-0.2.0b13.dist-info}/WHEEL +0 -0
- {flyte-0.2.0b11.dist-info → flyte-0.2.0b13.dist-info}/entry_points.txt +0 -0
- {flyte-0.2.0b11.dist-info → flyte-0.2.0b13.dist-info}/top_level.txt +0 -0
|
@@ -14,11 +14,13 @@ _sym_db = _symbol_database.Default()
|
|
|
14
14
|
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
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
17
18
|
from flyte._protos.validate.validate import validate_pb2 as validate_dot_validate__pb2
|
|
18
19
|
from flyte._protos.workflow import common_pb2 as workflow_dot_common__pb2
|
|
20
|
+
from flyte._protos.workflow import environment_pb2 as workflow_dot_environment__pb2
|
|
19
21
|
|
|
20
22
|
|
|
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\"\
|
|
23
|
+
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\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\x1a\x15workflow/common.proto\x1a\x1aworkflow/environment.proto\"\x8f\x01\n\x08TaskName\x12\x1b\n\x03org\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x03org\x12#\n\x07project\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x07project\x12!\n\x06\x64omain\x18\x03 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x06\x64omain\x12\x1e\n\x04name\x18\x04 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x04name\"\xba\x01\n\x0eTaskIdentifier\x12\x1b\n\x03org\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x03org\x12#\n\x07project\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x07project\x12!\n\x06\x64omain\x18\x03 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x06\x64omain\x12\x1e\n\x04name\x18\x04 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x04name\x12#\n\x07version\x18\x05 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18?R\x07version\"\xed\x01\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\x12\x1d\n\nshort_name\x18\x02 \x01(\tR\tshortName\x12\x45\n\x0b\x64\x65ployed_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\xfa\x42\x05\xb2\x01\x02\x08\x01R\ndeployedAt\x12)\n\x10\x65nvironment_name\x18\x04 \x01(\tR\x0f\x65nvironmentName\"\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\"\x8a\x02\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\x12&\n\nshort_name\x18\x03 \x01(\tB\x07\xfa\x42\x04r\x02\x18?R\tshortName\x12@\n\x0b\x65nvironment\x18\x04 \x01(\x0b\x32\x1e.cloudidl.workflow.EnvironmentR\x0b\x65nvironment\"\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')
|
|
22
24
|
|
|
23
25
|
_globals = globals()
|
|
24
26
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -27,47 +29,51 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
27
29
|
DESCRIPTOR._options = None
|
|
28
30
|
DESCRIPTOR._serialized_options = b'\n\025com.cloudidl.workflowB\023TaskDefinitionProtoH\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'
|
|
29
31
|
_TASKNAME.fields_by_name['org']._options = None
|
|
30
|
-
_TASKNAME.fields_by_name['org']._serialized_options = b'\372B\
|
|
32
|
+
_TASKNAME.fields_by_name['org']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
31
33
|
_TASKNAME.fields_by_name['project']._options = None
|
|
32
|
-
_TASKNAME.fields_by_name['project']._serialized_options = b'\372B\
|
|
34
|
+
_TASKNAME.fields_by_name['project']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
33
35
|
_TASKNAME.fields_by_name['domain']._options = None
|
|
34
|
-
_TASKNAME.fields_by_name['domain']._serialized_options = b'\372B\
|
|
36
|
+
_TASKNAME.fields_by_name['domain']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
35
37
|
_TASKNAME.fields_by_name['name']._options = None
|
|
36
|
-
_TASKNAME.fields_by_name['name']._serialized_options = b'\372B\
|
|
38
|
+
_TASKNAME.fields_by_name['name']._serialized_options = b'\372B\007r\005\020\001\030\377\001'
|
|
37
39
|
_TASKIDENTIFIER.fields_by_name['org']._options = None
|
|
38
|
-
_TASKIDENTIFIER.fields_by_name['org']._serialized_options = b'\372B\
|
|
40
|
+
_TASKIDENTIFIER.fields_by_name['org']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
39
41
|
_TASKIDENTIFIER.fields_by_name['project']._options = None
|
|
40
|
-
_TASKIDENTIFIER.fields_by_name['project']._serialized_options = b'\372B\
|
|
42
|
+
_TASKIDENTIFIER.fields_by_name['project']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
41
43
|
_TASKIDENTIFIER.fields_by_name['domain']._options = None
|
|
42
|
-
_TASKIDENTIFIER.fields_by_name['domain']._serialized_options = b'\372B\
|
|
44
|
+
_TASKIDENTIFIER.fields_by_name['domain']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
43
45
|
_TASKIDENTIFIER.fields_by_name['name']._options = None
|
|
44
|
-
_TASKIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\
|
|
46
|
+
_TASKIDENTIFIER.fields_by_name['name']._serialized_options = b'\372B\007r\005\020\001\030\377\001'
|
|
45
47
|
_TASKIDENTIFIER.fields_by_name['version']._options = None
|
|
46
|
-
_TASKIDENTIFIER.fields_by_name['version']._serialized_options = b'\372B\
|
|
48
|
+
_TASKIDENTIFIER.fields_by_name['version']._serialized_options = b'\372B\006r\004\020\001\030?'
|
|
47
49
|
_TASKMETADATA.fields_by_name['deployed_by']._options = None
|
|
48
50
|
_TASKMETADATA.fields_by_name['deployed_by']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
51
|
+
_TASKMETADATA.fields_by_name['deployed_at']._options = None
|
|
52
|
+
_TASKMETADATA.fields_by_name['deployed_at']._serialized_options = b'\372B\005\262\001\002\010\001'
|
|
49
53
|
_TASK.fields_by_name['task_id']._options = None
|
|
50
54
|
_TASK.fields_by_name['task_id']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
51
55
|
_TASK.fields_by_name['metadata']._options = None
|
|
52
56
|
_TASK.fields_by_name['metadata']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
53
57
|
_TASKSPEC.fields_by_name['task_template']._options = None
|
|
54
58
|
_TASKSPEC.fields_by_name['task_template']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
59
|
+
_TASKSPEC.fields_by_name['short_name']._options = None
|
|
60
|
+
_TASKSPEC.fields_by_name['short_name']._serialized_options = b'\372B\004r\002\030?'
|
|
55
61
|
_TASKDETAILS.fields_by_name['task_id']._options = None
|
|
56
62
|
_TASKDETAILS.fields_by_name['task_id']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
57
63
|
_TASKDETAILS.fields_by_name['metadata']._options = None
|
|
58
64
|
_TASKDETAILS.fields_by_name['metadata']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
59
65
|
_TASKDETAILS.fields_by_name['spec']._options = None
|
|
60
66
|
_TASKDETAILS.fields_by_name['spec']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
61
|
-
_globals['_TASKNAME']._serialized_start=
|
|
62
|
-
_globals['_TASKNAME']._serialized_end=
|
|
63
|
-
_globals['_TASKIDENTIFIER']._serialized_start=
|
|
64
|
-
_globals['_TASKIDENTIFIER']._serialized_end=
|
|
65
|
-
_globals['_TASKMETADATA']._serialized_start=
|
|
66
|
-
_globals['_TASKMETADATA']._serialized_end=
|
|
67
|
-
_globals['_TASK']._serialized_start=
|
|
68
|
-
_globals['_TASK']._serialized_end=
|
|
69
|
-
_globals['_TASKSPEC']._serialized_start=
|
|
70
|
-
_globals['_TASKSPEC']._serialized_end=
|
|
71
|
-
_globals['_TASKDETAILS']._serialized_start=
|
|
72
|
-
_globals['_TASKDETAILS']._serialized_end=
|
|
67
|
+
_globals['_TASKNAME']._serialized_start=238
|
|
68
|
+
_globals['_TASKNAME']._serialized_end=381
|
|
69
|
+
_globals['_TASKIDENTIFIER']._serialized_start=384
|
|
70
|
+
_globals['_TASKIDENTIFIER']._serialized_end=570
|
|
71
|
+
_globals['_TASKMETADATA']._serialized_start=573
|
|
72
|
+
_globals['_TASKMETADATA']._serialized_end=810
|
|
73
|
+
_globals['_TASK']._serialized_start=813
|
|
74
|
+
_globals['_TASK']._serialized_end=960
|
|
75
|
+
_globals['_TASKSPEC']._serialized_start=963
|
|
76
|
+
_globals['_TASKSPEC']._serialized_end=1229
|
|
77
|
+
_globals['_TASKDETAILS']._serialized_start=1232
|
|
78
|
+
_globals['_TASKDETAILS']._serialized_end=1445
|
|
73
79
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
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
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
4
5
|
from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
|
|
5
6
|
from flyte._protos.workflow import common_pb2 as _common_pb2
|
|
7
|
+
from flyte._protos.workflow import environment_pb2 as _environment_pb2
|
|
6
8
|
from google.protobuf.internal import containers as _containers
|
|
7
9
|
from google.protobuf import descriptor as _descriptor
|
|
8
10
|
from google.protobuf import message as _message
|
|
@@ -37,10 +39,16 @@ class TaskIdentifier(_message.Message):
|
|
|
37
39
|
def __init__(self, org: _Optional[str] = ..., project: _Optional[str] = ..., domain: _Optional[str] = ..., name: _Optional[str] = ..., version: _Optional[str] = ...) -> None: ...
|
|
38
40
|
|
|
39
41
|
class TaskMetadata(_message.Message):
|
|
40
|
-
__slots__ = ["deployed_by"]
|
|
42
|
+
__slots__ = ["deployed_by", "short_name", "deployed_at", "environment_name"]
|
|
41
43
|
DEPLOYED_BY_FIELD_NUMBER: _ClassVar[int]
|
|
44
|
+
SHORT_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
45
|
+
DEPLOYED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
46
|
+
ENVIRONMENT_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
42
47
|
deployed_by: _identity_pb2.EnrichedIdentity
|
|
43
|
-
|
|
48
|
+
short_name: str
|
|
49
|
+
deployed_at: _timestamp_pb2.Timestamp
|
|
50
|
+
environment_name: str
|
|
51
|
+
def __init__(self, deployed_by: _Optional[_Union[_identity_pb2.EnrichedIdentity, _Mapping]] = ..., short_name: _Optional[str] = ..., deployed_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., environment_name: _Optional[str] = ...) -> None: ...
|
|
44
52
|
|
|
45
53
|
class Task(_message.Message):
|
|
46
54
|
__slots__ = ["task_id", "metadata"]
|
|
@@ -51,12 +59,16 @@ class Task(_message.Message):
|
|
|
51
59
|
def __init__(self, task_id: _Optional[_Union[TaskIdentifier, _Mapping]] = ..., metadata: _Optional[_Union[TaskMetadata, _Mapping]] = ...) -> None: ...
|
|
52
60
|
|
|
53
61
|
class TaskSpec(_message.Message):
|
|
54
|
-
__slots__ = ["task_template", "default_inputs"]
|
|
62
|
+
__slots__ = ["task_template", "default_inputs", "short_name", "environment"]
|
|
55
63
|
TASK_TEMPLATE_FIELD_NUMBER: _ClassVar[int]
|
|
56
64
|
DEFAULT_INPUTS_FIELD_NUMBER: _ClassVar[int]
|
|
65
|
+
SHORT_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
+
ENVIRONMENT_FIELD_NUMBER: _ClassVar[int]
|
|
57
67
|
task_template: _tasks_pb2.TaskTemplate
|
|
58
68
|
default_inputs: _containers.RepeatedCompositeFieldContainer[_common_pb2.NamedParameter]
|
|
59
|
-
|
|
69
|
+
short_name: str
|
|
70
|
+
environment: _environment_pb2.Environment
|
|
71
|
+
def __init__(self, task_template: _Optional[_Union[_tasks_pb2.TaskTemplate, _Mapping]] = ..., default_inputs: _Optional[_Iterable[_Union[_common_pb2.NamedParameter, _Mapping]]] = ..., short_name: _Optional[str] = ..., environment: _Optional[_Union[_environment_pb2.Environment, _Mapping]] = ...) -> None: ...
|
|
60
72
|
|
|
61
73
|
class TaskDetails(_message.Message):
|
|
62
74
|
__slots__ = ["task_id", "metadata", "spec"]
|
|
@@ -11,11 +11,13 @@ from google.protobuf.internal import builder as _builder
|
|
|
11
11
|
_sym_db = _symbol_database.Default()
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
from flyte._protos.common import identifier_pb2 as common_dot_identifier__pb2
|
|
15
|
+
from flyte._protos.common import list_pb2 as common_dot_list__pb2
|
|
14
16
|
from flyte._protos.validate.validate import validate_pb2 as validate_dot_validate__pb2
|
|
15
17
|
from flyte._protos.workflow import task_definition_pb2 as workflow_dot_task__definition__pb2
|
|
16
18
|
|
|
17
19
|
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bworkflow/task_service.proto\x12\x11\x63loudidl.workflow\x1a\x17validate/validate.proto\x1a\x1eworkflow/task_definition.proto\"\x94\x01\n\x11\x44\x65ployTaskRequest\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\x12\x39\n\x04spec\x18\x02 \x01(\x0b\x32\x1b.cloudidl.workflow.TaskSpecB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x04spec\"\x14\n\x12\x44\x65ployTaskResponse\"]\n\x15GetTaskDetailsRequest\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\"R\n\x16GetTaskDetailsResponse\x12\x38\n\x07\x64\x65tails\x18\x01 \x01(\x0b\x32\x1e.cloudidl.workflow.TaskDetailsR\x07\x64\
|
|
20
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bworkflow/task_service.proto\x12\x11\x63loudidl.workflow\x1a\x17\x63ommon/identifier.proto\x1a\x11\x63ommon/list.proto\x1a\x17validate/validate.proto\x1a\x1eworkflow/task_definition.proto\"\x94\x01\n\x11\x44\x65ployTaskRequest\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\x12\x39\n\x04spec\x18\x02 \x01(\x0b\x32\x1b.cloudidl.workflow.TaskSpecB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x04spec\"\x14\n\x12\x44\x65ployTaskResponse\"]\n\x15GetTaskDetailsRequest\x12\x44\n\x07task_id\x18\x01 \x01(\x0b\x32!.cloudidl.workflow.TaskIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06taskId\"R\n\x16GetTaskDetailsResponse\x12\x38\n\x07\x64\x65tails\x18\x01 \x01(\x0b\x32\x1e.cloudidl.workflow.TaskDetailsR\x07\x64\x65tails\"\xdc\x02\n\x10ListTasksRequest\x12\x36\n\x07request\x18\x01 \x01(\x0b\x32\x1c.cloudidl.common.ListRequestR\x07request\x12\x1b\n\x03org\x18\x02 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01H\x00R\x03org\x12M\n\nproject_id\x18\x03 \x01(\x0b\x32\".cloudidl.common.ProjectIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01H\x00R\tprojectId\x12T\n\rknown_filters\x18\x04 \x03(\x0b\x32/.cloudidl.workflow.ListTasksRequest.KnownFilterR\x0cknownFilters\x1a=\n\x0bKnownFilter\x12!\n\x0b\x64\x65ployed_by\x18\x01 \x01(\tH\x00R\ndeployedByB\x0b\n\tfilter_byB\x0f\n\x08scope_by\x12\x03\xf8\x42\x01\"X\n\x11ListTasksResponse\x12-\n\x05tasks\x18\x01 \x03(\x0b\x32\x17.cloudidl.workflow.TaskR\x05tasks\x12\x14\n\x05token\x18\x02 \x01(\tR\x05token2\xb3\x02\n\x0bTaskService\x12[\n\nDeployTask\x12$.cloudidl.workflow.DeployTaskRequest\x1a%.cloudidl.workflow.DeployTaskResponse\"\x00\x12j\n\x0eGetTaskDetails\x12(.cloudidl.workflow.GetTaskDetailsRequest\x1a).cloudidl.workflow.GetTaskDetailsResponse\"\x03\x90\x02\x01\x12[\n\tListTasks\x12#.cloudidl.workflow.ListTasksRequest\x1a$.cloudidl.workflow.ListTasksResponse\"\x03\x90\x02\x01\x42\xbd\x01\n\x15\x63om.cloudidl.workflowB\x10TaskServiceProtoH\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')
|
|
19
21
|
|
|
20
22
|
_globals = globals()
|
|
21
23
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -29,16 +31,30 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
29
31
|
_DEPLOYTASKREQUEST.fields_by_name['spec']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
30
32
|
_GETTASKDETAILSREQUEST.fields_by_name['task_id']._options = None
|
|
31
33
|
_GETTASKDETAILSREQUEST.fields_by_name['task_id']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
34
|
+
_LISTTASKSREQUEST.oneofs_by_name['scope_by']._options = None
|
|
35
|
+
_LISTTASKSREQUEST.oneofs_by_name['scope_by']._serialized_options = b'\370B\001'
|
|
36
|
+
_LISTTASKSREQUEST.fields_by_name['org']._options = None
|
|
37
|
+
_LISTTASKSREQUEST.fields_by_name['org']._serialized_options = b'\372B\004r\002\020\001'
|
|
38
|
+
_LISTTASKSREQUEST.fields_by_name['project_id']._options = None
|
|
39
|
+
_LISTTASKSREQUEST.fields_by_name['project_id']._serialized_options = b'\372B\005\212\001\002\020\001'
|
|
32
40
|
_TASKSERVICE.methods_by_name['GetTaskDetails']._options = None
|
|
33
41
|
_TASKSERVICE.methods_by_name['GetTaskDetails']._serialized_options = b'\220\002\001'
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_globals['
|
|
37
|
-
_globals['
|
|
38
|
-
_globals['
|
|
39
|
-
_globals['
|
|
40
|
-
_globals['
|
|
41
|
-
_globals['
|
|
42
|
-
_globals['
|
|
43
|
-
_globals['
|
|
42
|
+
_TASKSERVICE.methods_by_name['ListTasks']._options = None
|
|
43
|
+
_TASKSERVICE.methods_by_name['ListTasks']._serialized_options = b'\220\002\001'
|
|
44
|
+
_globals['_DEPLOYTASKREQUEST']._serialized_start=152
|
|
45
|
+
_globals['_DEPLOYTASKREQUEST']._serialized_end=300
|
|
46
|
+
_globals['_DEPLOYTASKRESPONSE']._serialized_start=302
|
|
47
|
+
_globals['_DEPLOYTASKRESPONSE']._serialized_end=322
|
|
48
|
+
_globals['_GETTASKDETAILSREQUEST']._serialized_start=324
|
|
49
|
+
_globals['_GETTASKDETAILSREQUEST']._serialized_end=417
|
|
50
|
+
_globals['_GETTASKDETAILSRESPONSE']._serialized_start=419
|
|
51
|
+
_globals['_GETTASKDETAILSRESPONSE']._serialized_end=501
|
|
52
|
+
_globals['_LISTTASKSREQUEST']._serialized_start=504
|
|
53
|
+
_globals['_LISTTASKSREQUEST']._serialized_end=852
|
|
54
|
+
_globals['_LISTTASKSREQUEST_KNOWNFILTER']._serialized_start=774
|
|
55
|
+
_globals['_LISTTASKSREQUEST_KNOWNFILTER']._serialized_end=835
|
|
56
|
+
_globals['_LISTTASKSRESPONSE']._serialized_start=854
|
|
57
|
+
_globals['_LISTTASKSRESPONSE']._serialized_end=942
|
|
58
|
+
_globals['_TASKSERVICE']._serialized_start=945
|
|
59
|
+
_globals['_TASKSERVICE']._serialized_end=1252
|
|
44
60
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
from flyte._protos.common import identifier_pb2 as _identifier_pb2
|
|
2
|
+
from flyte._protos.common import list_pb2 as _list_pb2
|
|
1
3
|
from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
|
|
2
4
|
from flyte._protos.workflow import task_definition_pb2 as _task_definition_pb2
|
|
5
|
+
from google.protobuf.internal import containers as _containers
|
|
3
6
|
from google.protobuf import descriptor as _descriptor
|
|
4
7
|
from google.protobuf import message as _message
|
|
5
|
-
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
8
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
6
9
|
|
|
7
10
|
DESCRIPTOR: _descriptor.FileDescriptor
|
|
8
11
|
|
|
@@ -29,3 +32,28 @@ class GetTaskDetailsResponse(_message.Message):
|
|
|
29
32
|
DETAILS_FIELD_NUMBER: _ClassVar[int]
|
|
30
33
|
details: _task_definition_pb2.TaskDetails
|
|
31
34
|
def __init__(self, details: _Optional[_Union[_task_definition_pb2.TaskDetails, _Mapping]] = ...) -> None: ...
|
|
35
|
+
|
|
36
|
+
class ListTasksRequest(_message.Message):
|
|
37
|
+
__slots__ = ["request", "org", "project_id", "known_filters"]
|
|
38
|
+
class KnownFilter(_message.Message):
|
|
39
|
+
__slots__ = ["deployed_by"]
|
|
40
|
+
DEPLOYED_BY_FIELD_NUMBER: _ClassVar[int]
|
|
41
|
+
deployed_by: str
|
|
42
|
+
def __init__(self, deployed_by: _Optional[str] = ...) -> None: ...
|
|
43
|
+
REQUEST_FIELD_NUMBER: _ClassVar[int]
|
|
44
|
+
ORG_FIELD_NUMBER: _ClassVar[int]
|
|
45
|
+
PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
46
|
+
KNOWN_FILTERS_FIELD_NUMBER: _ClassVar[int]
|
|
47
|
+
request: _list_pb2.ListRequest
|
|
48
|
+
org: str
|
|
49
|
+
project_id: _identifier_pb2.ProjectIdentifier
|
|
50
|
+
known_filters: _containers.RepeatedCompositeFieldContainer[ListTasksRequest.KnownFilter]
|
|
51
|
+
def __init__(self, request: _Optional[_Union[_list_pb2.ListRequest, _Mapping]] = ..., org: _Optional[str] = ..., project_id: _Optional[_Union[_identifier_pb2.ProjectIdentifier, _Mapping]] = ..., known_filters: _Optional[_Iterable[_Union[ListTasksRequest.KnownFilter, _Mapping]]] = ...) -> None: ...
|
|
52
|
+
|
|
53
|
+
class ListTasksResponse(_message.Message):
|
|
54
|
+
__slots__ = ["tasks", "token"]
|
|
55
|
+
TASKS_FIELD_NUMBER: _ClassVar[int]
|
|
56
|
+
TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
tasks: _containers.RepeatedCompositeFieldContainer[_task_definition_pb2.Task]
|
|
58
|
+
token: str
|
|
59
|
+
def __init__(self, tasks: _Optional[_Iterable[_Union[_task_definition_pb2.Task, _Mapping]]] = ..., token: _Optional[str] = ...) -> None: ...
|
|
@@ -25,6 +25,11 @@ class TaskServiceStub(object):
|
|
|
25
25
|
request_serializer=workflow_dot_task__service__pb2.GetTaskDetailsRequest.SerializeToString,
|
|
26
26
|
response_deserializer=workflow_dot_task__service__pb2.GetTaskDetailsResponse.FromString,
|
|
27
27
|
)
|
|
28
|
+
self.ListTasks = channel.unary_unary(
|
|
29
|
+
'/cloudidl.workflow.TaskService/ListTasks',
|
|
30
|
+
request_serializer=workflow_dot_task__service__pb2.ListTasksRequest.SerializeToString,
|
|
31
|
+
response_deserializer=workflow_dot_task__service__pb2.ListTasksResponse.FromString,
|
|
32
|
+
)
|
|
28
33
|
|
|
29
34
|
|
|
30
35
|
class TaskServiceServicer(object):
|
|
@@ -45,6 +50,13 @@ class TaskServiceServicer(object):
|
|
|
45
50
|
context.set_details('Method not implemented!')
|
|
46
51
|
raise NotImplementedError('Method not implemented!')
|
|
47
52
|
|
|
53
|
+
def ListTasks(self, request, context):
|
|
54
|
+
"""Lists tasks, one per task name, returning the latest version and who it was deployed by.
|
|
55
|
+
"""
|
|
56
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
57
|
+
context.set_details('Method not implemented!')
|
|
58
|
+
raise NotImplementedError('Method not implemented!')
|
|
59
|
+
|
|
48
60
|
|
|
49
61
|
def add_TaskServiceServicer_to_server(servicer, server):
|
|
50
62
|
rpc_method_handlers = {
|
|
@@ -58,6 +70,11 @@ def add_TaskServiceServicer_to_server(servicer, server):
|
|
|
58
70
|
request_deserializer=workflow_dot_task__service__pb2.GetTaskDetailsRequest.FromString,
|
|
59
71
|
response_serializer=workflow_dot_task__service__pb2.GetTaskDetailsResponse.SerializeToString,
|
|
60
72
|
),
|
|
73
|
+
'ListTasks': grpc.unary_unary_rpc_method_handler(
|
|
74
|
+
servicer.ListTasks,
|
|
75
|
+
request_deserializer=workflow_dot_task__service__pb2.ListTasksRequest.FromString,
|
|
76
|
+
response_serializer=workflow_dot_task__service__pb2.ListTasksResponse.SerializeToString,
|
|
77
|
+
),
|
|
61
78
|
}
|
|
62
79
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
63
80
|
'cloudidl.workflow.TaskService', rpc_method_handlers)
|
|
@@ -102,3 +119,20 @@ class TaskService(object):
|
|
|
102
119
|
workflow_dot_task__service__pb2.GetTaskDetailsResponse.FromString,
|
|
103
120
|
options, channel_credentials,
|
|
104
121
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
122
|
+
|
|
123
|
+
@staticmethod
|
|
124
|
+
def ListTasks(request,
|
|
125
|
+
target,
|
|
126
|
+
options=(),
|
|
127
|
+
channel_credentials=None,
|
|
128
|
+
call_credentials=None,
|
|
129
|
+
insecure=False,
|
|
130
|
+
compression=None,
|
|
131
|
+
wait_for_ready=None,
|
|
132
|
+
timeout=None,
|
|
133
|
+
metadata=None):
|
|
134
|
+
return grpc.experimental.unary_unary(request, target, '/cloudidl.workflow.TaskService/ListTasks',
|
|
135
|
+
workflow_dot_task__service__pb2.ListTasksRequest.SerializeToString,
|
|
136
|
+
workflow_dot_task__service__pb2.ListTasksResponse.FromString,
|
|
137
|
+
options, channel_credentials,
|
|
138
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
flyte/_run.py
CHANGED
|
@@ -63,6 +63,7 @@ class _Runner:
|
|
|
63
63
|
raw_data_path: str | None = None,
|
|
64
64
|
metadata_path: str | None = None,
|
|
65
65
|
run_base_dir: str | None = None,
|
|
66
|
+
overwrite_cache: bool = False,
|
|
66
67
|
):
|
|
67
68
|
init_config = _get_init_config()
|
|
68
69
|
client = init_config.client if init_config else None
|
|
@@ -81,6 +82,7 @@ class _Runner:
|
|
|
81
82
|
self._raw_data_path = raw_data_path
|
|
82
83
|
self._metadata_path = metadata_path or "/tmp"
|
|
83
84
|
self._run_base_dir = run_base_dir or "/tmp/base"
|
|
85
|
+
self._overwrite_cache = overwrite_cache
|
|
84
86
|
|
|
85
87
|
@requires_initialization
|
|
86
88
|
async def _run_remote(self, obj: TaskTemplate[P, R] | LazyEntity, *args: P.args, **kwargs: P.kwargs) -> Run:
|
|
@@ -182,6 +184,9 @@ class _Runner:
|
|
|
182
184
|
project_id=project_id,
|
|
183
185
|
task_spec=task_spec,
|
|
184
186
|
inputs=inputs.proto_inputs,
|
|
187
|
+
run_spec=run_definition_pb2.RunSpec(
|
|
188
|
+
overwrite_cache=self._overwrite_cache,
|
|
189
|
+
),
|
|
185
190
|
),
|
|
186
191
|
)
|
|
187
192
|
return Run(pb2=resp.run)
|
|
@@ -414,6 +419,7 @@ def with_runcontext(
|
|
|
414
419
|
interactive_mode: bool | None = None,
|
|
415
420
|
raw_data_path: str | None = None,
|
|
416
421
|
run_base_dir: str | None = None,
|
|
422
|
+
overwrite_cache: bool = False,
|
|
417
423
|
) -> _Runner:
|
|
418
424
|
"""
|
|
419
425
|
Launch a new run with the given parameters as the context.
|
flyte/_trace.py
CHANGED
|
@@ -112,10 +112,8 @@ def trace(func: Callable[..., T]) -> Callable[..., T]:
|
|
|
112
112
|
# Choose the appropriate wrapper based on the function type
|
|
113
113
|
if inspect.iscoroutinefunction(func):
|
|
114
114
|
# This handles async functions that return normal values
|
|
115
|
-
print(f"Coroutine function {func.__name__}")
|
|
116
115
|
return cast(Callable[..., T], wrapper_async)
|
|
117
116
|
elif inspect.isasyncgenfunction(func):
|
|
118
|
-
print(f"Async generator function {func.__name__}")
|
|
119
117
|
return cast(Callable[..., T], wrapper_async_iterator)
|
|
120
118
|
else:
|
|
121
119
|
# For regular sync functions
|
flyte/_utils/__init__.py
CHANGED
|
@@ -9,14 +9,18 @@ from .coro_management import run_coros
|
|
|
9
9
|
from .file_handling import filehash_update, update_hasher_for_source
|
|
10
10
|
from .helpers import get_cwd_editable_install
|
|
11
11
|
from .lazy_module import lazy_module
|
|
12
|
+
from .org_discovery import hostname_from_url, org_from_endpoint, sanitize_endpoint
|
|
12
13
|
from .uv_script_parser import parse_uv_script_file
|
|
13
14
|
|
|
14
15
|
__all__ = [
|
|
15
16
|
"AsyncLRUCache",
|
|
16
17
|
"filehash_update",
|
|
17
18
|
"get_cwd_editable_install",
|
|
19
|
+
"hostname_from_url",
|
|
18
20
|
"lazy_module",
|
|
21
|
+
"org_from_endpoint",
|
|
19
22
|
"parse_uv_script_file",
|
|
20
23
|
"run_coros",
|
|
24
|
+
"sanitize_endpoint",
|
|
21
25
|
"update_hasher_for_source",
|
|
22
26
|
]
|
flyte/_utils/org_discovery.py
CHANGED
|
@@ -29,3 +29,29 @@ def org_from_endpoint(endpoint: str | None) -> str | None:
|
|
|
29
29
|
# Assuming the organization is the first part of the domain
|
|
30
30
|
return domain_parts[0]
|
|
31
31
|
return None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def sanitize_endpoint(endpoint: str | None) -> str | None:
|
|
35
|
+
"""
|
|
36
|
+
Sanitize the endpoint URL by ensuring it has a valid scheme.
|
|
37
|
+
:param endpoint: The endpoint URL to sanitize
|
|
38
|
+
:return: Sanitized endpoint URL or None if the input was None
|
|
39
|
+
"""
|
|
40
|
+
if not endpoint:
|
|
41
|
+
return None
|
|
42
|
+
if "://" not in endpoint:
|
|
43
|
+
endpoint = f"dns:///{endpoint}"
|
|
44
|
+
else:
|
|
45
|
+
if endpoint.startswith("https://"):
|
|
46
|
+
# If the endpoint starts with dns:///, we assume it's a gRPC endpoint
|
|
47
|
+
endpoint = f"dns:///{endpoint[8:]}"
|
|
48
|
+
elif endpoint.startswith("http://"):
|
|
49
|
+
# If the endpoint starts with http://, we assume it's a REST endpoint
|
|
50
|
+
endpoint = f"dns:///{endpoint[7:]}"
|
|
51
|
+
elif not endpoint.startswith("dns:///"):
|
|
52
|
+
raise RuntimeError(
|
|
53
|
+
f"Invalid endpoint {endpoint}, expected format is "
|
|
54
|
+
f"dns:///<hostname> or https://<hostname> or http://<hostname>"
|
|
55
|
+
)
|
|
56
|
+
endpoint = endpoint.removesuffix("/")
|
|
57
|
+
return endpoint
|
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.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 2, 0, '
|
|
20
|
+
__version__ = version = '0.2.0b13'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 2, 0, 'b13')
|
flyte/cli/_abort.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import rich_click as click
|
|
2
|
+
from rich.console import Console
|
|
2
3
|
|
|
3
4
|
from flyte.cli import _common as common
|
|
4
5
|
|
|
@@ -22,5 +23,6 @@ def run(cfg: common.CLIConfig, run_name: str, project: str | None = None, domain
|
|
|
22
23
|
cfg.init(project=project, domain=domain)
|
|
23
24
|
r = Run.get(name=run_name)
|
|
24
25
|
if r:
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
console = Console()
|
|
27
|
+
r.abort()
|
|
28
|
+
console.print(f"Run '{run_name}' has been aborted.")
|
flyte/cli/_common.py
CHANGED
|
@@ -310,12 +310,18 @@ def get_table(title: str, vals: Iterable[Any]) -> Table:
|
|
|
310
310
|
border_style=PREFERRED_BORDER_COLOR,
|
|
311
311
|
)
|
|
312
312
|
headers = None
|
|
313
|
+
has_rich_repr = False
|
|
313
314
|
for p in vals:
|
|
315
|
+
if hasattr(p, "__rich_repr__"):
|
|
316
|
+
has_rich_repr = True
|
|
317
|
+
elif not isinstance(p, (list, tuple)):
|
|
318
|
+
raise ValueError("Expected a list or tuple of values, or an object with __rich_repr__ method.")
|
|
319
|
+
o = p.__rich_repr__() if has_rich_repr else p
|
|
314
320
|
if headers is None:
|
|
315
|
-
headers = [k for k, _ in
|
|
321
|
+
headers = [k for k, _ in o]
|
|
316
322
|
for h in headers:
|
|
317
323
|
table.add_column(h.capitalize())
|
|
318
|
-
table.add_row(*[str(v) for _, v in
|
|
324
|
+
table.add_row(*[str(v) for _, v in o])
|
|
319
325
|
return table
|
|
320
326
|
|
|
321
327
|
|
flyte/cli/_create.py
CHANGED
|
@@ -4,7 +4,7 @@ from typing import Any, Dict, get_args
|
|
|
4
4
|
import rich_click as click
|
|
5
5
|
|
|
6
6
|
import flyte.cli._common as common
|
|
7
|
-
from flyte.remote
|
|
7
|
+
from flyte.remote import SecretTypes
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@click.group(name="create")
|
|
@@ -103,6 +103,8 @@ def config(
|
|
|
103
103
|
"""
|
|
104
104
|
import yaml
|
|
105
105
|
|
|
106
|
+
from flyte._utils import org_from_endpoint, sanitize_endpoint
|
|
107
|
+
|
|
106
108
|
output_path = Path(output)
|
|
107
109
|
|
|
108
110
|
if output_path.exists() and not force:
|
|
@@ -113,13 +115,12 @@ def config(
|
|
|
113
115
|
|
|
114
116
|
admin: Dict[str, Any] = {}
|
|
115
117
|
if endpoint:
|
|
118
|
+
endpoint = sanitize_endpoint(endpoint)
|
|
116
119
|
admin["endpoint"] = endpoint
|
|
117
120
|
if insecure:
|
|
118
121
|
admin["insecure"] = insecure
|
|
119
122
|
|
|
120
123
|
if not org and endpoint:
|
|
121
|
-
from flyte._utils.org_discovery import org_from_endpoint
|
|
122
|
-
|
|
123
124
|
org = org_from_endpoint(endpoint)
|
|
124
125
|
|
|
125
126
|
task: Dict[str, str] = {}
|
flyte/cli/_deploy.py
CHANGED
|
@@ -74,15 +74,22 @@ class DeployEnvCommand(click.Command):
|
|
|
74
74
|
super().__init__(*args, **kwargs)
|
|
75
75
|
|
|
76
76
|
def invoke(self, ctx: Context):
|
|
77
|
-
|
|
77
|
+
from rich.console import Console
|
|
78
|
+
|
|
79
|
+
console = Console()
|
|
80
|
+
console.print(f"Deploying root - environment: {self.obj_name}")
|
|
78
81
|
obj: CLIConfig = ctx.obj
|
|
79
82
|
obj.init(self.deploy_args.project, self.deploy_args.domain)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
with console.status("Deploying...", spinner="dots"):
|
|
84
|
+
deployment = flyte.deploy(
|
|
85
|
+
self.obj,
|
|
86
|
+
dryrun=self.deploy_args.dry_run,
|
|
87
|
+
copy_style=self.deploy_args.copy_style,
|
|
88
|
+
version=self.deploy_args.version,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
console.print(common.get_table("Environments", deployment.env_repr()))
|
|
92
|
+
console.print(common.get_table("Tasks", deployment.task_repr()))
|
|
86
93
|
|
|
87
94
|
|
|
88
95
|
class EnvPerFileGroup(common.ObjectsPerFileGroup):
|
|
@@ -140,6 +147,6 @@ deploy = EnvFiles(
|
|
|
140
147
|
name="deploy",
|
|
141
148
|
help="""
|
|
142
149
|
Deploy one or more environments from a python file.
|
|
143
|
-
|
|
150
|
+
This command will create or update environments in the Flyte system.
|
|
144
151
|
""",
|
|
145
152
|
)
|
flyte/cli/_get.py
CHANGED
|
@@ -20,7 +20,7 @@ def get():
|
|
|
20
20
|
Using a `get` subcommand without any arguments will retrieve a list of available resources to get.
|
|
21
21
|
For example:
|
|
22
22
|
|
|
23
|
-
* `get project` (without
|
|
23
|
+
* `get project` (without specifying a project), will list all projects.
|
|
24
24
|
* `get project my_project` will return the details of the project named `my_project`.
|
|
25
25
|
|
|
26
26
|
In some cases, a partially specified command will act as a filter and return available further parameters.
|
|
@@ -40,7 +40,6 @@ def project(cfg: common.CLIConfig, name: str | None = None):
|
|
|
40
40
|
"""
|
|
41
41
|
from flyte.remote import Project
|
|
42
42
|
|
|
43
|
-
print(cfg)
|
|
44
43
|
cfg.init()
|
|
45
44
|
|
|
46
45
|
console = Console()
|
|
@@ -76,10 +75,12 @@ def run(cfg: common.CLIConfig, name: str | None = None, project: str | None = No
|
|
|
76
75
|
@get.command(cls=common.CommandBase)
|
|
77
76
|
@click.argument("name", type=str, required=False)
|
|
78
77
|
@click.argument("version", type=str, required=False)
|
|
78
|
+
@click.option("--limit", type=int, default=100, help="Limit the number of tasks to show.")
|
|
79
79
|
@click.pass_obj
|
|
80
80
|
def task(
|
|
81
81
|
cfg: common.CLIConfig,
|
|
82
82
|
name: str | None = None,
|
|
83
|
+
limit: int = 100,
|
|
83
84
|
version: str | None = None,
|
|
84
85
|
project: str | None = None,
|
|
85
86
|
domain: str | None = None,
|
|
@@ -95,16 +96,16 @@ def task(
|
|
|
95
96
|
|
|
96
97
|
console = Console()
|
|
97
98
|
if name:
|
|
98
|
-
if
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
if version:
|
|
100
|
+
v = Task.get(name=name, version=version)
|
|
101
|
+
if v is None:
|
|
102
|
+
raise click.BadParameter(f"Task {name} not found.")
|
|
103
|
+
t = v.fetch()
|
|
104
|
+
console.print(pretty_repr(t))
|
|
105
|
+
else:
|
|
106
|
+
console.print(common.get_table("Tasks", Task.listall(by_task_name=name, limit=limit)))
|
|
105
107
|
else:
|
|
106
|
-
|
|
107
|
-
# console.print(common.get_table("Tasks", Task.listall()))
|
|
108
|
+
console.print(common.get_table("Tasks", Task.listall(limit=limit)))
|
|
108
109
|
|
|
109
110
|
|
|
110
111
|
@get.command(cls=common.CommandBase)
|
|
@@ -142,7 +143,7 @@ def action(
|
|
|
142
143
|
"--pretty",
|
|
143
144
|
is_flag=True,
|
|
144
145
|
default=False,
|
|
145
|
-
help="Show logs in
|
|
146
|
+
help="Show logs in an auto-scrolling box, where number of lines is limited to `--lines`",
|
|
146
147
|
)
|
|
147
148
|
@click.option(
|
|
148
149
|
"--attempt", "-a", type=int, default=None, help="Attempt number to show logs for, defaults to the latest attempt."
|
flyte/cli/_run.py
CHANGED
|
@@ -66,7 +66,7 @@ class RunArguments:
|
|
|
66
66
|
["--follow", "-f"],
|
|
67
67
|
is_flag=True,
|
|
68
68
|
default=False,
|
|
69
|
-
help="Wait and watch logs for the parent action. If not provided, the
|
|
69
|
+
help="Wait and watch logs for the parent action. If not provided, the CLI will exit after "
|
|
70
70
|
"successfully launching a remote execution with a link to the UI.",
|
|
71
71
|
)
|
|
72
72
|
},
|
|
@@ -108,7 +108,6 @@ class RunTaskCommand(click.Command):
|
|
|
108
108
|
|
|
109
109
|
r = flyte.with_runcontext(
|
|
110
110
|
copy_style=self.run_args.copy_style,
|
|
111
|
-
version=self.run_args.copy_style,
|
|
112
111
|
mode="local" if self.run_args.local else "remote",
|
|
113
112
|
name=self.run_args.name,
|
|
114
113
|
).run(self.obj, **ctx.params)
|
flyte/cli/main.py
CHANGED
|
@@ -103,7 +103,7 @@ def main(
|
|
|
103
103
|
config_file: str | None,
|
|
104
104
|
):
|
|
105
105
|
"""
|
|
106
|
-
The Flyte CLI is the
|
|
106
|
+
The Flyte CLI is the command line interface for working with the Flyte SDK and backend.
|
|
107
107
|
|
|
108
108
|
It follows a simple verb/noun structure,
|
|
109
109
|
where the top-level commands are verbs that describe the action to be taken,
|
flyte/remote/__init__.py
CHANGED
|
@@ -11,6 +11,7 @@ __all__ = [
|
|
|
11
11
|
"Run",
|
|
12
12
|
"RunDetails",
|
|
13
13
|
"Secret",
|
|
14
|
+
"SecretTypes",
|
|
14
15
|
"Task",
|
|
15
16
|
"create_channel",
|
|
16
17
|
"upload_dir",
|
|
@@ -21,5 +22,5 @@ from ._client.auth import create_channel
|
|
|
21
22
|
from ._data import upload_dir, upload_file
|
|
22
23
|
from ._project import Project
|
|
23
24
|
from ._run import Action, ActionDetails, ActionInputs, ActionOutputs, Run, RunDetails
|
|
24
|
-
from ._secret import Secret
|
|
25
|
+
from ._secret import Secret, SecretTypes
|
|
25
26
|
from ._task import Task
|