crosvm/docker
Gurchetan Singh 84d59e76b3 Dockerfile: stop tracking virglrenderer master
With crrev.com/c/1745316, the regular ChromeOS build started
adding epatches to virglrenderer. Therefore, don't track virglrenderer
master for the time being, until we can upstream and/or remove our
downstream APIs.

BUG=chromium:906811
TEST=docker/wrapped_smoke_test.sh

Change-Id: I9567e9286130048fb793fecb4ff3801b7d64ddba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1758371
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-08-20 17:46:23 +00:00
..
pkgconfig add docker supported builds and tests 2019-05-15 13:36:19 -07:00
build_crosvm.sh docker: support passing extra arguments to scripts 2019-08-07 23:31:48 +00:00
build_crosvm_base.sh docker: support passing extra arguments to scripts 2019-08-07 23:31:48 +00:00
checkout_commits.env docker: add adhd to checkout_commits.env and update all commits 2019-06-04 00:46:18 +00:00
crosvm_wrapper.sh add docker supported builds and tests 2019-05-15 13:36:19 -07:00
Dockerfile Dockerfile: stop tracking virglrenderer master 2019-08-20 17:46:23 +00:00
Dockerfile.crosvm add docker supported builds and tests 2019-05-15 13:36:19 -07:00
README.md add docker supported builds and tests 2019-05-15 13:36:19 -07:00
upgrade_checkout_commits.sh docker: add adhd to checkout_commits.env and update all commits 2019-06-04 00:46:18 +00:00
wrapped_smoke_test.sh docker: support passing extra arguments to scripts 2019-08-07 23:31:48 +00:00

Docker for Building/Running crosvm

This module contains various pieces of Docker infrastructure for supporting crosvm outside of Chrome OS environments. This includes the kokoro build environment.

[TOC]

Introduction

Ordinarily, crosvm is built using the standard cargo build command inside of a Chrome OS chroot. The chroot requirement is there because of various path dependencies in the crosvm Cargo.toml are targeted to paths outside of the crosvm repo itself. If one were to checkout crosvm in isolation, cargo build would be inadequate, failing with an error related to these missing paths. Additionally, crosvm depends on native packages that are not ordinarily available from an OS package manager (e.g. minijail) or have been forked in the Chrome OS project in an incompatible fashion (libusb).

crosvm-base Docker Image

To support building crosvm outside of a Chrome OS chroot, this modules contains a Dockerfile that is used to build the crosvm-base docker image. Part of that image build process is downloading various repos, checking out pinned commits (specified in checkout_commits.env), and installing them. For the path dependencies in the Cargo.toml, the Dockerfile downloads and places the source code in the correct spot relative to the crosvm source repository. The crosvm-base build step stops short of actually building crosvm. It doesn't even have the source code for crosvm. The intent here is to use crosvm-base for building and running any version of crosvm.

To build the crosvm-base image, run build_crosvm_base.sh. The script will automatically use the checkouts from checkout_commits.env which can be reconfigured to point to any commit desired. To upgrade checkout_commits.sh to the HEAD of each remote master branch, run the upgrade_checkout_commits.sh script.

crosvm Docker Image

After generating a crosvm-base, the system is ready to build crosvm into its own crosvm docker image. The resulting docker image will be capable of running VMs without fear of missing native dependencies. Run the build_crosvm.sh script to build crosvm into a docker image. Once that completes, use the crosvm_wrapper.sh script to run crosvm within the docker image. That script will pass the arguments given to it verbatim to crosvm. In addition, the current working directory is bind mounted into the container so that file paths passed to crosvm_wrapper.sh should work as long as they are relative paths to files contained in the working directory.

smoke_test

There is a convenience wrapper for smoke_test that uses the crosvm docker image to execute all the tests. Run wrapped_smoke_test.sh after building crosvm-base docker image to run the smoke_test within docker.