diff options
author | Adin Scannell <ascannell@google.com> | 2020-01-22 10:38:03 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-22 10:39:45 -0800 |
commit | cb3906ae00575859a6910b8edc62ab9d531d1c85 (patch) | |
tree | 2dcb1dfd4f7f3d400682b74fa036c43c0f54871a /tools/images/BUILD | |
parent | 6a59e7f510a7b12f8b3bd768dfe569033ef07d30 (diff) |
Add tools for generating images.
This formalizes the adhoc scripts previously in kokoro. The image targets can
be used by e.g. benchmarks in order to automated image prepation.
PiperOrigin-RevId: 290982744
Diffstat (limited to 'tools/images/BUILD')
-rw-r--r-- | tools/images/BUILD | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tools/images/BUILD b/tools/images/BUILD new file mode 100644 index 000000000..2b77c2737 --- /dev/null +++ b/tools/images/BUILD @@ -0,0 +1,68 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//tools/images:defs.bzl", "vm_image", "vm_test") + +package( + default_visibility = ["//:sandbox"], + licenses = ["notice"], +) + +genrule( + name = "zone", + outs = ["zone.txt"], + cmd = "gcloud config get-value compute/zone > $@", + tags = [ + "local", + "manual", + ], +) + +sh_binary( + name = "builder", + srcs = ["build.sh"], +) + +sh_binary( + name = "executer", + srcs = ["execute.sh"], +) + +cc_binary( + name = "test", + testonly = 1, + srcs = ["test.cc"], + linkstatic = 1, + deps = [ + "//test/util:test_main", + "@com_google_googletest//:gtest", + ], +) + +vm_image( + name = "ubuntu1604", + family = "ubuntu-1604-lts", + project = "ubuntu-os-cloud", + scripts = [ + "//tools/images/ubuntu1604", + ], +) + +vm_test( + name = "ubuntu1604_test", + image = ":ubuntu1604", + targets = [":test"], +) + +vm_image( + name = "ubuntu1804", + family = "ubuntu-1804-lts", + project = "ubuntu-os-cloud", + scripts = [ + "//tools/images/ubuntu1804", + ], +) + +vm_test( + name = "ubuntu1804_test", + image = ":ubuntu1804", + targets = [":test"], +) |