Commit Graph

313 Commits

Author SHA1 Message Date
Dave Protasowski
c9b4f8306a Ensure VPNKit process is properly killed when errors occur
The log.Fatal* calls will leak the vpnkit process since
defer functions are not invoked when os.Exit(int) is invoked

We register an ExitHandler with logrus - that'll be invoke when
log.Fatal* is called

Signed-off-by: Steve Hiehn <shiehn@pivotal.io>
Signed-off-by: Dave Protasowski <dprotaso@gmail.com>
2017-12-05 09:48:09 -05:00
Ian Campbell
ce639e8080 linuxkit: implement docker image dependencies for pkg build.
This allows the `linuxkit/kubernetes` "image-cache" packages to use a standard
`linuxkit pkg build` based flow rather than requiring surrounding scaffolding.

Fixes #2766. Compared with the original (actually, the second) proposal made in
issue #2766, the field is `docker-images` rather than `images` to allow for
future inclusion of e.g. `containerd-images`.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-04 14:14:45 +00:00
Ian Campbell
98d46945d1 linuxkit: Use docker image «foo» consistently
In preference to the `docker «foo»` shortcut/aliases.

Better to be more specific.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-04 12:12:41 +00:00
Ian Campbell
8eed6a4b38 linuxkit: Rename Pkg.pkgPath to Pkg.path
Previous name a bit stuttery.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-12-04 12:12:41 +00:00
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
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
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
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
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
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
Marco Mariani
ce6dabfea0 add support for OS_CACERT, OS_INSECURE
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-10-30 12:12:14 +01:00
Justin Cormack
8fc857b293 Merge pull request #2643 from Wolphin-project/sec-groups
support for OpenStack security groups
2017-10-26 17:13:43 +02:00
Marco Mariani
d2a1457da7 log message fix: Info() -> Infof()
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-10-26 12:19:29 +02:00
Marco Mariani
0a2ce1a357 support for OpenStack security groups
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-10-26 12:19:01 +02:00
Justin Cormack
9ebcd04989 Merge pull request #2640 from Wolphin-project/image-server-id
Output image_id, server_id in stdout to ease automation
2017-10-25 18:17:41 +02:00
Justin Cormack
525a457bf5 Merge pull request #2634 from tomconte/azure-bootdiags
Add Azure boot diagnostics
2017-10-25 17:54:20 +02:00
Marco Mariani
5b96d96a7a output image_id, server_id in stdout to ease automation
Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
2017-10-25 14:00:40 +02:00