Commit Graph

152 Commits

Author SHA1 Message Date
Rolf Neugebauer
5231e06dec cmd: Add a -state option to hyperkit runner (and enable vsock)
The state directory is used to store:
- the disk image, if not specified via '-disk'
- the ISO for metadata, if '-data' is used
- the Unix domain socket for virtio sockets
- the PID of the hyperkit process
- a JSON file with the hyperkit configuration

This patch also enables the virtio socket device for the VM.

While at it, also fix .gitignore to ignore kernel images again.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:09:48 +01:00
Dave Tucker
ce2bdea399 Add a test suite
This adds a test suite to be executed using `linuxkit/rtf`.
This is installed in the top-level Makefile

The tests are written in shell script and cover the following cases:

- Kernel Config is OK!
- Kernel Modules can be built and loaded
- QEMU can build and run kernel+initrd, iso-bios and iso-uefi
- That we can build for all other supported output formats
- That all of the examples in `./examples` can be built
- The LTP tests can be run (if `-l slow` is provided)

The virtsock and docker-bench tests were migrated but no test has been
written as yet as AFAICT they are still a WIP

Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-12 20:12:59 +01:00
Justin Cormack
fe4b6aaf5d Add image builder for compressed disk image
This is a fairly generic bootable disk with syslinux. Should
work if you `dd` it onto a USB stick, and should also work for AWS.

You need to uncompress it of course! Default size is 1G.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 14:43:55 +01:00
Justin Cormack
4746e67b9e Update Moby tool
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-12 13:08:59 +01:00
Justin Cormack
6dced3a196 Update moby tool to fix symlinks handling
Symlinks were being handled incorrectly in initrd output.

Fix #1792

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:54:38 +01:00
Justin Cormack
4261ce0a81 Update moby tool
Adds support for tar output, various fixes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 20:18:59 +01:00
Justin Cormack
fb3dab399d Code in the initrd generator to split a single tarball
In the WIP code in `moby` we now have a standard base tarball format,
that includes the kernel and cmdline as files in `/boot` so that the
entire output of the yaml file can default to a single tarball. Then
this can be split back up by LinuxKit into initrd, kernel and cmdline
as needed. This will probably become the only output of the `moby build`
stage, with a `moby package` stage dealing with output formats.

We may remove the output format specification from the yaml file as well,
and just have it in the command.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 16:15:50 +01:00
Dave Tucker
e4d84cf304 tests: add makefile for tests
this removes all test targets from the top level makefile with the
exception of `make test` that now calls `$(MAKE) -C test`.

all tests now use `moby run` by instead of the older `./scripts`.
this removes the need for dedicated qemu/hyperkit test targets.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-05 11:01:09 +01:00
Justin Cormack
6deddf749c Merge pull request #1770 from justincormack/cleanup
Fix make clean to remove new -kernel files
2017-05-04 16:34:44 +01:00
Justin Cormack
0c53e88be5 Fix make clean to remove new -kernel files
Missed this in the changeover

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-04 16:03:20 +01:00
Dave Tucker
8610716be1 Makefile: gather all build artifacts in one location
This makes it easier for CI to grab artifacts from the ephemeral build
VMs and provides a stable location so they can be used in subsequent
tests. For example, running the LTP tests.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-04 12:08:31 +01:00
Dave Tucker
cda03f7e0d Makefile: Use the name provided to upload in run
This fixes an issue introduced in the split of push and run.
Before this commit, an image could be pushed to a custom location from
the presence of the `CLOUDSDK_IMAGE_NAME` variable. The subsquent run
would fail as the name `test-ltp` or `test` had been hard coded in the
Make target. We now use a target-specific variable which is only set if
there is not an existing variable in the environment

Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-02 12:38:27 +01:00
Justin Cormack
6155e8c8bc Change to use kernel not bzImage everywhere
Previously we hardcoded `bzImage` which is not used for all
use cases or architectures.

fix #1630

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 16:24:15 +01:00
Justin Cormack
10ad066031 Pin moby tool commit
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 15:13:14 +01:00
Justin Cormack
791e11f07a Pull images on CI
Always do `moby build --pull` on CI.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 14:41:23 +01:00
Justin Cormack
98dfe7ad55 Merge pull request #1721 from riyazdf/more-signing-targets
Signing targets for binfmt, rngd, compilers, toybox, tini
2017-04-27 18:53:49 +01:00
Riyaz Faizullabhoy
2c4c55859f Add separate sign-tag target, keep tool building offline
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-27 10:34:40 -07:00
Lorenzo Fontana
910205036a Specified platform for hyperkit and qemu
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2017-04-27 00:18:02 +02:00
Riyaz Faizullabhoy
38ad84bfbd pull base images with content trust for binfmt, rngd, tini, toybox-media
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-26 14:28:30 -07:00
Riyaz Faizullabhoy
78a0d018c1 enable DCT in buildchain for compiler images
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-26 12:09:33 -07:00
Justin Cormack
252e32aac5 Remove the moby tool from this repo
Updated go-compile to be able to compile remotely. Note I
did not update the oter users of go-compile as it does not affect
them.

