Skip to content

Instantly share code, notes, and snippets.

@flokli
Last active December 24, 2023 14:05
Show Gist options
  • Save flokli/80f1ce01b1d473e2e2fc352a96437e38 to your computer and use it in GitHub Desktop.
Save flokli/80f1ce01b1d473e2e2fc352a96437e38 to your computer and use it in GitHub Desktop.
tvix-build oci docstr
// Builds a OCI bundle from a BuildRequest and a path, which points to an
// existing (and empty) path to a directory (usually a temporary).
//
// This function emits an OCI bundle that will run the build specifed in the
// buildRequest.
//
// After running this function, the directory contains the following:
//
// - `config.json`, the OCI runtime spec itself
// - `scratch`, a directory containing other directories which will be
// bind-mounted read-write into the container and used as scratch space
// during the build.
// Don't make any assumptions on the contents inside this directory!
// - `inputs`, a directory where the user of this function is supposed to
// provide the castore nodes specified in the buildRequest inputs.
// - `outputs`, a directory where all writes to the store_dir during the build
// are directed to.
// - `root`, a minimal skeleton of files that'll be present at /.
//
// It is up to the user to provide the inputs at `{path}/inputs` before
// running the OCI payload itself.
// It is also up to the user to collect the outputs at `{path}/outputs`.
//
// In the future, it might become possible to allow specifying another directory
// than {path}/scratch as scratch root.
func makeOCIBundle(buildRequest *buildv1pb.BuildRequest, path string, rootless bool) error {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment