ob-metaflow 2.12.26.1__py2.py3-none-any.whl → 2.12.30.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 (66) hide show
  1. metaflow/__init__.py +2 -3
  2. metaflow/cli.py +31 -4
  3. metaflow/client/core.py +78 -40
  4. metaflow/clone_util.py +1 -1
  5. metaflow/cmd/develop/stub_generator.py +623 -233
  6. metaflow/datastore/task_datastore.py +1 -1
  7. metaflow/extension_support/plugins.py +1 -0
  8. metaflow/flowspec.py +2 -2
  9. metaflow/includefile.py +8 -14
  10. metaflow/{metadata → metadata_provider}/metadata.py +6 -0
  11. metaflow/metaflow_config.py +4 -7
  12. metaflow/metaflow_current.py +1 -1
  13. metaflow/parameters.py +3 -0
  14. metaflow/plugins/__init__.py +12 -8
  15. metaflow/plugins/airflow/airflow_cli.py +5 -0
  16. metaflow/plugins/airflow/airflow_decorator.py +1 -1
  17. metaflow/plugins/argo/argo_workflows_cli.py +3 -3
  18. metaflow/plugins/argo/argo_workflows_decorator.py +1 -1
  19. metaflow/plugins/argo/argo_workflows_deployer.py +77 -363
  20. metaflow/plugins/argo/argo_workflows_deployer_objects.py +381 -0
  21. metaflow/plugins/aws/batch/batch_cli.py +1 -1
  22. metaflow/plugins/aws/batch/batch_decorator.py +2 -2
  23. metaflow/plugins/aws/step_functions/step_functions_cli.py +9 -2
  24. metaflow/plugins/aws/step_functions/step_functions_decorator.py +1 -1
  25. metaflow/plugins/aws/step_functions/step_functions_deployer.py +65 -224
  26. metaflow/plugins/aws/step_functions/step_functions_deployer_objects.py +236 -0
  27. metaflow/plugins/azure/includefile_support.py +2 -0
  28. metaflow/plugins/cards/card_cli.py +3 -2
  29. metaflow/plugins/cards/card_modules/components.py +9 -9
  30. metaflow/plugins/cards/card_server.py +39 -14
  31. metaflow/plugins/datatools/local.py +2 -0
  32. metaflow/plugins/datatools/s3/s3.py +2 -0
  33. metaflow/plugins/env_escape/__init__.py +3 -3
  34. metaflow/plugins/gcp/includefile_support.py +3 -0
  35. metaflow/plugins/kubernetes/kubernetes_cli.py +1 -1
  36. metaflow/plugins/kubernetes/kubernetes_decorator.py +5 -4
  37. metaflow/plugins/kubernetes/kubernetes_jobsets.py +1 -4
  38. metaflow/plugins/{metadata → metadata_providers}/local.py +2 -2
  39. metaflow/plugins/{metadata → metadata_providers}/service.py +2 -2
  40. metaflow/plugins/parallel_decorator.py +1 -1
  41. metaflow/plugins/pypi/conda_decorator.py +1 -1
  42. metaflow/plugins/resources_decorator.py +2 -2
  43. metaflow/plugins/tag_cli.py +1 -4
  44. metaflow/plugins/test_unbounded_foreach_decorator.py +1 -1
  45. metaflow/runner/click_api.py +4 -0
  46. metaflow/runner/deployer.py +134 -303
  47. metaflow/runner/deployer_impl.py +167 -0
  48. metaflow/runner/metaflow_runner.py +14 -12
  49. metaflow/runner/nbdeploy.py +12 -13
  50. metaflow/runner/nbrun.py +3 -3
  51. metaflow/runner/utils.py +55 -8
  52. metaflow/runtime.py +1 -1
  53. metaflow/system/system_logger.py +1 -19
  54. metaflow/system/system_monitor.py +0 -24
  55. metaflow/task.py +32 -26
  56. metaflow/version.py +1 -1
  57. {ob_metaflow-2.12.26.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/METADATA +2 -2
  58. {ob_metaflow-2.12.26.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/RECORD +66 -63
  59. {ob_metaflow-2.12.26.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/WHEEL +1 -1
  60. /metaflow/{metadata → metadata_provider}/__init__.py +0 -0
  61. /metaflow/{metadata → metadata_provider}/heartbeat.py +0 -0
  62. /metaflow/{metadata → metadata_provider}/util.py +0 -0
  63. /metaflow/plugins/{metadata → metadata_providers}/__init__.py +0 -0
  64. {ob_metaflow-2.12.26.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/LICENSE +0 -0
  65. {ob_metaflow-2.12.26.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/entry_points.txt +0 -0
  66. {ob_metaflow-2.12.26.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/top_level.txt +0 -0
@@ -81,6 +81,8 @@ class Local(object):
81
81
  In the future, we may want to allow it to be used in a way similar to the S3() client.
82
82
  """
83
83
 
84
+ TYPE = "local"
85
+
84
86
  @staticmethod
85
87
  def _makedirs(path):
86
88
  try:
@@ -504,6 +504,8 @@ class S3(object):
504
504
  If `run` is not specified, use this as the S3 prefix.
505
505
  """
506
506
 
507
+ TYPE = "s3"
508
+
507
509
  @classmethod
508
510
  def get_root_from_config(cls, echo, create_on_absent=True):
509
511
  return DATATOOLS_S3ROOT
@@ -124,9 +124,9 @@ def load():
124
124
  cur_path = os.path.dirname(__file__)
125
125
  sys.path = [p for p in old_paths if p != cur_path]
126
126
  # Handle special case where we launch a shell (including with a command)
127
- # and we are in the CWD (searched if '' is the first element of sys.path)
128
- if cur_path == os.getcwd() and sys.path[0] == '':
129
- sys.path = sys.path[1:]
127
+ # and we are in the CWD (searched if '' is present in sys.path)
128
+ if cur_path == os.getcwd() and '' in sys.path:
129
+ sys.path.remove("")
130
130
 
131
131
  # Remove the module (this file) to reload it properly. Do *NOT* update sys.modules but
132
132
  # modify directly since it may be referenced elsewhere
@@ -8,6 +8,9 @@ from metaflow.exception import MetaflowException, MetaflowInternalError
8
8
 
9
9
 
10
10
  class GS(object):
11
+
12
+ TYPE = "gs"
13
+
11
14
  @classmethod
12
15
  def get_root_from_config(cls, echo, create_on_absent=True):
13
16
  from metaflow.metaflow_config import DATATOOLS_GSROOT
@@ -9,7 +9,7 @@ import metaflow.tracing as tracing
9
9
  from metaflow import JSONTypeClass, util
10
10
  from metaflow._vendor import click
11
11
  from metaflow.exception import METAFLOW_EXIT_DISALLOW_RETRY, MetaflowException
12
- from metaflow.metadata.util import sync_local_metadata_from_datastore
12
+ from metaflow.metadata_provider.util import sync_local_metadata_from_datastore
13
13
  from metaflow.metaflow_config import DATASTORE_LOCAL_DIR, KUBERNETES_LABELS
14
14
  from metaflow.mflog import TASK_LOG_SOURCE
15
15
  from metaflow.unbounded_foreach import UBF_CONTROL, UBF_TASK
@@ -7,8 +7,8 @@ import time
7
7
  from metaflow import current
8
8
  from metaflow.decorators import StepDecorator
9
9
  from metaflow.exception import MetaflowException
10
- from metaflow.metadata import MetaDatum
11
- from metaflow.metadata.util import sync_local_metadata_to_datastore
10
+ from metaflow.metadata_provider import MetaDatum
11
+ from metaflow.metadata_provider.util import sync_local_metadata_to_datastore
12
12
  from metaflow.metaflow_config import (
13
13
  DATASTORE_LOCAL_DIR,
14
14
  KUBERNETES_CONTAINER_IMAGE,
@@ -75,8 +75,9 @@ class KubernetesDecorator(StepDecorator):
75
75
  in Metaflow configuration.
76
76
  node_selector: Union[Dict[str,str], str], optional, default None
77
77
  Kubernetes node selector(s) to apply to the pod running the task.
78
- Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
79
- or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
78
+ Can be passed in as a comma separated string of values e.g.
79
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
80
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
80
81
  namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
81
82
  Kubernetes namespace to use when launching pod in Kubernetes.
82
83
  gpu : int, optional, default None
@@ -332,11 +332,8 @@ class RunningJobSet(object):
332
332
  name=self._name,
333
333
  )
334
334
 
335
- # Suspend the jobset and set the replica's to Zero.
336
- #
335
+ # Suspend the jobset
337
336
  obj["spec"]["suspend"] = True
338
- for replicated_job in obj["spec"]["replicatedJobs"]:
339
- replicated_job["replicas"] = 0
340
337
 
341
338
  api_instance.replace_namespaced_custom_object(
342
339
  group=self._group,
@@ -8,9 +8,9 @@ import time
8
8
  from collections import namedtuple
9
9
 
10
10
  from metaflow.exception import MetaflowInternalError, MetaflowTaggingError
11
- from metaflow.metadata.metadata import ObjectOrder
11
+ from metaflow.metadata_provider.metadata import ObjectOrder
12
12
  from metaflow.metaflow_config import DATASTORE_LOCAL_DIR
13
- from metaflow.metadata import MetadataProvider
13
+ from metaflow.metadata_provider import MetadataProvider
14
14
  from metaflow.tagging_util import MAX_USER_TAG_SET_SIZE, validate_tags
15
15
 
16
16
 
@@ -14,8 +14,8 @@ from metaflow.metaflow_config import (
14
14
  SERVICE_HEADERS,
15
15
  SERVICE_URL,
16
16
  )
17
- from metaflow.metadata import MetadataProvider
18
- from metaflow.metadata.heartbeat import HB_URL_KEY
17
+ from metaflow.metadata_provider import MetadataProvider
18
+ from metaflow.metadata_provider.heartbeat import HB_URL_KEY
19
19
  from metaflow.sidecar import Message, MessageTypes, Sidecar
20
20
 
21
21
  from metaflow.util import version_parse
@@ -2,7 +2,7 @@ from collections import namedtuple
2
2
  from metaflow.decorators import StepDecorator
3
3
  from metaflow.unbounded_foreach import UBF_CONTROL, CONTROL_TASK_TAG
4
4
  from metaflow.exception import MetaflowException
5
- from metaflow.metadata import MetaDatum
5
+ from metaflow.metadata_provider import MetaDatum
6
6
  from metaflow.metaflow_current import current, Parallel
7
7
  import os
8
8
  import sys
@@ -8,7 +8,7 @@ import tempfile
8
8
 
9
9
  from metaflow.decorators import FlowDecorator, StepDecorator
10
10
  from metaflow.extension_support import EXT_PKG
11
- from metaflow.metadata import MetaDatum
11
+ from metaflow.metadata_provider import MetaDatum
12
12
  from metaflow.metaflow_environment import InvalidEnvironmentException
13
13
  from metaflow.util import get_metaflow_root
14
14
 
@@ -23,7 +23,7 @@ class ResourcesDecorator(StepDecorator):
23
23
  ----------
24
24
  cpu : int, default 1
25
25
  Number of CPUs required for this step.
26
- gpu : int, default 0
26
+ gpu : int, optional, default None
27
27
  Number of GPUs required for this step.
28
28
  disk : int, optional, default None
29
29
  Disk size (in MB) required for this step. Only applies on Kubernetes.
@@ -37,7 +37,7 @@ class ResourcesDecorator(StepDecorator):
37
37
  name = "resources"
38
38
  defaults = {
39
39
  "cpu": "1",
40
- "gpu": "0",
40
+ "gpu": None,
41
41
  "disk": None,
42
42
  "memory": "4096",
43
43
  "shared_memory": None,
@@ -225,10 +225,7 @@ def _get_client_run_obj(obj, run_id, user_namespace):
225
225
 
226
226
 
227
227
  def _set_current(obj):
228
- current._set_env(
229
- metadata_str="%s@%s"
230
- % (obj.metadata.__class__.TYPE, obj.metadata.__class__.INFO)
231
- )
228
+ current._set_env(metadata_str=obj.metadata.metadata_str())
232
229
 
233
230
 
234
231
  @click.group()
@@ -15,7 +15,7 @@ from metaflow.unbounded_foreach import (
15
15
  CONTROL_TASK_TAG,
16
16
  )
17
17
  from metaflow.util import to_unicode
18
- from metaflow.metadata import MetaDatum
18
+ from metaflow.metadata_provider import MetaDatum
19
19
 
20
20
 
21
21
  class InternalTestUnboundedForeachInput(UnboundedForeachInput):
@@ -193,6 +193,10 @@ class MetaflowAPI(object):
193
193
  def chain(self):
194
194
  return self._chain
195
195
 
196
+ @property
197
+ def name(self):
198
+ return self._API_NAME
199
+
196
200
  @classmethod
197
201
  def from_cli(cls, flow_file: str, cli_collection: Callable) -> Callable:
198
202
  flow_cls = extract_flow_class_from_file(flow_file)