Commit Graph

126 Commits

Author SHA1 Message Date
Magnus Skjegstad
f0e7e41424 linuxrun: add -vsock-ports option to HyperKit
When `-vsock-ports` is specified, the listed guest vsock
ports will be made available through unix domain sockets
in the state directory.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-15 20:14:30 +02:00
Rolf Neugebauer
a16d1683f8 cmd: Add a -state argument to VMware runner
The state directory is used to store any user data disk images
and the .vmx file. At run time, it is also used to keep
various other files, such as the nvram, log and lock files, etc.

While at it, also clean up the code a little more and fix the
handling of the "-disk-size" argument when no "-disk" argument
is specified. This brings it in line with the other runners.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:13:55 +01:00
Rolf Neugebauer
243967db6f cmd: Unify the coding style somewhat
There is no need to prefix local variables and try to name
variables which refer to the same/simialr thing the same
across runners.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:09:48 +01:00
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
Justin Cormack
b86fcd5253 Merge pull request #1813 from thebsdbox/vmware_disk_fix
Added matching capability to create a disk
2017-05-14 10:39:54 +01:00
thebsdbox
3e9a0ae94c Added matching capability to create a disk
- What I did
Added the capability to re-use or create a disk from the linuxkit
VMware cli

- How I did it
Using the vmware-diskmanager that comes with Fusion/Workstation

- How to verify it
Run linuxkit run vmware with the -disk -disk-size arguments

- Description for the changelog
Persistent disk functionality added into the VMware backend.

- A picture of a cute animal (not mandatory but encouraged)
nope

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-13 19:29:55 +01:00
Dave Tucker
7027dc814c Fix path handling in QEMU to allow containers outside the PWD
Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-12 20:12:59 +01:00
Ian Campbell
c1ce8b4688 Consolidate metadata ISO writing into a single function
Used by both `metadata create` and the hyperkit runner.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 19:25:28 +01:00
Ian Campbell
36eaa44d7e Add linuxkit metadata command
Only subcommand is currently `create` which is a thin wrapper to create an iso
file in the format expected by `pkg/metadata`.

Currently very basic and just takes the content on the command line but could
be extended to read from a file etc.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 19:25:27 +01:00
Justin Cormack
56e30fdbc5 Clean up initrd creation library
Remove duplicated code and clean up file handling a little.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:30:14 +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
Lorenzo Fontana
82e6534e9c Port forwarding in qemu runner
Example usage:
	linuxkit run qemu -publish 1111:1111/udp -publish 8081:80/tcp example

Signed-off-by: Lorenzo Fontana <lo@linux.com>
2017-05-06 00:34:44 +02:00
Rolf Neugebauer
5ce03cc884 cmd: Unify 'run' cmdline options
- Use 'disk-size' for disk size
- Use 'disk' for the path to the disk image
- Use 'fw' for the path to the EFI firmware

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-02 17:00:57 +01:00
Dave Tucker
ccfbcceebd linuxkit: Make gcp push honour the img-name flag
This fixes a regression where `linuxkit push gcp` no longer allows for a
custom destination to be provided via the `-img-name` flag or the
`CLOUDSDK_IMAGE_NAME` environment variable

Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-02 12:36:09 +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
Phil Estes
5612718b0f The -drive parameter for qemu run requires more flags
To use `-drive` as an analog for `-hda` or `-hdb`, etc. the qemu
docs note that "media" and "index" are required flags. Local
testing shows that drive shows up properly as `/dev/sda` after
this change.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2017-04-27 13:33:03 -04:00
Lorenzo Fontana
b28eab3912 Using the actual invoked command for help messages
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2017-04-26 23:56:14 +02:00
Carlton-Semple
f512541868 Fix for old moby reference in linuxkit CLI
Signed-off-by: Carlton-Semple <carlton.semple@ibm.com>
2017-04-25 14:18:10 -04: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
48daeda07e moby: Add container fallback for moby run qemu
This commit allows moby run qemu to fallback to using a container if
qemu isn't installed on the host OS

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-24 15:16:57 +01:00
Rolf Neugebauer
9bdd831b37 src: Use hyperkit from the the moby org
HyperKit got moved from docker to moby. Update vendoring and
imports.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-24 10:53:59 +01:00
Riyaz Faizullabhoy
2ec3884283 Merge pull request #1653 from dave-tucker/ltp-ci
Changes required to run LTP tests in CI
2017-04-23 13:22:40 -07:00
Dave Tucker
bbe8078755 moby: add skip-cleanup flag to moby run gcp
This is used as the CI will cleanup after itself

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-19 16:02:48 +01:00
Daniel Finneran
6f9d0247c9 Fix for prefix for linuxkit
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-18 19:00:31 -05:00
solidnerd
2c836c28ab Rename package initrd in build.go
This will rename github.com/docker/moby/src/initrd to github.com/linuxkit/linuxkit/src/initrd

