ob-metaflow 2.10.7.4__py2.py3-none-any.whl → 2.10.9.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 (52) hide show
  1. metaflow/cards.py +2 -0
  2. metaflow/decorators.py +1 -1
  3. metaflow/metaflow_config.py +2 -0
  4. metaflow/plugins/__init__.py +4 -0
  5. metaflow/plugins/airflow/airflow_cli.py +1 -1
  6. metaflow/plugins/argo/argo_workflows_cli.py +1 -1
  7. metaflow/plugins/aws/aws_utils.py +1 -1
  8. metaflow/plugins/aws/batch/batch.py +4 -0
  9. metaflow/plugins/aws/batch/batch_cli.py +3 -0
  10. metaflow/plugins/aws/batch/batch_client.py +40 -11
  11. metaflow/plugins/aws/batch/batch_decorator.py +1 -0
  12. metaflow/plugins/aws/step_functions/step_functions.py +1 -0
  13. metaflow/plugins/aws/step_functions/step_functions_cli.py +1 -1
  14. metaflow/plugins/azure/azure_exceptions.py +1 -1
  15. metaflow/plugins/cards/card_cli.py +413 -28
  16. metaflow/plugins/cards/card_client.py +16 -7
  17. metaflow/plugins/cards/card_creator.py +228 -0
  18. metaflow/plugins/cards/card_datastore.py +124 -26
  19. metaflow/plugins/cards/card_decorator.py +40 -86
  20. metaflow/plugins/cards/card_modules/base.html +12 -0
  21. metaflow/plugins/cards/card_modules/basic.py +74 -8
  22. metaflow/plugins/cards/card_modules/bundle.css +1 -170
  23. metaflow/plugins/cards/card_modules/card.py +65 -0
  24. metaflow/plugins/cards/card_modules/components.py +446 -81
  25. metaflow/plugins/cards/card_modules/convert_to_native_type.py +9 -3
  26. metaflow/plugins/cards/card_modules/main.js +250 -21
  27. metaflow/plugins/cards/card_modules/test_cards.py +117 -0
  28. metaflow/plugins/cards/card_resolver.py +0 -2
  29. metaflow/plugins/cards/card_server.py +361 -0
  30. metaflow/plugins/cards/component_serializer.py +506 -42
  31. metaflow/plugins/cards/exception.py +20 -1
  32. metaflow/plugins/datastores/azure_storage.py +1 -2
  33. metaflow/plugins/datastores/gs_storage.py +1 -2
  34. metaflow/plugins/datastores/s3_storage.py +2 -1
  35. metaflow/plugins/datatools/s3/s3.py +24 -11
  36. metaflow/plugins/env_escape/client.py +2 -12
  37. metaflow/plugins/env_escape/client_modules.py +18 -14
  38. metaflow/plugins/env_escape/server.py +18 -11
  39. metaflow/plugins/env_escape/utils.py +12 -0
  40. metaflow/plugins/gcp/gs_exceptions.py +1 -1
  41. metaflow/plugins/gcp/gs_utils.py +1 -1
  42. metaflow/plugins/pypi/conda_environment.py +5 -6
  43. metaflow/plugins/pypi/pip.py +2 -2
  44. metaflow/plugins/pypi/utils.py +15 -0
  45. metaflow/task.py +1 -0
  46. metaflow/version.py +1 -1
  47. {ob_metaflow-2.10.7.4.dist-info → ob_metaflow-2.10.9.1.dist-info}/METADATA +1 -1
  48. {ob_metaflow-2.10.7.4.dist-info → ob_metaflow-2.10.9.1.dist-info}/RECORD +52 -50
  49. {ob_metaflow-2.10.7.4.dist-info → ob_metaflow-2.10.9.1.dist-info}/LICENSE +0 -0
  50. {ob_metaflow-2.10.7.4.dist-info → ob_metaflow-2.10.9.1.dist-info}/WHEEL +0 -0
  51. {ob_metaflow-2.10.7.4.dist-info → ob_metaflow-2.10.9.1.dist-info}/entry_points.txt +0 -0
  52. {ob_metaflow-2.10.7.4.dist-info → ob_metaflow-2.10.9.1.dist-info}/top_level.txt +0 -0
metaflow/cards.py CHANGED
@@ -6,6 +6,8 @@ from metaflow.plugins.cards.card_modules.components import (
6
6
  Image,
7
7
  Error,
8
8
  Markdown,
9
+ VegaChart,
10
+ ProgressBar,
9
11
  )
