ob-metaflow 2.12.30.2__py2.py3-none-any.whl → 2.13.6.1__py2.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 ob-metaflow might be problematic. Click here for more details.

Files changed (96) hide show
  1. metaflow/__init__.py +3 -0
  2. metaflow/cards.py +1 -0
  3. metaflow/cli.py +185 -717
  4. metaflow/cli_args.py +17 -0
  5. metaflow/cli_components/__init__.py +0 -0
  6. metaflow/cli_components/dump_cmd.py +96 -0
  7. metaflow/cli_components/init_cmd.py +51 -0
  8. metaflow/cli_components/run_cmds.py +362 -0
  9. metaflow/cli_components/step_cmd.py +176 -0
  10. metaflow/cli_components/utils.py +140 -0
  11. metaflow/cmd/develop/stub_generator.py +9 -2
  12. metaflow/datastore/flow_datastore.py +2 -2
  13. metaflow/decorators.py +63 -2
  14. metaflow/exception.py +8 -2
  15. metaflow/extension_support/plugins.py +42 -27
  16. metaflow/flowspec.py +176 -23
  17. metaflow/graph.py +28 -27
  18. metaflow/includefile.py +50 -22
  19. metaflow/lint.py +35 -20
  20. metaflow/metadata_provider/heartbeat.py +23 -8
  21. metaflow/metaflow_config.py +10 -1
  22. metaflow/multicore_utils.py +31 -14
  23. metaflow/package.py +17 -3
  24. metaflow/parameters.py +97 -25
  25. metaflow/plugins/__init__.py +22 -0
  26. metaflow/plugins/airflow/airflow.py +18 -17
  27. metaflow/plugins/airflow/airflow_cli.py +1 -0
  28. metaflow/plugins/argo/argo_client.py +0 -2
  29. metaflow/plugins/argo/argo_workflows.py +195 -132
  30. metaflow/plugins/argo/argo_workflows_cli.py +1 -1
  31. metaflow/plugins/argo/argo_workflows_decorator.py +2 -4
  32. metaflow/plugins/argo/argo_workflows_deployer_objects.py +51 -9
  33. metaflow/plugins/argo/jobset_input_paths.py +0 -1
  34. metaflow/plugins/aws/aws_utils.py +6 -1
  35. metaflow/plugins/aws/batch/batch_client.py +1 -3
  36. metaflow/plugins/aws/batch/batch_decorator.py +13 -13
  37. metaflow/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.py +13 -10
  38. metaflow/plugins/aws/step_functions/dynamo_db_client.py +0 -3
  39. metaflow/plugins/aws/step_functions/production_token.py +1 -1
  40. metaflow/plugins/aws/step_functions/step_functions.py +33 -1
  41. metaflow/plugins/aws/step_functions/step_functions_cli.py +1 -1
  42. metaflow/plugins/aws/step_functions/step_functions_decorator.py +0 -1
  43. metaflow/plugins/aws/step_functions/step_functions_deployer_objects.py +7 -9
  44. metaflow/plugins/cards/card_cli.py +7 -2
  45. metaflow/plugins/cards/card_creator.py +1 -0
  46. metaflow/plugins/cards/card_decorator.py +79 -8
  47. metaflow/plugins/cards/card_modules/basic.py +56 -5
  48. metaflow/plugins/cards/card_modules/card.py +16 -1
  49. metaflow/plugins/cards/card_modules/components.py +64 -16
  50. metaflow/plugins/cards/card_modules/main.js +27 -25
  51. metaflow/plugins/cards/card_modules/test_cards.py +4 -4
  52. metaflow/plugins/cards/component_serializer.py +1 -1
  53. metaflow/plugins/datatools/s3/s3.py +12 -4
  54. metaflow/plugins/datatools/s3/s3op.py +3 -3
  55. metaflow/plugins/events_decorator.py +338 -186
  56. metaflow/plugins/kubernetes/kube_utils.py +84 -1
  57. metaflow/plugins/kubernetes/kubernetes.py +40 -92
  58. metaflow/plugins/kubernetes/kubernetes_cli.py +32 -7
  59. metaflow/plugins/kubernetes/kubernetes_decorator.py +76 -4
  60. metaflow/plugins/kubernetes/kubernetes_job.py +23 -20
  61. metaflow/plugins/kubernetes/kubernetes_jobsets.py +41 -20
  62. metaflow/plugins/kubernetes/spot_metadata_cli.py +69 -0
  63. metaflow/plugins/kubernetes/spot_monitor_sidecar.py +109 -0
  64. metaflow/plugins/parallel_decorator.py +4 -1
  65. metaflow/plugins/project_decorator.py +33 -5
  66. metaflow/plugins/pypi/bootstrap.py +249 -81
  67. metaflow/plugins/pypi/conda_decorator.py +20 -10
  68. metaflow/plugins/pypi/conda_environment.py +83 -27
  69. metaflow/plugins/pypi/micromamba.py +82 -37
  70. metaflow/plugins/pypi/pip.py +9 -6
  71. metaflow/plugins/pypi/pypi_decorator.py +11 -9
  72. metaflow/plugins/pypi/utils.py +4 -2
  73. metaflow/plugins/timeout_decorator.py +2 -2
  74. metaflow/runner/click_api.py +240 -50
  75. metaflow/runner/deployer.py +1 -1
  76. metaflow/runner/deployer_impl.py +12 -11
  77. metaflow/runner/metaflow_runner.py +68 -34
  78. metaflow/runner/nbdeploy.py +2 -0
  79. metaflow/runner/nbrun.py +1 -1
  80. metaflow/runner/subprocess_manager.py +61 -10
  81. metaflow/runner/utils.py +208 -44
  82. metaflow/runtime.py +216 -112
  83. metaflow/sidecar/sidecar_worker.py +1 -1
  84. metaflow/tracing/tracing_modules.py +4 -1
  85. metaflow/user_configs/__init__.py +0 -0
  86. metaflow/user_configs/config_decorators.py +563 -0
  87. metaflow/user_configs/config_options.py +548 -0
  88. metaflow/user_configs/config_parameters.py +436 -0
  89. metaflow/util.py +22 -0
  90. metaflow/version.py +1 -1
  91. {ob_metaflow-2.12.30.2.dist-info → ob_metaflow-2.13.6.1.dist-info}/METADATA +12 -3
  92. {ob_metaflow-2.12.30.2.dist-info → ob_metaflow-2.13.6.1.dist-info}/RECORD +96 -84
  93. {ob_metaflow-2.12.30.2.dist-info → ob_metaflow-2.13.6.1.dist-info}/WHEEL +1 -1
  94. {ob_metaflow-2.12.30.2.dist-info → ob_metaflow-2.13.6.1.dist-info}/LICENSE +0 -0
  95. {ob_metaflow-2.12.30.2.dist-info → ob_metaflow-2.13.6.1.dist-info}/entry_points.txt +0 -0
  96. {ob_metaflow-2.12.30.2.dist-info → ob_metaflow-2.13.6.1.dist-info}/top_level.txt +0 -0
@@ -16,9 +16,15 @@ CLIS_DESC = [
16
16
  ("argo-workflows", ".argo.argo_workflows_cli.cli"),
17
17
  ("card", ".cards.card_cli.cli"),
18
18
  ("tag", ".tag_cli.cli"),
19
+ ("spot-metadata", ".kubernetes.spot_metadata_cli.cli"),
19
20
  ("logs", ".logs_cli.cli"),
20
21
  ]
21
22
 
23
+ # Add additional commands to the runner here
24
+ # These will be accessed using Runner().<command>()
25
+ RUNNER_CLIS_DESC = []
26
+
27
+
22
28
  from .test_unbounded_foreach_decorator import InternalTestUnboundedForeachInput
23
29
 
24
30
  # Add new step decorators here
@@ -99,6 +105,10 @@ SIDECARS_DESC = [
99
105
  "save_logs_periodically",
100
106
  "..mflog.save_logs_periodically.SaveLogsPeriodicallySidecar",
101
107
  ),
108
+ (
109
+ "spot_termination_monitor",
110
+ ".kubernetes.spot_monitor_sidecar.SpotTerminationMonitorSidecar",
111
+ ),
102
112
  ("heartbeat", "metaflow.metadata_provider.heartbeat.MetadataHeartBeat"),
