Add BuildPrecompiledDriver method for GPU precompilation

This method takes as input a build request in the form of a
textproto config. See
schttps://cos.googlesource.com/cos/tools/+/refs/heads/master/src/pkg/gpuconfig/proto/config.proto.
It builds the precompiled driver package (NVIDIA installer packaged with
the preinstalled COS kernel headers).

The build dir and the name of the precompiled driver package is returned
by the method.

Note:
The build dir must be cleaned by the caller of `BuildPrecompiledDriver` after usage.
The following env vars of the process calling this method are altered.
CC, CXX, SYSROOT, PATH.

The method also creates a symbolic link to the linker provided in the
downloaded toolchain package as described by the textproto config.

BUG=b/238215395

Change-Id: I421be52fa0ec62ea7d00e30a5d3d1ecd927eebd1
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/38609
Reviewed-by: Meena Shanmugam <meenashanmugam@google.com>
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
Tested-by: Arnav Kansal <rnv@google.com>
9 files changed
tree: c95352e21a39844619725eef2bdf96ed98254a28
  1. coverage/
  2. release/
  3. src/
  4. testing/
  5. .gitignore
  6. BUILD.bazel
  7. cloudbuild.yaml
  8. CONTRIBUTING.md
  9. deps.bzl
  10. go.mod
  11. go.sum
  12. LICENSE
  13. README.md
  14. run_tests.sh
  15. WORKSPACE
README.md

Tools for Container-Optimized OS

This is a repository of various tools developed for Container-Optimized OS. Examples include cos-gpu-installer, cos-toolbox, etc.

See CONTRIBUTING.md for how to contribute.