-
Notifications
You must be signed in to change notification settings - Fork 138
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
always log output to a file #1205
Conversation
I'm not sure that I would want the logfiles to be in /var/log rather than the current scratchdir but it LGTM, +1 |
@dirkmueller Thanks. Regarding the location, your opinions are very welcome on the discussion in #224 ... as long as you agree with me. Just kidding ;-) |
@@ -15,6 +15,13 @@ | |||
# 2. This tool relies on the script qa_crowbarsetup.sh | |||
# 3. Please 'export' environment variables according to your needs. | |||
|
|||
: ${virtualcloud:=virtual} | |||
|
|||
: ${log_dir:=/var/log/mkcloud/$virtualcloud} |
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.
👎
Oh there can be many clouds with the (internal) name 'virtual' on the same host.
The differentiating name is held in the $cloud
variable.
+1 |
-100 - see commented code |
OK, I think I see what you mean. This would break things for non-virtual clouds like the hardware QA clouds? I find the use of these undocumented variables in the code (including untracked scripts on Tangent: IMHO this just proves the importance of #220 and #256, which sadly have not progressed in over a year, because currently noone owns the responsibility of fixing them. If we clearly defined ownership / maintainership for the various components, I expect this type of problem of lack of progress would happen less. It would still happen of course because we all have too much to do and not enough time, but ownership -> specialization -> focus -> less context-switching / fewer distractions -> less tired brains -> more productivity! |
@aspiers: No, thats not the point. You can run multiple 'virtual' clouds on a single host at the same time. With this proposed patch they would both log to the same log file. Thats the conflict. Instead of
There should no longer be untracked scripts. We put them into git even months ago.
Thats why I am looking forward to join the automation squad soon, to be able to improve and cleanup a lot. |
No they wouldn't. For example, the mysteriously-named
so in the majority of cases, both variables have the same value which is different for each virtual cloud on a host. (Secondly, this PR makes each
Please can you explain how this can possibly be true given the above code? Because I just don't get it. Having said that, I have no problem changing the PR to use
Sorry, I don't understand this sentence at all. What is
There are still loads of untracked scripts, because I'm not just talking about the
But even the host config had issues last time I looked.
Sounds great! |
Sure. There is more than just our mkcloud workers who happen to set different names even for the virtual clouds. Everybody can run multiple clouds on his own system/workstation/server/wherever and they will all default to the same virtualcloud name "virtual". This value is just used to create different network configurations in qa_crowbarsetup. And "virtual" is just one case (besides d1, d2,.., qa1, qa2,...,cumulus). And here is the default:
Ok, thanks, please change it :)
It was an example.
Well the majority is not enough for this kind of change. It should break no other use cases.
Its called manual .... It has nothing to do with jenkins or any official part of our automation. These are configs from developers for manually created clouds which they use temporarily. Its just developers playing with clouds. Its kind of their home directory on an mkcloud host. You could also name such a directory |
Although AFAICS that default value never gets used, because in the virtual cloud cases, the variable gets set to same value as
OK, now it's becoming clearer. Actually this value is not directly referenced in
OK, so
As the person who has complained the most about resource contention on
Will do. But we should also improve the variable naming ...
Agreed - I was trying to understand which situations it would break, and it seems I confirmed my guess that it would break the hardware clouds where
I know that, of course! That's why I said "I find the use of these undocumented variables in the code (including untracked scripts on mkch* hosts) very confusing", and also why I posted this:
I think that's an overly narrow view. To make this stuff all work well, we need to consider use cases, how developers are currently using |
025d2b1
to
f8ada33
Compare
+1 |
Now uses |
Again, there is more than our mkchX workers. The default will be default for all other runs.
No, it is passed to qa_crowbarsetup with this line:
If we want to call kvm virtual 'hardware', yes :)
Thats historical debt. In the beginning this variable was kind of a boolean. It only switched between virtual and non virtual. The support for other clouds (real hardware clouds) was introduced later and the same variable was (mis)used without refactoring it (I guess because we did not want to break existing automation back then). IMHO configuration data for different hardware clouds should not even be part of mkcloud/qa_crowbarsetup but rather be kept in separately maintained config files. |
Thanks 👍 |
Travis is not happy :/ |
for required_var in cloud; do | ||
if [ "${!required_var:+defined}" != 'defined' ]; then | ||
echo "mkcloud requires $required_var variable to be set; aborting" >&2 | ||
exit 1 |
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.
-1 "mkcloud requires cloud variable to be set" breaks mkcloud help function as discovered by travis CI 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.
Oops, good point :-/
OK, third time lucky. |
@@ -15,6 +15,15 @@ | |||
# 2. This tool relies on the script qa_crowbarsetup.sh | |||
# 3. Please 'export' environment variables according to your needs. | |||
|
|||
if [[ "$cloud" ]]; then |
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 move this line
: ${cloud:=cloud}
above this block and skip the check?
Btw: no quotes required.
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 agree. There is no point in testing for a variable, that gets a default value some lines below.
This eliminates the risk of losing crucial debug output in a long mkcloud run because you forgot to redirect to a file and the terminal/screen/tmux scrollback buffer wasn't big enough. Closes SUSE-Cloud#1191.
Fourth time lucky ... |
still +1 if gating passes |
+1 |
This eliminates the risk of losing crucial debug output in a long mkcloud run because you forgot to redirect to a file and the terminal/screen/tmux scrollback buffer wasn't big enough.
Closes #1191.