Skip to content
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

supervisor and svc pkg versions in sup log output #5666

Merged

Conversation

jeremymv2
Copy link
Contributor

@jeremymv2 jeremymv2 commented Sep 21, 2018

This change is targeted to humans reading Habitat Supervisor
logs whom wish to know the precise version of the Supervisor
and the Services that are managed.

17:48 $ sudo -E ./target/debug/hab sup run &
[1] 16618
hab-sup(MR): version core/hab-sup/0.64.0-dev <--
hab-sup(MR): Supervisor Member-ID 7807eb11c928433caffa0d04c8ae8a13
hab-sup(MR): Starting chef/automate-elasticsearch
hab-sup(MR): pkg version chef/automate-elasticsearch/6.2.2/20180527141927 <--
automate-elasticsearch.default(UCW): Watching user.toml
hab-sup(MR): Starting core/redis
hab-sup(MR): pkg version core/redis/3.2.4/20170514150022 <--
redis.default(UCW): Watching user.toml
...

Signed-off-by: Jeremy J. Miller jm@chef.io

This change is aimed at humans reading Habitat Supervisor
logs and wishing to know precise versions of the Supervisor
and the Services that are running.

Signed-off-by: Jeremy J. Miller <jm@chef.io>
Signed-off-by: Jeremy J. Miller <jm@chef.io>
@jeremymv2
Copy link
Contributor Author

jeremymv2 commented Sep 24, 2018

It appears to me that the AppVeyor build failed with an unrelated error:

✗✗✗
✗✗✗ We tried 5 times but could not download core/hab-studio/0.63.0/20180914030343. Giving up.
✗✗✗

Copy link
Contributor

@christophermaier christophermaier left a comment

Choose a reason for hiding this comment

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

@jeremymv2 This would be a great improvement to the logging output. I think we can simplify the code a bit here, but then this would be great to merge.

Thanks again!

.release
.as_ref()
.unwrap_or(&"UNKNOWN".to_string())
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should be able to replace all this with

outputln!("pkg version {}", service.pkg.ident);

since PkgIdent implements Display.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking a bit more, In terms of unifying the log output more, it may be better to remove the outputln! call from line 585 and do it all down here:

outputln!("Starting {} ({})", spec.ident, service.pkg.ident);

That would give us a single line like this:

hab-sup(MR): Starting core/redis (core/redis/3.2.4/20170514150022)

rather than

hab-sup(MR): Starting core/redis
hab-sup(MR): pkg version core/redis/3.2.4/20170514150022

@christophermaier
Copy link
Contributor

@jeremymv2 Yeah, I think that error is unrelated to this work.

Signed-off-by: Jeremy J. Miller <jm@chef.io>
@jeremymv2
Copy link
Contributor Author

I like your idea @christophermaier
I've tried to unify the output further, here is what it looks like now:

hab-sup(MR): core/hab-sup (core/hab-sup/0.64.0-dev)
hab-sup(MR): Supervisor Member-ID 7807eb11c928433caffa0d04c8ae8a13 
hab-sup(MR): Starting core/redis (core/redis/3.2.4/20170514150022)
redis.default(UCW): Watching user.toml

@christophermaier christophermaier merged commit f6092c3 into habitat-sh:master Sep 24, 2018
chef-ci pushed a commit that referenced this pull request Sep 24, 2018
Obvious fix; these changes are the result of automation not creative thinking.
@jeremymv2 jeremymv2 deleted the jeremymv2/versions_cause_why_not branch September 24, 2018 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants