summaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-12-09 18:48:52 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-09 18:51:17 -0800
commit65a2242db409e7f4aeef04a01eb4f89699557866 (patch)
treecfb631cdab80793dadb00d19e4039a0d8826deb0 /tools
parent92ca72ecb73d91e9def31e7f9835adf7a50b3d65 (diff)
Tweak aarch64 support.
A few images were broken with respect to aarch64. We should now be able to run push-all-images with ARCH=aarch64 as part of the regular continuous integration builds, and add aarch64 smoke tests (via user emulation for now) to the regular test suite (future). PiperOrigin-RevId: 346685462
Diffstat (limited to 'tools')
-rw-r--r--tools/bazel.mk10
-rw-r--r--tools/images.mk18
2 files changed, 18 insertions, 10 deletions
diff --git a/tools/bazel.mk b/tools/bazel.mk
index ae99a2c76..396785e16 100644
--- a/tools/bazel.mk
+++ b/tools/bazel.mk
@@ -44,8 +44,8 @@ BUILD_ROOTS := bazel-bin/ bazel-out/
# Bazel container configuration (see below).
USER := $(shell whoami)
HASH := $(shell readlink -m $(CURDIR) | md5sum | cut -c1-8)
-BUILDER_NAME := gvisor-builder-$(HASH)
-DOCKER_NAME := gvisor-bazel-$(HASH)
+BUILDER_NAME := gvisor-builder-$(HASH)-$(ARCH)
+DOCKER_NAME := gvisor-bazel-$(HASH)-$(ARCH)
DOCKER_PRIVILEGED := --privileged
BAZEL_CACHE := $(shell readlink -m ~/.cache/bazel/)
GCLOUD_CONFIG := $(shell readlink -m ~/.config/gcloud/)
@@ -164,7 +164,7 @@ bazel-image: load-default ## Ensures that the local builder exists.
@docker commit $(BUILDER_NAME) gvisor.dev/images/builder
.PHONY: bazel-image
-ifeq (,$(findstring $(DOCKER_NAME),$(shell docker ps 2>/dev/null)))
+ifneq (true,$(shell $(wrapper echo true)))
bazel-server: bazel-image ## Ensures that the server exists.
@$(call header,DOCKER RUN)
@docker rm -f $(DOCKER_NAME) 2>/dev/null || true
@@ -208,6 +208,10 @@ run = $(call header,RUN $(1) $(2)) && $(call build_paths,$(1),{} $(2))
sudo = $(call header,SUDO $(1) $(2)) && $(call build_paths,$(1),sudo -E {} $(2))
test = $(call header,TEST $(1)) && $(call wrapper,$(BAZEL) test $(TEST_OPTIONS) $(1))
+clean: ## Cleans the bazel cache.
+ @$(call clean)
+.PHONY: clean
+
testlogs: ## Returns the most recent set of test logs.
@if test -f .build_events.json; then \
cat .build_events.json | jq -r \
diff --git a/tools/images.mk b/tools/images.mk
index ef72f2b80..46f56bb2c 100644
--- a/tools/images.mk
+++ b/tools/images.mk
@@ -99,8 +99,8 @@ loaded1_$(1)=.PHONY: load-$$(1)
endef
$(foreach image, $(EXISTING_IMAGES), $(eval $(call existing_image_rule,$(image))))
define tag_expand_rule =
-$(eval $(loaded0_$(call local_image,$(1))_$(call tag,$(1))))
-$(eval $(loaded1_$(call local_image,$(1))_$(call tag,$(1))))
+$(eval $(loaded0_$(call remote_image,$(1))_$(call tag,$(1))))
+$(eval $(loaded1_$(call remote_image,$(1))_$(call tag,$(1))))
endef
$(foreach image, $(ALL_IMAGES), $(eval $(call tag_expand_rule,$(image))))
@@ -108,16 +108,19 @@ $(foreach image, $(ALL_IMAGES), $(eval $(call tag_expand_rule,$(image))))
# ensure that caching works as expected, as well as the "latest" tag that is
# used by the tests.
local_tag = \
- docker tag $(call remote_image,$(1)):$(call tag,$(1)) $(call local_image,$(1)):$(call tag,$(1)) && \
- docker tag $(call remote_image,$(1)):$(call tag,$(1)) $(call local_image,$(1))
+ docker tag $(call remote_image,$(1)):$(call tag,$(1)) $(call local_image,$(1)):$(call tag,$(1))
+latest_tag = \
+ docker tag $(call local_image,$(1)):$(call tag,$(1)) $(call local_image,$(1))
tag-%: ## Tag a local image.
- @$(call local_tag,$*)
+ @$(call header,TAG $*)
+ @$(call local_tag,$*) && $(call latest_tag,$*)
# pull forces the image to be pulled.
pull = \
$(call header,PULL $(1)) && \
docker pull $(DOCKER_PLATFORM_ARGS) $(call remote_image,$(1)):$(call tag,$(1)) && \
- $(call local_tag,$(1))
+ $(call local_tag,$(1)) && \
+ $(call latest_tag,$(1))
pull-%: register-cross ## Force a repull of the image.
@$(call pull,$*)
@@ -134,7 +137,8 @@ rebuild = \
-t "$(call remote_image,$(1)):$(call tag,$(1))" \
$$T && \
rm -rf $$T) && \
- $(call local_tag,$(1))
+ $(call local_tag,$(1)) && \
+ $(call latest_tag,$(1))
rebuild-%: register-cross ## Force rebuild an image locally.
@$(call rebuild,$*)