-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preprocessor: use a shared /caches mount in multi-step scripts
For Go API guides, use of cuelang.org/go will be common. In serve mode, making changes and re-running a guide as it progresses is common. Where a dependency on cuelang.org/go exists, this requires downloading that module and its dependencies on every run because we currently start from a cold set of caches. For such guides it is therefore useful to be able to leverage at least modules download caches. But build and test caches are sometimes useful too. This change introduces a pattern whereby images used by guides must provide a /caches directory which is world-writable. This cache area is then the basis for a convention used by scripts (in later CLs): /caches/gobuild - a shared GOCACHE cache /caches/gomodcache - a shared GOMODCACHE ... This can only be a convention, because it requires some degree of coordination between guides and images. The area in general needs to be world-writable because there is no guarantee that each image uses the same UID as the user for the guide. In general, at least for Go caches, this is not a problem. A further convention is therefore that each image must establish a umask of 0000 so that writes to the cache area remain world-writable. Again, there is no risk in general here because everything is running in a container. Using a docker volume for these shared caches means that all caches, and any potential damage to those caches, is entirely isolated from the host machine. In a totally unrelated change (but in the interests of keeping this stack small) we also bump to go1.22 in our go.mod. Fixes cue-lang/cue#2831 Preprocessor-No-Write-Cache: true Signed-off-by: Paul Jolly <[email protected]> Change-Id: I67f17f53e68a8b719546ccf05e6767ec6f8a9e5d
- Loading branch information
Showing
9 changed files
with
88 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/cue-lang/cuelang.org | ||
|
||
go 1.20 | ||
go 1.22 | ||
|
||
require ( | ||
cuelang.org/go v0.7.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters