Commit Graph

6108 Commits

Author SHA1 Message Date
Rolf Neugebauer
a0a4ec5449 Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 15:13:58 +01:00
Rolf Neugebauer
cd4d50920a tools: Update to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 14:59:45 +01:00
Rolf Neugebauer
4eddd90ae2
Merge pull request #3103 from rn/kup
Update kernel to 4.17.5/4.14.54
2018-07-10 14:21:06 +01:00
Rolf Neugebauer
4ee42d63b9
Merge pull request #3102 from ijc/containerd-v1.1.1
Containerd v1.1.1
2018-07-10 13:05:11 +01:00
Rolf Neugebauer
a90d4a92d5 Update YAMLs to the latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 13:03:09 +01:00
Rolf Neugebauer
6a7b336ade kernel: Update to 4.17.5/4.14.54
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-10 10:58:18 +01:00
Ian Campbell
ec2dfa6625 Revert "tests: Temporarily disable containerd test"
This reverts commit 177008fe0c. The underlying
issue was fixed in containerd v1.1.1.

Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 10:46:42 +01:00
Ian Campbell
93496067ea Bump yml to pickup containerd v1.1.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 10:19:14 +01:00
Ian Campbell
18f11b2834 Bump packages to new alpine w/ containerd v1.1.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 09:53:11 +01:00
Ian Campbell
8ad9f65ec8 alpine: Bump to containerd v1.1.1
Signed-off-by: Ian Campbell <ijc@docker.com>
2018-07-10 04:52:57 -04:00
Rolf Neugebauer
20bd54c6b0
Merge pull request #3095 from djs55/more-logging
Support log rotation and logging of /dev/kmsg
2018-07-09 22:34:43 +01:00
David Scott
facadbf548 examples/logging: add kmsg to read /dev/kmsg
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
9344473ba5 pkg/kmsg: add simple test case
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
e7fc5b59a3 pkg/kmsg: re-run vndr
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
793dd1b257 Add pkg/kmsg
This very simple program reads from `/dev/kmsg` and logs the output.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:58 +01:00
David Scott
565f787bb3 Add pkg/logwrite which writes and rotates log files
This process connects to memlogd and streams logs to individual files,
one per log. It keeps track of how many bytes have been written to each
file and rotates when the file size exceeds a defined threshold.

By default the maximum size of each file before rotation is 1MiB and
we keep up to 10 files per log.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-09 20:36:51 +01:00
Rolf Neugebauer
4b4d56913d
Merge pull request #3100 from zx2c4-forks/wireguard-bump
wireguard: upgrade to 0.0.20180708
2018-07-09 08:39:50 +01:00
Jason A. Donenfeld
05753e7341 wireguard: upgrade to 0.0.20180708
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-08 19:43:03 +02:00
Rolf Neugebauer
b305db0ae5
Merge pull request #3098 from rn/alpine3.8
Update to Alpine 3.8
2018-07-07 23:54:07 +01:00
Rolf Neugebauer
177008fe0c tests: Temporarily disable containerd test
Looks like brtfs-prog v4.17 as shipped with alpine:3.8 requires
a loopback device of 109MB while the containerd tests only
create a 100MB device. This causes the test to fail.

Disable it until https://github.com/containerd/containerd/issues/2447
is fixed.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 21:59:40 +01:00
Rolf Neugebauer
8301540809 Update remaining uses of alpine:3.7 to alpine:3.8
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 19:26:58 +01:00
Rolf Neugebauer
63ae346152 Update YAMLs to latest pkg versions
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 19:25:21 +01:00
Rolf Neugebauer
6045ddaf51 pkg: Use alpine 3.8 version of go (no need for go1.10)
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 18:24:56 +01:00
Rolf Neugebauer
a9acdd827e pkg: Update packages to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 18:05:29 +01:00
Rolf Neugebauer
d7d995cab5 kernel: Update build to use updated alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 17:51:08 +01:00
Rolf Neugebauer
21f65528d2 Update use of test packages to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 17:50:34 +01:00
Rolf Neugebauer
38636e80d9 tests: Use go (not go1.10) for containerd test
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 14:05:42 +01:00
Rolf Neugebauer
c6c502c631 tests: Update packages to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 14:03:01 +01:00
Rolf Neugebauer
5c8df3837d Update use of tools to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 14:00:07 +01:00
Rolf Neugebauer
48ca3f1302 tools: Update to latest alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 13:27:48 +01:00
Rolf Neugebauer
20e71cf09e tools/alpine: Update alpine base
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 08:21:54 -04:00
Rolf Neugebauer
1b23313bb3 tools/alpine: Remove gummiboot for arm64
The package does not exist any more in 3.8 and I can't
see any uses for it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 11:43:06 +01:00
Rolf Neugebauer
53af0ce80c tools/alpine: Remove go1.10
alpine:3.8 comes with go 1.10 as default

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 09:30:51 +01:00
Rolf Neugebauer
3c492fe40a tools/alpine: Update to alpine:3.8
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@gmail.com>
2018-07-07 09:29:59 +01:00
Rolf Neugebauer
29c3ef0aa0
Merge pull request #3085 from djs55/update-logging
Support pluggable logging systems
2018-07-07 09:21:13 +01:00
David Scott
5d614468a0 Update linuxkit/init and linuxkit/memlogd yamls
Signed-off-by: David Scott <dave@recoil.org>
2018-07-06 21:51:04 +01:00
David Scott
9bbc0ecbee projects/logging: delete the remaining unused bits
Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
92a9a64a1b examples: add the example from projects/logging
This simplifies the example by adding a service which writes to the
log every 1s and a getty for introspection.

