gitlab ci: Rework how mirrors are configured#39939
gitlab ci: Rework how mirrors are configured#39939kwryankrattiger merged 1 commit intospack:developfrom
Conversation
|
fyi @kwryankrattiger @zackgalbreath I finally made this PR from the branch I've been using to test fetching from cloudfront in pipelines. I'm still not sure how we bust the cache managed by cloudfront when we:
|
|
For the first point, I agree we need to investigate more. I can imagine some edge cases where it would be problematic and pipelines would fail where a spec hash left existence two weeks earlier, and was reintroduced via a reversion or something on a PR that was depending on the old cached binary. I can't think of a case where it would break develop pipelines though, but maybe you have some ideas. For the second one I am less concerned about the growing mirror case. In the worst case it will schedule redundant jobs and then do nothing when it finds the binary in the cache. It isn't ideal, but it shouldn't break pipelines which I think is the most important. And if we are getting a huge speed bump in fetch times with CF, the cost of extra scheduled jobs may be outweighed. That may be something worth measuring and/or annotating in the database so we can compare how many jobs like that are getting scheduled and how long they are taking to run. It may be that CF causes a significant overhead. In the case where things are removed from the index, I think that follows the first point. |
|
If it's possible to avoid caching at all for certain patterns ( |
badb264 to
096a25b
Compare
096a25b to
67bce3d
Compare
9319c39 to
48a990f
Compare
48a990f to
62e3688
Compare
share/spack/gitlab/cloud_pipelines/configs/multi-src-mirrors.yaml.in
Outdated
Show resolved
Hide resolved
91c7aa9 to
7ca2028
Compare
7ca2028 to
e0e669a
Compare
|
Used an old PR on The proof that it worked is, e.g., here, where you can see that instead of the usual three mirrors you'd expect for a PR pipeline, there's just the one, and it corresponds to the PR-specific version. |
e0e669a to
abb3f89
Compare
|
I did some more testing of the various flavors of pipeline in my side repo, which uncovered a couple of issues I have now fixed.
All those were run with some extra WIP commits to:
|
abb3f89 to
855ebeb
Compare
855ebeb to
6437443
Compare
kwryankrattiger
left a comment
There was a problem hiding this comment.
I still need to verify the stacks have removed the mirror section, but having the old mirror listed also shouldn't hurt anything.
| # TODO: Remove this block in Spack 0.23 | ||
| mirrors_to_check = None | ||
| if remote_mirror_override: | ||
| if deprecated_mirror_config and remote_mirror_override: |
There was a problem hiding this comment.
I am not sure if it makes sense to disable this based on the deprecated_mirror_config flag since it is still a CLI option.
There was a problem hiding this comment.
I don't want to modify the mirror state unless the user didn't use the new approach of adding a mirror named buildcache-destination and instead used that command line option. Did I get that logic wrong?
There was a problem hiding this comment.
The option --buildcache-destination can still be specified without error, even in the new method. I think either this should be an error earlier saying we don't support both, or this specific override method should be allowed even in the new mode.
I didn't comment on the other mirror gymnastics we were doing because those were sort of magic from the outside world perspective.
There was a problem hiding this comment.
Ok, I'm leaning toward an error saying we don't support both at the same time, unless you object.
There was a problem hiding this comment.
That is also my inclination, having both active at the same time feels odd.
6437443 to
5cd8765
Compare
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
5cd8765 to
b614035
Compare
kwryankrattiger
left a comment
There was a problem hiding this comment.
This looks good, thanks @scottwittenburg !
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.
By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.
This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:
- arguments to "spack ci generate":
* --buildcache-destination
* --copy-to
- gitlab configuration options:
* enable-artifacts-buildcache
* temporary-storage-url-prefix
Improve how mirrors are used in gitlab ci, where we have until now thought of them as only a string. This PR aims to catch gitlab ci up to where the rest of spack is, in terms of mirror configuration.
By configuring ci mirrors ahead of time using the proposed mirror templates, and by taking advantage of the expressiveness that spack now has for mirrors, this PR will allow us to easily switch the protocol/url we use for fetching binary dependencies.
This PR also:
temporary storageandartifacts buildcachefunctionality from gitlab pipeline schema.--buildcache-destinationand--copy-tooptions from thespack ci generatecommand.Still TODO:
PIPELINE_MIRROR_TEMPLATEappropriately for "rebuild everything" pipelines (done here)CacheContent: no-cacheheadersdevelopmirror,I think we can write a script to issue cache invalidations for the existing index files, followed immediately by updating the index using theCacheContent: no-cacheheader. Since caching only happens on client requests, we should not have to worry about the PR mirrors as long as we merge buildcache: Tell servers not to cache index or hash #40339 before this.