-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Synchronized env update for install #14621
Synchronized env update for install #14621
Conversation
…t; this removes the db read tx entirely for the env update since it doesn't help much
…ifficult because unlike Environment.install it doesn't concretize anything or otherwise change the underlying .lock/.yaml file)
@tldahlgren @tgamblin this is a work in progress. I expect it will be improved by the end of today. It should be usable now (at least for making #13100 work with environments) |
…g a write transaction; refactor redundant logic between _install and install_all
…logic that re-reads the environment's state from the filesystem for the transaction
… written before the package is actually installed now
…reate a deadlock for multiple processes trying to install at the same time
…ns along with 'spack install' will not result in an inconsistent state
Closing/reopening to redo python version check |
…ocking when all specs are already installed
def install_all(self, args=None): | ||
"""Install all concretized specs in an environment. | ||
|
||
Note: this does not regenerate the views for the environment; | ||
that needs to be done separately with a call to write(). | ||
|
||
""" | ||
|
||
# If "spack install" is invoked repeatedly for a large environment |
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.
Glad to see this comment.
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.
Overall this looks fine to me though I think it would be better, in install_all
, to save off and only process (in the second loop) the uninstalled specs.
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 looks good! I have a few questions and comments but I think it's pretty close.
…mpts to install specs that it found were uninstalled
@tgamblin @tldahlgren docstrings are added and the other requests are now addressed at this point too IMO |
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.
@scheibelp: one more request: I think that uninstall
also needs a write transaction around the parts that update the environment. Can you add that?
On second thought, let's do uninstall in a separate PR. @scheibelp: can you follow up with that? |
Yes: I was looking into taking care of that and I'll open up a PR for it by mid-day tomorrow (1/29) |
@scheibelp: thanks! |
@tldahlgren: FYI, this is merged |
Great! I'll do another update after I test a change I just made. |
Just pushed the merge. |
This is a minimal set of edits to get parallel installs as implemented in #13100 working with environments.
What it currently does:
Environment.write_transaction
Environment.write_transaction
incmd.install
(UPDATE: now passing)
One test is currently failing, which I think is an issue with the testing framwork vs. the actual logic (since I cannot manually reproduce the error when manually running through commands executed in the test).TODOs
spack add
,spack rm
etc.; this isn't strictly necessary for correcting parallel Spack installs but it should be done (perhaps later)Database.write_transaction
toEnvironment.write_transaction
, which would include re-reading the environment (this would possibly allow moving the transaction logic fromcmd.install
toEnvironment