Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bonsai --export-image can block due to failures from restoring the environment #2096

Closed
PathogenDavid opened this issue Jan 8, 2025 · 4 comments · Fixed by #2124
Closed
Labels
bug Something isn't working

Comments

@PathogenDavid
Copy link
Member

This happens when generating documentation of bonsai-rx/machinelearning@789b1b8

Bonsai shows the NuGet restore dialog with an error and blocks waiting for the user to interact with the UI to dismiss the error.

This isn't good or useful in a command line context. In a CI context, it causes the run to hang since there's no interactive user to even see the dialog.

The error is printed to the terminal already, which is all that's really needed in a context where Bonsai is being run from a script (which is what --export-image is for.)

@PathogenDavid PathogenDavid added the bug Something isn't working label Jan 8, 2025
@PathogenDavid PathogenDavid changed the title Bonsai --export-image can blocks due to failures from restoring the environment Bonsai --export-image can block due to failures from restoring the environment Jan 15, 2025
@glopesdev
Copy link
Member

glopesdev commented Feb 3, 2025

@PathogenDavid thanks, this was indeed a problem, just submitted a fix.

In the meantime the workaround is to use --export-image --no-editor if you want to avoid launching the editor; or if you want to disable package restore entirely you can also use --export-image --no-boot.

@PathogenDavid
Copy link
Member Author

PathogenDavid commented Feb 3, 2025

Ah, makes sense.

What's the overhead of package restore when everything is already restored? (On second thought it's definitely pretty low, the below thoughts might still be nice for failing early but yeah unlikely for this reason.)

IIRC Bonsai.ML was using one Bonsai environment per example, but is that what we're recommending/what is common? I wonder if it'd make sense for CI to restore the example environment(s) in a separate step before docfx generates the SVGs. Maybe probably not worth it though, just a thought.

@glopesdev
Copy link
Member

IIRC Bonsai.ML was using one Bonsai environment per example, but is that what we're recommending/what is common?

I remember discussing this with @ncguilbeault when it started, and I think the main argument was to make each example fully self-contained, i.e. have an environment where only the ML packages which are needed to run that example are included. I think conceptually that rationale still makes sense, but maybe the implementation could be improved to make it less likely that we forget to update versions on specific examples.

Maybe we should move this discussion to a separate issue over at machinelearning, there are some ideas we could discuss for this.

@glopesdev
Copy link
Member

What's the overhead of package restore when everything is already restored?

There is very little overhead of the restore itself, but for completion, one effect of the --no-boot flag is that it will not spawn child processes, which could be handy for other reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants