flyte 0.2.0b18__py3-none-any.whl → 0.2.0b20__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.

Files changed (34) hide show
  1. flyte/_code_bundle/bundle.py +2 -2
  2. flyte/_deploy.py +2 -3
  3. flyte/_image.py +101 -65
  4. flyte/_initialize.py +9 -1
  5. flyte/_internal/imagebuild/__init__.py +4 -0
  6. flyte/_internal/imagebuild/docker_builder.py +57 -24
  7. flyte/_internal/imagebuild/image_builder.py +69 -42
  8. flyte/_internal/imagebuild/remote_builder.py +259 -0
  9. flyte/_protos/imagebuilder/definition_pb2.py +59 -0
  10. flyte/_protos/imagebuilder/definition_pb2.pyi +140 -0
  11. flyte/_protos/imagebuilder/definition_pb2_grpc.py +4 -0
  12. flyte/_protos/imagebuilder/payload_pb2.py +32 -0
  13. flyte/_protos/imagebuilder/payload_pb2.pyi +21 -0
  14. flyte/_protos/imagebuilder/payload_pb2_grpc.py +4 -0
  15. flyte/_protos/imagebuilder/service_pb2.py +29 -0
  16. flyte/_protos/imagebuilder/service_pb2.pyi +5 -0
  17. flyte/_protos/imagebuilder/service_pb2_grpc.py +66 -0
  18. flyte/_run.py +20 -8
  19. flyte/_task_environment.py +1 -0
  20. flyte/_version.py +2 -2
  21. flyte/cli/__init__.py +9 -0
  22. flyte/cli/_create.py +15 -0
  23. flyte/config/_config.py +30 -2
  24. flyte/config/_internal.py +8 -0
  25. flyte/config/_reader.py +0 -3
  26. flyte/extras/_container.py +2 -2
  27. flyte/remote/_data.py +2 -0
  28. flyte/remote/_run.py +5 -4
  29. flyte/remote/_task.py +35 -7
  30. {flyte-0.2.0b18.dist-info → flyte-0.2.0b20.dist-info}/METADATA +1 -1
  31. {flyte-0.2.0b18.dist-info → flyte-0.2.0b20.dist-info}/RECORD +34 -25
  32. {flyte-0.2.0b18.dist-info → flyte-0.2.0b20.dist-info}/WHEEL +0 -0
  33. {flyte-0.2.0b18.dist-info → flyte-0.2.0b20.dist-info}/entry_points.txt +0 -0
  34. {flyte-0.2.0b18.dist-info → flyte-0.2.0b20.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,140 @@
1
+ from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
2
+ from google.protobuf.internal import containers as _containers
3
+ from google.protobuf import descriptor as _descriptor
4
+ from google.protobuf import message as _message
5
+ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
6
+
7
+ DESCRIPTOR: _descriptor.FileDescriptor
8
+
9
+ class ImageIdentifier(_message.Message):
10
+ __slots__ = ["name"]
11
+ NAME_FIELD_NUMBER: _ClassVar[int]
12
+ name: str
13
+ def __init__(self, name: _Optional[str] = ...) -> None: ...
14
+
15
+ class Image(_message.Message):
16
+ __slots__ = ["id", "fqin"]
17
+ ID_FIELD_NUMBER: _ClassVar[int]
18
+ FQIN_FIELD_NUMBER: _ClassVar[int]
19
+ id: ImageIdentifier
20
+ fqin: str
21
+ def __init__(self, id: _Optional[_Union[ImageIdentifier, _Mapping]] = ..., fqin: _Optional[str] = ...) -> None: ...
22
+
23
+ class AptPackages(_message.Message):
24
+ __slots__ = ["packages"]
25
+ PACKAGES_FIELD_NUMBER: _ClassVar[int]
26
+ packages: _containers.RepeatedScalarFieldContainer[str]
27
+ def __init__(self, packages: _Optional[_Iterable[str]] = ...) -> None: ...
28
+
29
+ class PipOptions(_message.Message):
30
+ __slots__ = ["index_url", "extra_index_urls", "pre", "extra_args"]
31
+ INDEX_URL_FIELD_NUMBER: _ClassVar[int]
32
+ EXTRA_INDEX_URLS_FIELD_NUMBER: _ClassVar[int]
33
+ PRE_FIELD_NUMBER: _ClassVar[int]
34
+ EXTRA_ARGS_FIELD_NUMBER: _ClassVar[int]
35
+ index_url: str
36
+ extra_index_urls: _containers.RepeatedScalarFieldContainer[str]
37
+ pre: bool
38
+ extra_args: str
39
+ def __init__(self, index_url: _Optional[str] = ..., extra_index_urls: _Optional[_Iterable[str]] = ..., pre: bool = ..., extra_args: _Optional[str] = ...) -> None: ...
40
+
41
+ class PipPackages(_message.Message):
42
+ __slots__ = ["packages", "options"]
43
+ PACKAGES_FIELD_NUMBER: _ClassVar[int]
44
+ OPTIONS_FIELD_NUMBER: _ClassVar[int]
45
+ packages: _containers.RepeatedScalarFieldContainer[str]
46
+ options: PipOptions
47
+ def __init__(self, packages: _Optional[_Iterable[str]] = ..., options: _Optional[_Union[PipOptions, _Mapping]] = ...) -> None: ...
48
+
49
+ class Requirements(_message.Message):
50
+ __slots__ = ["file", "options"]
51
+ FILE_FIELD_NUMBER: _ClassVar[int]
52
+ OPTIONS_FIELD_NUMBER: _ClassVar[int]
53
+ file: str
54
+ options: PipOptions
55
+ def __init__(self, file: _Optional[str] = ..., options: _Optional[_Union[PipOptions, _Mapping]] = ...) -> None: ...
56
+
57
+ class PythonWheels(_message.Message):
58
+ __slots__ = ["dir", "options"]
59
+ DIR_FIELD_NUMBER: _ClassVar[int]
60
+ OPTIONS_FIELD_NUMBER: _ClassVar[int]
61
+ dir: str
62
+ options: PipOptions
63
+ def __init__(self, dir: _Optional[str] = ..., options: _Optional[_Union[PipOptions, _Mapping]] = ...) -> None: ...
64
+
65
+ class UVProject(_message.Message):
66
+ __slots__ = ["pyproject", "uvlock", "options"]
67
+ PYPROJECT_FIELD_NUMBER: _ClassVar[int]
68
+ UVLOCK_FIELD_NUMBER: _ClassVar[int]
69
+ OPTIONS_FIELD_NUMBER: _ClassVar[int]
70
+ pyproject: str
71
+ uvlock: str
72
+ options: PipOptions
73
+ def __init__(self, pyproject: _Optional[str] = ..., uvlock: _Optional[str] = ..., options: _Optional[_Union[PipOptions, _Mapping]] = ...) -> None: ...
74
+
75
+ class Commands(_message.Message):
76
+ __slots__ = ["cmd"]
77
+ CMD_FIELD_NUMBER: _ClassVar[int]
78
+ cmd: _containers.RepeatedScalarFieldContainer[str]
79
+ def __init__(self, cmd: _Optional[_Iterable[str]] = ...) -> None: ...
80
+
81
+ class WorkDir(_message.Message):
82
+ __slots__ = ["workdir"]
83
+ WORKDIR_FIELD_NUMBER: _ClassVar[int]
84
+ workdir: str
85
+ def __init__(self, workdir: _Optional[str] = ...) -> None: ...
86
+
87
+ class CopyConfig(_message.Message):
88
+ __slots__ = ["src", "dst"]
89
+ SRC_FIELD_NUMBER: _ClassVar[int]
90
+ DST_FIELD_NUMBER: _ClassVar[int]
91
+ src: str
92
+ dst: str
93
+ def __init__(self, src: _Optional[str] = ..., dst: _Optional[str] = ...) -> None: ...
94
+
95
+ class Env(_message.Message):
96
+ __slots__ = ["env_variables"]
97
+ class EnvVariablesEntry(_message.Message):
98
+ __slots__ = ["key", "value"]
99
+ KEY_FIELD_NUMBER: _ClassVar[int]
100
+ VALUE_FIELD_NUMBER: _ClassVar[int]
101
+ key: str
102
+ value: str
103
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
104
+ ENV_VARIABLES_FIELD_NUMBER: _ClassVar[int]
105
+ env_variables: _containers.ScalarMap[str, str]
106
+ def __init__(self, env_variables: _Optional[_Mapping[str, str]] = ...) -> None: ...
107
+
108
+ class Layer(_message.Message):
109
+ __slots__ = ["apt_packages", "pip_packages", "commands", "requirements", "python_wheels", "workdir", "copy_config", "uv_project", "env"]
110
+ APT_PACKAGES_FIELD_NUMBER: _ClassVar[int]
111
+ PIP_PACKAGES_FIELD_NUMBER: _ClassVar[int]
112
+ COMMANDS_FIELD_NUMBER: _ClassVar[int]
113
+ REQUIREMENTS_FIELD_NUMBER: _ClassVar[int]
114
+ PYTHON_WHEELS_FIELD_NUMBER: _ClassVar[int]
115
+ WORKDIR_FIELD_NUMBER: _ClassVar[int]
116
+ COPY_CONFIG_FIELD_NUMBER: _ClassVar[int]
117
+ UV_PROJECT_FIELD_NUMBER: _ClassVar[int]
118
+ ENV_FIELD_NUMBER: _ClassVar[int]
119
+ apt_packages: AptPackages
120
+ pip_packages: PipPackages
121
+ commands: Commands
122
+ requirements: Requirements
123
+ python_wheels: PythonWheels
124
+ workdir: WorkDir
125
+ copy_config: CopyConfig
126
+ uv_project: UVProject
127
+ env: Env
128
+ def __init__(self, apt_packages: _Optional[_Union[AptPackages, _Mapping]] = ..., pip_packages: _Optional[_Union[PipPackages, _Mapping]] = ..., commands: _Optional[_Union[Commands, _Mapping]] = ..., requirements: _Optional[_Union[Requirements, _Mapping]] = ..., python_wheels: _Optional[_Union[PythonWheels, _Mapping]] = ..., workdir: _Optional[_Union[WorkDir, _Mapping]] = ..., copy_config: _Optional[_Union[CopyConfig, _Mapping]] = ..., uv_project: _Optional[_Union[UVProject, _Mapping]] = ..., env: _Optional[_Union[Env, _Mapping]] = ...) -> None: ...
129
+
130
+ class ImageSpec(_message.Message):
131
+ __slots__ = ["base_image", "python_version", "layers", "platform"]
132
+ BASE_IMAGE_FIELD_NUMBER: _ClassVar[int]
133
+ PYTHON_VERSION_FIELD_NUMBER: _ClassVar[int]
134
+ LAYERS_FIELD_NUMBER: _ClassVar[int]
135
+ PLATFORM_FIELD_NUMBER: _ClassVar[int]
136
+ base_image: str
137
+ python_version: str
138
+ layers: _containers.RepeatedCompositeFieldContainer[Layer]
139
+ platform: _containers.RepeatedScalarFieldContainer[str]
140
+ def __init__(self, base_image: _Optional[str] = ..., python_version: _Optional[str] = ..., layers: _Optional[_Iterable[_Union[Layer, _Mapping]]] = ..., platform: _Optional[_Iterable[str]] = ...) -> 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
+
@@ -0,0 +1,32 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: imagebuilder/payload.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 flyte._protos.imagebuilder import definition_pb2 as imagebuilder_dot_definition__pb2
15
+ from flyte._protos.validate.validate import validate_pb2 as validate_dot_validate__pb2
16
+
17
+
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aimagebuilder/payload.proto\x12\x15\x63loudidl.imagebuilder\x1a\x1dimagebuilder/definition.proto\x1a\x17validate/validate.proto\"w\n\x0fGetImageRequest\x12@\n\x02id\x18\x01 \x01(\x0b\x32&.cloudidl.imagebuilder.ImageIdentifierB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x02id\x12\"\n\x0corganization\x18\x02 \x01(\tR\x0corganization\"F\n\x10GetImageResponse\x12\x32\n\x05image\x18\x01 \x01(\x0b\x32\x1c.cloudidl.imagebuilder.ImageR\x05imageB\xd1\x01\n\x19\x63om.cloudidl.imagebuilderB\x0cPayloadProtoH\x02P\x01Z/github.com/unionai/cloud/gen/pb-go/imagebuilder\xa2\x02\x03\x43IX\xaa\x02\x15\x43loudidl.Imagebuilder\xca\x02\x15\x43loudidl\\Imagebuilder\xe2\x02!Cloudidl\\Imagebuilder\\GPBMetadata\xea\x02\x16\x43loudidl::Imagebuilderb\x06proto3')
19
+
20
+ _globals = globals()
21
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
22
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'imagebuilder.payload_pb2', _globals)
23
+ if _descriptor._USE_C_DESCRIPTORS == False:
24
+ DESCRIPTOR._options = None
25
+ DESCRIPTOR._serialized_options = b'\n\031com.cloudidl.imagebuilderB\014PayloadProtoH\002P\001Z/github.com/unionai/cloud/gen/pb-go/imagebuilder\242\002\003CIX\252\002\025Cloudidl.Imagebuilder\312\002\025Cloudidl\\Imagebuilder\342\002!Cloudidl\\Imagebuilder\\GPBMetadata\352\002\026Cloudidl::Imagebuilder'
26
+ _GETIMAGEREQUEST.fields_by_name['id']._options = None
27
+ _GETIMAGEREQUEST.fields_by_name['id']._serialized_options = b'\372B\005\212\001\002\020\001'
28
+ _globals['_GETIMAGEREQUEST']._serialized_start=109
29
+ _globals['_GETIMAGEREQUEST']._serialized_end=228
30
+ _globals['_GETIMAGERESPONSE']._serialized_start=230
31
+ _globals['_GETIMAGERESPONSE']._serialized_end=300
32
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,21 @@
1
+ from flyte._protos.imagebuilder import definition_pb2 as _definition_pb2
2
+ from flyte._protos.validate.validate import validate_pb2 as _validate_pb2
3
+ from google.protobuf import descriptor as _descriptor
4
+ from google.protobuf import message as _message
5
+ from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
6
+
7
+ DESCRIPTOR: _descriptor.FileDescriptor
8
+
9
+ class GetImageRequest(_message.Message):
10
+ __slots__ = ["id", "organization"]
11
+ ID_FIELD_NUMBER: _ClassVar[int]
12
+ ORGANIZATION_FIELD_NUMBER: _ClassVar[int]
13
+ id: _definition_pb2.ImageIdentifier
14
+ organization: str
15
+ def __init__(self, id: _Optional[_Union[_definition_pb2.ImageIdentifier, _Mapping]] = ..., organization: _Optional[str] = ...) -> None: ...
16
+
17
+ class GetImageResponse(_message.Message):
18
+ __slots__ = ["image"]
19
+ IMAGE_FIELD_NUMBER: _ClassVar[int]
20
+ image: _definition_pb2.Image
21
+ def __init__(self, image: _Optional[_Union[_definition_pb2.Image, _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
+
@@ -0,0 +1,29 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: imagebuilder/service.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 flyte._protos.imagebuilder import payload_pb2 as imagebuilder_dot_payload__pb2
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aimagebuilder/service.proto\x12\x15\x63loudidl.imagebuilder\x1a\x1aimagebuilder/payload.proto2p\n\x0cImageService\x12`\n\x08GetImage\x12&.cloudidl.imagebuilder.GetImageRequest\x1a\'.cloudidl.imagebuilder.GetImageResponse\"\x03\x90\x02\x01\x42\xd1\x01\n\x19\x63om.cloudidl.imagebuilderB\x0cServiceProtoH\x02P\x01Z/github.com/unionai/cloud/gen/pb-go/imagebuilder\xa2\x02\x03\x43IX\xaa\x02\x15\x43loudidl.Imagebuilder\xca\x02\x15\x43loudidl\\Imagebuilder\xe2\x02!Cloudidl\\Imagebuilder\\GPBMetadata\xea\x02\x16\x43loudidl::Imagebuilderb\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'imagebuilder.service_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ DESCRIPTOR._serialized_options = b'\n\031com.cloudidl.imagebuilderB\014ServiceProtoH\002P\001Z/github.com/unionai/cloud/gen/pb-go/imagebuilder\242\002\003CIX\252\002\025Cloudidl.Imagebuilder\312\002\025Cloudidl\\Imagebuilder\342\002!Cloudidl\\Imagebuilder\\GPBMetadata\352\002\026Cloudidl::Imagebuilder'
25
+ _IMAGESERVICE.methods_by_name['GetImage']._options = None
26
+ _IMAGESERVICE.methods_by_name['GetImage']._serialized_options = b'\220\002\001'
27
+ _globals['_IMAGESERVICE']._serialized_start=81
28
+ _globals['_IMAGESERVICE']._serialized_end=193
29
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,5 @@
1
+ from flyte._protos.imagebuilder import payload_pb2 as _payload_pb2
2
+ from google.protobuf import descriptor as _descriptor
3
+ from typing import ClassVar as _ClassVar
4
+
5
+ DESCRIPTOR: _descriptor.FileDescriptor
@@ -0,0 +1,66 @@
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
+
5
+ from flyte._protos.imagebuilder import payload_pb2 as imagebuilder_dot_payload__pb2
6
+
7
+
8
+ class ImageServiceStub(object):
9
+ """Missing associated documentation comment in .proto file."""
10
+
11
+ def __init__(self, channel):
12
+ """Constructor.
13
+
14
+ Args:
15
+ channel: A grpc.Channel.
16
+ """
17
+ self.GetImage = channel.unary_unary(
18
+ '/cloudidl.imagebuilder.ImageService/GetImage',
19
+ request_serializer=imagebuilder_dot_payload__pb2.GetImageRequest.SerializeToString,
20
+ response_deserializer=imagebuilder_dot_payload__pb2.GetImageResponse.FromString,
21
+ )
22
+
23
+
24
+ class ImageServiceServicer(object):
25
+ """Missing associated documentation comment in .proto file."""
26
+
27
+ def GetImage(self, request, context):
28
+ """Missing associated documentation comment in .proto file."""
29
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
30
+ context.set_details('Method not implemented!')
31
+ raise NotImplementedError('Method not implemented!')
32
+
33
+
34
+ def add_ImageServiceServicer_to_server(servicer, server):
35
+ rpc_method_handlers = {
36
+ 'GetImage': grpc.unary_unary_rpc_method_handler(
37
+ servicer.GetImage,
38
+ request_deserializer=imagebuilder_dot_payload__pb2.GetImageRequest.FromString,
39
+ response_serializer=imagebuilder_dot_payload__pb2.GetImageResponse.SerializeToString,
40
+ ),
41
+ }
42
+ generic_handler = grpc.method_handlers_generic_handler(
43
+ 'cloudidl.imagebuilder.ImageService', rpc_method_handlers)
44
+ server.add_generic_rpc_handlers((generic_handler,))
45
+
46
+
47
+ # This class is part of an EXPERIMENTAL API.
48
+ class ImageService(object):
49
+ """Missing associated documentation comment in .proto file."""
50
+
51
+ @staticmethod
52
+ def GetImage(request,
53
+ target,
54
+ options=(),
55
+ channel_credentials=None,
56
+ call_credentials=None,
57
+ insecure=False,
58
+ compression=None,
59
+ wait_for_ready=None,
60
+ timeout=None,
61
+ metadata=None):
62
+ return grpc.experimental.unary_unary(request, target, '/cloudidl.imagebuilder.ImageService/GetImage',
63
+ imagebuilder_dot_payload__pb2.GetImageRequest.SerializeToString,
64
+ imagebuilder_dot_payload__pb2.GetImageResponse.FromString,
65
+ options, channel_credentials,
66
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
flyte/_run.py CHANGED
@@ -43,7 +43,7 @@ async def _get_code_bundle_for_run(name: str) -> CodeBundle | None:
43
43
 
44
44
  run = await Run.get.aio(name=name)
45
45
  if run:
46
- run_details = await run.details()
46
+ run_details = await run.details.aio()
47
47
  spec = run_details.action_details.pb2.resolved_task_spec
48
48
  return extract_code_bundle(spec)
49
49
  return None
@@ -64,6 +64,8 @@ class _Runner:
64
64
  metadata_path: str | None = None,
65
65
  run_base_dir: str | None = None,
66
66
  overwrite_cache: bool = False,
67
+ project: str | None = None,
68
+ domain: str | None = None,
67
69
  env: Dict[str, str] | None = None,
68
70
  labels: Dict[str, str] | None = None,
69
71
  annotations: Dict[str, str] | None = None,
@@ -88,6 +90,8 @@ class _Runner:
88
90
  self._metadata_path = metadata_path or "/tmp"
89
91
  self._run_base_dir = run_base_dir or "/tmp/base"
90
92
  self._overwrite_cache = overwrite_cache
93
+ self._project = project
94
+ self._domain = domain
91
95
  self._env = env
92
96
  self._labels = labels
93
97
  self._annotations = annotations
@@ -111,6 +115,8 @@ class _Runner:
111
115
  from ._protos.workflow import run_definition_pb2, run_service_pb2
112
116
 
113
117
  cfg = get_common_config()
118
+ project = self._project or cfg.project
119
+ domain = self._domain or cfg.domain
114
120
 
115
121
  if isinstance(obj, LazyEntity):
116
122
  task = await obj.fetch.aio()
@@ -172,23 +178,23 @@ class _Runner:
172
178
  project_id = None
173
179
  if self._name:
174
180
  run_id = run_definition_pb2.RunIdentifier(
175
- project=cfg.project,
176
- domain=cfg.domain,
181
+ project=project,
182
+ domain=domain,
177
183
  org=cfg.org,
178
184
  name=self._name if self._name else None,
179
185
  )
180
186
  else:
181
187
  project_id = identifier_pb2.ProjectIdentifier(
182
- name=cfg.project,
183
- domain=cfg.domain,
188
+ name=project,
189
+ domain=domain,
184
190
  organization=cfg.org,
185
191
  )
186
192
  # Fill in task id inside the task template if it's not provided.
187
193
  # Maybe this should be done here, or the backend.
188
194
  if task_spec.task_template.id.project == "":
189
- task_spec.task_template.id.project = cfg.project if cfg.project else ""
195
+ task_spec.task_template.id.project = project if project else ""
190
196
  if task_spec.task_template.id.domain == "":
191
- task_spec.task_template.id.domain = cfg.domain if cfg.domain else ""
197
+ task_spec.task_template.id.domain = domain if domain else ""
192
198
  if task_spec.task_template.id.org == "":
193
199
  task_spec.task_template.id.org = cfg.org if cfg.org else ""
194
200
  if task_spec.task_template.id.version == "":
@@ -450,6 +456,8 @@ def with_runcontext(
450
456
  raw_data_path: str | None = None,
451
457
  run_base_dir: str | None = None,
452
458
  overwrite_cache: bool = False,
459
+ project: str | None = None,
460
+ domain: str | None = None,
453
461
  env: Dict[str, str] | None = None,
454
462
  labels: Dict[str, str] | None = None,
455
463
  annotations: Dict[str, str] | None = None,
@@ -486,7 +494,9 @@ def with_runcontext(
486
494
  and can be used to store raw data in specific locations. TODO coming soon for remote runs as well.
487
495
  :param run_base_dir: Optional The base directory to use for the run. This is used to store the metadata for the run,
488
496
  that is passed between tasks.
489
- :param overwrite_cache: Optional If true, the cache will be overwritten for the run.
497
+ :param overwrite_cache: Optional If true, the cache will be overwritten for the run
498
+ :param project: Optional The project to use for the run
499
+ :param domain: Optional The domain to use for the run
490
500
  :param env: Optional Environment variables to set for the run
491
501
  :param labels: Optional Labels to set for the run
492
502
  :param annotations: Optional Annotations to set for the run
@@ -514,6 +524,8 @@ def with_runcontext(
514
524
  labels=labels,
515
525
  annotations=annotations,
516
526
  interruptible=interruptible,
527
+ project=project,
528
+ domain=domain,
517
529
  log_level=log_level,
518
530
  )
519
531
 
@@ -180,4 +180,5 @@ class TaskEnvironment(Environment):
180
180
  if task.name in self._tasks:
181
181
  raise ValueError(f"Task {task.name} already exists in the environment. Task names should be unique.")
182
182
  self._tasks[task.name] = task
183
+ task.parent_env = weakref.ref(self)
183
184
  return task
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.0b18'
21
- __version_tuple__ = version_tuple = (0, 2, 0, 'b18')
20
+ __version__ = version = '0.2.0b20'
21
+ __version_tuple__ = version_tuple = (0, 2, 0, 'b20')
flyte/cli/__init__.py CHANGED
@@ -1,3 +1,12 @@
1
+ import os
2
+
1
3
  from flyte.cli.main import main
2
4
 
3
5
  __all__ = ["main"]
6
+
7
+
8
+ # Set GRPC_VERBOSITY to NONE if not already set to silence unwanted output
9
+ # This addresses the issue with grpcio >=1.68.0 causing unwanted output
10
+ # https://github.com/flyteorg/flyte/issues/6082
11
+ if "GRPC_VERBOSITY" not in os.environ:
12
+ os.environ["GRPC_VERBOSITY"] = "NONE"
flyte/cli/_create.py CHANGED
@@ -87,6 +87,14 @@ def secret(
87
87
  help="Force overwrite of the configuration file if it already exists.",
88
88
  show_default=True,
89
89
  )
90
+ @click.option(
91
+ "--image-builder",
92
+ "--builder",
93
+ type=click.Choice(["local", "remote"]),
94
+ default="local",
95
+ help="Image builder to use for building images. Defaults to 'local'.",
96
+ show_default=True,
97
+ )
90
98
  def config(
91
99
  output: str,
92
100
  endpoint: str | None = None,
@@ -95,6 +103,7 @@ def config(
95
103
  project: str | None = None,
96
104
  domain: str | None = None,
97
105
  force: bool = False,
106
+ image_builder: str | None = None,
98
107
  ):
99
108
  """
100
109
  Creates a configuration file for Flyte CLI.
@@ -131,6 +140,10 @@ def config(
131
140
  if domain:
132
141
  task["domain"] = domain
133
142
 
143
+ image: Dict[str, str] = {}
144
+ if image_builder:
145
+ image["builder"] = image_builder
146
+
134
147
  if not admin and not task:
135
148
  raise click.BadParameter("At least one of --endpoint or --org must be provided.")
136
149
 
@@ -140,6 +153,8 @@ def config(
140
153
  d["admin"] = admin
141
154
  if task:
142
155
  d["task"] = task
156
+ if image:
157
+ d["image"] = image
143
158
  yaml.dump(d, f)
144
159
 
145
160
  click.echo(f"Config file written to {output_path}")
flyte/config/_config.py CHANGED
@@ -13,7 +13,7 @@ from flyte._logging import logger
13
13
  from flyte.config import _internal
14
14
  from flyte.config._reader import ConfigFile, get_config_file, read_file_if_exists
15
15
 
16
- _all__ = ["ConfigFile", "PlatformConfig", "TaskConfig"]
16
+ _all__ = ["ConfigFile", "PlatformConfig", "TaskConfig", "ImageConfig"]
17
17
 
18
18
  if TYPE_CHECKING:
19
19
  from flyte.remote._client.auth import AuthType
@@ -140,6 +140,28 @@ class TaskConfig(object):
140
140
  return TaskConfig(**kwargs)
141
141
 
142
142
 
143
+ @rich.repr.auto
144
+ @dataclass(init=True, repr=True, eq=True, frozen=True)
145
+ class ImageConfig(object):
146
+ """
147
+ Configuration for Docker image settings.
148
+ """
149
+
150
+ builder: str | None = None
151
+
152
+ @classmethod
153
+ def auto(cls, config_file: typing.Optional[typing.Union[str, ConfigFile]] = None) -> "ImageConfig":
154
+ """
155
+ Reads from a config file, and overrides from Environment variables. Refer to ConfigEntry for details
156
+ :param config_file:
157
+ :return:
158
+ """
159
+ config_file = get_config_file(config_file)
160
+ kwargs: typing.Dict[str, typing.Any] = {}
161
+ kwargs = set_if_exists(kwargs, "builder", _internal.Image.BUILDER.read(config_file))
162
+ return ImageConfig(**kwargs)
163
+
164
+
143
165
  @rich.repr.auto
144
166
  @dataclass(init=True, repr=True, eq=True, frozen=True)
145
167
  class Config(object):
@@ -154,16 +176,19 @@ class Config(object):
154
176
 
155
177
  platform: PlatformConfig = field(default=PlatformConfig())
156
178
  task: TaskConfig = field(default=TaskConfig())
179
+ image: ImageConfig = field(default=ImageConfig())
157
180
  source: pathlib.Path | None = None
158
181
 
159
182
  def with_params(
160
183
  self,
161
184
  platform: PlatformConfig | None = None,
162
185
  task: TaskConfig | None = None,
186
+ image: ImageConfig | None = None,
163
187
  ) -> "Config":
164
188
  return Config(
165
189
  platform=platform or self.platform,
166
190
  task=task or self.task,
191
+ image=image or self.image,
167
192
  )
168
193
 
169
194
  @classmethod
@@ -182,7 +207,10 @@ class Config(object):
182
207
  logger.debug("No config file found, using default values")
183
208
  return Config()
184
209
  return Config(
185
- platform=PlatformConfig.auto(config_file), task=TaskConfig.auto(config_file), source=config_file.path
210
+ platform=PlatformConfig.auto(config_file),
211
+ task=TaskConfig.auto(config_file),
212
+ image=ImageConfig.auto(config_file),
213
+ source=config_file.path,
186
214
  )
187
215
 
188
216
 
flyte/config/_internal.py CHANGED
@@ -62,3 +62,11 @@ class Task(object):
62
62
  ORG = ConfigEntry(YamlConfigEntry("task.org"))
63
63
  PROJECT = ConfigEntry(YamlConfigEntry("task.project"))
64
64
  DOMAIN = ConfigEntry(YamlConfigEntry("task.domain"))
65
+
66
+
67
+ class Image(object):
68
+ """
69
+ Defines the configuration for the image builder.
70
+ """
71
+
72
+ BUILDER = ConfigEntry(YamlConfigEntry("image.builder"))
flyte/config/_reader.py CHANGED
@@ -177,9 +177,6 @@ def get_config_file(c: typing.Union[str, ConfigFile, None]) -> ConfigFile | None
177
177
  """
178
178
  Checks if the given argument is a file or a configFile and returns a loaded configFile else returns None
179
179
  """
180
- if "PYTEST_VERSION" in os.environ:
181
- # Use default local config in the pytest environment
182
- return None
183
180
  if isinstance(c, str):
184
181
  logger.debug(f"Using specified config file at {c}")
185
182
  return ConfigFile(c)
@@ -260,8 +260,8 @@ class ContainerTask(TaskTemplate):
260
260
  }
261
261
 
262
262
  return tasks_pb2.DataLoadingConfig(
263
- input_path=str(self._input_data_dir),
264
- output_path=str(self._output_data_dir),
263
+ input_path=str(self._input_data_dir) if self._input_data_dir else None,
264
+ output_path=str(self._output_data_dir) if self._output_data_dir else None,
265
265
  enabled=True,
266
266
  format=literal_to_protobuf.get(self._metadata_format, "JSON"),
267
267
  )
flyte/remote/_data.py CHANGED
@@ -18,6 +18,7 @@ from google.protobuf import duration_pb2
18
18
  from flyte._initialize import CommonInit, ensure_client, get_client, get_common_config
19
19
  from flyte._logging import make_hyperlink
20
20
  from flyte.errors import InitializationError, RuntimeSystemError
21
+ from flyte.syncify import syncify
21
22
 
22
23
  _UPLOAD_EXPIRES_IN = timedelta(seconds=60)
23
24
 
@@ -113,6 +114,7 @@ async def _upload_single_file(
113
114
  return str_digest, resp.native_url
114
115
 
115
116
 
117
+ @syncify
116
118
  async def upload_file(fp: Path, verify: bool = True) -> Tuple[str, str]:
117
119
  """
118
120
  Uploads a file to a remote location and returns the remote URI.
flyte/remote/_run.py CHANGED
@@ -226,12 +226,13 @@ class Run:
226
226
  ):
227
227
  await self.action.show_logs(attempt, max_lines, show_ts, raw, filter_system=filter_system)
228
228
 
229
+ @syncify
229
230
  async def details(self) -> RunDetails:
230
231
  """
231
232
  Get the details of the run. This is a placeholder for getting the run details.
232
233
  """
233
234
  if self._details is None:
234
- self._details = await RunDetails.get_details(RunDetails, self.pb2.action.id.run)
235
+ self._details = await RunDetails.get_details.aio(self.pb2.action.id.run)
235
236
  return self._details
236
237
 
237
238
  @property
@@ -636,7 +637,7 @@ class Action:
636
637
  # Update progress description with the current phase
637
638
  progress.update(
638
639
  task_id,
639
- description=f"Run: {self.name} in {ad.phase}, Runtime: {ad.runtime} secs "
640
+ description=f"Run: {self.run_name} in {ad.phase}, Runtime: {ad.runtime} secs "
640
641
  f"Attempts[{ad.attempts}]",
641
642
  )
642
643
 
@@ -644,10 +645,10 @@ class Action:
644
645
  if ad.done():
645
646
  progress.stop_task(task_id)
646
647
  if ad.pb2.status.phase == run_definition_pb2.PHASE_SUCCEEDED:
647
- console.print(f"[bold green]Run '{self.name}' completed successfully.[/bold green]")
648
+ console.print(f"[bold green]Run '{self.run_name}' completed successfully.[/bold green]")
648
649
  else:
649
650
  console.print(
650
- f"[bold red]Run '{self.name}' exited unsuccessfully in state {ad.phase} "
651
+ f"[bold red]Run '{self.run_name}' exited unsuccessfully in state {ad.phase}"
651
652
  f"with error: {ad.error_info}[/bold red]"
652
653
  )
653
654
  break