ob-metaflow 2.12.27.1__py2.py3-none-any.whl → 2.12.30.2__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 (63) hide show
  1. metaflow/__init__.py +2 -3
  2. metaflow/cli.py +27 -0
  3. metaflow/client/core.py +2 -2
  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/metaflow_config.py +4 -7
  11. metaflow/metaflow_current.py +1 -1
  12. metaflow/parameters.py +3 -0
  13. metaflow/plugins/__init__.py +12 -8
  14. metaflow/plugins/airflow/airflow_cli.py +5 -0
  15. metaflow/plugins/airflow/airflow_decorator.py +1 -1
  16. metaflow/plugins/argo/argo_workflows_decorator.py +1 -1
  17. metaflow/plugins/argo/argo_workflows_deployer.py +77 -363
  18. metaflow/plugins/argo/argo_workflows_deployer_objects.py +381 -0
  19. metaflow/plugins/aws/batch/batch_cli.py +1 -1
  20. metaflow/plugins/aws/batch/batch_decorator.py +2 -2
  21. metaflow/plugins/aws/step_functions/step_functions_cli.py +7 -0
  22. metaflow/plugins/aws/step_functions/step_functions_decorator.py +1 -1
  23. metaflow/plugins/aws/step_functions/step_functions_deployer.py +65 -224
  24. metaflow/plugins/aws/step_functions/step_functions_deployer_objects.py +236 -0
  25. metaflow/plugins/azure/includefile_support.py +2 -0
  26. metaflow/plugins/cards/card_cli.py +3 -2
  27. metaflow/plugins/cards/card_modules/components.py +9 -9
  28. metaflow/plugins/cards/card_server.py +39 -14
  29. metaflow/plugins/datatools/local.py +2 -0
  30. metaflow/plugins/datatools/s3/s3.py +2 -0
  31. metaflow/plugins/env_escape/__init__.py +3 -3
  32. metaflow/plugins/gcp/includefile_support.py +3 -0
  33. metaflow/plugins/kubernetes/kubernetes_cli.py +1 -1
  34. metaflow/plugins/kubernetes/kubernetes_decorator.py +5 -4
  35. metaflow/plugins/kubernetes/kubernetes_jobsets.py +43 -28
  36. metaflow/plugins/{metadata → metadata_providers}/local.py +2 -2
  37. metaflow/plugins/{metadata → metadata_providers}/service.py +2 -2
  38. metaflow/plugins/parallel_decorator.py +1 -1
  39. metaflow/plugins/pypi/conda_decorator.py +1 -1
  40. metaflow/plugins/test_unbounded_foreach_decorator.py +1 -1
  41. metaflow/runner/click_api.py +4 -0
  42. metaflow/runner/deployer.py +134 -303
  43. metaflow/runner/deployer_impl.py +167 -0
  44. metaflow/runner/metaflow_runner.py +10 -9
  45. metaflow/runner/nbdeploy.py +12 -13
  46. metaflow/runner/nbrun.py +3 -3
  47. metaflow/runner/utils.py +55 -8
  48. metaflow/runtime.py +1 -1
  49. metaflow/system/system_logger.py +1 -19
  50. metaflow/system/system_monitor.py +0 -24
  51. metaflow/task.py +5 -8
  52. metaflow/version.py +1 -1
  53. {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.2.dist-info}/METADATA +2 -2
  54. {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.2.dist-info}/RECORD +63 -60
  55. {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.2.dist-info}/WHEEL +1 -1
  56. /metaflow/{metadata → metadata_provider}/__init__.py +0 -0
  57. /metaflow/{metadata → metadata_provider}/heartbeat.py +0 -0
  58. /metaflow/{metadata → metadata_provider}/metadata.py +0 -0
  59. /metaflow/{metadata → metadata_provider}/util.py +0 -0
  60. /metaflow/plugins/{metadata → metadata_providers}/__init__.py +0 -0
  61. {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.2.dist-info}/LICENSE +0 -0
  62. {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.2.dist-info}/entry_points.txt +0 -0
  63. {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.2.dist-info}/top_level.txt +0 -0
@@ -10,7 +10,7 @@ from types import MethodType, FunctionType
10
10
 
11
11
  from .. import metaflow_config
12
12
  from ..exception import MetaflowInternalError
13
- from ..metadata import DataArtifact, MetaDatum
13
+ from ..metadata_provider import DataArtifact, MetaDatum
14
14
  from ..parameters import Parameter
15
15
  from ..util import Path, is_stringish, to_fileobj
16
16
 
