Skip to content

Support disabling default setup of shim logger.#3239

Merged
estesp merged 1 commit intocontainerd:masterfrom
sipsma:nosetuplog
Apr 25, 2019
Merged

Support disabling default setup of shim logger.#3239
estesp merged 1 commit intocontainerd:masterfrom
sipsma:nosetuplog

Conversation

@sipsma
Copy link
Copy Markdown
Contributor

@sipsma sipsma commented Apr 25, 2019

Before this change, the v2 runtime shim setup code was hardcoded to always
configure logrus to write logs to the "log" FIFO present in the current working
directory. This only happens in the "default" action codepath
(i.e. not shim start or shim delete).

This is problematic for shims that execute outside the current working
directory of a bundle. For example, it often doesn't make sense for shims that
manage multiple containers to execute in a single bundle directory. Additionally,
shim processes that require being pre-created, i.e. spun up before tasks they
will handle are actually created, won't have a log FIFO to write to until a task
is created.

This change leaves the default behavior as is but introduces a Binary Config
field that will optionally disable automatic configuration of logrus to use the
"log" FIFO. This allows shims to configure their own logger if necessary while
still re-using the rest of the shim helper code in containerd.

Signed-off-by: Erik Sipsma [email protected]

Before this change, the v2 runtime shim setup code was hardcoded to always
configure logrus to write logs to the "log" FIFO present in the current working
directory. This only happens in the "default" action codepath
(i.e. not shim start or shim delete).

This is problematic for shims that execute outside the current working
directory of a bundle. For example, it often doesn't make sense for shims that
manage multiple containers to execute in a single bundle directory. Additionally,
shim processes that require being pre-created, i.e. spun up before tasks they
will handle are actually created, won't have a log FIFO to write to until a task
is created.

This change leaves the default behavior as is but introduces a Binary Config
field that will optionally disable automatic configuration of logrus to use the
"log" FIFO. This allows shims to configure their own logger if necessary while
still re-using the rest of the shim helper code in containerd.

Signed-off-by: Erik Sipsma <[email protected]>
@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 25, 2019

Codecov Report

Merging #3239 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3239      +/-   ##
==========================================
- Coverage   44.63%   44.63%   -0.01%     
==========================================
  Files         113      113              
  Lines       12161    12162       +1     
==========================================
  Hits         5428     5428              
- Misses       5898     5899       +1     
  Partials      835      835
Flag Coverage Δ
#linux 48.65% <0%> (-0.01%) ⬇️
#windows 39.86% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
runtime/v2/shim/shim.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d780a7...48f4651. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 810b3c3 into containerd:master Apr 25, 2019
@sipsma sipsma deleted the nosetuplog branch April 25, 2019 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants