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

logging: Add sandbox CLI option#90

Merged
sboeuf merged 3 commits intokata-containers:masterfrom
jodh-intel:add-sandbox-to-logs
Jul 5, 2018
Merged

logging: Add sandbox CLI option#90
sboeuf merged 3 commits intokata-containers:masterfrom
jodh-intel:add-sandbox-to-logs

Conversation

@jodh-intel
Copy link

Added a new -sandbox command-line option. This is not required by the
proxy itself, but is used to add a sandbox log field to make log
analysis easier.

Also changed the initial log message to show the standard "announce" message tag along with fields for each of the command-line options.

Fixes #87.

Signed-off-by: James O. D. Hunt [email protected]

@jodh-intel
Copy link
Author

Note: the -sandbox option is not mandatory (yet). The plan is:

  • land this PR.
  • update the runtime/vc to launch the proxy with the new -sandbox option.
  • raise a new proxy PR to make the option mandatory.

Alternatively, I could raise a runtime PR to pass the option now and we could land them together.

I don't mind either way - thoughts @sboeuf, @bergwolf, @grahamwhaley?

@grahamwhaley
Copy link
Contributor

I thought we might add it as an optinal (that is, not mandatory) in order to not break backwards compatibility. We could then make it mandatory later once all versions support it and have filtered through and/or been deprecated.

@gnawux
Copy link
Member

gnawux commented Jul 4, 2018

As it is used in logs only, I think optional is enough.

@jodh-intel
Copy link
Author

Thanks guys. The option is currently optional so this should work for us ;) I'll raise a runtime PR to add the option when starting the kata proxy and block on this PR landing...

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

@opendev-zuul
Copy link

opendev-zuul bot commented Jul 4, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@codecov
Copy link

codecov bot commented Jul 4, 2018

Codecov Report

Merging #90 into master will decrease coverage by 0.46%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
- Coverage   34.63%   34.16%   -0.47%     
==========================================
  Files           2        2              
  Lines         231      240       +9     
==========================================
+ Hits           80       82       +2     
- Misses        141      148       +7     
  Partials       10       10
Impacted Files Coverage Δ
proxy.go 29.12% <28.57%> (-0.32%) ⬇️

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 749b317...1672418. Read the comment docs.

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

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

one minor nit comment

proxy.go Outdated
"name": proxyName,
"pid": os.Getpid(),
"source": "proxy",
"sandbox": sandboxID,
Copy link

Choose a reason for hiding this comment

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

since sandboxID is optional, I think you should add it only if it's not empty, right?

Copy link
Author

Choose a reason for hiding this comment

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

I guess that's fair :) Branch updated.

@jodh-intel jodh-intel force-pushed the add-sandbox-to-logs branch from 990aa7a to 6de5cad Compare July 5, 2018 05:44
@opendev-zuul
Copy link

opendev-zuul bot commented Jul 5, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@jodh-intel
Copy link
Author

Hi @raravena80 - amusing problem - Travis is failing over here, but only for osx:

$ .ci/static-checks.sh
/Users/travis/gopath/src/github.com/kata-containers/tests/.ci/static-checks.sh: line 24: typeset: -A: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...

The static-checks.sh script is now failing as I recently updated it on kata-containers/tests#471. The problem here appears to be due to osx not providing a new enough version of bash that supports associative arrays. Any idea how to fix this?

@devimc
Copy link

devimc commented Jul 5, 2018

lgtm

James O. D. Hunt added 2 commits July 5, 2018 13:43
The version of bash provided by OSX under Travis is too old to support
`typeset -A`, so install a newer version using homebrew.

Signed-off-by: James O. D. Hunt <[email protected]>
For parity with other system components, Change the initial log message
to show the standard "announce" message tag along with fields for each
of the command-line options.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel jodh-intel force-pushed the add-sandbox-to-logs branch from 6de5cad to fc4c79e Compare July 5, 2018 12:43
@jodh-intel
Copy link
Author

@raravena80 - I think I've fixed it by installing bash using homebrew.

@opendev-zuul
Copy link

opendev-zuul bot commented Jul 5, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@sboeuf
Copy link

sboeuf commented Jul 5, 2018

@jodh-intel are you planning to add some unit tests here ? If not, let me know and I'll merge it!

@jodh-intel jodh-intel force-pushed the add-sandbox-to-logs branch from fc4c79e to e5f334c Compare July 5, 2018 14:52
@jodh-intel
Copy link
Author

Tests added! ;)

Added a new `-sandbox` command-line option. This is not required by the
proxy itself, but is used to add a `sandbox` log field to make log
analysis easier.

Fixes kata-containers#87.

Signed-off-by: James O. D. Hunt <[email protected]>
@opendev-zuul
Copy link

opendev-zuul bot commented Jul 5, 2018

Build failed (third-party-check pipeline) integration testing with
OpenStack. For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@raravena80
Copy link
Member

@jodh-intel good to hear. It would be interesting to find out what version of bash travis is using. This is what's on my laptop for High Sierra:

$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)
Copyright (C) 2007 Free Software Foundation, Inc.

@sboeuf sboeuf merged commit 7e2a93d into kata-containers:master Jul 5, 2018
@jodh-intel
Copy link
Author

@raravena80 - I don't think the version was logged but bash 4 added associative arrays (typeset -A) so it is likely to be version 3.*.

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.

6 participants