Commit Graph

791 Commits

Author SHA1 Message Date
Justin Cormack
090abf3254 Merge pull request #2790 from justincormack/vbox
Add VirtualBox support to linuxkit run
2017-12-02 11:01:51 +00:00
Justin Cormack
3251f67015 Add VirtualBox support to linuxkit run
You can use `linuxkit run vbox ...` to run using Oracle VirtualBox.
ISO or raw should be supported, and you can specify EFI.

Some more options may be useful in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-12-01 21:48:21 +00:00
Ian Campbell
d03e6d65e2 linuxkit pkg: include linuxkit tool's version info in labels
Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-01 13:59:45 +00:00
Ian Campbell
13adecbc3e linuxkit: move version info to subpackage
Will avoid circular includes when I reference from pkglib too.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-01 13:55:43 +00:00
Rolf Neugebauer
9a83407986 Merge pull request #2782 from ijc/hyperkit-net-fix
hyperkit: split network option into 3
2017-12-01 11:06:19 +00:00
Ian Campbell
0d9de644b8 hyperkit: split network option into 3
vpnkit mode has one or two arguments (eth socket and port control socket).

If splitting into only 2 then
    vpnkit,vpnkit-state/eth.sock,vpnkit-state/port.sock
becomes
    2: vpnkit
    1: vpnkit-state/eth.sock,vpnkit-state/port.sock
rather than
    0: vpnkit
    1: vpnkit-state/eth.sock
    2: vpnkit-state/port.sock
as desired.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-29 15:12:30 +00:00
Justin Cormack
6e9b1bb09a Add support for newer AWS networking types
- ENA networking is what the very new (and bare metal) machines have
- sriov "simple" mode is Intel VF passthrough

I reflect the underlying APIs, which is bool for ENA and a string
for sriov even though there is currently only one valid sriov option...

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-29 14:46:48 +00:00
Ian Campbell
1f6c1a59ca linuxkit pkg: Add config field to build.yml
This is a `moby.ImageConfig` struct which is marshalled into JSON and added as
the `org.mobyproject.config` label on the built image.

Convert `pkg/sysctl` as PoC.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-28 12:01:39 +00:00
Ian Campbell
f9893d9a9b Fixup test after Image → ImageConfig split.
The syntax used for the yaml definitions is changed by the need to include the
substruct in the struct literal.

For the label switch to `ImageConfig` directly, which is actually more correct
in that it avoids spurious `name` and `image` fields in the label.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-27 14:47:21 +00:00
Ian Campbell
aec82c4cdf Split config-related fields of Image into a substruct.
Where "config-related" here means "ones you might find in the
"org.mobyproject.config" label on an image.

