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

Synchronized env update for install #14621

Merged

Conversation

scheibelp
Copy link
Member

@scheibelp scheibelp commented Jan 24, 2020

This is a minimal set of edits to get parallel installs as implemented in #13100 working with environments.

What it currently does:

  • adds a lock file for an environment that is stored in the environment directory
  • adds Environment.write_transaction
  • makes use of Environment.write_transaction in cmd.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

  • fix the test
  • (lower priority) synchronize other actions like spack add, spack rm etc.; this isn't strictly necessary for correcting parallel Spack installs but it should be done (perhaps later)
  • introduce similar logic to Database.write_transaction to Environment.write_transaction, which would include re-reading the environment (this would possibly allow moving the transaction logic from cmd.install to Environment

…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)
@scheibelp
Copy link
Member Author

@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)

@scheibelp scheibelp added the WIP label Jan 24, 2020
…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
@scheibelp
Copy link
Member Author

Closing/reopening to redo python version check

@scheibelp scheibelp closed this Jan 24, 2020
@scheibelp scheibelp reopened this Jan 24, 2020
@scheibelp scheibelp closed this Jan 25, 2020
@scheibelp scheibelp reopened this Jan 25, 2020
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
Copy link
Contributor

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.

Copy link
Contributor

@tldahlgren tldahlgren left a 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.

Copy link
Member

@tgamblin tgamblin left a 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.

lib/spack/spack/environment.py Outdated Show resolved Hide resolved
lib/spack/spack/environment.py Outdated Show resolved Hide resolved
lib/spack/spack/environment.py Outdated Show resolved Hide resolved
lib/spack/spack/environment.py Show resolved Hide resolved
lib/spack/spack/cmd/install.py Outdated Show resolved Hide resolved
lib/spack/spack/cmd/install.py Show resolved Hide resolved
lib/spack/spack/environment.py Outdated Show resolved Hide resolved
@scheibelp
Copy link
Member Author

@tgamblin @tldahlgren docstrings are added and the other requests are now addressed at this point too IMO

Copy link
Member

@tgamblin tgamblin left a 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?

@tgamblin
Copy link
Member

On second thought, let's do uninstall in a separate PR. @scheibelp: can you follow up with that?

@tgamblin tgamblin merged commit 69feea2 into spack:develop Jan 29, 2020
@scheibelp
Copy link
Member Author

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)

@tgamblin
Copy link
Member

@scheibelp: thanks!

@tgamblin
Copy link
Member

@tldahlgren: FYI, this is merged

@tldahlgren
Copy link
Contributor

@tldahlgren: FYI, this is merged

Great! I'll do another update after I test a change I just made.

@tldahlgren
Copy link
Contributor

@tldahlgren: FYI, this is merged

Great! I'll do another update after I test a change I just made.

Just pushed the merge.

@tldahlgren tldahlgren mentioned this pull request Jan 29, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants