outerbounds / metaflow-card-notebook

Render Jupyter Notebooks With Metaflow Cards
Apache License 2.0
24 stars 3 forks source link

Notebook Key Interrupted Error #7

Open mustfkeskin opened 1 year ago

mustfkeskin commented 1 year ago

Hello

This is my simple flow I want to run my notebook first 5-6 cell work correctly But last few cell always get KeyboardInterrupt: error My flow dont throw any exception But when i enter [_rendered_1679995435861952_end_2_model_examle.ipynb] i saw the error

What could be wrong here

Flow Output

2023-03-28 12:23:55.865 Workflow starting (run-id 1679995435861952):
2023-03-28 12:23:55.875 [1679995435861952/start/1 (pid 8060)] Task is starting.
2023-03-28 12:23:56.722 [1679995435861952/start/1 (pid 8060)] Start
2023-03-28 12:23:56.861 [1679995435861952/start/1 (pid 8060)] Task finished successfully.
2023-03-28 12:23:56.871 [1679995435861952/end/2 (pid 8161)] Task is starting.
2023-03-28 12:24:45.329 [1679995435861952/end/2 (pid 8161)] Task finished successfully.
2023-03-28 12:24:45.330 Done!

My Flow

from metaflow import FlowSpec, step, current, Parameter, card, resources

class LinearFlow(FlowSpec):

    @step
    def start(self):
        print("Start")
        self.next(self.end)

    @card(type='notebook')
    @step
    def end(self):
        self.nb_options_dict = dict(input_path='../notebooks/model_examle.ipynb')

if __name__ == '__main__':
    LinearFlow()
JonathanBroadbent commented 7 months ago

Hi,

I have the same issue. Has anyone found a fix for it yet?

For more information when I run the rendered notebook it works fine, its only during the metaflow card execution that i receive a Keyboard Interrupt: error with no other information

mustfkeskin commented 7 months ago

I solved this by running runs with the papermill library. Metaflow also uses this in the background, but it timeouts. Since I couldn't find timeout parameter, I ignored metaflow for now.

JonathanBroadbent commented 7 months ago

Thanks for the information. Can you describe to me a bit more?

How do you use the papermill library? Are you still including your notebooks in the metaflow UI or did you abandon metaflow completely?

valayDave commented 6 months ago

you can set timeout in the @card decorator to set timeouts for longer execution of the notebook.