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

USHIFT-2992: Image builder cleanup: don't stop osbuild-composer.socket #3271

Conversation

pmtk
Copy link
Member

@pmtk pmtk commented Apr 23, 2024

Disabling socket can cause composer to fail the shutdown and result in multiple restarts that fail and block later start (at the end of the script).
Instead, stop workers first to keep composer from reactivating via socket, then stop the composer.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 23, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 23, 2024

@pmtk: This pull request references USHIFT-2992 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to this:

Disabling socket can cause composer to fail the shutdown and result in multiple restarts that fail and block later start (at the end of the script).
Instead, stop workers first to keep composer from reactivating via socket, then stop the composer.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from jogeo and pacevedom April 23, 2024 12:24
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 23, 2024
for n in $(seq 100) ; do
worker=osbuild-worker@${n}.service
if sudo systemctl status "${worker}" &>/dev/null ; then
sudo systemctl stop --now "osbuild-worker@${n}.service"
sudo systemctl stop "osbuild-worker@${n}.service"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we remove --now? Does it have no effect during stop?

Copy link
Member Author

Choose a reason for hiding this comment

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

--now is only meaningful for enable and disable and results in immediate start (enable) and stop (disable)

else
break
fi
done
sudo systemctl stop osbuild-composer.service
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment about stopping osbuild-composer.socket here?

fi
done
sudo systemctl start osbuild-worker@1.service
sudo systemctl start osbuild-composer.service
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the start order be inverted here as we're first stopping workers now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I found that we don't even need to start composer. Thanks to the socket, starting workers will cause composer to start but left it just in case

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment about this?

@pmtk pmtk force-pushed the rhel94/image-builder-cleanup-dont-stop-socket branch from 8769dbf to 821218c Compare April 23, 2024 12:45
…failing

Disabling socket can cause composer to fail the shutdown and result in
multiple restarts that fail and block later start (at the end of the
script).
Instead, stop workers first to keep composer from reactivating via
socket, then stop the composer.
@pmtk pmtk force-pushed the rhel94/image-builder-cleanup-dont-stop-socket branch from 821218c to f5f43f9 Compare April 23, 2024 12:52
@ggiguash
Copy link
Contributor

/lgtm

Copy link
Contributor

openshift-ci bot commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, pmtk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
Copy link
Contributor

openshift-ci bot commented Apr 23, 2024

@pmtk: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 7a0d547 into openshift:main Apr 23, 2024
8 checks passed
@pmtk pmtk deleted the rhel94/image-builder-cleanup-dont-stop-socket branch April 23, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants