ob-metaflow 2.12.27.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.
- metaflow/__init__.py +2 -3
- metaflow/cli.py +27 -0
- metaflow/client/core.py +2 -2
- metaflow/clone_util.py +1 -1
- metaflow/cmd/develop/stub_generator.py +623 -233
- metaflow/datastore/task_datastore.py +1 -1
- metaflow/extension_support/plugins.py +1 -0
- metaflow/flowspec.py +2 -2
- metaflow/includefile.py +8 -14
- metaflow/metaflow_config.py +4 -7
- metaflow/metaflow_current.py +1 -1
- metaflow/parameters.py +3 -0
- metaflow/plugins/__init__.py +12 -8
- metaflow/plugins/airflow/airflow_cli.py +5 -0
- metaflow/plugins/airflow/airflow_decorator.py +1 -1
- metaflow/plugins/argo/argo_workflows_decorator.py +1 -1
- metaflow/plugins/argo/argo_workflows_deployer.py +77 -363
- metaflow/plugins/argo/argo_workflows_deployer_objects.py +381 -0
- metaflow/plugins/aws/batch/batch_cli.py +1 -1
- metaflow/plugins/aws/batch/batch_decorator.py +2 -2
- metaflow/plugins/aws/step_functions/step_functions_cli.py +7 -0
- metaflow/plugins/aws/step_functions/step_functions_decorator.py +1 -1
- metaflow/plugins/aws/step_functions/step_functions_deployer.py +65 -224
- metaflow/plugins/aws/step_functions/step_functions_deployer_objects.py +236 -0
- metaflow/plugins/azure/includefile_support.py +2 -0
- metaflow/plugins/cards/card_cli.py +3 -2
- metaflow/plugins/cards/card_modules/components.py +9 -9
- metaflow/plugins/cards/card_server.py +39 -14
- metaflow/plugins/datatools/local.py +2 -0
- metaflow/plugins/datatools/s3/s3.py +2 -0
- metaflow/plugins/env_escape/__init__.py +3 -3
- metaflow/plugins/gcp/includefile_support.py +3 -0
- metaflow/plugins/kubernetes/kubernetes_cli.py +1 -1
- metaflow/plugins/kubernetes/kubernetes_decorator.py +5 -4
- metaflow/plugins/{metadata → metadata_providers}/local.py +2 -2
- metaflow/plugins/{metadata → metadata_providers}/service.py +2 -2
- metaflow/plugins/parallel_decorator.py +1 -1
- metaflow/plugins/pypi/conda_decorator.py +1 -1
- metaflow/plugins/test_unbounded_foreach_decorator.py +1 -1
- metaflow/runner/click_api.py +4 -0
- metaflow/runner/deployer.py +134 -303
- metaflow/runner/deployer_impl.py +167 -0
- metaflow/runner/metaflow_runner.py +10 -9
- metaflow/runner/nbdeploy.py +12 -13
- metaflow/runner/nbrun.py +3 -3
- metaflow/runner/utils.py +55 -8
- metaflow/runtime.py +1 -1
- metaflow/system/system_logger.py +1 -19
- metaflow/system/system_monitor.py +0 -24
- metaflow/task.py +5 -8
- metaflow/version.py +1 -1
- {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/METADATA +2 -2
- {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/RECORD +62 -59
- {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/WHEEL +1 -1
- /metaflow/{metadata → metadata_provider}/__init__.py +0 -0
- /metaflow/{metadata → metadata_provider}/heartbeat.py +0 -0
- /metaflow/{metadata → metadata_provider}/metadata.py +0 -0
- /metaflow/{metadata → metadata_provider}/util.py +0 -0
- /metaflow/plugins/{metadata → metadata_providers}/__init__.py +0 -0
- {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/LICENSE +0 -0
- {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.1.dist-info}/entry_points.txt +0 -0
- {ob_metaflow-2.12.27.1.dist-info → ob_metaflow-2.12.30.1.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 ..
|
|
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
|
|
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=
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
metaflow/metaflow_config.py
CHANGED
|
@@ -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
|
###
|
metaflow/metaflow_current.py
CHANGED
metaflow/parameters.py
CHANGED
metaflow/plugins/__init__.py
CHANGED
|
@@ -73,8 +73,8 @@ ENVIRONMENTS_DESC = [
|
|
|
73
73
|
|
|
74
74
|
# Add metadata providers here
|
|
75
75
|
METADATA_PROVIDERS_DESC = [
|
|
76
|
-
("service", ".
|
|
77
|
-
("local", ".
|
|
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.
|
|
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(
|
|
@@ -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.
|
|
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
|