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

Add more logging to the copr-builder-ready script #3484

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Oct 17, 2024

So it doesn't have an empty stdout when everything went fine, e.g.

[2024-10-16 22:31:55,344][  INFO][PID:3774651] Checking that builder machine is OK
[2024-10-16 22:31:56,157][  INFO][PID:3774651] 
[2024-10-16 22:31:56,158][  INFO][PID:3774651] Filling build.info file with builder info

So it doesn't have an empty stdout when everything went fine:

    [  INFO][PID:3774651] Checking that builder machine is OK
    [  INFO][PID:3774651]
    [  INFO][PID:3774651] Filling build.info file with builder info
@FrostyX
Copy link
Member Author

FrostyX commented Oct 17, 2024

Now the logs looks like this for Fedora

[2024-10-17 10:30:57,720][  INFO][PID:4101539] Checking that builder machine is OK
[2024-10-17 10:30:58,347][  INFO][PID:4101539] Red Hat subscription not needed for fedora-40-x86_64
Builder is ready to be used

And RHEL:

[2024-10-17 10:30:48,604][  INFO][PID:4101535] Checking that builder machine is OK
[2024-10-17 10:30:48,699][  INFO][PID:4101535] Checking Red Hat subscription (attempt #1)
Red Hat subscription active
Builder is ready to be used

@@ -255,6 +255,7 @@ def _check_vm(self):
# generalize it into a separate package that we could eventually use
# here.
cmd = "copr-builder-ready " + self.job.chroot
self.log.info("Running remote command: %s", cmd)
Copy link
Member

Choose a reason for hiding this comment

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

nit: ton't you want to show stderr, if provided? might give us some warnings in advance

Copy link
Member Author

Choose a reason for hiding this comment

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

We do

if rc:
    self.log.info(stderr)

which should IMHO work fine.

Copy link
Member

Choose a reason for hiding this comment

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

but if rc == 0 and there's some output, we just swallow it

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it this way because for some reason my stderr is polluted by this line when testing this locally

Shared connection to builder closed.

So I intentionally wanted to swallow it. But we haven't seen that message in STG so I am confused.

Copy link
Member

Choose a reason for hiding this comment

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

🤷 if you want to hear my opinion, I don't think the logs need to be pretty - but must be complete (minus credentials, haha). But it is up to you, I already approved this PR.

Copy link
Member

@praiskup praiskup left a comment

Choose a reason for hiding this comment

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

Anyway, looks good. Thanks!

@nikromen nikromen merged commit 1d4005c into fedora-copr:main Oct 21, 2024
8 checks passed
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.

3 participants