Update `go get` instructions to fetch new one, or `make && make install`
will still work.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-25 14:53:32 +01:00
Rolf Neugebauer
f0ee1ee707 src: Remove the infrakit plugin
It has been merged/moved to https://github.com/docker/infrakit

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-25 13:17:04 +01:00
Justin Cormack
6f80f664ce Split cli into moby and linuxkit
moby just does the simple `build` cases, while `linuxkit` does
`push` and `run`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 20:03:22 +01:00
Justin Cormack
2709ee88bc Split build and push, and remove push code from run
This currently only changes the `gcp` target, but is the new
model - the `build` command will only do things locally, then
you need to `push` to an image store such as GCP or other ones
in order to `run` for platforms that cannot boot directly from
a local image.

Fix #1618

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 17:12:05 +01:00
Dave Tucker
745dcb66b9 makefile: Remove script -q so errors appear in CI
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-24 15:17:01 +01:00
Dave Tucker
11fcf087ca makefile: Use moby run qemu
This deprectes scripts/qemu.sh as moby run qemu can now safely be run in
CI, where we currently used the qemu container

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-24 15:17:01 +01:00
Dave Tucker
11742d0148 makefile: Add target for LTP tests
This adds a target that runs the LTP tests
This target will be run on master and tag builds in CI

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-19 16:02:48 +01:00
solidnerd
00b7e145e6 Rename package github.com/docker/moby
This commit will rename the package to the correct new place.

Signed-off-by: solidnerd <niclas@mietz.io>
2017-04-18 20:18:26 +02:00
Rolf Neugebauer
3448a804f1 tests: Move kernel check test over to use linuxkit org
Also some other moby renames.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-14 15:08:51 -05:00
Gianluca Arbezzano
e36b76885e Added install support on make
Fixed #1544

I added `make install` support. By default it does:

```
cp -r ./bin/* /usr/local/bin
```

There is a env var `$PREFIX` in make. By default it's `/usr/local`

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2017-04-14 09:34:51 +02:00
Riyaz Faizullabhoy
31a8480878 Add ineffassign to go-compile, use tmp files to ensure proper failure
handling

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-12 14:42:19 -07:00
Rolf Neugebauer
a06e6bbb37 build: Switch using go-compile from linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Dave Tucker
00edddac9a Add vndr to go-compile and add vendoring docs
This makes it easier to safely udpate the vendor directory

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-11 13:35:51 +01:00
Robb Kistler
99e1643c82 Change hyperkit-test to test-hyperkit
Other test targets are all `test-*`, should be consistent

Signed-off-by: Robb Kistler <robb.kistler@docker.com>
2017-04-07 19:04:36 -07:00
Dave Tucker
a4980c8bfb makefile: Add targets to test GCP
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-07 15:22:12 +01:00
Dave Tucker
fddfd0b3ec makefile: Allow a bin/moby to be provided
This is needed for CI to be able to run `moby run $platform` with a
known good version of moby. For example, the one generated when building
the `master`.

This protects CI from any nefarious changes to the `moby` tool and
allows `moby run` to be used safely to test PRs.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-07 15:20:35 +01:00
Justin Cormack
6dc0ee4748 Remove Makefile targets that build moby.yml
Its trivial to just do `bin/moby build moby` etc.

Just leaving test targets, which should really move
out of root later.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-07 14:54:41 +01:00
Justin Cormack
3223897232 Merge pull request #1514 from rneugeba/cli-up
Improvements to the CLI
2017-04-06 13:01:58 +01:00
Rolf Neugebauer
3e53aab4ce cli: Add a 'version' version
Pass version and git commit hash from the Makefile
into main.go. Add a 'version' subcommand to print
the information.

While at it also tweak the help output to only print the
command name and not the entire path.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-06 12:29:52 +01:00
Thomas Gazagnaire
8f64191dee Fix make qemu
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-06 13:20:33 +02:00
Rolf Neugebauer
fa7c85e235 build: Improve dependency for CLI/infrakit build
Use vendor.conf as a proxy for ./vendor contents

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-05 23:10:08 +01:00
Rolf Neugebauer
df993d8b0d build: Fix copy&paste error for Infrakit dependencies
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-05 19:52:31 +01:00
Justin Cormack
bc0feab1c9 Merge pull request #1476 from riyazdf/make-cleaner
Make clean cleaner, and ignore more output disks
2017-04-04 17:23:12 +01:00
Riyaz Faizullabhoy
bba42d2d7e Make clean cleaner, and ignore more output disks
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-04 08:19:20 -07:00
Dave Tucker
6726746484 Add a runner for UEFI ISOs
Fixes #480

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-03 14:13:37 +01:00
Rolf Neugebauer
e9fbe43b34 Rename .yaml to .yml
docker-compose and other utilities use the .yml extension.
For consistency rename all .yaml to .yml

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-27 09:53:26 +02:00
Rolf Neugebauer
6a29d153f5 infrakit: Move the hyperkit instance plugin into the source directory
- The tools directory ideally should not contain source code
- Removes double vendoring of packagages
- Makes it easer to hook the build into the top-level Makefile

Eventually, the plugin should be moved to the infrakit repo.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-25 13:02:45 +01:00
Justin Cormack
668408614f Use moby run to run hyperkit in Makefile
- cut down the hyperkit script but leave as reference for now
- an error left over after shutdown that needs removing at some point

fix #1375

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-24 18:52:42 +00:00
Justin Cormack
c76074ff66 Remove docker2tar docker image, use Docker directly from Go
Removing the left over indirect creates that use the Docker socket
and run in containers not directly.

See #1347

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-03-22 22:26:13 +00:00
Rolf Neugebauer
759637b3f0 moby: Introduce the "build" subcommand
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-03-22 14:38:02 +00:00