103
113
  ]
104
114
 
@@ -164,6 +174,18 @@ def get_plugin_cli():
164
174
  return resolve_plugins("cli")
165
175
 
166
176
 
177
+ def get_plugin_cli_path():
178
+ return resolve_plugins("cli", path_only=True)
179
+
180
+
181
+ def get_runner_cli():
182
+ return resolve_plugins("runner_cli")
183
+
184
+
185
+ def get_runner_cli_path():
186
+ return resolve_plugins("runner_cli", path_only=True)
187
+
188
+
167
189
  STEP_DECORATORS = resolve_plugins("step_decorator")
168
190
  FLOW_DECORATORS = resolve_plugins("flow_decorator")
169
191
  ENVIRONMENTS = resolve_plugins("environment")
@@ -46,6 +46,7 @@ from metaflow.parameters import (
46
46
  # TODO: Move chevron to _vendor
47
47
  from metaflow.plugins.cards.card_modules import chevron
48
48
  from metaflow.plugins.kubernetes.kubernetes import Kubernetes
49
+ from metaflow.plugins.kubernetes.kube_utils import qos_requests_and_limits
49
50
  from metaflow.plugins.timeout_decorator import get_run_time_limit_for_task
50
51
  from metaflow.util import compress_list, dict_to_cli_options, get_username
51
52
 
@@ -428,25 +429,25 @@ class Airflow(object):
428
429
  if k8s_deco.attributes["namespace"] is not None
429
430
  else "default"
430
431
  )
431
-
432
+ qos_requests, qos_limits = qos_requests_and_limits(
433
+ k8s_deco.attributes["qos"],
434
+ k8s_deco.attributes["cpu"],
435
+ k8s_deco.attributes["memory"],
436
+ k8s_deco.attributes["disk"],
437
+ )
432
438
  resources = dict(
433
- requests={
434
- "cpu": k8s_deco.attributes["cpu"],
435
- "memory": "%sM" % str(k8s_deco.attributes["memory"]),
436
- "ephemeral-storage": str(k8s_deco.attributes["disk"]),
437
- }
439
+ requests=qos_requests,
440
+ limits={
441
+ **qos_limits,
442
+ **{
443
+ "%s.com/gpu".lower()
444
+ % k8s_deco.attributes["gpu_vendor"]: str(k8s_deco.attributes["gpu"])
445
+ for k in [0]
446
+ # Don't set GPU limits if gpu isn't specified.
447
+ if k8s_deco.attributes["gpu"] is not None
448
+ },
449
+ },
438
450
  )
439
- if k8s_deco.attributes["gpu"] is not None:
440
- resources.update(
441
- dict(
442
- limits={
443
- "%s.com/gpu".lower()
444
- % k8s_deco.attributes["gpu_vendor"]: str(
445
- k8s_deco.attributes["gpu"]
446
- )
447
- }
448
- )
449
- )
450
451
 
451
452
  annotations = {
452
453
  "metaflow/production_token": self.production_token,
@@ -283,6 +283,7 @@ def make_flow(
283
283
  ):
284
284
  # Attach @kubernetes.
285
285
  decorators._attach_decorators(obj.flow, [KubernetesDecorator.name])
286
+ decorators._init(obj.flow)
286
287
 
287
288
  decorators._init_step_decorators(
288
289
  obj.flow, obj.graph, obj.environment, obj.flow_datastore, obj.logger
@@ -1,6 +1,4 @@
1
1
  import json
2
- import os
3
- import sys
4
2
 
5
3
  from metaflow.exception import MetaflowException
6
4
  from metaflow.plugins.kubernetes.kubernetes_client import KubernetesClient