gvisor/tools/vm
Adin Scannell c60613475c Standardize all Docker images.
This change moves all Docker images to a standard location, and abstracts the
build process so that they can be maintained in an automated fashion. This also
allows the images to be architecture-independent.

All images will now be referred to by the test framework via the canonical
`gvisor.dev/images/<name>`, where `<name>` is a function of the path within the
source tree.

In a subsequent change, continuous integration will be added so that the images
will always be correct and available locally.

In the end, using `bazel` for Docker containers is simply not possible. Given
that we already have the need to use `make` with the base container (for
Docker), we extend this approach to get more flexibility.

This change also adds a self-documenting and powerful Makefile that is intended
to replace the collection of scripts in scripts. Canonical (self-documenting)
targets can be added here for targets that understand which images need to be
loaded and/or built.

PiperOrigin-RevId: 308322438
2020-04-24 14:11:42 -07:00
..
ubuntu1604 Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
ubuntu1804 Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
BUILD Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
README.md Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
build.sh Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
defs.bzl Standardize all Docker images. 2020-04-24 14:11:42 -07:00
execute.sh Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
test.cc Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00
zone.sh Add a functional vm_test for root_test. 2020-04-20 15:48:27 -07:00

README.md

VM Images & Tests

All commands in this directory require the gcloud project to be set.

For example: gcloud config set project gvisor-kokoro-testing.

Images can be generated by using the vm_image rule. This rule will generate a binary target that builds an image in an idempotent way, and can be referenced from other rules.

For example:

vm_image(
    name = "ubuntu",
    project = "ubuntu-1604-lts",
    family = "ubuntu-os-cloud",
    scripts = [
        "script.sh",
        "other.sh",
    ],
)

These images can be built manually by executing the target. The output on stdout will be the image id (in the current project).

Images are always named per the hash of all the hermetic input scripts. This allows images to be memoized quickly and easily.

The vm_test rule can be used to execute a command remotely. This is still under development however, and will likely change over time.

For example:

vm_test(
    name = "mycommand",
    image = ":ubuntu",
    targets = [":test"],
)