Commit Graph

6788 Commits

Author SHA1 Message Date
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
David Scott
6eabfdcb96 projects/logging: add modern build.yml and Dockerfile
Signed-off-by: David Scott <dave@recoil.org>
2018-07-06 21:47:49 +01:00
Rolf Neugebauer
2c8438f64b
Merge pull request #3093 from TiejunChina/master-dev
update -rt to 4.14.53-rt34
2018-07-06 11:11:03 +01:00
Tiejun Chen
a1d47ff766 update -rt to 4.14.53-rt34
Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
2018-07-06 14:02:07 +08:00
Rolf Neugebauer
9088e3f843
Merge pull request #3088 from rn/kernel-up
Update kernel to 4.17.4/4.14.53/4.9.11/4.4.139
2018-07-05 10:15:07 +01:00
Justin Cormack
e1cff3614a
Merge pull request #3090 from rn/june-report
June 2018 LinuxKit report
2018-07-05 10:00:06 +01:00
Rolf Neugebauer
977dec7ae2
Merge pull request #216 from justincormack/gnutar2
Use PAX tar format
2018-07-04 16:08:57 +01:00
Rolf Neugebauer
91bed426f1
Merge pull request #3089 from masterzen/fix/3087-faq-and-motd
Some FAQ and motd update
2018-07-04 15:05:54 +01:00
Brice Figureau
9a1d9fb1eb Add FAQ entries to help troubleshoot running containers
Since I struggled to understand and find information about how to
troubleshoot a running linuxkit instance, I propose to add these two
FAQ entries.
The first one explains why it is possible to not see the `containerd` or
`init` outputs at boot in the console.
The second one gives a few `ctr` example to list containers, running
containers or how to open a shell in a given container.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-07-04 13:51:19 +02:00
Rolf Neugebauer
b859e7ab4d June 2018 LinuxKit report
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-04 11:24:25 +01:00
Rolf Neugebauer
498d4f1a91 Update YAMLs to latest kernels
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-04 10:38:55 +01:00
Brice Figureau
f7ff31382b Make sure motd contains the correct ctr command
The listed namespace wasn't correct, and thus the given `ctr` command
wasn't working.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
2018-07-04 11:32:36 +02:00
Rolf Neugebauer
909a9fac68
Merge pull request #3086 from mat007/fix-windows-build
Fix windows build
2018-07-03 18:19:46 +01:00
Rolf Neugebauer
dcc4a5e799 kernel: Update to 4.17.4/4.14.53/4.9.111/4.4.139
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2018-07-03 11:49:36 +01:00