Skip to content

Commit 1ac5a2a

Browse files
Geoffroy Van Cutsemjren1
authored andcommitted
Enable Travis CI for all combinations
Enable the Travis CI testing for all combinations of variables that can be set at compile-time. I.e. RELEASE={0|1} and PLATFORM={0|1} Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
1 parent eadc921 commit 1ac5a2a

12 files changed

+270
-15
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Build container based on CentOS 7
2+
FROM centos:centos7
3+
4+
RUN yum -y update; yum clean all
5+
RUN yum -y install gcc \
6+
git \
7+
make \
8+
vim \
9+
libuuid-devel \
10+
openssl-devel \
11+
libpciaccess-devel \
12+
gnu-efi-devel
13+
14+
WORKDIR /root/acrn
15+
16+
CMD ["/bin/bash"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Build container based on Clearlinux
2+
FROM clearlinux:base
3+
4+
RUN swupd bundle-add os-core-dev dev-utils-dev
5+
6+
WORKDIR /root/acrn
7+
8+
CMD ["/bin/bash"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build container based on Debian 8
2+
FROM debian:8
3+
4+
# Install dependencies.
5+
RUN apt-get update \
6+
&& apt-get install -y gcc make vim git \
7+
gnu-efi \
8+
libssl-dev \
9+
libpciaccess-dev \
10+
uuid-dev \
11+
&& apt-get clean
12+
13+
WORKDIR /root/acrn
14+
15+
CMD ["/bin/bash"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Build container based on Fedora 26
2+
FROM fedora:26
3+
4+
RUN dnf -y update && dnf clean all
5+
RUN dnf -y install gcc \
6+
git \
7+
make \
8+
vim \
9+
libuuid-devel \
10+
openssl-devel \
11+
libpciaccess-devel \
12+
gnu-efi-devel
13+
14+
WORKDIR /root/acrn
15+
16+
CMD ["/bin/bash"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Build container based on Fedora 27
2+
FROM fedora:27
3+
4+
RUN dnf -y update && dnf clean all
5+
RUN dnf -y install gcc \
6+
git \
7+
make \
8+
vim \
9+
libuuid-devel \
10+
openssl-devel \
11+
libpciaccess-devel \
12+
gnu-efi-devel
13+
14+
WORKDIR /root/acrn
15+
16+
CMD ["/bin/bash"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build container based on Ubuntu 14.04
2+
FROM ubuntu:14.04
3+
4+
# Install dependencies.
5+
RUN apt-get update \
6+
&& apt-get install -y gcc make vim git \
7+
gnu-efi \
8+
libssl-dev \
9+
libpciaccess-dev \
10+
uuid-dev \
11+
&& apt-get clean
12+
13+
WORKDIR /root/acrn
14+
15+
CMD ["/bin/bash"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build container based on Ubuntu 16.04
2+
FROM ubuntu:16.04
3+
4+
# Install dependencies.
5+
RUN apt-get update \
6+
&& apt-get install -y gcc make vim git \
7+
gnu-efi \
8+
libssl-dev \
9+
libpciaccess-dev \
10+
uuid-dev \
11+
&& apt-get clean
12+
13+
WORKDIR /root/acrn
14+
15+
CMD ["/bin/bash"]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2018, Geoffroy Van Cutsem
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Build containers for Project ACRN
2+
3+
## Introduction
4+
5+
This repository contains a number of Dockerfile that include
6+
all the build tools and dependencies to build the ACRN Project
7+
components, i.e. the `acrn-hypervisor` and `acrn-devicemodel`
8+
9+
The workflow is pretty simple and can be summarized in these few steps:
10+
11+
1. Build the *build containers* based on your preferred OS
12+
1. Clone the Project ACRN repositories
13+
1. Start the build container and give it the repositories
14+
1. Build the Project ACRN components
15+
16+
The pre-requisite is that you have Docker installed on your machine.
17+
Explaining how to install it on your system is beyond the scope of this
18+
document, please visit https://www.docker.com for detailed instructions.
19+
20+
## Build the *build containers*
21+
22+
Each `Dockerfile` in this repo has an extension that tells what Linux
23+
distribution it is based on. To build a container using any of those,
24+
use this command:
25+
```
26+
$ sudo docker build -t <container-name> -f Dockerfile.<baseos> .
27+
```
28+
29+
As an example, to build a container based on CentOS 7, do:
30+
```
31+
$ sudo docker build -t centos7 -f Dockerfile.centos7 .
32+
```
33+
34+
## Clone Project ACRN
35+
36+
Follow these simple steps to clone the Project ACRN repositories
37+
```
38+
$ mkdir ~/acrn
39+
$ cd ~/acrn
40+
$ git clone https://github.com/projectacrn/acrn-hypervisor
41+
$ git clone https://github.com/projectacrn/acrn-devicemodel
42+
```
43+
44+
## Start the build container
45+
46+
Use this `~/acrn` folder and pass it on to your build container:
47+
```
48+
$ cd ~/acrn
49+
$ sudo docker run -ti -v $PWD:/root/acrn <container-name>
50+
```
51+
52+
Using CentOS 7 again as an example, that gives us:
53+
```
54+
$ cd ~/acrn
55+
$ sudo docker run -ti -v $PWD:/root/acrn centos7
56+
```
57+
58+
**Note:** if you encounter permission issues within the container (as it
59+
happens on a Fedora 27 host), try adding the `:z` parameter to the mount option.
60+
This will unlock the permission restriction (that comes from SElinux). Your
61+
command-line would then be:
62+
```
63+
$ cd ~/acrn
64+
$ sudo docker run -ti -v $PWD:/root/acrn:z centos7
65+
```
66+
67+
## Build the ACRN components
68+
69+
The steps above place you inside the container and give you access to
70+
the Project ACRN repositories you cloned earlier. You can now build any
71+
of the components. Here is an example:
72+
```
73+
# cd acrn-hypervisor
74+
# make PLATFORM=uefi RELEASE=1
75+
```
76+
77+
You can do this for all build combinations and also try to build the `acrn-devicemodel`.
78+
All the build dependencies and tools are pre-installed in the container as well as a
79+
couple of useful tools (`git` and `vim`) so you can directly edit files to experiment
80+
from within the container.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
DOCKER_BIN=`which docker`
4+
5+
function usage {
6+
echo "Usage: $0 <path-to-acrn>"
7+
echo " Where <path-to-acrn> is the path to where you"
8+
echo " have cloned the acrn repositories"
9+
exit 1
10+
}
11+
12+
if [ $# -eq 0 ];
13+
then
14+
usage
15+
fi
16+
17+
build_container () {
18+
var=$(sudo $DOCKER_BIN images --format '{{.Tag}}' | grep -c $distro)
19+
echo $var
20+
if [ $(sudo $DOCKER_BIN images --format '{{.Repository}}' | grep -c $distro) == '0' ];
21+
then
22+
echo There is no build container for $distro yet.
23+
echo Creating a build container for $distro... please be patient!
24+
$DOCKER_BIN build -t $distro -f Dockerfile.$distro .
25+
else
26+
echo We already have a build container for $distro, attempting to use it...
27+
fi
28+
}
29+
30+
for distro in `ls Dockerfile.*`; do
31+
# Extract the name of the Linux distro. It assumes the Dockerfile name is built as "Dockerfile.<distro>"
32+
distro=${distro:11}
33+
build_container
34+
echo "Testing Linux distribion: $distro"
35+
$DOCKER_BIN run -v $1:/root/acrn:z $distro make
36+
done
37+

0 commit comments

Comments
 (0)