Repeatable Reliable Test Environment
I've worked out a set of steps to reliably recreate a test environment for the run-time test. There are small problems with the instructions for running things as they stand in runtime-spec.md. Here are the steps I followed to build an OCI runtime tools ready vagrant box based on Fedora 24.
# Build a vagrant fedora box clean
# (Fedora25 is out, but official box only seems to exist for 24)
$ vagrant init fedora/24-cloud-base
$ vagrant up --provider virtualbox
$ vagrant ssh
# On the vagrant machine ...
# Set up ntp to keep the vagrant machine in time (vagrant/virtualbox loses sync
# when some hosts sleep.)
$ sudo yum -y install ntp
$ sudo ntpd -gq
# Update the world
$ sudo dnf -y update
# Install git
$ sudo dnf -y install git
$ git version
git version 2.7.4
# Install go (Current stable as of this writing is 1.7.4)
$ curl -O https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.7.4.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
$ mkdir $HOME/work
$ export GOPATH=$HOME/work
$ go version
go version go1.7.4 linux/amd64
# make isn't present ...
$ sudo dnf install @development-tools
$ make --version
GNU Make 4.1
Built for x86_64-redhat-linux-gnu
...
# Add seccomp
$ sudo dnf -y install libseccomp-devel
# You now have an OCI ready Fedora 24 machine in VirtualBox.
# Almost. There are still golang man dependencies to install for runtime-tools
# You might want to add the Go lang export lines to your .profile
# Add runc
$ mkdir -p $HOME/work/src/github.com/opencontainers
$ cd $HOME/work/src/github.com/opencontainers
$ git clone https://github.com/opencontainers/runc
$ cd runc
$ make
$ sudo make install
$ which runc
/usr/local/sbin/runc
$ runc --version
runc version 1.0.0-rc2
commit: 4271a8b5aec07d69f128df5474dea064d4694832
spec: 1.0.0-rc2-dev
# Add runtime-tools
$ cd $HOME/work/src/github.com/opencontainers
$ git clone https://github.com/opencontainers/runtime-tools
$ cd runtime-tools
$ make
# N.B. It is unclear what part Godeps presently plays. Because
# if I'm reading Godep.json correctly, it was last run a while ago.
# Also: Add man page gen dependencies ...
$ go get github.com/russross/blackfriday
$ go install github.com/russross/blackfriday
$ go get github.com/cpuguy83/go-md2man
$ go install github.com/cpuguy83/go-md2man
$ sudo install -m 755 $GOPATH/bin/go-md2man /usr/bin
$ sudo make install
# WARNING! test_runtime.sh is presently bound to runc and runc commands.
# You may need to edit test_runtime.sh to change the "start" command to "run". i.e.
# TESTCMD="${RUNTIME} start $(uuidgen)"
# becomes
# TESTCMD="${RUNTIME} run $(uuidgen)"
# You also may need to be explicit with the runc path.
# I recommend turning on debug so you can actually see the suite execute
# (with a little more detail until it errors out.)
$ sudo ./test_runtime.sh -r $(which runc) -l debug
On Mon, Dec 05, 2016 at 05:56:02PM -0800, Stephen Walli wrote:
I've worked out a set of steps to reliably recreate a test environment for the run-time test. …
# Add runc…# Add runtime-tools
These look like instructions that should be targeted at the runC and runtime-tools repos (like opencontainers/runtime-tools#287). The spec is (hopefully ;) going to move more slowly than either of the other two repos, so it's not a great place to store their installation instructions.
@wking Totally agree. I was tired. I posted in the wrong place. I'll report, taking into account your comments on @RobDolinMS work. Thanks.