Skip to content

buildcache list: add listed specs to database as not installed#19085

Closed
becker33 wants to merge 4 commits intodevelopfrom
features/add-buildcache-list-to-database
Closed

buildcache list: add listed specs to database as not installed#19085
becker33 wants to merge 4 commits intodevelopfrom
features/add-buildcache-list-to-database

Conversation

@becker33
Copy link
Copy Markdown
Member

This allows the following worflow

spack buildcache list -l  # note hash for desired package is abcdefg
spack install --cache-only /abcdefg

Included work: Database.add: allow packages to be added without being marked installed

Database.add: allow packages to be added without being marked installed
@@ -1115,7 +1114,7 @@ def _add(

else:
# If it is already there, mark it as installed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment with new behaviour

@eugeneswalker
Copy link
Copy Markdown
Contributor

eugeneswalker commented Oct 4, 2020

How does this work if the cache has 22,000+ entries? Does adding this many entries create a problem?

@eugeneswalker
Copy link
Copy Markdown
Contributor

eugeneswalker commented Oct 14, 2020

I'm using this branch to run spack buildcache list -l on our cache of 23k+ packages right now. The command has been running for more than 2 hours.... I will post final runtime and size information after it completes.

@becker33
Copy link
Copy Markdown
Member Author

@eugeneswalker we could improve the performance of that command by doing a single write transaction with all of the specs to add, I'm more worried about the performance of spack find after you finish that command. I think that's where we'll really learn whether this is feasible, since that's just a single read, see if the database is too big for good performance.

@tgamblin
Copy link
Copy Markdown
Member

I don't think the DB will necessarily be too big after this -- we already read the buildcache after buildcache list and that operation is pretty fast. I'm guessing (maybe many) seconds for a spack find if we do one write transaction.

@eugeneswalker
Copy link
Copy Markdown
Contributor

eugeneswalker commented Oct 14, 2020

spack buildcache list -l finished in 172 minutes

I ran it with debug output turned on. This was part of the final debug output:

$> time spack buildcache list -l
...
==> [2020-10-14-15:58:36.762000] 0 cached builds.
==> [2020-10-14-15:58:36.762128] You can query all available architectures with:
  spack buildcache list --allarch

real	172m39.813s
user	168m31.895s
sys	1m51.269s

I feel like something is off. 0 cached builds ??? What do you think?

$> time spack find
==> 15 installed packages
-- linux-rhel7-sandybridge / [email protected] --------------------------
[email protected]  [email protected]   [email protected]          [email protected]  [email protected]             [email protected]  [email protected]
[email protected]   [email protected]  [email protected]  [email protected]   [email protected]  rdma-core@20          [email protected]

-- linux-ubuntu18.04-ppc64le / [email protected] ------------------------
[email protected]

real	0m9.906s
user	0m7.470s
sys	0m0.475s

@becker33
Copy link
Copy Markdown
Member Author

@eugeneswalker were any of the builds in the cache for the same architecture as the machine you ran it on? You could use the --allarch option to see them all, that would be my guess.

I've also pushed a commit that should improve the performance some. Can you run a time spack buildcache list -l again and see how long that takes? Or can you slack me the url for the mirror you're using and I can try this out? I'll also want to compare to timing on develop, so it might be easier if I don't have to bother you every time I change something.

cosmicexplorer pushed a commit to cosmicexplorer/spack that referenced this pull request Feb 8, 2021
cosmicexplorer pushed a commit to cosmicexplorer/spack that referenced this pull request Feb 8, 2021
cosmicexplorer pushed a commit to cosmicexplorer/spack that referenced this pull request Feb 11, 2021
cosmicexplorer pushed a commit to cosmicexplorer/spack that referenced this pull request Feb 11, 2021
cosmicexplorer pushed a commit to cosmicexplorer/spack that referenced this pull request Feb 11, 2021
cosmicexplorer pushed a commit to cosmicexplorer/spack that referenced this pull request Feb 11, 2021
@becker33
Copy link
Copy Markdown
Member Author

Closing: we decided to solve this problem with a hash cache rather than adding to the database, because of scalability concerns with the json database.

@becker33 becker33 closed this Jul 22, 2021
@haampie haampie deleted the features/add-buildcache-list-to-database branch August 2, 2022 09:52
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.

5 participants