crosvm/ci/Makefile
Dennis Kempin 191b95b5d7 native and aarch64 cross-compile containers
This CL adds the foundation for running tests consistently
in Kokoro and locally, for both x86 and aarch64.

The crosvm_builder is similar to the original image from
docker/crosvm.Dockerfile.
The main difference is that ChromeOS dependencies are not
compiled into the container, but built at runtime.

The crosvm_aarch64_builder installs the build enviornment
to cross-compile crosvm for aarch64. The tests are run
with user-space emulation using qemu-aarch64-static.

See ci/README.md for instructions on how to use these
builders.

Tests on aarch64 cannot all be run using user-space
emulation. We will need a VM to pass all smoke tests,
this work is tracked in b/177228167.

BUG=b:177133814
TEST=Tested by running
./ci/builder bin/smoke_test
./ci/builder cargo test
./ci/aarch64_builder cargo build
./ci/aarch64_builder cargo test -p tempfile

Change-Id: Iffffcf48894787dd72fff894af351fdaced0b429
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2621994
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-01-20 17:41:27 +00:00

35 lines
956 B
Makefile

# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file
#
# Builds docker images for the crosvm builders.
# Run the `upload` target to upload the images to the container registry
# (provided you are authorized to upload them).
TAG_BASE=gcr.io/crosvm-packages
ifneq (, $(shell which podman))
DEFAULT_DOCKER=podman
else
DEFAULT_DOCKER=docker
endif
DOCKER ?= $(DEFAULT_DOCKER)
all: crosvm_builder crosvm_aarch64_builder
upload: all
$(DOCKER) push $(TAG_BASE)/crosvm_base
$(DOCKER) push $(TAG_BASE)/crosvm_builder
$(DOCKER) push $(TAG_BASE)/crosvm_aarch64_builder
crosvm_base:
cd $@ && $(DOCKER) build -t $(TAG_BASE)/$@ .
crosvm_builder: crosvm_base
cd $@ && $(DOCKER) build -t $(TAG_BASE)/$@ .
crosvm_aarch64_builder: crosvm_base
cd $@ && $(DOCKER) build -t $(TAG_BASE)/$@ .
.PHONY: all crosvm_base crosvm_builder crosvm_aarch64_builder