-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version in tool cache is often behind go-versions manifest's latest #73
Comments
Tool cache can be stale in GitHub and self-hosted runners. If supplied `go-version` is a semver range--instead of an explicit version--it will be tried through the version inventory in cache, first. Even though the GitHub local copy or origin distribution may have newer versions matching the passed range, as long as the cache can satisfy the range, the latest version from cache will be used. Introduce an optional input, `version-resolver`. If defined, it tries to resolve the version spec against either GitHub local copy or Go's canonical source of version manifest. If the value of `version-resolver` is: - "manifest": the manifest file under @actions/go-version get used. - "dist": the manifest at https://golang.org/dl/?mode=json&include=all gets used. It can take values Example: -------- - Latest Go Version: 1.15.2 - tool-cache has go1.15 (1.15.0), latest. build.yml: ``` [...] - uses: actions/setup-go@v2 with: go-version: '>=1.5 <2' [...] ``` Although the intention of the user might be to get latest version between "oldest Go 1.15.0, newest--not inclusive--Go 2.0", the cache will match this range with Go 1.15.0. build.yml (v2): ``` [...] - uses: actions/setup-go@v2 with: go-version: '>=1.5 <2' version-resolver: 'manifest' [...] ``` With supplied version resolver, the semver range will be checked against the local GitHub version manifest from @actions/go-versions[1], and match 1.15.2. Cache will be queried with the resolved version, instead of the range. When the cache gets updated globally, next runs will use the tool from the cache, instead of downloading locally or in case of resolver 'dist', directly from Google. [1]: https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json Closes actions#73
Tool cache can be stale in GitHub and self-hosted runners. If supplied `go-version` is a semver range--instead of an explicit version--it will be tried through the version inventory in cache, first. Even though the GitHub local copy or origin distribution may have newer versions matching the passed range, as long as the cache can satisfy the range, the latest version from cache will be used. Introduce an optional input, `version-resolver`. If defined, it tries to resolve the version spec against either GitHub local copy or Go's canonical source of version manifest. If the value of `version-resolver` is: - "manifest": the manifest file under @actions/go-version get used. - "dist": the manifest at https://golang.org/dl/?mode=json&include=all gets used. It can take values Example: -------- - Latest Go Version: 1.15.2 - tool-cache has go1.15 (1.15.0), latest. build.yml: ``` [...] - uses: actions/setup-go@v2 with: go-version: '>=1.5 <2' [...] ``` Although the intention of the user might be to get latest version between "oldest Go 1.15.0, newest--not inclusive--Go 2.0", the cache will match this range with Go 1.15.0. build.yml (v2): ``` [...] - uses: actions/setup-go@v2 with: go-version: '>=1.5 <2' version-resolver: 'manifest' [...] ``` With supplied version resolver, the semver range will be checked against the local GitHub version manifest from @actions/go-versions[1], and match 1.15.2. Cache will be queried with the resolved version, instead of the range. When the cache gets updated globally, next runs will use the tool from the cache, instead of downloading locally or in case of resolver 'dist', directly from Google. [1]: https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json Closes actions#73
Tool cache can be stale in GitHub and self-hosted runners. If supplied `go-version` is a semver range--instead of an explicit version--it will be tried through the version inventory in cache, first. Even though the GitHub local copy or origin distribution may have newer versions matching the passed range, as long as the cache can satisfy the range, the latest version from cache will be used. Introduce an optional input, `version-resolver`. If defined, it tries to resolve the version spec against either GitHub local copy or Go's canonical source of version manifest. If the value of `version-resolver` is: - "manifest": the manifest file under @actions/go-version get used. - "dist": the manifest at https://golang.org/dl/?mode=json&include=all gets used. It can take values Example: -------- - Latest Go Version: 1.15.2 - tool-cache has go1.15 (1.15.0), latest. build.yml: ``` [...] - uses: actions/setup-go@v2 with: go-version: '>=1.5 <2' [...] ``` Although the intention of the user might be to get latest version between "oldest Go 1.15.0, newest--not inclusive--Go 2.0", the cache will match this range with Go 1.15.0. build.yml (v2): ``` [...] - uses: actions/setup-go@v2 with: go-version: '>=1.5 <2' version-resolver: 'manifest' [...] ``` With supplied version resolver, the semver range will be checked against the local GitHub version manifest from @actions/go-versions[1], and match 1.15.2. Cache will be queried with the resolved version, instead of the range. When the cache gets updated globally, next runs will use the tool from the cache, instead of downloading locally or in case of resolver 'dist', directly from Google. [1]: https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json Closes actions#73
we won't be able to use latest version until actions/setup-go#73 is fixed
* adds initial smoke test for RayClusterReconciler * attemps to match latest bug fix go version in ci * set explicit go version in ci we won't be able to use latest version until actions/setup-go#73 is fixed * finishes smoke test for full raycluster create * disables codecov patch testing this isn't very helpful right now but it could be with the proper configuration after we stabilize the project * adds missing /fixes docs * reenables project coverage checks but this time explicitly
Hi, @bdd! Answers to your questions: What cache gets updated by installGoVersion()? Is checking the cache with a version spec intentional? |
For more context, |
Goal: Set minimum required Go version but pick the latest available
For the use case of specifying a lower bound Go version for a project but defaulting to the latest release I'm using this action config fragment:
Down the rabbit hole 🐇
Check tool-cache
setup-go first checks if a matching version Go is in the tool cache. https://github.com/actions/setup-go/blob/main/src/installer.ts#L41
With
ACTIONS_STEP_DEBUG=true
, the relevant part from a build run:(Although the debug looks like it's iterating from oldest version in cache, it actually isn't the behavior. These are
_isExplicitVersion(...)
calls fromfindAllVersions()
in@actions/toolkit/.../tool-cache.ts
https://github.com/actions/toolkit/blob/master/packages/tool-cache/src/tool-cache.ts#L514)
GitHub local Go Versions Manifest
Only if there isn't a matching version in the cache, it proceeds to checking
@actions/go-versions:versions-manifest.json
. A file that seems to be periodically generated, approved by humans in a PR, and gets committed again by a bot.If we check versions-manifest.json, it has Go 1.15.1 in it. On the other hand the cache only has—semver cleaned up—1.15.0.
Can we prime the cache?
To debug this, I tried priming the cache by hardcoding the version and seeing if
installGoVersion()
frominstaller.ts
would actually put this into the cache.It says so:
...but when I revert back to
>=1.5 <2
version spec and run the action again, it continues to match1.5.0
from the tool-cache.Questions
How does /opt/hostedtoolcache get populated?
Seems like only PyPy, Python, Ruby, boost, go, and node are the tools in this directory.
Makes me think this is centrally curated, and not a globally shared cache.
What cache gets updated by
installGoVersion()
?When it calls
tc.cacheDir
on the extracted Go install, what is the effective cache domain for this? Is it global, per project, per user, per run?Is checking the cache with a version spec intentional?
If we don't have an explicit version, setup-go checks the cache with the supplied semver version spec. Is this intentional? Because of this, there's no way to provide a version spec but hope to expect to get the latest version in
go-versions
manifest file, or directly from Google.The text was updated successfully, but these errors were encountered: