-
Notifications
You must be signed in to change notification settings - Fork 1.1k
conmon: implement logging #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Yeah, the CLA still isn't signed but I though I'd open a PR so nobody else re-does work I've already done. It also opens the door for testing. |
|
Sweet! I'll test this out. |
|
I've just pushed a version where |
|
@cyphar Fails tests. I will try manual testing next. |
|
pod create/ctr create/ctr start work fine. However I don't see any logs in the container.log file :/ |
|
@mrunalp How did you run it? You need to give an absolute path to the log directory in your configs -- otherwise odd things happen to the cwd that I haven't figured out yet. For example, the test data is currently broken (though I think I included a fix) because it sets the |
|
@cyphar I'll try with setting the log_directory. Thanks! |
|
@mrunalp Note: if you set |
|
@cyphar I set pod log_directory to |
|
@mrunalp Just to make sure, you did this right (I actually made this mistake a few times): % sbox_id=$(sudo ./ocic pod create --config test/testdata/sandbox_config.json --name sandbox1)
% ctr_id=$(sudo ./ocic ctr create --config test/testdata/container_config.json --pod $sbox_id)
% sudo ./ocic ctr start --id $ctr_id # I forgot to do this a few times.After making the changes you mentioned. It works for me: |
|
@cyphar I have been testing container_redis.json. I'll try with the other config and check whether redis is writing to stdout or stderr. |
|
@cyphar I just got around to testing this again. Your example with ls works fine but redis-server doesn't work with or without tty. |
|
Okay, just retested this. redis works without tty but no logs with tty. |
|
Ping @cyphar any update? |
|
We are close to getting console rewrite merged in runc which worked last I tested so can just wait for that.
… On Nov 24, 2016, at 10:31 AM, Antonio Murdaca ***@***.***> wrote:
Ping @cyphar any update?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
@mrunalp thanks, wasn't aware of that |
|
What's the status of this? |
|
The same as above. There is a console rewrite PR in runC pending to be merged (opencontainers/runc#1018) -- when you apply that patch to runC this PR works properly. Otherwise there are issues with |
|
opencontainers/runc#1018 has been merged. I will rebase this soon. |
|
@cyphar any update on this one 👼 |
|
@runcom Sorry, |
|
Hmmm. I need to figure out where all of my |
|
@sameo Can you retest with etcd? |
|
okay, retested with latest and looks good 👍 :) will wait for tests to go green and @sameo retest. |
|
@mrunalp re-testing... |
|
LGTM (we can merge once tests are green) |
|
works for me as well |
|
EUGH. I made a typo in the lint command. The actual tests pass though. I'll push a fix. |
|
(Travis isn't giving a single fu*k about our tests apparently) |
|
I think it's because Travis limits the number of jobs for each organisation not repo, so there's some other job being run on behalf of @kubernetes-incubator that is blocking us. FFS. |
|
Oh goddammit. |
checking lint oci/oci.go:372::warning: declaration of err shadows declaration at oci.go:240: (vetshadow) oci/oci.go:265:15:warning: error return value not checked (os.RemoveAll(logPath)) (errcheck) Signed-off-by: Aleksa Sarai <[email protected]>
The runtimeversion test was incorrectly written and would fail for no good reason if setup_ocid happened to run a command that failed (even if it was handled). Signed-off-by: Aleksa Sarai <[email protected]>
This is necessary for --console-socket. Signed-off-by: Aleksa Sarai <[email protected]>
This adds a very simple implementation of logging within conmon, where every buffer read from the masterfd of the container is also written to the log file (with errors during writing to the log file ignored). Signed-off-by: Aleksa Sarai <[email protected]>
While pipes have their downsides, it turns out that socketpair(2) will
break any program that tries to open /dev/std{out,err} for writing
(because they're symlinked to /proc/1/fd/{1,2} which will cause lots of
fun issues with sockets).
Signed-off-by: Mrunal Patel <[email protected]>
Signed-off-by: Aleksa Sarai <[email protected]>
CRI requires us to timestamp our logs line-by-line by specifying whether
the line came from std{out,err} and the time at which the log was
recieved. This is a preliminary implementation of said behaviour
(without explicit newline handling at the moment).
Signed-off-by: Mrunal Patel <[email protected]>
Signed-off-by: Aleksa Sarai <[email protected]>
This is necessary, as otherwise ocid will use its own current directory as a log_directory, which is not the best idea in the world. The same applies for log_path. Signed-off-by: Aleksa Sarai <[email protected]>
The main purpose of these tests is to make sure that the log actually contains output from the container. We don't test the timestamps or the stream that's stated at the moment. Signed-off-by: Aleksa Sarai <[email protected]>
Because kubelet will create broken symlinks for logPath it is necessary to remove those symlinks before we attempt to write to them. This is a temporary workaround while the issue is fixed upstream. Ref: https://issues.k8s.io/44043 Signed-off-by: Aleksa Sarai <[email protected]>
|
🎉 The tests are green! 🦎 💚 |
|
Merging. |
|
@cyphar Yay 🎉 |
|
🎉 |
|
Does this help our k8s test matrix? |
|
Yes. This and other patches in progress for logging helped pass a lot of the tests.
… On Apr 8, 2017, at 1:09 PM, Daniel J Walsh ***@***.***> wrote:
Does this help our k8s test matrix?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
obs: qemu-vanilla: point to qemu repository.
This adds a very simple implementation of logging within conmon, where
every buffer read from the masterfd of the container is also written to
the log file (with errors during writing to the log file ignored). It also
includes changes to how we compute the logPath for a container.
The WIP part of this PR is that conmon currently doesn't really handle
containers where
terminal: false. This is going to be not-very-nice tofix because the current runC API is broken (which is why we need to
make sure that the current state of opencontainers/runtime-spec#513
is fixed). However, while that's being sorted (and I work on the
relevant console changes in runC) we can solve it with a
fork+execvethough no doubt there will be some fun issues with the exit code.
Closes #24.
Signed-off-by: Aleksa Sarai [email protected]