-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add --log-file argument and log test result details #54
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kyle Edwards <[email protected]>
b7953f1
to
eb92df3
Compare
Signed-off-by: Kyle Edwards <[email protected]>
Signed-off-by: Kyle Edwards <[email protected]>
Signed-off-by: Kyle Edwards <[email protected]>
cdfafe6
to
5aa7e33
Compare
Signed-off-by: Kyle Edwards <[email protected]>
Signed-off-by: Kyle Edwards <[email protected]>
48a196d
to
7337049
Compare
Signed-off-by: Kyle Edwards <[email protected]>
Signed-off-by: Kyle Edwards <[email protected]>
Signed-off-by: Kyle Edwards <[email protected]>
b8c09d9
to
febd36a
Compare
I'd like to revive this, but I don't have write access here. @KyleFromNVIDIA could you update this to latest And @jacobtomlinson after that could you help us out with a 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.
Thanks for the patience on the review here.
I'm keen to dig into the motivation here, particularly around logging to a file. I expect canary will be used mostly in CI, so I would want output to be logged to stdout where it can be captured by the CI runner rather than disappearing into a file.
If I understand correctly the goal here is to provide more verbose messages around failures. Why not use the existing console output to supply this information?
@@ -40,7 +40,7 @@ checks: | |||
description: 🌏 Exposes an HTTP interface on port 8888 | |||
probe: | |||
httpGet: | |||
path: / | |||
path: /hub/jovyan |
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'm curious about the motivation here. This feels orthogonal to the rest of this PR.
It's my understanding that Kubeflow only expects a service on port 8888
, not any particular path on that web server. You could equally run VSCode Server or some other application and expect it to work.
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.
This PR has some bug fixes and tests too. One of the bugs was that it wasn't checking the status code when doing httpGet
. I fixed that, but as a result this test started failing (I don't remember what the return code was). GET
ting a different path got a successful status code.
@@ -85,6 +90,7 @@ func imageArg(cmd *cobra.Command, args []string) error { | |||
func init() { | |||
rootCmd.AddCommand(validateCmd) | |||
validateCmd.PersistentFlags().String("file", "", "Path or URL of a manifest to validate against.") | |||
validateCmd.PersistentFlags().String("log-file", "", "File to print log output to.") |
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.
Why not use stdout? That gives more flexibility for redirection.
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 believe stdout is already consumed by the user-readable output. Writing to a separate log file allows us to get separate machine-readable output, and CI can always cat
the file if we want the developer to see it (that's what I plan on doing).
@jameslamb I've added you to the codeowners team here. @KyleFromNVIDIA I was unable to add you as you're not a member of the @NVIDIA org, we probably need to figure out how to add you so that you can be added to the codeowners. |
I've fixed this, you can go ahead and add me. |
@jameslamb @jacobtomlinson Is there anything else left to address here? |
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'm still not sold on the design here I'm afraid. Writing detailed information to a logfile feels unusual in the context of this tool.
A core goal of container canary is to fit in comfortably in the cloud tooling ecosystem and behave in ways that match the expectations of users of cloud-native tooling like Kubernetes and Docker.
Given that canary
is a tool that is intended to be used primarily in CI or remote environments it's much more common to always write to stdout/stderr with a configurable level of verbosity. A large motivation for this is that we assume the environment is ephemeral and the filesystem is lost after the job completes, but the standard streams are captured by an external logging service.
Adding a flag to write to a log file, then adding a cat
command feels like a long winded way to just bump up the verbosity with a flag.
If there is strong motivation to merge this as it is I'd love to see some examples of other tools that follow this pattern of writing a more verbose stream to a separate file on disk. Especially tools which we expect to be commonly used alongside canary
.
Add a
--log-file
argument for container-canary to write detailed logs, so that developers can see exactly how and why a test failed.