Signed-off-by: solidnerd <niclas@mietz.io>
2017-04-18 20:19:21 +02:00
Justin Cormack
0a8ad62d50 Update Go path to linuxkit/linuxkit for libraries
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-17 17:39:18 -05:00
Rolf Neugebauer
b28f60b44d cli: Unify environment variables for GCP run
GCP defines some "standard" environment variables for project and
zone. Use them for 'moby run gcp'. Change the other environment
variables to follow the same pattern.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-15 12:36:46 -05:00
Rolf Neugebauer
0ca76f63d9 infrakit: Fix the VPNKit key to set the IP address
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-14 11:57:24 -05:00
Rolf Neugebauer
50b1c5d78c cli: Update images to use the linuxkit hub org
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-12 21:28:17 +01:00
Ilya Dmitrichenko
531d821fc5 Generate VM UUID
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
2017-04-12 17:33:26 +01:00
Thomas Gazagnaire
1bdab6be8e fix yaml validation for image mounts
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 15:28:02 +02:00
Justin Cormack
f603d37638 Merge pull request #1599 from avsm/packet-net-run
Add `moby run packet` to boot on baremetal Packet.net hosts
2017-04-12 13:40:50 +01:00
Thomas Gazagnaire
6f747fe0d2 better comment in converter for yaml validation
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 14:10:27 +02:00
Anil Madhavapeddy
e61941999f Add moby run packet to boot on baremetal Packet.net hosts
This uses the Packet.net API and iPXE to boot a Moby host.
There are several enhancements coming soon, such as SSH key
customisation, but this PR is sufficient to boot a host and
then use the web interface to get console access.

The user must currently upload the built artefacts to a public
URL and specify it via --base-url, e.g.:
moby run packet --api-key <key> --project-id <id> \
  --base-url http://recoil.org/~avsm/ipxe --hostname test-moby packet

See #1424 #1245 for related issues.

Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2017-04-12 12:59:05 +01:00
Thomas Gazagnaire
ea8ad1fe3c Add Yaml validation
Fix #1292

Transform the Yaml struct to JSON and validate it against a JSON schema.

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-04-12 13:42:15 +02:00
Justin Cormack
b83e4af084 Merge pull request #1596 from thebsdbox/qemu_raw_disk
Fixed qemu argument typo and also correct use of raw disk
2017-04-12 12:03:33 +01:00
thebsdbox
13a6089324 Fixed qemu argument typo and also correct use of raw disk
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-12 11:19:58 +01:00
Dave Tucker
676e1779ee moby: Add system disk and disk size parameter to GCP
This makes gcp behave in a similar way to the qemu backend.
The minimum size on GCP 1GB, whereas qemu uses 256MB.
Without this, the LTP tests fail on GCP.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-12 00:52:01 +01:00
Dave Tucker
90ed2469db moby: enable internet access for GCP VM's
Adds an "access config" with a type of "ONE_TO_ONE_NAT" that
allows an instance to obtain an ephemeral IP address and access the
internet

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-11 23:36:31 +01:00
thebsdbox
66c28ccd19 Added Linux $PATH support and fixed FlagSet typo
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-11 11:48:51 +01:00
Anil Madhavapeddy
e8cbf1a23e tweak moby run CLI help to reflect that it supports GCP as well
Signed-off-by: Anil Madhavapeddy <anil@docker.com>
2017-04-11 11:18:55 +01:00
Justin Cormack
ceeddedbf5 Merge pull request #1577 from riyazdf/errchecking
catch and handle errors in src/cmd/moby
2017-04-10 21:48:41 +01:00
Riyaz Faizullabhoy
2fea805be1 catch and handle errors in src/cmd/moby
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-10 13:36:46 -07:00
Riyaz Faizullabhoy
cab4807e59 qemu: catch error on disk create and exit with message
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-04-10 12:09:54 -07:00
Justin Cormack
46799eb2de Merge pull request #1571 from dave-tucker/panic
Fix panic in gcp code
2017-04-10 17:37:52 +01:00
Dave Tucker
0ece2e8227 moby: use type assertion to avoid panic in gcp code
Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-10 17:29:59 +01:00
Rolf Neugebauer
34af633552 infrakit: rename the Moby property to kernel+initrd
The infrakit plugin is not specific to Moby and should be able
to boot other Linux systems as long as a kernel image and
initial RAM disk are supplied. Reflect this in the property
passed to the plugin.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-10 16:12:08 +01:00