10
12
  from metaflow.plugins.cards.card_modules.basic import (
11
13
  DefaultCard,
metaflow/decorators.py CHANGED
@@ -129,7 +129,7 @@ class Decorator(object):
129
129
 
130
130
  attrs = {}
131
131
  # TODO: Do we really want to allow spaces in the names of attributes?!?
132
- for a in re.split(""",(?=[\s\w]+=)""", deco_spec):
132
+ for a in re.split(r""",(?=[\s\w]+=)""", deco_spec):
133
133
  name, val = a.split("=", 1)
134
134
  try:
135
135
  val_parsed = json.loads(val.strip().replace('\\"', '"'))
@@ -165,6 +165,8 @@ CARD_NO_WARNING = from_conf("CARD_NO_WARNING", False)
165
165
 
166
166
  SKIP_CARD_DUALWRITE = from_conf("SKIP_CARD_DUALWRITE", False)
167
167
 
168
+ RUNTIME_CARD_RENDER_INTERVAL = from_conf("RUNTIME_CARD_RENDER_INTERVAL", 60)
169
+
168
170
  # Azure storage account URL
169
171
  AZURE_STORAGE_BLOB_SERVICE_ENDPOINT = from_conf("AZURE_STORAGE_BLOB_SERVICE_ENDPOINT")
170
172
 
@@ -172,6 +172,8 @@ from .cards.card_modules.test_cards import (
172
172
  TestNonEditableCard,
173
173
  TestPathSpecCard,
174
174
  TestTimeoutCard,
175
+ TestRefreshCard,
176
+ TestRefreshComponentCard,
175
177
  )
176
178
 
177
179
  CARDS = [
@@ -188,5 +190,7 @@ CARDS = [
188
190
  TestNonEditableCard,
189
191
  BlankCard,
190
192
  DefaultCardJSON,
193
+ TestRefreshCard,
194
+ TestRefreshComponentCard,
191
195
  ]
192
196
  merge_lists(CARDS, MF_EXTERNAL_CARDS, "type")
@@ -24,7 +24,7 @@ class IncorrectProductionToken(MetaflowException):
24
24
  headline = "Incorrect production token"
25
25
 
26
26
 
27
- VALID_NAME = re.compile("[^a-zA-Z0-9_\-\.]")
27
+ VALID_NAME = re.compile(r"[^a-zA-Z0-9_\-\.]")
28
28
 
29
29
 
30
30
  def resolve_token(
@@ -29,7 +29,7 @@ from metaflow.util import get_username, to_bytes, to_unicode, version_parse
29
29
 
30
30
  from .argo_workflows import ArgoWorkflows
31
31
 
32
- VALID_NAME = re.compile("^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$")
32
+ VALID_NAME = re.compile(r"^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$")
33
33
 
34
34
 
35
35
  class IncorrectProductionToken(MetaflowException):
@@ -39,7 +39,7 @@ def get_ec2_instance_metadata():
39
39
 
40
40
 
41
41
  def get_docker_registry(image_uri):
42
- """
42
+ r"""
43
43
  Explanation:
44
44
  (.+?(?:[:.].+?)\/)? - [GROUP 0] REGISTRY
45
45
  .+? - A registry must start with at least one character
@@ -185,6 +185,7 @@ class Batch(object):
185
185
  env={},
186
186
  attrs={},
187
187
  host_volumes=None,
188
+ efs_volumes=None,
188
189
  use_tmpfs=None,
189
190
  tmpfs_tempdir=None,
190
191
  tmpfs_size=None,
@@ -232,6 +233,7 @@ class Batch(object):
232
233
  efa,
233
234
  memory=memory,
234
235
  host_volumes=host_volumes,
236
+ efs_volumes=efs_volumes,
235
237
  use_tmpfs=use_tmpfs,
236
238
  tmpfs_tempdir=tmpfs_tempdir,
237
239
  tmpfs_size=tmpfs_size,
@@ -341,6 +343,7 @@ class Batch(object):
341
343
  inferentia=None,
342
344
  efa=None,
343
345
  host_volumes=None,
346
+ efs_volumes=None,
344
347
  use_tmpfs=None,
345
348
  tmpfs_tempdir=None,
346
349
  tmpfs_size=None,
@@ -379,6 +382,7 @@ class Batch(object):
379
382
  env=env,
380
383
  attrs=attrs,
381
384
  host_volumes=host_volumes,
385
+ efs_volumes=efs_volumes,
382
386
  use_tmpfs=use_tmpfs,
383
387
  tmpfs_tempdir=tmpfs_tempdir,
384
388
  tmpfs_size=tmpfs_size,
@@ -153,6 +153,7 @@ def kill(ctx, run_id, user, my_runs):
153
153
  # TODO: Maybe remove it altogether since it's not used here
154
154
  @click.option("--ubf-context", default=None, type=click.Choice([None, "ubf_control"]))
155
155
  @click.option("--host-volumes", multiple=True)
156
+ @click.option("--efs-volumes", multiple=True)
156
157
  @click.option(
157
158
  "--num-parallel",
158
159
  default=0,
@@ -184,6 +185,7 @@ def step(
184
185
  tmpfs_size=None,
185
186
  tmpfs_path=None,
186
187
  host_volumes=None,
188
+ efs_volumes=None,
187
189
  num_parallel=None,
188
190
  **kwargs
189
191
  ):
@@ -310,6 +312,7 @@ def step(
310
312
  env=env,
311
313
  attrs=attrs,
312
314
  host_volumes=host_volumes,
315
+ efs_volumes=efs_volumes,
313
316
  use_tmpfs=use_tmpfs,
314
317
  tmpfs_tempdir=tmpfs_tempdir,
315
318
  tmpfs_size=tmpfs_size,
@@ -152,6 +152,7 @@ class BatchJob(object):
152
152
  efa,
153
153
  memory,
154
154
  host_volumes,
155
+ efs_volumes,
155
156
  use_tmpfs,
156
157
  tmpfs_tempdir,
157
158
  tmpfs_size,
@@ -274,19 +275,45 @@ class BatchJob(object):
274
275
  }
275
276
  )
276
277
 
277
- if host_volumes:
278
+ if host_volumes or efs_volumes:
278
279
  job_definition["containerProperties"]["volumes"] = []
279
280
  job_definition["containerProperties"]["mountPoints"] = []
280
- if isinstance(host_volumes, str):
281
- host_volumes = [host_volumes]
282
- for host_path in host_volumes:
283
- name = host_path.replace("/", "_").replace(".", "_")
284
- job_definition["containerProperties"]["volumes"].append(
285
- {"name": name, "host": {"sourcePath": host_path}}
286
- )
287
- job_definition["containerProperties"]["mountPoints"].append(
288
- {"sourceVolume": name, "containerPath": host_path}
289
- )
281
+
282
+ if host_volumes:
283
+ if isinstance(host_volumes, str):
284
+ host_volumes = [host_volumes]
285
+ for host_path in host_volumes:
286
+ container_path = host_path
287
+ if ":" in host_path:
288
+ host_path, container_path = host_path.split(":", 1)
289
+ name = host_path.replace("/", "_").replace(".", "_")
290
+ job_definition["containerProperties"]["volumes"].append(
291
+ {"name": name, "host": {"sourcePath": host_path}}
292
+ )
293
+ job_definition["containerProperties"]["mountPoints"].append(
294
+ {"sourceVolume": name, "containerPath": container_path}
295
+ )
296
+
297
+ if efs_volumes:
298
+ if isinstance(efs_volumes, str):
299
+ efs_volumes = [efs_volumes]
300
+ for efs_id in efs_volumes:
301
+ container_path = "/mnt/" + efs_id
302
+ if ":" in efs_id:
303
+ efs_id, container_path = efs_id.split(":", 1)
304
+ name = "efs_" + efs_id
305
+ job_definition["containerProperties"]["volumes"].append(
306
+ {
307
+ "name": name,
308
+ "efsVolumeConfiguration": {
309
+ "fileSystemId": efs_id,
310
+ "transitEncryption": "ENABLED",
311
+ },
312
+ }
313
+ )
314
+ job_definition["containerProperties"]["mountPoints"].append(
315
+ {"sourceVolume": name, "containerPath": container_path}
316
+ )
290
317
 
291
318
  if use_tmpfs or (tmpfs_size and not use_tmpfs):
292
319
  if tmpfs_size:
@@ -401,6 +428,7 @@ class BatchJob(object):
401
428
  efa,
402
429
  memory,
403
430
  host_volumes,
431
+ efs_volumes,
404
432
  use_tmpfs,
405
433
  tmpfs_tempdir,
406
434
  tmpfs_size,
@@ -419,6 +447,7 @@ class BatchJob(object):
419
447
  efa,
420
448
  memory,
421
449
  host_volumes,
450
+ efs_volumes,
422
451
  use_tmpfs,
423
452
  tmpfs_tempdir,
424
453
  tmpfs_size,
@@ -102,6 +102,7 @@ class BatchDecorator(StepDecorator):
102
102
  "inferentia": None,
103
103
  "efa": None,
104
104
  "host_volumes": None,
105
+ "efs_volumes": None,
105
106
  "use_tmpfs": False,
106
107
  "tmpfs_tempdir": True,
107
108
  "tmpfs_size": None,
@@ -704,6 +704,7 @@ class StepFunctions(object):
704
704
  env=env,
705
705
  attrs=attrs,
706
706
  host_volumes=resources["host_volumes"],
707
+ efs_volumes=resources["efs_volumes"],
707
708
  )
708
709
  .attempts(total_retries + 1)
709
710
  )
@@ -19,7 +19,7 @@ from metaflow.util import get_username, to_bytes, to_unicode, version_parse
19
19
  from .step_functions import StepFunctions
20
20
  from .production_token import load_token, store_token, new_token
21
21
 
22
- VALID_NAME = re.compile("[^a-zA-Z0-9_\-\.]")
22
+ VALID_NAME = re.compile(r"[^a-zA-Z0-9_\-\.]")
23
23
 
24
24
 
25
25
  class IncorrectProductionToken(MetaflowException):
@@ -10,4 +10,4 @@ class MetaflowAzureResourceError(MetaflowException):
10
10
 
11
11
 
12
12
  class MetaflowAzurePackageError(MetaflowException):
13
- headline = "Missing required packages azure-identity and azure-storage-blob"
13
+ headline = "Missing required packages 'azure-identity' and 'azure-storage-blob'"