@@ -178,6 +178,7 @@ _plugin_categories = {
178
178
  "environment": lambda x: x.TYPE,
179
179
  "metadata_provider": lambda x: x.TYPE,
180
180
  "datastore": lambda x: x.TYPE,
181
+ "dataclient": lambda x: x.TYPE,
181
182
  "secrets_provider": lambda x: x.TYPE,
182
183
  "gcp_client_provider": lambda x: x.name,
183
184
  "deployer_impl_provider": lambda x: x.TYPE,
metaflow/flowspec.py CHANGED
@@ -64,7 +64,7 @@ class ParallelUBF(UnboundedForeachInput):
64
64
  return item or 0 # item is None for the control task, but it is also split 0
65
65
 
66
66
 
67
- class _FlowSpecMeta(type):
67
+ class FlowSpecMeta(type):
68
68
  def __new__(cls, name, bases, dct):
69
69
  f = super().__new__(cls, name, bases, dct)
70
70
  # This makes sure to give _flow_decorators to each
@@ -75,7 +75,7 @@ class _FlowSpecMeta(type):
75
75
  return f
76
76
 
77
77
 
78
- class FlowSpec(metaclass=_FlowSpecMeta):
78
+ class FlowSpec(metaclass=FlowSpecMeta):
79
79
  """
80
80
  Main class from which all Flows should inherit.
81
81
 
metaflow/includefile.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from collections import namedtuple
2
2
  import gzip
3
3
 
4
+ import importlib
4
5
  import io
5
6
  import json
6
7
  import os
@@ -17,6 +18,8 @@ from .parameters import (
17
18
  Parameter,
18
19
  ParameterContext,
19
20
  )
21
+
22
+ from .plugins import DATACLIENTS
20
23
  from .util import get_username
21
24
 
22
25
  import functools
@@ -47,16 +50,7 @@ _DelayedExecContext = namedtuple(
47
50
 
48
51
 
49
52
  # From here on out, this is the IncludeFile implementation.
50
- from metaflow.plugins.datatools import Local, S3
51
- from metaflow.plugins.azure.includefile_support import Azure
52
- from metaflow.plugins.gcp.includefile_support import GS
53
-
54
- DATACLIENTS = {
55
- "local": Local,
56
- "s3": S3,
57
- "azure": Azure,
58
- "gs": GS,
59
- }
53
+ _dict_dataclients = {d.TYPE: d for d in DATACLIENTS}
60
54
 
61
55
 
62
56
  class IncludedFile(object):
@@ -167,7 +161,7 @@ class FilePathClass(click.ParamType):
167
161
  "IncludeFile using a direct reference to a file in cloud storage is no "
168
162
  "longer supported. Contact the Metaflow team if you need this supported"
169
163
  )
170
- # if DATACLIENTS.get(path[:prefix_pos]) is None:
164
+ # if _dict_dataclients.get(path[:prefix_pos]) is None:
171
165
  # self.fail(
172
166
  # "IncludeFile: no handler for external file of type '%s' "
173
167
  # "(given path is '%s')" % (path[:prefix_pos], path)
@@ -187,7 +181,7 @@ class FilePathClass(click.ParamType):
187
181
  pass
188
182
  except OSError:
189
183
  self.fail("IncludeFile: could not open file '%s' for reading" % path)
190
- handler = DATACLIENTS.get(ctx.ds_type)
184
+ handler = _dict_dataclients.get(ctx.ds_type)
191
185
  if handler is None:
192
186
  self.fail(
193
187
  "IncludeFile: no data-client for datastore of type '%s'"
@@ -213,7 +207,7 @@ class FilePathClass(click.ParamType):
213
207
  ctx.path,
214
208
  ctx.is_text,
215
209
  ctx.encoding,
216
- DATACLIENTS[ctx.handler_type],
210
+ _dict_dataclients[ctx.handler_type],
217
211
  ctx.echo,
218
212
  )
219
213
  )
@@ -425,7 +419,7 @@ class UploaderV1:
425
419
  if prefix_pos < 0:
426
420
  raise MetaflowException("Malformed URL: '%s'" % url)
427
421
  prefix = url[:prefix_pos]
428
- handler = DATACLIENTS.get(prefix)
422
+ handler = _dict_dataclients.get(prefix)
429
423
  if handler is None:
430
424
  raise MetaflowException("Could not find data client for '%s'" % prefix)
431
425
  return handler
@@ -43,6 +43,10 @@ DEFAULT_GCP_CLIENT_PROVIDER = from_conf("DEFAULT_GCP_CLIENT_PROVIDER", "gcp-defa
43
43
  DEFAULT_SECRETS_BACKEND_TYPE = from_conf("DEFAULT_SECRETS_BACKEND_TYPE")
44
44
  DEFAULT_SECRETS_ROLE = from_conf("DEFAULT_SECRETS_ROLE")
45
45
 
46
+ DEFAULT_FROM_DEPLOYMENT_IMPL = from_conf(
47
+ "DEFAULT_FROM_DEPLOYMENT_IMPL", "argo-workflows"
48
+ )
49
+
46
50
  ###
47
51
  # User configuration
48
52
  ###
@@ -411,13 +415,6 @@ AIRFLOW_KUBERNETES_KUBECONFIG_CONTEXT = from_conf(
411
415
  )
412
416
 
413
417
 
414
- ###
415
- # From Deployment configuration
416
- ###
417
- # From Deployment Configuration for DeployedFlow
418
- FROM_DEPLOYMENT_IMPL = from_conf("FROM_DEPLOYMENT_IMPL", "argo-workflows")
419
-
420
-
421
418
  ###
422
419
  # Conda configuration
423
420
  ###
@@ -30,7 +30,7 @@ class Current(object):
30
30
  raise ex
31
31
 
32
32
  self.__class__.graph = property(
33
- fget=lambda _: _raise(RuntimeError("Graph is not available"))
33
+ fget=lambda self: _raise(RuntimeError("Graph is not available"))
34
34
  )
35
35
 
36
36
  def _set_env(
metaflow/parameters.py CHANGED
@@ -438,3 +438,6 @@ def add_custom_parameters(deploy_mode=False):
438
438
  return cmd
439
439
 
440
440
  return wrapper
441
+
442
+
443
+ JSONType = JSONTypeClass()
@@ -73,8 +73,8 @@ ENVIRONMENTS_DESC = [
73
73
 
74
74
  # Add metadata providers here
75
75
  METADATA_PROVIDERS_DESC = [
76
- ("service", ".metadata.service.ServiceMetadataProvider"),
77
- ("local", ".metadata.local.LocalMetadataProvider"),
76
+ ("service", ".metadata_providers.service.ServiceMetadataProvider"),
77
+ ("local", ".metadata_providers.local.LocalMetadataProvider"),
78
78
  ]
79
79
 
80
80
  # Add datastore here
@@ -85,13 +85,21 @@ DATASTORES_DESC = [
85
85
  ("gs", ".datastores.gs_storage.GSStorage"),
86
86
  ]
87
87
 
88
+ # Dataclients are used for IncludeFile
89
+ DATACLIENTS_DESC = [
90
+ ("local", ".datatools.Local"),
91
+ ("s3", ".datatools.S3"),
92
+ ("azure", ".azure.includefile_support.Azure"),
93
+ ("gs", ".gcp.includefile_support.GS"),
94
+ ]
95
+
88
96
  # Add non monitoring/logging sidecars here
89
97
  SIDECARS_DESC = [
90
98
  (
91
99
  "save_logs_periodically",
92
100
  "..mflog.save_logs_periodically.SaveLogsPeriodicallySidecar",
93
101
  ),
94
- ("heartbeat", "metaflow.metadata.heartbeat.MetadataHeartBeat"),
102
+ ("heartbeat", "metaflow.metadata_provider.heartbeat.MetadataHeartBeat"),
95
103
  ]
96
104
 
97
105
  # Add logging sidecars here
@@ -156,16 +164,12 @@ def get_plugin_cli():
156
164
  return resolve_plugins("cli")
157
165
 
158
166
 
159
- # just a normal dictionary, not a plugin since there is no class..
160
- FROM_DEPLOYMENT_PROVIDERS = {
161
- "argo-workflows": "metaflow.plugins.argo.argo_workflows_deployer",
162
- }
163
-
164
167
  STEP_DECORATORS = resolve_plugins("step_decorator")
165
168
  FLOW_DECORATORS = resolve_plugins("flow_decorator")
166
169
  ENVIRONMENTS = resolve_plugins("environment")
167
170
  METADATA_PROVIDERS = resolve_plugins("metadata_provider")
168
171
  DATASTORES = resolve_plugins("datastore")
172
+ DATACLIENTS = resolve_plugins("dataclient")
169
173
  SIDECARS = resolve_plugins("sidecar")
170
174
  LOGGING_SIDECARS = resolve_plugins("logging_sidecar")
171
175
  MONITOR_SIDECARS = resolve_plugins("monitor_sidecar")
@@ -389,6 +389,11 @@ def _validate_workflow(flow, graph, flow_datastore, metadata, workflow_timeout):
389
389
  "Step *%s* is marked for execution on AWS Batch with Airflow which isn't currently supported."
390
390
  % node.name
391
391
  )
392
+ if any([d.name == "slurm" for d in node.decorators]):
393
+ raise NotSupportedException(
394
+ "Step *%s* is marked for execution on Slurm with Airflow which isn't currently supported."
395
+ % node.name
396
+ )
392
397
  SUPPORTED_DATASTORES = ("azure", "s3", "gs")
393
398
  if flow_datastore.TYPE not in SUPPORTED_DATASTORES:
394
399
  raise AirflowException(
@@ -1,7 +1,7 @@
1
1
  import json
2
2
  import os
3
3
  from metaflow.decorators import StepDecorator
4
- from metaflow.metadata import MetaDatum
4
+ from metaflow.metadata_provider import MetaDatum
5
5
 
6
6
  from .airflow_utils import (
7
7
  TASK_ID_XCOM_KEY,
@@ -6,7 +6,7 @@ import time
6
6
  from metaflow import current
7
7
  from metaflow.decorators import StepDecorator
8
8
  from metaflow.events import Trigger
9
- from metaflow.metadata import MetaDatum
9
+ from metaflow.metadata_provider import MetaDatum
10
10
  from metaflow.metaflow_config import ARGO_EVENTS_WEBHOOK_URL
11
11
  from metaflow.graph import DAGNode, FlowGraph
12
12
  from metaflow.flowspec import FlowSpec