You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common scenario for pods is to write container logs (`stdout` and
`stderr`) to a file on the host (specified by the `LogPath` and
`LogDirectory` CRI fields), and then mount that directory to another
(e.g., a monitoring or observability container) in the pod for
consumption.
For LCOW, this means logs must traverse from the uVM to the host, and
then back into the uVM via (plan9) share, which both:
- adds unnecessary overhead; and
- exposes data to the host.
Address this by adding annotations to mimic `LogPath` and `LogDirectory`
functionality, but within the uVM.
Since the uVM rootfs is not directly backed by a VHD (i.e., directories
are either RO or `tmpfs` backed), create a dedicated directory in the
sandbox scratch for logs, and allow that path to be mounted within a
container.
Note: containerd expects to be the end-all sink for container
logs, use `io.MultiWriter` to keep default behavior and write logs to
the specified path while also exposing them to the host.
Therefore, annotations use `TeeLog` (instead of just `Log`) to make
behavior explicit.
Add `LCOWTeeLogPath` annotation to tee container `stdin` and `stderr`
to a specified file within the uVM, relative to a dedicated log
directory in the sandbox scratch.
Add `LCOWTeeLogDirMount` annotation to mount the above log directory to
the specified path within the container.
Add a dedicated `trapsort.MultiWriter` type that writes to both an
underlying `transport.Connection` and the provided `io.Writer`.
Move `logConnection` from `stdio` to `transport`, to keep the
different `Connection` implementations together.
Add functional tests.
Streamline `test/internal/util` by making `CleanName` operation on the
test name directly (`testing.TB.Name()`), since that is the majority of
the usage.
Add `CleanString` to handle the original functionality.
Signed-off-by: Hamza El-Saawy <[email protected]>
0 commit comments