-
Notifications
You must be signed in to change notification settings - Fork 192
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
Make sure that AutoGroups work correctly also when concurrent processes are executed #3650
Make sure that AutoGroups work correctly also when concurrent processes are executed #3650
Conversation
I would suggest not to squash the two commits - I am not 100% sure if the first, alone, would pass all tests, but the changes are splitted in two logical units. If this is an issue, ok to squash, but then please keep both commit messages as they contain relevant information. |
In particular: - deprecated use of 'group-name' in favour of 'group-label' both in the internal API of AutoGroups and in the CLI parameters of `verdi run` - Improved the Autogroup implementation and API - add various tests of the functionality of autogroups - fixed the CLI parameters to include/exclude groups, that were badly broken (and untested). Now it accepts any entrypoint string (before it was accepting the first part of an node_type string). Also added click validation of the parameters. - fixed the --group flag to activate/deactivate autogrouping (it was wrongly defined and thus always True) - linter fixes
8bea787
to
aeded55
Compare
I've rebased this, so it's ready to review (hoping the tests didn't break in the meantime...). @ramirezfranciscof do you want to go through this (together, or alone)? Also, @sphuber, looking back I realised that I improved the performance of storing nodes. Also, let me reiterate the comment on not squashing, if possible. |
aeded55
to
825521f
Compare
Codecov Report
@@ Coverage Diff @@
## develop #3650 +/- ##
===========================================
+ Coverage 77.18% 78.00% +0.82%
===========================================
Files 457 457
Lines 33795 33830 +35
===========================================
+ Hits 26084 26390 +306
+ Misses 7711 7440 -271
Continue to review full report at Codecov.
|
0264ff7
to
5d9120a
Compare
Sorry, it's taking a bit longer than expected as I found a new unexpected problem in the tests for backwards-migrations. |
Maybe related to the pre-commit and migration issues encountered in #3738? |
5d9120a
to
972efcd
Compare
Most probably - let me fix it here (actually it's now fixed, I'm just fixing another hopefully final pylint complaint, that BTW I see was also addressed in #3738. I've already force-pushed, if it works I'd suggest to merge this first. BTW, I hate when you fix all problems and then prospector starts complaining of something new... ;-) |
@sphuber @ramirezfranciscof this is ready for review, and @ltalirz this should also fix the migration test problem (or at least I fixed a problem in the same place you saw problems in #3738) |
Before I start reviewing, @giovannipizzi I am afraid you may have made a mistake in your rebasing. You now have two commits, but both with the same commit message |
Oh no... how was the reflog trick to get back old commit messages? Anybody knows? |
Never mind, I think I found it. I'll force-push with the correct message. |
This also remove an overzelous isinstance check, and moves additional checks in a cached function that is run only when storing the very first node (that needs to be put in an autogroup), making storing of nodes faster (even if times oscillates so it's hard to estimate exactly by how much). Also, added logic to allow for concurrent creation of multiple groups (and test). This fixes aiidateam#997
972efcd
to
43d852e
Compare
Ok @sphuber I fixed the commit message. |
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.
Thanks @giovannipizzi . Have some comments, maybe easiest to discuss in person on skype/zoom?
Addressed all comments in a new commit. Let's see how many rounds of testing I'll need to do this time... |
You should be able to run the docs and pre-commit also locally. For docs |
Yes, thanks. For the pre-commit, the problem is that if I check only the problematic files, I get no error... (with I could run
I'll fix this (and I already fixed something similar earlier) but it's just very confusing. BTW, a third test (sqlalchemy, py3.5) failed because it couldn't upload to codecov... Did anybody already see it? Mentioning @csadorf for info |
In particular, the most important changes include: - now the auto-group flag is called `--auto-group`, is a flag and is False by default - only kept `--include` and `--exclude` options, checking typestrings and allowing to end with `%`. One benefit is that while reimplementing I replaced some `isinstance` with string comparisons, with potential further benefits. - `--include` and `--exclude` are now mutually exclusive - improved documentation of the main point of the issue
3ac609e
to
ba4b217
Compare
This I have also already seen multiple times. For me was also py3.5 but probably just coincidence. Seems like a transient connection problem. Would be nice if this could be couched in a retry or if it could not fail the test. But then again, the coverage probably depends on it. |
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.
Thanks Gio. Unfortunately I still have some questions. Happy to discuss in person
Most notable: now the % sign can be anywhere in the string of included or excluded classes, and not only at the end.
All comments addressed and tests pass. |
This PR is cursed ;-) Fixed the problems after the merge, now ready to be merged! |
Let the curse be gone! Thanks @giovannipizzi ! |
If many
verdi run
processes were run at the same time, there were cases in which the automatic group name generated by the AutoGroup was conflicting, resulting in IntegrityErrors from the database.This issue fixes this problem by automatically generating a new name until this is unique.
Moreover, many bugs and issues found while addressing this issue are solved.
Fixes #997