-
Notifications
You must be signed in to change notification settings - Fork 196
Conversation
Blocked on the following trivial PRs which just need a few acks: |
I'm guessing the CI fail is due to the pending deps:
So, I'll mark this as DNM to stop the CI trying until we have those deps merged then. |
Yes - we really need those 3 other PRs merged... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hands up - I didn't scrutinise the code - but, for the general overview and intention,
lgtm
few minor queries...
.ci/run.sh
Outdated
eval "$cmd" | ||
done | ||
|
||
dir="." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note: the dir
feels strangely redundant (just *.log
would match in .
anyhow, no?). And, I'd probably have put a $(pwd)
maybe, but that is probably just personal preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
cmd/log-parser/Gopkg.toml
Outdated
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could nuke the example comments if you fancy.
cmd/log-parser/Makefile
Outdated
default: install | ||
|
||
check: | ||
go test . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we are relying on the global CI scripts to do any static analysis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - when any PR is raised on this repo, the .ci/static-checks.sh
will be run on all packages. In fact, that script is currently checking a leeeetle too much - see #100 :)
cmd/log-parser/README.md
Outdated
them, adding a time delta showing how much time has elapsed between each log | ||
entry. | ||
|
||
It is checks the logs for validity and can re-format the logs and output them in a different format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/It is/It/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
cmd/log-parser/README.md
Outdated
|
||
## Component logfiles | ||
|
||
The primary logfiles the tool reads are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume the tool itself is component neutral? It will work with any set of appropriately formatted log files I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a new section to the doc explaining the tools expectations.
cmd/log-parser/agent.go
Outdated
@@ -0,0 +1,94 @@ | |||
// Copyright (c) 2017-2018 Intel Corporation | |||
// | |||
// Licensed under the Apache License, Version 2.0 (the "License"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPDX headers here?
) | ||
|
||
// HexByteReader is an I/O Reader type. | ||
type HexByteReader struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, this is not something we could use package "encoding/hex" for is it?
(which I've used, but had some fun with before, as it only handles a single case (lower iirc), and I needed it to handle upper :-) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that package handles escaped hex values?
a723fc2
to
142adba
Compare
Hi @klynnrif - please could you take a look at the new |
209edce
to
45db9f0
Compare
Removing label now dependent PRs have landed... |
32589ab
to
635a7ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edited cmd/log-parser/README.md for grammar, format, and text flow. I might have changed the meaning with some edits - apologies in advance :). Thanks!
cmd/log-parser/README.md
Outdated
* [Usage](#usage) | ||
|
||
`kata-log-parser` is a tool that combines logfiles generated by the various | ||
system components, sorts them by timestamp and re-displays the log entries, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 8-9 suggested rewrite: system components, sorts them by timestamp, and re-displays the log entries. A time delta is added to shows how much time has elapsed between each log entry.
cmd/log-parser/README.md
Outdated
system components, sorts them by timestamp and re-displays the log entries, | ||
adding a time delta showing how much time has elapsed between each log entry. | ||
|
||
The tool also checks the validity of all log records and can re-format the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 11-12 suggested rewrite: The tool also checks the validity of all log records, can re-format the logs, and output them in a different format.
cmd/log-parser/README.md
Outdated
The tool also checks the validity of all log records and can re-format the | ||
logs and output them in a different format. | ||
|
||
For full details, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more information on the kata-log-parser
tool, use the help command:
cmd/log-parser/README.md
Outdated
## Logfile requirements | ||
|
||
The tool reads logfiles in the [logfmt](https://brandur.org/logfmt) structured | ||
logging format, for example as created by the golang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 23-24 suggested rewrite: logging format. For example, a logfile created by the golang logrus package.
cmd/log-parser/README.md
Outdated
logging format, for example as created by the golang | ||
[logrus](https://godoc.org/github.com/sirupsen/logrus) package. | ||
|
||
The tool requires the following fields to be defined for each log record: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tool requires that the following fields are defined for each log record:
cmd/log-parser/README.md
Outdated
format and including a nanosecond value. | ||
|
||
- Source field (`source`): a single word that specifies the name of a unique | ||
part of the system (for example, `proxy`, `runtime`, `shim`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of the system (e.g. proxy
, runtime
, shim
).
cmd/log-parser/README.md
Outdated
part of the system (for example, `proxy`, `runtime`, `shim`). | ||
|
||
- Name field (`name`): a single word that specifies the name of the | ||
application that generated the log record (for example, `kata-runtime`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application that generates the log record (e.g. kata-runtime
).
cmd/log-parser/README.md
Outdated
|
||
This log also includes embedded log entries from the | ||
[agent](https://github.com/katacontainers/agent). `kata-log-parser` | ||
automatically unpacks and displays these, discarding the proxies encapsulating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
automatically unpacks and displays the entries. During this process, the encapsulating proxy log messages are discarded.
cmd/log-parser/README.md
Outdated
|
||
## Usage | ||
|
||
To merge together all logs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To merge all logs:
cmd/log-parser/README.md
Outdated
``` | ||
1. Create a container. | ||
1. Collect the logs. | ||
1. Save the proxy log (which also includes agent log details): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save the proxy log, which includes agent log details:
bab5322
to
3d3d916
Compare
Hi @klynnrif - thanks for reviewing. Doc updated. |
94a06ed
to
5e07fb4
Compare
The CI is correctly detecting that the runtime logs are invalid:
This is because the version of |
Hi @klynnrif - thanks for re-reviewing. Could you add a "lgtm" comment as, alas, pullapprove doesn't honour the "thumbs-ups" 😄 |
@jodh-intel that is unfortunate :) "thumbs-ups" should always be honored. haha! Thanks! |
kata-containers/runtime#43 is now merged so re-started CI... Hi again @klynnrif - actually, I think you've got to use the approve button as the top right is still showing a red cross against your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@jodh-intel Okay, I think I'm set now :) let me know if not. Thanks! |
f84a8a1
to
26438aa
Compare
Add a log parsing tool (`kata-log-parser`) that reads multiple logfmt [*] logfiles and writes their output in time order showing time differences between log entries. The tool can also check logs for validity and convert the logs to various alternative formats. For full details: ``` $ kata-log-parser --help ``` Fixes kata-containers#93. [*] - https://brandur.org/logfmt Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Call the log parser at the end of the test run. It will check all component log files and display a detailed error message if any issues are found. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
26438aa
to
a03a589
Compare
CI is now failing due to an agent issue: kata-containers/agent#159. |
Blocked on kata-containers/agent#159. |
LGTM |
@jodh-intel I don't think you should bother with the CI failing right now. Kata is moving a lot and everything is not stable yet. This should not gate your PR from being merged. |
More specifically, blocked on: |
@sboeuf - wfm :) WDYT @grahamwhaley? We have 3 acks on this PR already... ;) |
Welllll - this works two ways - if we make the CI stable now, then we may abate major breakage as we 'move fast', which is a good thing. On the other hand, if we know we are fixing CI things that are going to be thrown in the bin (which I'm not convinced of...), then fine. I'd prefer we got CI running to stop us shooting our own feet off in the next couple of weeks. |
I agree that we want a stable CI. It's worth stating that this PR does not add any new tests - it adds a new (unused) tool. We also can see from the CI logs that the static checks pass for this PR. |
As explained by @jodh-intel, this PR cannot make the build worst as it is not introducing new tests. I think we should go ahead and merge it. |
Agree to merge this one.. |
Add a log parsing tool (
kata-log-parser
) that reads multiple logfmt[*] logfiles and writes their output in time order showing time
differences between log entries.
The tool can also check logs for validity and convert the logs to
various alternative formats.
For full details:
Fixes #93.
[*] - https://brandur.org/logfmt
Signed-off-by: James O. D. Hunt james.o.hunt@intel.com