cos-customizer: Refactor embeddings into main packages

Embeddings need to be compiled for the same platform as the executable
that they are embedded into. This is simpler to do when embeddings are
dependencies of binary targets instead of library targets.

One might say that this can be trivially accomplished with Bazel's
"--platforms" flag. This is not the case, because cos-customizer has two
parts; the part that runs in Cloud Build, and the part that runs on the
preload VM. The Cloud Build part must always be compiled for amd64,
while the preload VM part needs to be compiled for both amd64 and arm64.
The --platforms flag can't handle this kind of configuration. We will
take an alternative approach where binary targets will be duplicated
into amd64 and arm64 variants, and the final cos-customizer container
image will ultimately depend on both kinds of binary targets.

BUG=b/176990931
TEST=./run_tests

Change-Id: I5d92483503d834984bb7df5c78cb7c9590bd708c
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/25830
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
Reviewed-by: Roy Yang <royyang@google.com>
Tested-by: Robert Kolchmeyer <rkolchmeyer@google.com>
8 files changed
tree: f069da0d6ee1fc1bfe1cec9076c6d48819a9866c
  1. release/
  2. src/
  3. testing/
  4. BUILD.bazel
  5. cloudbuild.yaml
  6. CONTRIBUTING.md
  7. deps.bzl
  8. go.mod
  9. go.sum
  10. LICENSE
  11. README.md
  12. run_tests.sh
  13. 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.