File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,9 @@ python waiterflow.py run --with myprofiler.my_profile
107
107
108
108
Custom decorators don't require special treatment when [ executing tasks in
109
109
the cloud] ( /scaling/remote-tasks/introduction ) or when [ deploying flows to production] ( /production/introduction ) -
110
- they will get [ packaged automatically by Metaflow] ( /scaling/dependencies#unpacking-a-metaflow-project ) . Try it:
110
+ they will get [ packaged automatically by Metaflow] ( /scaling/dependencies#unpacking-a-metaflow-project ) . You don't
111
+ even need to ` import ` the decorators if you add them with ` --with ` . Try it:
112
+
111
113
```
112
114
python waiterflow.py run --with myprofiler.my_profile --with kubernetes
113
115
```
Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ You can test the effect of the options with `@robust_flow` above. You can see th
122
122
python failflow.py dump RUN_ID/start
123
123
```
124
124
125
+ Note that the same options apply to adding flow-level decorators as well.
126
+
125
127
## Introspecting a flow and applying configs
126
128
127
129
Let's walk through a more advanced mutator that shows how you can
Original file line number Diff line number Diff line change @@ -383,6 +383,15 @@ if __name__ == "__main__":
383
383
Note that when deployed on Argo Workflows, exit hook functions execute as separate
384
384
containers (pods), so they will execute even if steps fail e.g. due to out of memory condition.
385
385
386
+ ### Custom dependencies in exit hooks
387
+
388
+ Since exit hook functions are not steps, you can't use ` @pypi ` or ` @conda ` to manage
389
+ their dependencies.
390
+ Instead, you can provide a custom image in ` options={'image': ...} ` like here:
391
+ ```
392
+ @exit_hook(on_error=[failure_print], options={"image": URL_TO_AN_IMAGE})
393
+ ```
394
+
386
395
## Summary
387
396
388
397
Here is a quick summary of failure handling in Metaflow:
You can’t perform that action at this time.
0 commit comments