By making this new struct an anonymous member of the existing Image struct the
Go json parser does the right thing (i.e. inlines into the parent) when parsing
a complete image (from a yml assembly) by default. The Go yaml library which we
use requires a tag on the anonymous field to achieve the same.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-27 14:16:59 +00:00
Ian Campbell
ae53577078 linuxkit pkg: allow skipping build before push
If doing the build separately from pushing (as I am intending in
https://github.com/linuxkit/kubernetes/pull/8/) it is desirable to avoid a
second build when pushing.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-24 09:52:27 +00:00
Justin Cormack
83522d81fd Merge pull request #2761 from justincormack/restore-build
Restore linuxkit build
2017-11-21 10:21:39 +00:00
Justin Cormack
ca0b1309b0 Update vendoring for moby/tool
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 17:06:47 +00:00
Justin Cormack
3389f89c44 Create tmp dir in case required
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 16:50:58 +00:00
Ian Campbell
cef9d11f58 Only create metadata if file is non-zero sized
The recent iso9660wrap vendoring bump means this does now work, but it seems
pointless in this case so skip.

Relates to https://github.com/linuxkit/kubernetes/issues/4

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-20 15:26:51 +00:00
Ian Campbell
a5e5d42368 Move metadata ISO creation to common code
This code was identical in the QEMU and HyperKit cases. Move it to util.go and
wrap it in a function, with minimal changes for returning an error.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-20 15:22:02 +00:00
Ian Campbell
db9a783821 Bump iso9660wrap to baf8d62ad315
Reduces the linuxkit binary by 12k by removing The Raven. Also allows zero
sized files to be created, see https://github.com/linuxkit/kubernetes/issues/4

4606f848a0...baf8d62ad3

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-20 15:17:57 +00:00
Justin Cormack
eef8ab7757 Add linuxkit build, using vendored moby/tool as a library
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 14:48:48 +00:00
Justin Cormack
6395e339b9 Do not error if cache/config directory not specified
Just use the default. Easier to use as an external library.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-20 13:52:53 +00:00
Justin Cormack
c9bb1ecdf1 Add Cgroups to runtime config
This will create the list of cgroups specified

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-17 13:22:38 +00:00
Justin Cormack
a8dacba2c5 Only add in ttyS1 to kernel cmdline on Packet if not there already
This is not in most examples, but is in the Packet example, and
causes a duplicated console.

fix #2735

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-15 15:39:08 +00:00
Dave Protasowski
f598d9aff2 allow hyperkit console input/output to be redirected
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
Signed-off-by: Steve Hiehn <shiehn@pivotal.io>
2017-11-14 11:44:51 -05:00
Rolf Neugebauer
581cbdd1e8 Merge pull request #2701 from rn/vpnkit
Add support for publish port on localhost to the hyperkit backend
2017-11-10 13:29:02 +00:00
Rolf Neugebauer
4b9bf071e5 Update hyperkit vendoring
This includes using ftruncate for speedier disk creation

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-10 11:52:45 +00:00
Rolf Neugebauer
bc84fab42f vendor: remove github.com/satori/go.uuid
With the switch to github.com/satori/go.uuid this is no
longer needed. Strangely, it was not in vendor.conf...

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-10 11:52:45 +00:00
Rolf Neugebauer
638f15e1f8 tool/qemu: Switch to use github.com/google/uuid
With the hyperkit backend switched to this UUID package
switch qemu as well.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-10 11:52:44 +00:00
Rolf Neugebauer
c45179dce8 tool/hyperkit: Rename uuid.vpnkit to vpnkit.uuid
Other vpnkit related files start with vpnkit too.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-10 11:52:44 +00:00
Rolf Neugebauer
69501a8b26 tool/hyperkit: Add ability to expose port on localhost
When hyperkit is used with VPNKit we can "publish" VM ports
on localhost by using an API to the VPNKit process.

This commit adds a "-publish" flag to the hyperkit backend
exposing this functionality. "-publish" can be used multiple
times and is used the same way as for the qemu backend.

Other changes:
- Use 'github.com/google/uuid' as the 'uuid' package since
  VPKNkit uses it
- use 'vpnkit' prefix instead of 'vpnKit'
- Improve logging

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-10 11:52:44 +00:00
Ian Campbell
012e6fe9d1 linuxkit pkg: Handle build --dev later
The placement in #2679 can never have worked since we parse the yml over the
struct later on.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-10 10:16:19 +00:00
Dennis Chen
90f1582988 EFI image hash value update
Update the hash value of EFI-* docker image

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-11-10 08:10:22 +00:00
Rolf Neugebauer
6a159585e9 Vendor vpnkit go bindings
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-09 16:02:54 +00:00
Rolf Neugebauer
fe953f6bc2 tool: Move multipleFlag handling to utils.go
It's a generic thing and may be shared by other code.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-09 16:02:54 +00:00
Rolf Neugebauer
a272eba740 tool: Make ports uint16
The type of the guest and host ports should be uint16 not int. Also
make them public member of the PublishPort structure.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-09 16:02:54 +00:00
Rolf Neugebauer
d4517bc26f tool: Move the code for parsing published ports to utils.go
This code will soon be shared by other backends.

While at it, also rename the type to PublishPort (from publishPorts)
as it is just one Port and the function from splitPublish() to
NewPublishPort() as this seems more go like.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-09 16:02:54 +00:00
Rolf Neugebauer
f97b885bef pkglib: Enable runtime debug output
Log commands executed when '-v' is used on the commandline.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-07 15:31:57 +00:00
Avi Deitcher
2460b45397 Remove double invocation of virtio-rng-pci
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-11-07 09:17:51 +02:00
Rolf Neugebauer
0c997129f5 qemu: Use /dev/urandom on Linux for virtio-rng-pci
On Linux the default is /dev/random which may block if there
is not enough entropy (and it determines lack of entropy
conservatively). /dev/urandom never blocks but is fed from
the same entropy source as /dev/random so this change should
not affect platforms which have hardware RNGs but helps to
prevent stalls on platforms, in particular some arm64 platforms,
where the hardware RNG is either not present or not enabled.

If you really care about proper entropy inside a VM do not use
'linuxkit run', it's mostly for testing and shouldn't be used
for production anyway.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-11-06 14:07:48 +00:00
Rolf Neugebauer
3209cb0393 Merge pull request #2679 from ijc/linuxkit-pkg-dev-mode
linuxkit pkg: add `--dev` to force local org and hash
2017-11-05 14:49:20 +00:00
Rolf Neugebauer
42593a2b7f Merge pull request #2673 from thebsdbox/vSphere_panic_fix
vSphere Panic Fix
2017-11-05 14:48:53 +00:00
Ian Campbell
c3a150d5f7 linuxkit pkg: add --dev to force local org and hash
$USER and "dev" respectively.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-03 17:17:53 +00:00
thebsdbox
3f544d25ed vSphere Panic Fix
This fixes issue #2635 related to no network being passed during an
image upload as no network is required. However a hostname is still
required due to vCenter handing the upload to a vSphere server and it’s
DataStore.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-11-03 16:50:46 +00:00
Justin Cormack
c3e5d3e7c6 Merge pull request #2676 from justincormack/lint2
Some linting improvements from gometalinter
2017-11-03 16:36:19 +00:00
Ian Campbell
3410e4e988 linuxkit pkg: pull the actual tag before build
Pulling the arch suffixed version does not provide any assurance that a
previous build was actually completed.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-11-03 15:02:28 +00:00
Justin Cormack
f480e73645 Some linting improvements from gometalinter
There is more to do on these, but clean up some unused variables,
missing args, stray `\n` etc.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-03 15:02:18 +00:00
Justin Cormack
45333d2480 Update dependencies to use sirupsen not Sirupsen
That entailed a few other fixes, eg small Notary API changes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-11-01 15:14:58 +00:00
Avi Deitcher
31187652ce Fix prereqs, raw images with correct calcs
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2017-10-31 10:51:55 +02:00
Marco Mariani
7f86b8363d fixed -disable-content-trust parameter description
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-10-30 17:16:25 +01:00
Justin Cormack
14ed0953cd Fix some lint errors with error checking
This is due to lack of rebase after linter changes.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-10-30 13:25:22 +00:00
Justin Cormack
4a95c04300 Merge pull request #169 from deitch/add-raw-efi-bios-rename-aws
Add raw file formats, rename raw to aws and qcow2 to qcow2-bios
2017-10-30 11:28:53 +00:00
Justin Cormack
626b41fd30 Merge pull request #162 from ebriand/init-processing-logging
Add back init image processing logging
2017-10-30 11:24:53 +00:00