To see the logs:

  /proc/1/root/usr/bin/logread -F

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
a07ecf60d5 memlogd: use kmsg format for reading the logs
Switch to a more formally-specified `kmsg`-style format for reading
the logs.

- update the spec in docs/logging.md
- check for bad names in pkg/memlogd with unit test

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
fe64f33430 memlogd: add test cases
- check writing to the log does not block
- check the log doesn't expand -- it should be finite
- check that client connections don't buffer arbitrary amounts of
  data if the client is slow

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
6aca715ad8 memlogd: replace an unbounded buffer with bounded channel
Previously we had a per-connection

  bytes.Buffer // to be written to the connection
  sync.Cond    // to allow us to Wait for more data

This had the major disadvantage that the buffer was unbounded and so
a slow client could cause memory exhaustion in the server. This patch
replaces these with a single

  chan *logEntry

which is naturally bounded and supports blocking read. We make write
non-blocking using select i.e. we drop messages rather than allocate
more space.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:26 +01:00
David Scott
3e742018d6 memlogd: use net.Conn rather than *net.UnixConn
There's no need to be so specific about the connection implementation.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:25 +01:00
David Scott
c92af038fb projects/logging: promote pkg/memlogd to a toplevel package
This is an example external logging service which can be enabled by
adding it to the `init` section of the .yml, for example:

    ...
    init:
      - linuxkit/init:35866bb276c264a5f664bfac7456f4b9eeb87a4d
      - linuxkit/runc:v0.4
      - linuxkit/containerd:f2bc1bda1ab18146967fa1a149800aaf14bee81b
      - linuxkit/ca-certificates:v0.4
      - linuxkit/memlogd:cc035e5c9e4011ec1ba97a181a6689fc90965ce9
    onboot:
    ...

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:25 +01:00
David Scott
638c455dd2 docs: document how to use an external logging service
This is an updated version of projects/logging/README.md

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:25 +01:00
David Scott
f4bbce7a6c service: use the logging system with runc
If external logging is enabled, this patch sets the stdout and stderr
of the `runc` invocations to one end of a socketpair and the other end is
sent to the logging service. Otherwise we log to files as before.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:49:21 +01:00
David Scott
4dc75bc67b service: use the logging system with containerd
An external logging system exists if the socket

  /var/run/linuxkit-external-logging.sock

exists.

If an external logging system is enabled then create FIFOs for
containerd and send the other end of the FIFOs to the logging service.
Otherwise use /var/log files as before.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:48:57 +01:00
David Scott
1795c15276 projects/logging: start memlogd from init.d
Previously memlogd would always run in the foreground. This patch
adds a `-daemonize` option which binds the /var/run sockets, forks
and execs itself and immediately returns. Therefore the program won't
block (important for an init.d script) but guarantees the sockets will
be available for any program started afterwards.

This also removes the alpine base from the memlogd image as `init`
"containers" are treated as simple file overlays.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:50 +01:00
David Scott
6dfd40a639 projects/linuxkit: bind /var/run in the memlogd container
We will place the control sockets in the root /var/run and then share
with all services who need access.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:50 +01:00
David Scott
d09fbe04fb projects/logging: use /var/run for sockets by default
Previously we used /tmp, but /var/run is a better place for these.

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:49 +01:00
David Scott
8727bcb4f3 projects/logging: fix govet composite literal error
This fixes the error

net.UnixAddr composite literal uses unkeyed fields

Signed-off-by: David Scott <dave.scott@docker.com>
2018-07-06 21:47:49 +01:00