Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

shim: Add option to read and print the logs from the agent #172

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

devimc
Copy link

@devimc devimc commented Apr 26, 2019

shim is now able to read and print the agent logs, making the
debugging processes easier when use_vsocks is true.

fixes #171

Signed-off-by: Julio Montes julio.montes@intel.com

@devimc devimc force-pushed the topic/vsocks/printAgentLogs branch 2 times, most recently from b7a0cda to b025ced Compare April 26, 2019 16:55
@devimc
Copy link
Author

devimc commented Apr 26, 2019

/test

Copy link
Contributor

@grahamwhaley grahamwhaley left a comment

Choose a reason for hiding this comment

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

lgtm
minor nits
oh, if this works, that'll be great @devimc :-)

main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
Copy link

@sboeuf sboeuf left a comment

Choose a reason for hiding this comment

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

@devimc this sounds like a nice way to bypass the vsock limitation for agent logs.
But the question is, from a kata-runtime perspective, which shim are you going to pick to listen onto the socket?
My concern is that you will have each container level shim listening onto this socket, while we want only a single entity listening to this (since the agent is considered pod level), right?

@devimc
Copy link
Author

devimc commented Apr 26, 2019

@sboeuf

But the question is, from a kata-runtime perspective, which shim are you going to pick to listen onto the socket?

the fist shim (sandbox)

My concern is that you will have each container level shim listening onto this socket, while we want only a single entity listening to this (since the agent is considered pod level), right?

yes, only the sandbox shim is going to listen it, see devimc/kata-runtime@09b5bb9

devimc pushed a commit to devimc/kata-runtime that referenced this pull request Apr 26, 2019
The proxy is in charge to print the agent logs, but when `use_vsocks` is true
the runtime doesn't start the proxy, because it's not needed, hence the agent
logs are ignored. To mitigate this limitation and to make the debugging
processes easier, the fist shim started (the one who monitors the sandbox)
will read the console.sock and print the agent logs.

Depends-on: github.com/kata-containers/shim#172

fixes kata-containers#1596

Signed-off-by: Julio Montes <julio.montes@intel.com>
@devimc devimc force-pushed the topic/vsocks/printAgentLogs branch from b025ced to 5bd1799 Compare April 26, 2019 18:28
@devimc
Copy link
Author

devimc commented Apr 26, 2019

@grahamwhaley changes applied, thanks

@devimc
Copy link
Author

devimc commented Apr 26, 2019

/test

shim is now able to read and print the agent logs, making the
debugging process easier when `use_vsocks` is true.

fixes kata-containers#171

Signed-off-by: Julio Montes <julio.montes@intel.com>
@devimc devimc force-pushed the topic/vsocks/printAgentLogs branch from 5bd1799 to 8df14a1 Compare April 26, 2019 18:35
@devimc
Copy link
Author

devimc commented Apr 26, 2019

/test

@sboeuf
Copy link

sboeuf commented Apr 26, 2019

@devimc

yes, only the sandbox shim is going to listen it, see devimc/kata-runtime@09b5bb9

Ok this sounds good, but are you sure the ContainerType annotation is going to be provided in case of Docker? This will work for CRI callers (CRI-O, CRI/containerd), but I am worried this will not work for Docker.

@devimc
Copy link
Author

devimc commented Apr 26, 2019

@sboeuf it's working on docker and the CI seems happy kata-containers/runtime#1597

@grahamwhaley
Copy link
Contributor

Fedora CI failed - I'll nudge:

state container 
  with workload [true], timeWait 5
  /tmp/jenkins/workspace/kata-containers-shim-fedora-PR/go/src/github.com/kata-containers/tests/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go:46
Running command '/usr/local/bin/kata-runtime [kata-runtime --log=/tmp/bundle345590837/log run --bundle=/tmp/bundle345590837 --console= --pid-file=/tmp/bundle345590837/pid --detach ahkdkPuqiwbRLh9nfCIU]'
command failed error 'exit status 1'
[kata-runtime --log=/tmp/bundle345590837/log run --bundle=/tmp/bundle345590837 --console= --pid-file=/tmp/bundle345590837/pid --detach ahkdkPuqiwbRLh9nfCIU]
Timeout: 120 seconds
Exit Code: 1
Stdout: 
Stderr: Failed to check if grpc server is working: rpc error: code = Unavailable desc = transport is closing

Running command '/usr/local/bin/kata-runtime [kata-runtime list --quiet]'
[kata-runtime list --quiet]
Timeout: 120 seconds
Exit Code: 0
Stdout: 
Stderr: 

Ignoring Power8 CI for now until I hear it is back to being stable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to print the logs from the agent
4 participants