summaryrefslogtreecommitdiffhomepage
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
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
-rw-r--r--.buildkite/pipeline.yaml16
-rw-r--r--images/benchmarks/absl/Dockerfile.x86_64 (renamed from images/benchmarks/absl/Dockerfile)1
-rw-r--r--images/benchmarks/hey/Dockerfile13
-rw-r--r--images/benchmarks/runsc/Dockerfile.x86_64 (renamed from images/benchmarks/runsc/Dockerfile)1
-rw-r--r--images/default/Dockerfile6
-rw-r--r--images/runtimes/go1.12/Dockerfile.x86_64 (renamed from images/runtimes/go1.12/Dockerfile)0
-rw-r--r--runsc/cli/main.go3
-rw-r--r--tools/bazel.mk10
-rw-r--r--tools/images.mk18
9 files changed, 43 insertions, 25 deletions
diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml
index 3d0cd6c99..39987b30d 100644
--- a/.buildkite/pipeline.yaml
+++ b/.buildkite/pipeline.yaml
@@ -9,7 +9,8 @@ _templates:
steps:
# Run basic smoke tests before preceding to other tests.
- - label: ":fire: Smoke tests"
+ - <<: *common
+ label: ":fire: Smoke tests"
command: make smoke-tests
- wait
@@ -77,25 +78,24 @@ steps:
label: ":hammer: Packetimpact tests"
command: make packetimpact-tests
- # Start heavy runtime tests.
- - wait
+ # Runtime tests.
- <<: *common
label: ":php: PHP runtime tests"
- command: make php7.3.6-runtime-tests
+ command: make php7.3.6-runtime-tests_vfs2
parallelism: 10
- <<: *common
label: ":java: Java runtime tests"
- command: make java11-runtime-tests
+ command: make java11-runtime-tests_vfs2
parallelism: 40
- <<: *common
label: ":golang: Go runtime tests"
- command: make go1.12-runtime-tests
+ command: make go1.12-runtime-tests_vfs2
parallelism: 10
- <<: *common
label: ":node: NodeJS runtime tests"
- command: make nodejs12.4.0-runtime-tests
+ command: make nodejs12.4.0-runtime-tests_vfs2
parallelism: 10
- <<: *common
label: ":python: Python runtime tests"
- command: make python3.7.3-runtime-tests
+ command: make python3.7.3-runtime-tests_vfs2
parallelism: 10
diff --git a/images/benchmarks/absl/Dockerfile b/images/benchmarks/absl/Dockerfile.x86_64
index b0dd97695..810c9ef5e 100644
--- a/images/benchmarks/absl/Dockerfile
+++ b/images/benchmarks/absl/Dockerfile.x86_64
@@ -12,6 +12,7 @@ RUN set -x \
unzip \
python3 \
&& rm -rf /var/lib/apt/lists/*
+
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.27.0/bazel-0.27.0-installer-linux-x86_64.sh
RUN chmod +x bazel-0.27.0-installer-linux-x86_64.sh
RUN ./bazel-0.27.0-installer-linux-x86_64.sh
diff --git a/images/benchmarks/hey/Dockerfile b/images/benchmarks/hey/Dockerfile
index f586978b6..4b6a0f849 100644
--- a/images/benchmarks/hey/Dockerfile
+++ b/images/benchmarks/hey/Dockerfile
@@ -1,12 +1,13 @@
-FROM ubuntu:18.04
+FROM golang:1.15 as build
+RUN go get github.com/rakyll/hey
+WORKDIR /go/src/github.com/rakyll/hey
+RUN go mod download
+RUN CGO_ENABLED=0 go build -o /hey hey.go
+FROM ubuntu:18.04
RUN set -x \
&& apt-get update \
&& apt-get install -y \
wget \
&& rm -rf /var/lib/apt/lists/*
-
-RUN wget https://storage.googleapis.com/hey-release/hey_linux_amd64 \
- && chmod 777 hey_linux_amd64 \
- && cp hey_linux_amd64 /bin/hey \
- && rm hey_linux_amd64
+COPY --from=build /hey /bin/hey
diff --git a/images/benchmarks/runsc/Dockerfile b/images/benchmarks/runsc/Dockerfile.x86_64
index 6c3aafa57..28ae64816 100644
--- a/images/benchmarks/runsc/Dockerfile
+++ b/images/benchmarks/runsc/Dockerfile.x86_64
@@ -14,6 +14,7 @@ RUN set -x \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
+
RUN wget https://github.com/bazelbuild/bazel/releases/download/3.4.1/bazel-3.4.1-installer-linux-x86_64.sh
RUN chmod +x bazel-3.4.1-installer-linux-x86_64.sh
RUN ./bazel-3.4.1-installer-linux-x86_64.sh
diff --git a/images/default/Dockerfile b/images/default/Dockerfile
index 4b484d55b..224469267 100644
--- a/images/default/Dockerfile
+++ b/images/default/Dockerfile
@@ -1,16 +1,20 @@
FROM fedora:31
+
# Install bazel.
RUN dnf install -y dnf-plugins-core && dnf copr enable -y vbatts/bazel
RUN dnf install -y git gcc make golang gcc-c++ glibc-devel python3 which python3-pip python3-devel libffi-devel openssl-devel pkg-config glibc-static libstdc++-static patch diffutils
RUN pip install --no-cache-dir pycparser
RUN dnf install -y bazel3
-# Install gcloud.
+
+# Install gcloud. Note that while this is "x86_64", it doesn't actually matter.
RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-289.0.0-linux-x86_64.tar.gz | \
tar zxf - google-cloud-sdk && \
google-cloud-sdk/install.sh && \
ln -s /google-cloud-sdk/bin/gcloud /usr/bin/gcloud
+
# Install Docker client for the website build.
RUN dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
RUN dnf install -y docker-ce-cli
+
WORKDIR /workspace
ENTRYPOINT ["/usr/bin/bazel"]
diff --git a/images/runtimes/go1.12/Dockerfile b/images/runtimes/go1.12/Dockerfile.x86_64
index cb2944062..cb2944062 100644
--- a/images/runtimes/go1.12/Dockerfile
+++ b/images/runtimes/go1.12/Dockerfile.x86_64
diff --git a/runsc/cli/main.go b/runsc/cli/main.go
index bca015db5..cc3752e8d 100644
--- a/runsc/cli/main.go
+++ b/runsc/cli/main.go
@@ -22,6 +22,7 @@ import (
"io/ioutil"
"os"
"os/signal"
+ "runtime"
"syscall"
"time"
@@ -207,6 +208,8 @@ func Main(version string) {
log.Infof("***************************")
log.Infof("Args: %s", os.Args)
log.Infof("Version %s", version)
+ log.Infof("GOOS: %s", runtime.GOOS)
+ log.Infof("GOARCH: %s", runtime.GOARCH)
log.Infof("PID: %d", os.Getpid())
log.Infof("UID: %d, GID: %d", os.Getuid(), os.Getgid())
log.Infof("Configuration:")
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,$*)