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
Improve robustness of PipInstall
plugin
#7111
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
57f8f62
Improve robustness of PipInstall plugin
hendrikmakait 37eee2e
Explicit
hendrikmakait 549c902
Raise RuntimeError
hendrikmakait 74f71c5
pytest.raises
hendrikmakait a34cf10
Test PipInstall restarting Nanny
hendrikmakait 8f0fb85
Test that failing does not restart
hendrikmakait d34c5c9
Code review suggestion
hendrikmakait File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the
worker.id
instead. I think that there is a 1to1 relationship between PipInstallPlugin and Worker instances but either way, the uniqueness property should link to the worker, shouldn't ti?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ID is unique per
PipInstall
instance. It's mainly there to avoid conflicts between multiplePipInstall
plugins all trying to install a bunch of packages on the worker.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
PipInstall._compose_{installed|restarted}_key()
for the namespacing. We achieve the uniqueness per worker ofPipInstall._compose_restarted_key()
usingworker.nanny
, which should be the correct key, but we may want to add thepid
to that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worker.nanny is not perfect but I believe good enough. I don't think we have the PID of the nanny and I don't think this is necessary. Let's not overdo it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL: We teardown plugins that are overwritten which allows us to nicely remove their metadata. We can register also plugins to custom names ignoring their name attribute. However, we do not tell those plugins the name they are registered by. For
PipInstall
plugins,plugin.name
will remainpip
. We also do not pass that information on setup or teardown. Otherwise, we would be able to drop the ID and just use their name.