diff options
author | Scott Wittenburg <scott.wittenburg@kitware.com> | 2022-03-30 18:17:29 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 17:17:29 -0700 |
commit | 685e3d7ae9b968aa429c08a642aba4e718e0b419 (patch) | |
tree | 0486ec86022adb177b7ec60b70c98add0f792fb9 /.gitignore | |
parent | f97be99f2a193d23435f7a8511a471f2a781cfa5 (diff) | |
download | spack-685e3d7ae9b968aa429c08a642aba4e718e0b419.tar.gz spack-685e3d7ae9b968aa429c08a642aba4e718e0b419.tar.bz2 spack-685e3d7ae9b968aa429c08a642aba4e718e0b419.tar.xz spack-685e3d7ae9b968aa429c08a642aba4e718e0b419.zip |
spack ci: filter untouched pkgs from PR pipelines (#29697)
We've previously generated CI pipelines for PRs, and they rebuild any packages that don't have
a binary in an existing build cache. The assumption we were making was that ALL prior merged
builds would be in cache, but due to the way we do security in the pipeline, they aren't. `develop`
pipelines can take a while to catch up with the latest PRs, and while it does that, there may be a
bunch of redundant builds on PRs that duplicate things being rebuilt on `develop`. Until we can
do better caching of PR builds, we'll have this problem.
We can do better in PRs, though, by *only* rebuilding things in the CI environment that are actually
touched by the PR. This change computes exactly what packages are changed by a PR branch and
*only* includes those packages' dependents and dependencies in the generated pipeline. Other
as-yet unbuilt packages are pruned from CI for the PR.
For `develop` pipelines, we still want to build everything to ensure that the stack works, and to ensure
that `develop` catches up with PRs. This is especially true since we do not do rebuilds for *every* commit
on `develop` -- just the most recent one after each `develop` pipeline finishes. Since we skip around,
we may end up missing builds unless we ensure that we rebuild everything.
We differentiate between `develop` and PR pipelines in `.gitlab-ci.yml` by setting
`SPACK_PRUNE_UNTOUCHED` for PRs. `develop` will still have the old behavior.
- [x] Add `SPACK_PRUNE_UNTOUCHED` variable to `spack ci`
- [x] Refactor `spack pkg` command by moving historical package checking logic to `spack.repo`
- [x] Implement pruning logic in `spack ci` to remove untouched packages
- [x] add tests
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions