flyte 0.2.0b16__py3-none-any.whl → 0.2.0b18__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/__init__.py CHANGED
@@ -36,6 +36,7 @@ __all__ = [
36
36
  "TimeoutType",
37
37
  "__version__",
38
38
  "build",
39
+ "build_images",
39
40
  "ctx",
40
41
  "deploy",
41
42
  "group",
@@ -52,7 +53,7 @@ import sys
52
53
  from ._build import build
53
54
  from ._cache import Cache, CachePolicy, CacheRequest
54
55
  from ._context import ctx
55
- from ._deploy import deploy
56
+ from ._deploy import build_images, deploy
56
57
  from ._environment import Environment
57
58
  from ._excepthook import custom_excepthook
58
59
  from ._group import group
flyte/_bin/runtime.py CHANGED
@@ -26,6 +26,7 @@ DOMAIN_NAME = "FLYTE_INTERNAL_TASK_DOMAIN"
26
26
  ORG_NAME = "_U_ORG_NAME"
27
27
  ENDPOINT_OVERRIDE = "_U_EP_OVERRIDE"
28
28
  RUN_OUTPUT_BASE_DIR = "_U_RUN_BASE"
29
+ ENABLE_REF_TASKS = "_REF_TASKS" # This is a temporary flag to enable reference tasks in the runtime.
29
30
 
30
31
  # TODO: Remove this after proper auth is implemented
31
32
  _UNION_EAGER_API_KEY_ENV_VAR = "_UNION_EAGER_API_KEY"
@@ -112,15 +113,22 @@ def main(
112
113
  logger.debug(f"Using controller endpoint: {ep} with kwargs: {controller_kwargs}")
113
114
 
114
115
  bundle = CodeBundle(tgz=tgz, pkl=pkl, destination=dest, computed_version=version)
116
+ enable_ref_tasks = os.getenv(ENABLE_REF_TASKS, "false").lower() in ("true", "1", "yes")
115
117
  # We init regular client here so that reference tasks can work
116
118
  # Current reference tasks will not work with remote controller, because we create 2 different
117
119
  # channels on different threads and this is not supported by grpcio or the auth system. It ends up leading
118
120
  # File "src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi", line 147,
119
121
  # in grpc._cython.cygrpc.PollerCompletionQueue._handle_events
120
122
  # BlockingIOError: [Errno 11] Resource temporarily unavailable
121
- init(org=org, project=project, domain=domain, **controller_kwargs)
122
123
  # TODO solution is to use a single channel for both controller and reference tasks, but this requires a refactor
123
- # init()
124
+ if enable_ref_tasks:
125
+ logger.warning(
126
+ "Reference tasks are enabled. This will initialize client and you will see a BlockIOError. "
127
+ "This is harmless, but a nuisance. We are working on a fix."
128
+ )
129
+ init(org=org, project=project, domain=domain, **controller_kwargs)
130
+ else:
131
+ init()
124
132
  # Controller is created with the same kwargs as init, so that it can be used to run tasks
125
133
  controller = create_controller(ct="remote", **controller_kwargs)
126
134
 
flyte/_deploy.py CHANGED
@@ -123,7 +123,7 @@ async def _build_image_bg(env_name: str, image: Image) -> Tuple[str, str]:
123
123
  return env_name, await build.aio(image)
124
124
 
125
125
 
126
- async def build_images(deployment: DeploymentPlan) -> ImageCache:
126
+ async def _build_images(deployment: DeploymentPlan) -> ImageCache:
127
127
  """
128
128
  Build the images for the given deployment plan and update the environment with the built image.
129
129
  """
@@ -155,7 +155,7 @@ async def apply(deployment: DeploymentPlan, copy_style: CopyFiles, dryrun: bool
155
155
  from ._code_bundle import build_code_bundle
156
156
 
157
157
  cfg = get_common_config()
158
- image_cache = await build_images(deployment)
158
+ image_cache = await _build_images(deployment)
159
159
 
160
160
  version = deployment.version
161
161
  code_bundle = None
@@ -241,3 +241,14 @@ async def deploy(
241
241
  raise NotImplementedError("Interactive mode not yet implemented for deployment")
242
242
  deployment = plan_deploy(*envs, version=version)
243
243
  return await apply(deployment, copy_style=copy_style, dryrun=dryrun)
244
+
245
+
246
+ @syncify
247
+ async def build_images(*envs: Environment) -> ImageCache:
248
+ """
249
+ Build the images for the given environments.
250
+ :param envs: Environment or list of environments to build images for.
251
+ :return: ImageCache containing the built images.
252
+ """
253
+ deployment = plan_deploy(*envs)
254
+ return await _build_images(deployment)
@@ -239,3 +239,17 @@ class ImageCache(BaseModel):
239
239
  val = cls.model_validate_json(json_str)
240
240
  val.serialized_form = s
241
241
  return val
242
+
243
+ def repr(self) -> typing.List[typing.List[Tuple[str, str]]]:
244
+ """
245
+ Returns a detailed representation of the deployed environments.
246
+ """
247
+ tuples = []
248
+ for k, v in self.image_lookup.items():
249
+ tuples.append(
250
+ [
251
+ ("Name", k),
252
+ ("image", v),
253
+ ]
254
+ )
255
+ return tuples
flyte/_run.py CHANGED
@@ -3,7 +3,7 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import pathlib
5
5
  import uuid
6
- from typing import TYPE_CHECKING, Any, Literal, Optional, Tuple, Union, cast
6
+ from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Tuple, Union, cast
7
7
 
8
8
  import flyte.errors
9
9
  from flyte.errors import InitializationError
@@ -64,6 +64,11 @@ class _Runner:
64
64
  metadata_path: str | None = None,
65
65
  run_base_dir: str | None = None,
66
66
  overwrite_cache: bool = False,
67
+ env: Dict[str, str] | None = None,
68
+ labels: Dict[str, str] | None = None,
69
+ annotations: Dict[str, str] | None = None,
70
+ interruptible: bool = False,
71
+ log_level: int | None = None,
67
72
  ):
68
73
  init_config = _get_init_config()
69
74
  client = init_config.client if init_config else None
@@ -83,16 +88,23 @@ class _Runner:
83
88
  self._metadata_path = metadata_path or "/tmp"
84
89
  self._run_base_dir = run_base_dir or "/tmp/base"
85
90
  self._overwrite_cache = overwrite_cache
91
+ self._env = env
92
+ self._labels = labels
93
+ self._annotations = annotations
94
+ self._interruptible = interruptible
95
+ self._log_level = log_level
86
96
 
87
97
  @requires_initialization
88
98
  async def _run_remote(self, obj: TaskTemplate[P, R] | LazyEntity, *args: P.args, **kwargs: P.kwargs) -> Run:
89
99
  import grpc
100
+ from flyteidl.core import literals_pb2
101
+ from google.protobuf import wrappers_pb2
90
102
 
91
103
  from flyte.remote import Run
92
104
  from flyte.remote._task import LazyEntity
93
105
 
94
106
  from ._code_bundle import build_code_bundle, build_pkl_bundle
95
- from ._deploy import build_images, plan_deploy
107
+ from ._deploy import build_images
96
108
  from ._internal.runtime.convert import convert_from_native_to_inputs
97
109
  from ._internal.runtime.task_serde import translate_task_to_wire
98
110
  from ._protos.common import identifier_pb2
@@ -110,8 +122,7 @@ class _Runner:
110
122
  if obj.parent_env is None:
111
123
  raise ValueError("Task is not attached to an environment. Please attach the task to an environment")
112
124
 
113
- deploy_plan = plan_deploy(cast(Environment, obj.parent_env()))
114
- image_cache = await build_images(deploy_plan)
125
+ image_cache = await build_images.aio(cast(Environment, obj.parent_env()))
115
126
 
116
127
  if self._interactive_mode:
117
128
  code_bundle = await build_pkl_bundle(
@@ -142,6 +153,12 @@ class _Runner:
142
153
  task_spec = translate_task_to_wire(obj, s_ctx)
143
154
  inputs = await convert_from_native_to_inputs(obj.native_interface, *args, **kwargs)
144
155
 
156
+ env = self._env or {}
157
+ if self._log_level:
158
+ env["LOG_LEVEL"] = str(self._log_level)
159
+ else:
160
+ env["LOG_LEVEL"] = str(logger.getEffectiveLevel())
161
+
145
162
  if not self._dry_run:
146
163
  if get_client() is None:
147
164
  # This can only happen, if the user forces flyte.run(mode="remote") without initializing the client
@@ -177,6 +194,16 @@ class _Runner:
177
194
  if task_spec.task_template.id.version == "":
178
195
  task_spec.task_template.id.version = version
179
196
 
197
+ kv_pairs: List[literals_pb2.KeyValuePair] = []
198
+ for k, v in env.items():
199
+ if not isinstance(v, str):
200
+ raise ValueError(f"Environment variable {k} must be a string, got {type(v)}")
201
+ kv_pairs.append(literals_pb2.KeyValuePair(key=k, value=v))
202
+
203
+ env_kv = run_definition_pb2.Envs(values=kv_pairs)
204
+ annotations = run_definition_pb2.Annotations(values=self._annotations)
205
+ labels = run_definition_pb2.Labels(values=self._labels)
206
+
180
207
  try:
181
208
  resp = await get_client().run_service.CreateRun(
182
209
  run_service_pb2.CreateRunRequest(
@@ -186,6 +213,10 @@ class _Runner:
186
213
  inputs=inputs.proto_inputs,
187
214
  run_spec=run_definition_pb2.RunSpec(
188
215
  overwrite_cache=self._overwrite_cache,
216
+ interruptible=wrappers_pb2.BoolValue(value=self._interruptible),
217
+ annotations=annotations,
218
+ labels=labels,
219
+ envs=env_kv,
189
220
  ),
190
221
  ),
191
222
  )
@@ -237,7 +268,7 @@ class _Runner:
237
268
  """
238
269
  import flyte.report
239
270
  from flyte._code_bundle import build_code_bundle, build_pkl_bundle
240
- from flyte._deploy import build_images, plan_deploy
271
+ from flyte._deploy import build_images
241
272
  from flyte.models import RawDataPath
242
273
  from flyte.storage import ABFS, GCS, S3
243
274
 
@@ -249,8 +280,7 @@ class _Runner:
249
280
  if obj.parent_env is None:
250
281
  raise ValueError("Task is not attached to an environment. Please attach the task to an environment.")
251
282
 
252
- deploy_plan = plan_deploy(cast(Environment, obj.parent_env()))
253
- image_cache = await build_images(deploy_plan)
283
+ image_cache = build_images.aio(cast(Environment, obj.parent_env()))
254
284
 
255
285
  code_bundle = None
256
286
  if self._name is not None:
@@ -420,6 +450,11 @@ def with_runcontext(
420
450
  raw_data_path: str | None = None,
421
451
  run_base_dir: str | None = None,
422
452
  overwrite_cache: bool = False,
453
+ env: Dict[str, str] | None = None,
454
+ labels: Dict[str, str] | None = None,
455
+ annotations: Dict[str, str] | None = None,
456
+ interruptible: bool = False,
457
+ log_level: int | None = None,
423
458
  ) -> _Runner:
424
459
  """
425
460
  Launch a new run with the given parameters as the context.
@@ -451,6 +486,14 @@ def with_runcontext(
451
486
  and can be used to store raw data in specific locations. TODO coming soon for remote runs as well.
452
487
  :param run_base_dir: Optional The base directory to use for the run. This is used to store the metadata for the run,
453
488
  that is passed between tasks.
489
+ :param overwrite_cache: Optional If true, the cache will be overwritten for the run.
490
+ :param env: Optional Environment variables to set for the run
491
+ :param labels: Optional Labels to set for the run
492
+ :param annotations: Optional Annotations to set for the run
493
+ :param interruptible: Optional If true, the run can be interrupted by the user.
494
+ :param log_level: Optional Log level to set for the run. If not provided, it will be set to the default log level
495
+ set using `flyte.init()`
496
+
454
497
  :return: runner
455
498
  """
456
499
  if mode == "hybrid" and not name and not run_base_dir:
@@ -466,6 +509,12 @@ def with_runcontext(
466
509
  interactive_mode=interactive_mode,
467
510
  raw_data_path=raw_data_path,
468
511
  run_base_dir=run_base_dir,
512
+ overwrite_cache=overwrite_cache,
513
+ env=env,
514
+ labels=labels,
515
+ annotations=annotations,
516
+ interruptible=interruptible,
517
+ log_level=log_level,
469
518
  )
470
519
 
471
520
 
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.0b16'
21
- __version_tuple__ = version_tuple = (0, 2, 0, 'b16')
20
+ __version__ = version = '0.2.0b18'
21
+ __version_tuple__ = version_tuple = (0, 2, 0, 'b18')
flyte/cli/_build.py ADDED
@@ -0,0 +1,117 @@
1
+ from dataclasses import dataclass, field, fields
2
+ from pathlib import Path
3
+ from types import ModuleType
4
+ from typing import Any, Dict, List, cast
5
+
6
+ import click
7
+ from click import Context
8
+
9
+ import flyte
10
+
11
+ from . import _common as common
12
+ from ._common import CLIConfig
13
+
14
+
15
+ @dataclass
16
+ class BuildArguments:
17
+ noop: bool = field(
18
+ default=False,
19
+ metadata={
20
+ "click.option": click.Option(
21
+ ["--noop"],
22
+ type=bool,
23
+ help="Dummy parameter, placeholder for future use. Does not affect the build process.",
24
+ )
25
+ },
26
+ )
27
+
28
+ @classmethod
29
+ def from_dict(cls, d: Dict[str, Any]) -> "BuildArguments":
30
+ return cls(**d)
31
+
32
+ @classmethod
33
+ def options(cls) -> List[click.Option]:
34
+ """
35
+ Return the set of base parameters added to every flyte run workflow subcommand.
36
+ """
37
+ return [common.get_option_from_metadata(f.metadata) for f in fields(cls) if f.metadata]
38
+
39
+
40
+ class BuildEnvCommand(click.Command):
41
+ def __init__(self, obj_name: str, obj: Any, build_args: BuildArguments, *args, **kwargs):
42
+ self.obj_name = obj_name
43
+ self.obj = obj
44
+ self.build_args = build_args
45
+ super().__init__(*args, **kwargs)
46
+
47
+ def invoke(self, ctx: Context):
48
+ from rich.console import Console
49
+
50
+ console = Console()
51
+ console.print(f"Building Environment: {self.obj_name}")
52
+ obj: CLIConfig = ctx.obj
53
+ obj.init()
54
+ with console.status("Building...", spinner="dots"):
55
+ image_cache = flyte.build_images(self.obj)
56
+
57
+ console.print(common.get_table("Images", image_cache.repr(), simple=obj.simple))
58
+
59
+
60
+ class EnvPerFileGroup(common.ObjectsPerFileGroup):
61
+ """
62
+ Group that creates a command for each task in the current directory that is not `__init__.py`.
63
+ """
64
+
65
+ def __init__(self, filename: Path, build_args: BuildArguments, *args, **kwargs):
66
+ args = (filename, *args)
67
+ super().__init__(*args, **kwargs)
68
+ self.build_args = build_args
69
+
70
+ def _filter_objects(self, module: ModuleType) -> Dict[str, Any]:
71
+ return {k: v for k, v in module.__dict__.items() if isinstance(v, flyte.Environment)}
72
+
73
+ def _get_command_for_obj(self, ctx: click.Context, obj_name: str, obj: Any) -> click.Command:
74
+ obj = cast(flyte.Environment, obj)
75
+ return BuildEnvCommand(
76
+ name=obj_name,
77
+ obj_name=obj_name,
78
+ obj=obj,
79
+ help=f"{obj.name}" + (f": {obj.description}" if obj.description else ""),
80
+ build_args=self.build_args,
81
+ )
82
+
83
+
84
+ class EnvFiles(common.FileGroup):
85
+ """
86
+ Group that creates a command for each file in the current directory that is not `__init__.py`.
87
+ """
88
+
89
+ common_options_enabled = False
90
+
91
+ def __init__(
92
+ self,
93
+ *args,
94
+ **kwargs,
95
+ ):
96
+ if "params" not in kwargs:
97
+ kwargs["params"] = []
98
+ kwargs["params"].extend(BuildArguments.options())
99
+ super().__init__(*args, **kwargs)
100
+
101
+ def get_command(self, ctx, filename):
102
+ build_args = BuildArguments.from_dict(ctx.params)
103
+ return EnvPerFileGroup(
104
+ filename=Path(filename),
105
+ build_args=build_args,
106
+ name=filename,
107
+ help=f"Run, functions decorated `env.task` or instances of Tasks in {filename}",
108
+ )
109
+
110
+
111
+ build = EnvFiles(
112
+ name="build",
113
+ help="""
114
+ Build the environments defined in a python file or directory. This will build the images associated with the
115
+ environments.
116
+ """,
117
+ )
flyte/cli/_common.py CHANGED
@@ -24,7 +24,6 @@ from flyte.config import Config
24
24
  PREFERRED_BORDER_COLOR = "dim cyan"
25
25
  PREFERRED_ACCENT_COLOR = "bold #FFD700"
26
26
  HEADER_STYLE = f"{PREFERRED_ACCENT_COLOR} on black"
27
- PANELS = False
28
27
 
29
28
  PROJECT_OPTION = click.Option(
30
29
  param_decls=["-p", "--project"],
@@ -78,6 +77,7 @@ class CLIConfig:
78
77
  endpoint: str | None = None
79
78
  insecure: bool = False
80
79
  org: str | None = None
80
+ simple: bool = False
81
81
 
82
82
  def replace(self, **kwargs) -> CLIConfig:
83
83
  """
@@ -296,17 +296,20 @@ class FileGroup(GroupBase):
296
296
  raise NotImplementedError
297
297
 
298
298
 
299
- def get_table(title: str, vals: Iterable[Any]) -> Table:
299
+ def get_table(title: str, vals: Iterable[Any], simple: bool = False) -> Table:
300
300
  """
301
301
  Get a table from a list of values.
302
302
  """
303
- table = Table(
304
- title=title,
305
- box=rich.box.SQUARE_DOUBLE_HEAD,
306
- header_style=HEADER_STYLE,
307
- show_header=True,
308
- border_style=PREFERRED_BORDER_COLOR,
309
- )
303
+ if simple:
304
+ table = Table(title, box=None)
305
+ else:
306
+ table = Table(
307
+ title=title,
308
+ box=rich.box.SQUARE_DOUBLE_HEAD,
309
+ header_style=HEADER_STYLE,
310
+ show_header=True,
311
+ border_style=PREFERRED_BORDER_COLOR,
312
+ )
310
313
  headers = None
311
314
  has_rich_repr = False
312
315
  for p in vals:
@@ -323,11 +326,11 @@ def get_table(title: str, vals: Iterable[Any]) -> Table:
323
326
  return table
324
327
 
325
328
 
326
- def get_panel(title: str, renderable: Any) -> Panel:
329
+ def get_panel(title: str, renderable: Any, simple: bool = False) -> Panel:
327
330
  """
328
331
  Get a panel from a list of values.
329
332
  """
330
- if not PANELS:
333
+ if simple:
331
334
  return renderable
332
335
  return Panel.fit(
333
336
  renderable,
flyte/cli/_deploy.py CHANGED
@@ -32,16 +32,6 @@ class DeployArguments:
32
32
  },
33
33
  )
34
34
  dry_run: bool = field(default=False, metadata={"click.option": common.DRY_RUN_OPTION})
35
- local: bool = field(
36
- default=False,
37
- metadata={
38
- "click.option": click.Option(
39
- ["--local"],
40
- is_flag=True,
41
- help="Run the task locally",
42
- )
43
- },
44
- )
45
35
  copy_style: CopyFiles = field(
46
36
  default="loaded_modules",
47
37
  metadata={
@@ -88,8 +78,8 @@ class DeployEnvCommand(click.Command):
88
78
  version=self.deploy_args.version,
89
79
  )
90
80
 
91
- console.print(common.get_table("Environments", deployment.env_repr()))
92
- console.print(common.get_table("Tasks", deployment.task_repr()))
81
+ console.print(common.get_table("Environments", deployment.env_repr(), simple=obj.simple))
82
+ console.print(common.get_table("Tasks", deployment.task_repr(), simple=obj.simple))
93
83
 
94
84
 
95
85
  class EnvPerFileGroup(common.ObjectsPerFileGroup):
flyte/cli/_get.py CHANGED
@@ -46,7 +46,7 @@ def project(cfg: common.CLIConfig, name: str | None = None):
46
46
  if name:
47
47
  console.print(pretty_repr(Project.get(name)))
48
48
  else:
49
- console.print(common.get_table("Projects", Project.listall()))
49
+ console.print(common.get_table("Projects", Project.listall(), simple=cfg.simple))
50
50
 
51
51
 
52
52
  @get.command(cls=common.CommandBase)
@@ -69,7 +69,7 @@ def run(cfg: common.CLIConfig, name: str | None = None, project: str | None = No
69
69
  details = RunDetails.get(name=name)
70
70
  console.print(pretty_repr(details))
71
71
  else:
72
- console.print(common.get_table("Runs", Run.listall()))
72
+ console.print(common.get_table("Runs", Run.listall(), simple=cfg.simple))
73
73
 
74
74
 
75
75
  @get.command(cls=common.CommandBase)
@@ -103,9 +103,9 @@ def task(
103
103
  t = v.fetch()
104
104
  console.print(pretty_repr(t))
105
105
  else:
106
- console.print(common.get_table("Tasks", Task.listall(by_task_name=name, limit=limit)))
106
+ console.print(common.get_table("Tasks", Task.listall(by_task_name=name, limit=limit), simple=cfg.simple))
107
107
  else:
108
- console.print(common.get_table("Tasks", Task.listall(limit=limit)))
108
+ console.print(common.get_table("Tasks", Task.listall(limit=limit), simple=cfg.simple))
109
109
 
110
110
 
111
111
  @get.command(cls=common.CommandBase)
@@ -131,7 +131,9 @@ def action(
131
131
  console.print(pretty_repr(remote.Action.get(run_name=run_name, name=action_name)))
132
132
  else:
133
133
  # List all actions for the run
134
- console.print(common.get_table(f"Actions for {run_name}", remote.Action.listall(for_run_name=run_name)))
134
+ console.print(
135
+ common.get_table(f"Actions for {run_name}", remote.Action.listall(for_run_name=run_name), simple=cfg.simple)
136
+ )
135
137
 
136
138
 
137
139
  @get.command(cls=common.CommandBase)
@@ -225,7 +227,7 @@ def secret(
225
227
  if name:
226
228
  console.print(pretty_repr(remote.Secret.get(name)))
227
229
  else:
228
- console.print(common.get_table("Secrets", remote.Secret.listall()))
230
+ console.print(common.get_table("Secrets", remote.Secret.listall(), simple=cfg.simple))
229
231
 
230
232
 
231
233
  @get.command(cls=common.CommandBase)
@@ -294,6 +296,7 @@ def io(
294
296
  common.get_panel(
295
297
  "Inputs & Outputs",
296
298
  f"[green bold]Inputs[/green bold]\n{inputs}\n\n[blue bold]Outputs[/blue bold]\n{outputs}",
299
+ simple=cfg.simple,
297
300
  )
298
301
  )
299
302
 
flyte/cli/_run.py CHANGED
@@ -117,6 +117,7 @@ class RunTaskCommand(click.Command):
117
117
  f"[green bold]Created Run: {r.name} [/green bold] "
118
118
  f"(Project: {r.action.action_id.run.project}, Domain: {r.action.action_id.run.domain})\n"
119
119
  f"➡️ [blue bold]{r.url}[/blue bold]",
120
+ simple=obj.simple,
120
121
  )
121
122
  )
122
123
  if self.run_args.follow:
flyte/cli/main.py CHANGED
@@ -3,6 +3,7 @@ import rich_click as click
3
3
  from flyte._logging import initialize_logger, logger
4
4
 
5
5
  from ._abort import abort
6
+ from ._build import build
6
7
  from ._common import CLIConfig
7
8
  from ._create import create
8
9
  from ._delete import delete
@@ -21,8 +22,12 @@ help_config = click.RichHelpConfiguration(
21
22
  "commands": ["run", "abort"],
22
23
  },
23
24
  {
24
- "name": "Management",
25
- "commands": ["create", "deploy", "get", "delete"],
25
+ "name": "Management of various objects.",
26
+ "commands": ["create", "get", "delete"],
27
+ },
28
+ {
29
+ "name": "Build and deploy environments, tasks and images.",
30
+ "commands": ["build", "deploy"],
26
31
  },
27
32
  {
28
33
  "name": "Documentation generation",
@@ -92,6 +97,12 @@ def _verbosity_to_loglevel(verbosity: int) -> int | None:
92
97
  type=click.Path(exists=True),
93
98
  help="Path to the configuration file to use. If not specified, the default configuration file is used.",
94
99
  )
100
+ @click.option(
101
+ "--simple",
102
+ is_flag=True,
103
+ default=False,
104
+ help="Use a simple output format for commands that support it. This is useful for copying, pasting, and scripting.",
105
+ )
95
106
  @click.rich_config(help_config=help_config)
96
107
  @click.pass_context
97
108
  def main(
@@ -101,6 +112,7 @@ def main(
101
112
  verbose: int,
102
113
  org: str | None,
103
114
  config_file: str | None,
115
+ simple: bool = False,
104
116
  ):
105
117
  """
106
118
  The Flyte CLI is the command line interface for working with the Flyte SDK and backend.
@@ -154,6 +166,7 @@ def main(
154
166
  org=org,
155
167
  config=cfg,
156
168
  ctx=ctx,
169
+ simple=simple,
157
170
  )
158
171
 
159
172
 
@@ -164,3 +177,4 @@ main.add_command(create) # type: ignore
164
177
  main.add_command(abort) # type: ignore
165
178
  main.add_command(gen) # type: ignore
166
179
  main.add_command(delete) # type: ignore
180
+ main.add_command(build)
flyte/remote/_run.py CHANGED
@@ -387,6 +387,11 @@ class RunDetails:
387
387
  """
388
388
  Rich representation of the Run object.
389
389
  """
390
+ yield "labels", str(self.pb2.run_spec.labels)
391
+ yield "annotations", str(self.pb2.run_spec.annotations)
392
+ yield "env-vars", str(self.pb2.run_spec.envs)
393
+ yield "is-interruptible", str(self.pb2.run_spec.interruptible)
394
+ yield "cache-overwrite", self.pb2.run_spec.overwrite_cache
390
395
  yield from _action_details_rich_repr(self.pb2.action)
391
396
 
392
397
  def __repr__(self) -> str:
@@ -628,10 +628,8 @@ class DataclassTransformer(TypeTransformer[object]):
628
628
  python_type = hints.get(name, field.type)
629
629
  literal_type[name] = TypeEngine.to_literal_type(python_type)
630
630
  except Exception as e:
631
- logger.warning(
632
- "Field {} of type {} cannot be converted to a literal type. Error: {}".format(
633
- field.name, field.type, e
634
- )
631
+ logger.debug(
632
+ f"Field {field.name} of type {field.type} cannot be converted to a literal type. Error: {e}"
635
633
  )
636
634
 
637
635
  # This is for attribute access in FlytePropeller.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyte
3
- Version: 0.2.0b16
3
+ Version: 0.2.0b18
4
4
  Summary: Add your description here
5
5
  Author-email: Ketan Umare <kumare3@users.noreply.github.com>
6
6
  Requires-Python: >=3.10
@@ -1,7 +1,7 @@
1
- flyte/__init__.py,sha256=2OcML9ib7PwGyFRfQqc_i0l4BKHLabLbwBFvB7p1OeU,1699
1
+ flyte/__init__.py,sha256=VjIdD4AyX7mYNoWDSqZ6tmNKo14ZFwfToKeb49SB60U,1733
2
2
  flyte/_build.py,sha256=MkgfLAPeL56YeVrGRNZUCZgbwzlEzVP3wLbl5Qru4yk,578
3
3
  flyte/_context.py,sha256=K0-TCt-_pHOoE5Xni87_8uIe2vCBOhfNQEtjGT4Hu4k,5239
4
- flyte/_deploy.py,sha256=4RfrjSniBYbHSKRKQpmACGHPYdlaE4voX4jn-BdcOhA,9280
4
+ flyte/_deploy.py,sha256=HcLv3JSVAVogQoV9QICMlwYHr6FZ2XPq1AkqmFhCt38,9622
5
5
  flyte/_doc.py,sha256=_OPCf3t_git6UT7kSJISFaWO9cfNzJhhoe6JjVdyCJo,706
6
6
  flyte/_docstring.py,sha256=SsG0Ab_YMAwy2ABJlEo3eBKlyC3kwPdnDJ1FIms-ZBQ,1127
7
7
  flyte/_environment.py,sha256=dmIFmFLRIklOEYL9gsP2IH3-MYcjHYyyOlqlcf3E6_A,2924
@@ -17,19 +17,19 @@ flyte/_pod.py,sha256=lNaQuWX22QG6Xji7-8GpuKUkqCmVFaRxOVU-eUEa-Vk,637
17
17
  flyte/_resources.py,sha256=UOLyEVhdxolvrHhddiBbYdJuE1RkM_l7xeS9G1abe6M,7583
18
18
  flyte/_retry.py,sha256=rfLv0MvWxzPByKESTglEmjPsytEAKiIvvmzlJxXwsfE,941
19
19
  flyte/_reusable_environment.py,sha256=P4FBATVKAYcIKpdFN98sI8acPyKy8eIGx6V0kUb9YdM,1289
20
- flyte/_run.py,sha256=32pLVE2UhZOYOHfYH2yKPSzVFkRj1OjjCUxgCYMyeXE,20200
20
+ flyte/_run.py,sha256=_9OO1S780FunY9z46bZwJouAtY_Q0WrDoaDaxNcQ0UU,22404
21
21
  flyte/_secret.py,sha256=SqIHs6mi8hEkIIBZe3bI9jJsPt65Mt6dV5uh9_op1ME,2392
22
22
  flyte/_task.py,sha256=-3VLSROj8g3-ZWzV272Ww7mt5yIeA753kmpNyr75I58,18087
23
23
  flyte/_task_environment.py,sha256=1PIuRQ6inH0vMw89iutWKAyPff9qaTEcjk6UR1Gl0cg,6861
24
24
  flyte/_timeout.py,sha256=zx5sFcbYmjJAJbZWSGzzX-BpC9HC7Jfs35T7vVhKwkk,1571
25
25
  flyte/_tools.py,sha256=JewkQZBR_M85tS6QY8e4xXue75jbOE48nID4ZHnc9jY,632
26
26
  flyte/_trace.py,sha256=C788bgoSc3st8kE8Cae2xegnLx2CT6uuRKKfaDrDUys,5122
27
- flyte/_version.py,sha256=Wy9Hpu73hreuXyFmNOW06OVLv-7r2mEwn6uWD298BxQ,521
27
+ flyte/_version.py,sha256=pI4gmGor1yGCrz34JvXWRGjjLvgt5ATHZ6g07v7h1vw,521
28
28
  flyte/errors.py,sha256=skXcdexLisFZFcTnUmMvMmuh4Ty96oJkyLKaipzkyeI,4954
29
29
  flyte/models.py,sha256=my7Vxo-NK6gHGahyqtHr42wYjPGw0nl2SGBBoSb6hIc,14733
30
30
  flyte/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  flyte/_bin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- flyte/_bin/runtime.py,sha256=JXh1wgOhCnIMBE7YJY9biepY3VedrGdIFHDfzmz5gjM,5783
32
+ flyte/_bin/runtime.py,sha256=_ADnpWY4nVvjaujfcx2pBpOskAvnm0WtXBf1uPnZIAQ,6230
33
33
  flyte/_cache/__init__.py,sha256=zhdO5UuHQRdzn8GHmSN40nrxfAmI4ihDRuHZM11U84Y,305
34
34
  flyte/_cache/cache.py,sha256=ErhWzzJdEjTIuEF4f-r6IBgko-3Al9iUs1Eq4O42TUE,5021
35
35
  flyte/_cache/defaults.py,sha256=gzJZW0QJPUfd2OPnGpv3tzIfwPtgFjAKoie3NP1P97U,217
@@ -52,7 +52,7 @@ flyte/_internal/controllers/remote/_informer.py,sha256=StiPcQLLW0h36uEBhKsupMY79
52
52
  flyte/_internal/controllers/remote/_service_protocol.py,sha256=B9qbIg6DiGeac-iSccLmX_AL2xUgX4ezNUOiAbSy4V0,1357
53
53
  flyte/_internal/imagebuild/__init__.py,sha256=cLXVxkAyFpbdC1y-k3Rb6FRW9f_xpoRQWVn__G9IqKs,354
54
54
  flyte/_internal/imagebuild/docker_builder.py,sha256=cvJ_e2hDvLS9SBvdzgNwvSvkQORP6m-_mjMBHZf-m8I,14479
55
- flyte/_internal/imagebuild/image_builder.py,sha256=mzC0Dz_vUCnOB9ZO4zRMoS0qXFGsw6UBC_xOqU8TVkQ,9785
55
+ flyte/_internal/imagebuild/image_builder.py,sha256=fP70cm-yRwQu3zTb2D_LL1gIsoSY-FlHzILgFcgtb1U,10180
56
56
  flyte/_internal/imagebuild/remote_builder.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  flyte/_internal/resolvers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  flyte/_internal/resolvers/_task_module.py,sha256=jwy1QYygUK7xmpCZLt1SPTfJCkfox3Ck3mTlTsm66UI,1973
@@ -143,15 +143,16 @@ flyte/_utils/org_discovery.py,sha256=C7aJa0LfnWBkDtSU9M7bE60zp27qEhJC58piqOErZ94
143
143
  flyte/_utils/uv_script_parser.py,sha256=PxqD8lSMi6xv0uDd1s8LKB2IPZr4ttZJCUweqlyMTKk,1483
144
144
  flyte/cli/__init__.py,sha256=M02O-UGqQlA8JJ_jyWRiwQhTNc5CJJ7x9J7fNxTxBT0,52
145
145
  flyte/cli/_abort.py,sha256=Ty-63Gtd2PUn6lCuL5AaasfBoPu7TDSU5EQKVbkF4qw,661
146
- flyte/cli/_common.py,sha256=QphqiND3LkF3bngngtArZWqdLMe1uiG5K9XRCHwRdhA,10973
146
+ flyte/cli/_build.py,sha256=SBgybTVWOZ22VBHFL8CVFB_oo34lF9wvlwNirYFFyk0,3543
147
+ flyte/cli/_common.py,sha256=CFBmdc0c59XqWb7PuZfLr7Z55HXnlqKaxDCq1sgY9MU,11115
147
148
  flyte/cli/_create.py,sha256=a75II-xT71SpdopNY14rPuidO5qL0mH1UAwf205sVzQ,4313
148
149
  flyte/cli/_delete.py,sha256=VTmXv09PBjkdtyl23mbSjIQQlN7Y1AI_bO0GkHP-f9E,546
149
- flyte/cli/_deploy.py,sha256=_7tMgLavjvncdTdrn1sxN4UlnL16vuC1o-k5VefZTxM,4841
150
+ flyte/cli/_deploy.py,sha256=Zxm7vn1zrqmll73CJTiVGYJI95P-XBI1AlhOlmbmkD0,4635
150
151
  flyte/cli/_gen.py,sha256=vlE5l8UR1zz4RSdaRyUfYFvGR0TLxGcTYcP4dhA3Pvg,5458
151
- flyte/cli/_get.py,sha256=UBh82YQ3WZF7WPZjW3l3RQG97JZYlgHMzpuiVdtJseg,9896
152
+ flyte/cli/_get.py,sha256=fRLXefcF_fgJ7TgmaF06gdscOvLDamNvO0TpveqHDAQ,10063
152
153
  flyte/cli/_params.py,sha256=cDeTvjOQP8EydVJUrncLeAxUaHvGorJyDvMSrAxapmM,19466
153
- flyte/cli/_run.py,sha256=a8Y1XLhti6kaaibcN2AZHjxIauHeXqT9wnXWDKee2ew,7733
154
- flyte/cli/main.py,sha256=a9VsgyGi-s_FoXL-HsSXYSQfLV_ljCJWnTCriOHWXWI,4382
154
+ flyte/cli/_run.py,sha256=fyxGt5ZbW84EcjPVJq5ADK4254kzYHUa2ggp7MRKarI,7776
155
+ flyte/cli/main.py,sha256=7P8nBWvme7beBola5Oo-tHgn9ydWIA-J3w5XH_ORImM,4836
155
156
  flyte/config/__init__.py,sha256=MiwEYK5Iv7MRR22z61nzbsbvZ9Q6MdmAU_g9If1Pmb8,144
156
157
  flyte/config/_config.py,sha256=QE3T0W8xOULjJaqDMdMF90f9gFVjGR6h8QPOLsyqjYw,9831
157
158
  flyte/config/_internal.py,sha256=Bj0uzn3PYgxKbzM-q2GKXxp7Y6cyzhPzUB-Y2i6cQKo,2836
@@ -170,7 +171,7 @@ flyte/remote/_console.py,sha256=avmELJPx8nQMAVPrHlh6jEIRPjrMwFpdZjJsWOOa9rE,660
170
171
  flyte/remote/_data.py,sha256=EO1ZXGYvhfFDOlU9Q0-tSJqLK4shc7q3nvOPPWJxuTc,6078
171
172
  flyte/remote/_logs.py,sha256=EOXg4OS8yYclsT6NASgOLMo0TA2sZpKb2MWZXpWBPuI,6404
172
173
  flyte/remote/_project.py,sha256=dTBYqORDAbLvh9WnPO1Ytuzw2vxNYZwwNsKE2_b0o14,2807
173
- flyte/remote/_run.py,sha256=MQRxd6Ib_Si2aGV83H4P1ZR3QiDpec_gwsAtjjkp8qY,31247
174
+ flyte/remote/_run.py,sha256=kkk2TJ05iQdIkORhqIec-WJwmm2NXlvNm8GG87eHTG0,31557
174
175
  flyte/remote/_secret.py,sha256=l5xeMS83uMcWWeSSTRsSZUNhS0N--1Dze09C-thSOQs,4341
175
176
  flyte/remote/_task.py,sha256=7e5Y0K8vd8TC2J6Nb0nOCUPaUh8IiV3kKfgsCP9CcGw,14227
176
177
  flyte/remote/_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -209,10 +210,10 @@ flyte/types/_interface.py,sha256=5y9EC5r897xz03Hh0ltF8QVGKMfMfAznws-hKSEO4Go,167
209
210
  flyte/types/_pickle.py,sha256=PjdR66OTDMZ3OYq6GvM_Ua0cIo5t2XQaIjmpJ9xo4Ys,4050
210
211
  flyte/types/_renderer.py,sha256=ygcCo5l60lHufyQISFddZfWwLlQ8kJAKxUT_XnR_6dY,4818
211
212
  flyte/types/_string_literals.py,sha256=NlG1xV8RSA-sZ-n-IFQCAsdB6jXJOAKkHWtnopxVVDk,4231
212
- flyte/types/_type_engine.py,sha256=Kk5g1nZubh2A4KWbvGBf5A-aZTvbTtjrY1Bg1_GOPV4,96643
213
+ flyte/types/_type_engine.py,sha256=CCjpqXNX2BMza2cKq42hJXwabWy8GWsimsgiGZJ_00M,96583
213
214
  flyte/types/_utils.py,sha256=pbts9E1_2LTdLygAY0UYTLYJ8AsN3BZyviSXvrtcutc,2626
214
- flyte-0.2.0b16.dist-info/METADATA,sha256=kFsYDsndkkOQAlmDyfTPQk8rx4gpId8eFPVOyXKwW2E,5850
215
- flyte-0.2.0b16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
216
- flyte-0.2.0b16.dist-info/entry_points.txt,sha256=MIq2z5dBurdCJfpXfMKzgBv7sJOakKRYxr8G0cMiTrg,75
217
- flyte-0.2.0b16.dist-info/top_level.txt,sha256=7dkyFbikvA12LEZEqawx8oDG1CMod6hTliPj7iWzgYo,6
218
- flyte-0.2.0b16.dist-info/RECORD,,
215
+ flyte-0.2.0b18.dist-info/METADATA,sha256=Vm2UnlwiqYvEuPjxIddiv5SGy67HjNtI34X9z_RDgRw,5850
216
+ flyte-0.2.0b18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
217
+ flyte-0.2.0b18.dist-info/entry_points.txt,sha256=MIq2z5dBurdCJfpXfMKzgBv7sJOakKRYxr8G0cMiTrg,75
218
+ flyte-0.2.0b18.dist-info/top_level.txt,sha256=7dkyFbikvA12LEZEqawx8oDG1CMod6hTliPj7iWzgYo,6
219
+ flyte-0.2.0b18.dist-info/RECORD,,