Conversation
98f9ffe to
2f49576
Compare
|
@scottwittenburg do you consider this complete? At FNAL we have been thinking about how to handle release builds. |
|
Nevermind. I see this is labeled WIP. |
|
@gartung I don't think it's necessarily precisely what we want yet, but I think we'd like to get something merged and then iterate on it from there. I think this version is pretty close to something we could merge though. Maybe you could take a look and provide your thoughts? Let me know if you have questions or want something clarified. Pinging @tgamblin as he'll probably be interested in your thoughts as well. |
|
The idea of spec sets is appealing. We need the ability to specify a preferred set of package versions that may not be the latest. Would the spec set package versions be used in concretization? |
|
@gartung Yes, the Down the road I think @tgamblin would like to avoid needing to concretize each spec in a specific container in order to generate the Hopefully I answered your question, but let me know if something is unclear. |
|
Have you considered the case where you want to specify variants and compiler flags in the spec-set as well? |
|
Yes, we've talked about that, and would like to get there eventually, but there's no support for it here yet. |
|
The only way you can enforce the version, variants and flags is to manage spack/etc/spack/packages.yaml. This was problematic with different release having a different packages.yaml from the current one. The environments feature helps with this because it preserves a snapshot of the concretization. |
2f49576 to
53f4c89
Compare
|
I have determined that the buildcache creation with placeholder rpaths is bugged. The original install path is supposed to be replaced with a placeholder in the rpath list. Instead the path with the placeholder is added to the rpath list. This is why the allow root flag always has to be provided. |
|
I take that back. The bug appears to be checking the first path in rpaths for the placeholder string. This turns out to be the compiler path for c++ libraries. |
|
See #10287 for a fix to the problem I described. |
|
@gartung: have you seen the new environments support? We have some features in the pipeline that will build on it for better spec sets -- particularly for combinatorial builds. Maybe we should chat Thursday about the work we are doing on Spack Stacks, which will basically be combinatorial environments -- "instances" of combinatorial deployments. Look at https://github.com/spack/spack/projects/7. Stacks will likely to be a good long-term way to specify a release and they'll be implemented using some of this. |
|
I've filed omega-h issue at #10291 |
|
ping @opadron |
|
ping @aashish24 |
89375e7 to
527e9ce
Compare
|
@tgamblin I have removed the |
|
I'm not sure why github is still showing the file in the diff... nevermind it's gone. |
|
No, I don't think you're missing anything. At the moment we're thinking we'll have another small PR once this one is merged and do a few things all at once at that time (add that "pointer" Take a look at this branch on my fork to see an example of what that "pointer" Let me know what you think. Or if my explanation wasn't very clear. |
scheibelp
left a comment
There was a problem hiding this comment.
I have
- a couple of suggestions for the future (and also checking if I'm in sync)
- some documentation requests
| saveyaml.add_argument( | ||
| '-r', '--root-spec', default=None, | ||
| help='Root spec of dependent spec') | ||
| saveyaml.add_argument( |
There was a problem hiding this comment.
IMO this would make sense to move to spack spec. Since a follow-up PR is planned, I think this could be handled there. I'm curious if you agree.
There was a problem hiding this comment.
Just to be sure I understand you: you're suggesting it should be a subcommand in lib/spack/spack/cmd/spec.py? Hmmm, yeah, I do agree with you if that's the case. I probably should have thought of that when you asked me to move the actual functionality that implements the command into the spack.spec module. Suddenly it looks a little out of place here.
There was a problem hiding this comment.
But yes, let's hold off on this for the next PR.
| spack mirror add remote_binary_mirror ${MIRROR_URL} | ||
|
|
||
| # Now download it | ||
| spack -d buildcache download --spec-yaml "${SPEC_YAML_PATH}" --path "${BUILD_CACHE_DIR}/" --require-cdashid |
There was a problem hiding this comment.
Ideally the spack buildcache command wouldn't have to be aware of CDash. I think this would go hand-in-hand though with extracting CDash-awareness out of spack install (which IIRC you were planning to do later to capture more of the process of creating the tarball).
There was a problem hiding this comment.
So I did remove understanding of CDash from the binary_distribution.py module, as you requested in a previous round of change requests. But at the time I didn't see how to remove it from here without forcing the caller (the user entering the command in the terminal) to understand how the buildcache entry files are named. But maybe it's as simple as just grabbing any files with the same path and prefix as the .spec.yaml file, but in that case, we'd need to download some kind of index of all files in the root of the build_cache directory to know what those were.
I hadn't thought of this as necessarily related to the CDash-awareness of spack install, except at a higher conceptual level. But maybe it is. Though you're not suggesting we re-work the way reporters are hooked into the install process in general, are you?
There was a problem hiding this comment.
Didn't do anything here, as we covered this earlier today in conversation.
|
Thanks for another careful round of review and more thoughtful comments @scheibelp, I should be able to knock these all out before we talk tomorrow. |
e9e4795 to
8f636fd
Compare
- add CombinatorialSpecSet in spack.util.spec_set module.
- class is iterable and encaspulated YAML parsing and validation.
- Adjust YAML format to be more generic
- YAML spec-set format now has a `matrix` section, which can contain
multiple lists of specs, generated different ways. Including:
- specs: a raw list of specs.
- packages: a list of package names and versions
- compilers: a list of compiler names and versions
- All of the elements of `matrix` are dimensions for the build matrix;
we take the cartesian product of these lists of specs to generate a
build matrix. This means we can add things like [^mpich, ^openmpi]
to get builds with different MPI versions. It also means we can
multiply the build matrix out with lots of different parameters.
- Add a schema format for spec-sets
Adds four new sub-commands to the buildcache command: 1. save-yaml: Takes a root spec and a list of dependent spec names, along with a directory in which to save yaml files, and writes out the full spec.yaml for each of the dependent specs. This only needs to concretize the root spec once, then indexes it with the names of the dependent specs. 2. check: Checks a spec (via either an abstract spec or via a full spec.yaml) against remote mirror to see if it needs to be rebuilt. Comparies full_hash stored on remote mirror with full_hash computed locally to determine whether spec needs to be rebuilt. Can also generate list of specs to check against remote mirror by expanding the set of release specs expressed in etc/spack/defaults/release.yaml. 3. get-buildcache-name: Makes it possible to attempt to read directly the spec.yaml file on a remote or local mirror by providing the path where the file should live based on concretizing the spec. 4. download: Downloads all buildcache files associated with a spec on a remote mirror, including any .spack, .spec, and .cdashid files that might exist. Puts the files into the local path provided on the command line, and organizes them in the same hierarchy found on the remote mirror This commit also refactors lib/spack/spack/util/web.py to expose functionality allowing other modules to read data from a url.
The built images are set up with fairly recent versions of gcc and clang: - centos_7: [ [email protected] (built from src), [email protected] (spack-built from src) ] - ubuntu_18.04: [ [email protected] (system), [email protected] (system) ]
This spack command adds a new schema for a file which describes the builder containers available, along with the compilers availabe on each builder. The release-jobs command then generates the .gitlab-ci.yml file by first expanding the release spec set, concretizing each spec (in an appropriate docker container if --this-machine-only argument is not provided on command line), and then combining and staging all the concrete specs as jobs to be run by gitlab.
|
Looks good: thanks! Once you have refactored the commits, let me know and I can browse them and merge this. |
8f636fd to
330c678
Compare
|
Thanks for all the hard work reviewing this beast @scheibelp. I have force-pushed the rewritten history, so have a look at the commit messages when you get a chance. Those will be easy enough for me to update if you want changes. |
|
Thanks! |
|
This error was produced when trying to create a buildcache for [email protected] that was linked against system zlib which has an entry for a version 1.2.7 that does not exists in the zliz package.py |
|
@scottwittenburg it appears to happen while calculating spec.full_hash() |
|
@scheibelp I had a fix for this in my branch at one time, but took it out after some discussion that it was not required anymore. Should I dig it up and create a PR? It was just a guard against using that attribute if it didn't exist. |
|
The fix is trivial. |
|
@gartung Indeed, that's what I had in my branch, but I removed because after discussing it with @scheibelp, it seemed that should not be needed. |
|
It's a weird corner case where the package was built before I have other packages built in another (newer) spack directory where the same [email protected] was used in packages.yaml and packages built against it do not give this error when creating the buildcache. I added this patch to my current buildcache-placeholder-fix branch. We'll see if it passes review. |
Ah, then it makes sense why I seemed to need it in my local testing, but in general it seems like it shouldn't be necessary.
Perhaps a link to this conversation from your current PR would help the reviewer understand why that guard is there. Thanks for this. |
This topic implements several pieces needed to support a release workflow for Spack. Some of the pieces included:
A new Spack command to create a description of packages for Gitlab-CI to build. It defines a gitlab-ci.yml file that would be placed in a repository, such that when Gitlab-CI detects a commit to the branch, it will build the packages mentioned in the description. More details on this new command are provided further down in this PR description ("Details of
release-jobscommand).A build job shell script to be run by Gitlab-CI. The responsibility of this script is to be assigned a spec, determine if the package corresponding to that spec exists and is up-to-date on a configured binary mirror, and if it is not, build the package, create a buildcache for it, and push that buildcache to the binary mirror, communicating with a CDash instance along the way.
Other infrastructure and changes in support of the items above.
The command to generate this
.gitlab-ci.ymlfile looks like this:A summary of the jobs/stages can be printed by the above command if you add the
--print-summarycommand-line argument.One approach to managing the release workflow
To avoid churn in the Spack repository, we plan not to keep the full list of release jobs under source control in a full
.gitlab-ci.ymlfile. Rather, a separate microservice will be capable of generating the bulk of the contents of the.gitlab-ci.ymlon demand, for a given commit or sha.Here is an example of the
.gitlab-ci.ymlthat might be maintained within the Spack repository:Whenever the pipeline is configured to run, the file above would trigger the microservice to checkout the given sha, run the
spack release-jobs ...command on the release spec set, and return the full list of staged jobs to be run.Details of
release-jobscommandThe
release-jobscommand makes use of two new configuration files defined in the repository,etc/spack/defaults/release.yaml(or an arbitrary yaml file following the same schema) and 'share/spack/docker/os-container-mapping.yaml'. First therelease.yamlfile is used to construct aCombinatorialSpecSet, which expands the contents into a list of the entire cross-product of packages/versions/compilers expressed in that file. Next, theos-container-mapping.yamlfile is used to find docker containers with compilers that "satisfy" the specs in the expanded cross-product. Theos-container-mapping.yamlfile is essentially a list of operating systems which each provide animage(the image should exist on DockerHub so it can be pulled by both therelease-jobscommand and the AWS gitlab runners), and a list of available compilers on that image. For any compiler found in one of the containers that satisfies the compiler requirement of a release spec, that spec (with the OS fromos-container-mapping.yamladded to it) is added to a list that will be concretized in the appropriate docker container in order to gather all the specific dependencies of the spec. Then all the resulting specs are combined and staged.For example, given the following
release.yaml:and given this
os-container-mapping.yaml:then the
release-jobscommand will generate the following specs to be built:Note that although the
[email protected]compiler is available in thelinux-ubuntu18.04-x86_64container, no jobs with that compiler were staged because it wasn't listed as a desired compiler in therelease.yaml. Conversely, also note the additional version ofpkgconfwhich will be built, even though it wasn't specifically mentioned in therelease.yaml. This is because that particular version was a dependency of another spec in the spec set.To avoid running the concretization of release specs (and generation of dependencies) in docker containers, the
--this-machine-onlyargument may be passed to therelease-jobscommand. In this case, the current machine will be used for concretization and dependency generation, but for this to work, theos-container-mapping.yamlfile must contain an entry corresponding to `spack.architecture.sys_type().Additional Notes
Currently the Spack Gitlab instance is set up to test branches it finds on my fork (
scottwittenburg/spack), so that will need to be changed before merging this topic will seem to have any effect.This PR replaces both #8451 and #8718.
Before we can merge this, we need to address at least #10141, but there may be other prerequisites as well, hence the
WIPon this PR for the time being.Things currently holding this up:
-fInstalling packages using the -f option does not seem to work #10141