ob-metaflow-extensions 1.2.7rc1__py2.py3-none-any.whl → 1.2.9__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-extensions might be problematic. Click here for more details.

@@ -335,6 +335,7 @@ STEP_DECORATORS_DESC = [
335
335
  ("snowpark", ".snowpark.snowpark_decorator.SnowparkDecorator"),
336
336
  ("tensorboard", ".tensorboard.TensorboardDecorator"),
337
337
  ("gpu_profile", ".profilers.gpu_profile_decorator.GPUProfileDecorator"),
338
+ ("test_append_card", ".profilers.simple_card_decorator.DynamicCardAppendDecorator"),
338
339
  ("nim", ".nim.nim_decorator.NimDecorator"),
339
340
  ("ollama", ".ollama.OllamaDecorator"),
340
341
  ("vllm", ".vllm.VLLMDecorator"),
@@ -0,0 +1,96 @@
1
+ from datetime import datetime
2
+ from metaflow.decorators import StepDecorator
3
+ from ..card_utilities.injector import CardDecoratorInjector
4
+
5
+
6
+ class DynamicCardAppendDecorator(StepDecorator):
7
+ """
8
+ A simple decorator that demonstrates using CardDecoratorInjector
9
+ to inject a card and render simple markdown content.
10
+ """
11
+
12
+ name = "test_append_card"
13
+
14
+ defaults = {
15
+ "title": "Simple Card",
16
+ "message": "Hello from DynamicCardAppendDecorator!",
17
+ "show_timestamp": True,
18
+ "refresh_interval": 5,
19
+ }
20
+
21
+ CARD_ID = "simple_card"
22
+
23
+ def step_init(
24
+ self, flow, graph, step_name, decorators, environment, flow_datastore, logger
25
+ ):
26
+ """Initialize the decorator and inject the card."""
27
+ self.deco_injector = CardDecoratorInjector()
28
+ self.deco_injector.attach_card_decorator(
29
+ flow,
30
+ step_name,
31
+ self.CARD_ID,
32
+ "blank",
33
+ refresh_interval=self.attributes["refresh_interval"],
34
+ )
35
+
36
+ def task_decorate(
37
+ self, step_func, flow, graph, retry_count, max_user_code_retries, ubf_context
38
+ ):
39
+ """Decorate the step function to add card content."""
40
+ from metaflow import current
41
+ from metaflow.cards import Markdown
42
+
43
+ # Create the card content
44
+ title = self.attributes["title"]
45
+ message = self.attributes["message"]
46
+ show_timestamp = self.attributes["show_timestamp"]
47
+
48
+ # Add title to the card
49
+ current.card[self.CARD_ID].append(Markdown(f"# {title}"))
50
+
51
+ # Add message to the card
52
+ current.card[self.CARD_ID].append(Markdown(f"**Message:** {message}"))
53
+
54
+ # Add timestamp if requested
55
+ if show_timestamp:
56
+ timestamp = datetime.now().astimezone().strftime("%Y-%m-%d %H:%M:%S %z")
57
+ current.card[self.CARD_ID].append(Markdown(f"**Created at:** {timestamp}"))
58
+
59
+ # Add step information
60
+ current.card[self.CARD_ID].append(Markdown(f"**Step:** `{current.pathspec}`"))
61
+
62
+ # Add a simple divider
63
+ current.card[self.CARD_ID].append(Markdown("---"))
64
+
65
+ # Add some dynamic content that shows this is working
66
+ current.card[self.CARD_ID].append(
67
+ Markdown("**Status:** Card successfully injected! 🎉")
68
+ )
69
+
70
+ def wrapped_step_func():
71
+ """Execute the original step function."""
72
+ try:
73
+ # Before execution
74
+ current.card[self.CARD_ID].append(
75
+ Markdown("**Execution:** Step started...")
76
+ )
77
+ current.card[self.CARD_ID].refresh()
78
+
79
+ # Execute the original step
80
+ step_func()
81
+
82
+ # After execution
83
+ current.card[self.CARD_ID].append(
84
+ Markdown("**Execution:** Step completed successfully! ✅")
85
+ )
86
+ current.card[self.CARD_ID].refresh()
87
+
88
+ except Exception as e:
89
+ # Handle errors
90
+ current.card[self.CARD_ID].append(
91
+ Markdown(f"**Error:** Step failed with error: `{str(e)}` ❌")
92
+ )
93
+ current.card[self.CARD_ID].refresh()
94
+ raise
95
+
96
+ return wrapped_step_func
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ob-metaflow-extensions
3
- Version: 1.2.7rc1
3
+ Version: 1.2.9
4
4
  Summary: Outerbounds Platform Extensions for Metaflow
5
5
  Author: Outerbounds, Inc.
6
6
  License: Commercial
7
7
  Description-Content-Type: text/markdown
8
8
  Requires-Dist: boto3
9
9
  Requires-Dist: kubernetes
10
- Requires-Dist: ob-metaflow (==2.15.21.2)
10
+ Requires-Dist: ob-metaflow (==2.15.21.5)
11
11
 
12
12
  # Outerbounds platform package
13
13
 
@@ -1,7 +1,7 @@
1
1
  metaflow_extensions/outerbounds/__init__.py,sha256=Gb8u06s9ClQsA_vzxmkCzuMnigPy7kKcDnLfb7eB-64,514
2
2
  metaflow_extensions/outerbounds/remote_config.py,sha256=pEFJuKDYs98eoB_-ryPjVi9b_c4gpHMdBHE14ltoxIU,4672
3
3
  metaflow_extensions/outerbounds/config/__init__.py,sha256=JsQGRuGFz28fQWjUvxUgR8EKBLGRdLUIk_buPLJplJY,1225
4
- metaflow_extensions/outerbounds/plugins/__init__.py,sha256=SgqRTG7FFk-jrPBNPYQ-D0W26Yr_dgg7ZL-YJInTQGw,13706
4
+ metaflow_extensions/outerbounds/plugins/__init__.py,sha256=c4zZnULrBOU2bmleU_D7Xr5H3kTuTgDhtZIKUAJiNqw,13795
5
5
  metaflow_extensions/outerbounds/plugins/auth_server.py,sha256=_Q9_2EL0Xy77bCRphkwT1aSu8gQXRDOH-Z-RxTUO8N4,2202
6
6
  metaflow_extensions/outerbounds/plugins/perimeters.py,sha256=QXh3SFP7GQbS-RAIxUOPbhPzQ7KDFVxZkTdKqFKgXjI,2697
7
7
  metaflow_extensions/outerbounds/plugins/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -84,6 +84,7 @@ metaflow_extensions/outerbounds/plugins/ollama/ollama.py,sha256=C-6Hz8OxsJiB14AA
84
84
  metaflow_extensions/outerbounds/plugins/ollama/status_card.py,sha256=F5e4McDl28lhtjeUyInkl03bqjr1lgLxWoau8Q9xwBE,10994
85
85
  metaflow_extensions/outerbounds/plugins/profilers/deco_injector.py,sha256=oI_C3c64XBm7n88FILqHwn-Nnc5DeT_68I67lM9rXaI,2434
86
86
  metaflow_extensions/outerbounds/plugins/profilers/gpu_profile_decorator.py,sha256=gDHQ2sMIp4NuZSzUspbSd8RGdFAoO5mgZAyFcZ2a51Y,2619
87
+ metaflow_extensions/outerbounds/plugins/profilers/simple_card_decorator.py,sha256=4W9tLGCmkFx-4XYLa1xF6qMiaWOBYYFx_RclZDKej30,3259
87
88
  metaflow_extensions/outerbounds/plugins/secrets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
89
  metaflow_extensions/outerbounds/plugins/secrets/secrets.py,sha256=3s98hO_twKkM22tKyDdcUjGQNfYpSXW_jLKISV9ju_U,8433
89
90
  metaflow_extensions/outerbounds/plugins/snowflake/__init__.py,sha256=RG4ixt3jwqcK1_tt0QxLcUbNmf7wWAMnZhBx-ZMGgLk,114
@@ -115,7 +116,7 @@ metaflow_extensions/outerbounds/toplevel/plugins/ollama/__init__.py,sha256=GRSz2
115
116
  metaflow_extensions/outerbounds/toplevel/plugins/snowflake/__init__.py,sha256=LptpH-ziXHrednMYUjIaosS1SXD3sOtF_9_eRqd8SJw,50
116
117
  metaflow_extensions/outerbounds/toplevel/plugins/torchtune/__init__.py,sha256=uTVkdSk3xZ7hEKYfdlyVteWj5KeDwaM1hU9WT-_YKfI,50
117
118
  metaflow_extensions/outerbounds/toplevel/plugins/vllm/__init__.py,sha256=ekcgD3KVydf-a0xMI60P4uy6ePkSEoFHiGnDq1JM940,45
118
- ob_metaflow_extensions-1.2.7rc1.dist-info/METADATA,sha256=uxDptIcQbq__3AinjXnU6P2BfNqpiFAp0yBMQoR8m6k,522
119
- ob_metaflow_extensions-1.2.7rc1.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
120
- ob_metaflow_extensions-1.2.7rc1.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
121
- ob_metaflow_extensions-1.2.7rc1.dist-info/RECORD,,
119
+ ob_metaflow_extensions-1.2.9.dist-info/METADATA,sha256=-i0hbI1ZXbWZmHbP67Kq7ibjnj_sh_m1cEGwvU0ew2w,519
120
+ ob_metaflow_extensions-1.2.9.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
121
+ ob_metaflow_extensions-1.2.9.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
122
+ ob_metaflow_extensions-1.2.9.dist-info/RECORD,,