Conversation
…es the DB of the upstream installation to check if a package is installed
…cally-installed specs vs. upstream specs
This comment has been minimized.
This comment has been minimized.
|
I thought I'd add an example of how you edit config.yaml to include upstream instances but that interferes with doc generation and testing so I'll add an example here: UPDATED 12/12: upstream configuration has been moved to its own config file called (OLD) UPDATED 11/21: (OLD) UPDATED 8/23: specification of (OLD) UPDATED 8/10: originally the upstream installations config variable was list of Spack install directories. Now it is a dictionary of Spack binary to installation directory. The binary is needed to compute module file locations for upstream Spack instances. It is not strictly required to specify the install directory along with the Spack binary for current versions of Spack, since you could have Spack print out the install location. That being said I don't know how far back this support goes, and in general I don't want to invoke several instances of Spack each time I construct the Spack database. OLD:
|
|
Hello, I've tested this feature with two installations of spack and two packages, installation 1 with package A and installation 2 with package B -> A and I can confirm that in the second installation spack will only build package B. However I have a case where I point spack to a directory with many pre-built packages and then try to build package C which depends on all of those. Spack will proceed to install every dependency of C again. I am not sure why I get this in the second scenario and I wanted to point it out and that there may be something that is still missing from this feature. |
|
Hi @paul-chelarescu, as a sanity check: did you confirm that If the dependency hashes do match (i.e. they exist in the upstream DB and aren't being used) would it be possible to attach the package.py files for I'll have a chance to experiment with this on 7/30 |
|
How hard is it to set up a real test suite implementation of something like this? Obviously, there is a fairly complicated setup required. I haven’t looked into the detail of the test suite at all. I would have created tests like this in my original pull request if I had known how to do it and/or found the time to figure it out.
—Jim
------------------------
James Amundson
Head, Scientific Software Infrastructure Department
Scientific Computing Division, Fermilab
+1 (630) 840-2430
On Jul 25, 2018, at 10:38 PM, scheibelp <[email protected]<mailto:[email protected]>> wrote:
Hi @paul-chelarescu<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_paul-2Dchelarescu&d=DwMFaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=CHBGEtgcObTpDl5qHRk9ayaogsrDBgoaB4wksjoxIZ0&m=eiVF9DLNGWhzCriWTcs7rSvlcfzvTkPB7HBQTO3XEK8&s=-5lGrxzLrS5LDa636Vm7nY3HOs-OrtDvSe_VjFhe_mg&e=>, as a sanity check: did you confirm that C depended on the exact same instance of B and A (i.e. that the dependency hashes were the same)? I think spack spec gives you an option to output the DAG hash (apologies but I'm not in a spot to run spack spec --help to make sure of that right now).
If the dependency hashes do match (i.e. they exist in the upstream DB and aren't being used) would it be possible to attach the package.py files for A/B/C? I've had luck for at least one case of A->B->C, namely sqlite, where all of it's dependencies were installed upstream (so perhaps it is clear how your case differs from sqlite and you can just mention that vs. including the package.py files).
I'll have a chance to experiment with this on 7/30
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_spack_spack_pull_8772-23issuecomment-2D407966295&d=DwMFaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=CHBGEtgcObTpDl5qHRk9ayaogsrDBgoaB4wksjoxIZ0&m=eiVF9DLNGWhzCriWTcs7rSvlcfzvTkPB7HBQTO3XEK8&s=eOr_ue8edxit6sfotwG1u1xhiCKpLLkmdcFPKhdY2nc&e=>, or mute the thread<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAIi0b9Av33398Mzh4YY0D9ek1EAMTNAks5uKTmzgaJpZM4VZc2g&d=DwMFaQ&c=gRgGjJ3BkIsb5y6s49QqsA&r=CHBGEtgcObTpDl5qHRk9ayaogsrDBgoaB4wksjoxIZ0&m=eiVF9DLNGWhzCriWTcs7rSvlcfzvTkPB7HBQTO3XEK8&s=thffE8tx1ezmHG-BkeA3o9TxlloPayqwLC29jReBj3c&e=>.
|
I anticipate it will be somewhat challenging but I should be able to sort it out by the end of this week. I think either mock packages provided for Spack testing (which makes it easy to create dependency DAGs) or the mock testing repository (which includes packages which actually install) will be useful. More details on that soon. |
|
@scheibelp I think I have a better clue why C was installing every dependency again, the .spack-db in the upstream was created using an older version of spack (tags/v0.11.0). There are None objects After your last commit which looks at the spec hash, spack will correctly link against a few of the packages there, but there are some which will fail because of the differences in the database versions. I will try to make another upstream installation with a newer version of spack, but this points out at least that this method is not backwards compatible with older versions of spack installations. |
…r packages marked as being installed upstream
…lled in an upstream db
|
I've now added tests to check the following:
I'm going to update the PR description with remaining issues.
Thanks for testing that! I have not checked what happens when using a different DB version. Minimally I should add an explicit check to assert that the upstream DB is the same version (vs. failing silently). |
…pstream DBs (the error message for this should never be seen by an end user, only of there is an internal Spack error)
…ns are attempted on an upstream DB
fb31880 to
e643681
Compare
|
@scheibelp I have generated another spack installation in my upstream using a newer version of spack (commit c79cd5f) and ran this feature locally pointing at it. Every package is correctly flagged as being installed upstream, except for one of them: I am trying to investigate the differences between the local installation of this package, which I have been able to link against, and this one above installed upstream which is failing. There are differences between the two index.json databases but it is not clear to me why and what difference exactly is causing this instance to pick up a Edit: Edit2: |
…ernal_path' to get path of upstream externals
becker33
left a comment
There was a problem hiding this comment.
@scheibelp one point in addition to the tests we've discussed.
lib/spack/spack/directory_layout.py
Outdated
| def metadata_path(self, spec): | ||
| return os.path.join(self.path_for_spec(spec), self.metadata_dir) | ||
| if self.check_upstream and spec.package.installed_upstream: | ||
| # TODO: This assumes that older spack versions use the same |
There was a problem hiding this comment.
The metadata dir is configurable on the YamlDirectoryLayout object. I think we should remove that option (no code appears to use it) as part of this PR since we depend on it not being used in the future.
…(not just for upstream installs); add a test for querying a downstream DB when a package is installed in both the upstream and downstream DB
…mlDirectoryLayout
…s; this follows several other hardcoded variables which must be consistent between upstream and downstream DBs. Also update DirectoryLayout.metadata_path to work entirely with Spec.prefix, since Spec.prefix is set from the DB when available (so metadata_path was duplicating that logic)
…nto features/chain-limited
|
#8772 (comment) and #8772 (comment) are now addressed. Also, note that 5c4330b is addressed by beb9a31. I decided as part of this that YamlDirectoryLayout should defer entirely to Spec.prefix when constructing the metadata path, which meant a test in |
|
I'm really excited to see this merged and I am ready to try it again. I know the yaml files changed format several times during the development process. Is there an official documentation location yet? I didn't see anything about |
|
@scheibelp I want to try this out, is any documentation available? |
not in the actual docs, it is all here for now (the PR description and #8772 (comment)). Although docs are definitely worth adding and I can add a PR for something official in the next few days. |
Add documentation for the Spack chain feature added in #8772
#11152 added documentation for #8772 but some details were based on an earlier implementation that had changed by the time #8772 was merged. In particular, #11152 mentioned that upstream Spack instances were configured in config.yaml, when in fact they should be placed in a separate upstreams.yaml config file; this PR updates the documentation accordingly.
@gartung @paul-chelarescu @amundson
See also: #8545
This attempts to connect a local Spack instance to another "upstream" instance, exactly like #8545 (and uses many ideas from it). To use this, see #8772 (comment)
The primary goal of this PR, quoting from #8772 (comment):
The implementation differs from #8545: it tries to interact only with the upstream database, and otherwise avoids parsing upstream config files with the local Spack instance. For example it does not maintain a
parent_layoutanalogous toparent_db: it assigns Spec prefixes based on the paths stored in install records and avoids all interactions with the directory layouts of upstream Spack instances.Similarly, this PR adds a capability for upstream Spack instances to generate a module index file that associates installed packages with their generated module files. This is used for
spack module tcl findetc. to locate module files. I think this approach will be more resilient to version drift between a local/upstream spack instance. Currently, the module file index is implicitly generated when doing e.g.spack module tcl refresh.(EDIT 11/21: originally the plan to handle module files for upstream packages was to invoke the upstream Spack binary to locate them but that ended up being problematic outside of environment setup scripts. The module indices now correctly locate upstream module files for Spack commands, but do not currently handle autoloading module file generation schemes)
This PR also tries to be careful about not writing any files to upstream database, including:
TODOs (updated 9/7):
spack uninstall -ato uninstall all specs from the local Spack instance (but not attempt to uninstall any upstream Spack installs)cshenvironment script to retrieve modules from upstream Spack instances in the same mannersetup-env.shspack find)update(UPDATE) there is not actually sufficient information available for the downstream instance to handle this: Without extra information added tospack reindexto setpathonInstallRecords so that upstream-installed externals can be used for older Spack instancesInstallRecord, the downstream Spack instance would need to examine the configuration files of the upstream instance to find the externals (which this PR avoids). This PR adds the external path to theInstallRecord, so the external package is available; external packages "look the same as" Spack-installed packages from the perspective of a downstream Spack instance.