-
Notifications
You must be signed in to change notification settings - Fork 266
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
Unregister from SCC after worker finishes #1923
Conversation
how did you test? Please describe the test procedure in the commit message |
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
#use base "basetest"; |
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.
delete
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.
done
sub setup_unregister_hook { | ||
# Get file without switching console | ||
# console("testapi_console")->type_string("stringstring"); | ||
# my $creds = console("install-shell")->script_output("cut -d= -f2 /etc/zypp/credentials.d/SCCcredentials"); |
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.
what is this disabled code for?
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.
removed
701e761
to
84e6f13
Compare
We need to consider canceled & failed jobs, so de-registration must be performed from worker. It needs username & password that are generated during registration and exported into SCC_DEREGISTER variable. Worker unregister from scc using by calling SCC url with: DELETE /connect/systems There is a short window between system registration and set_var("SCC_DEREGISTER"), when system would not unregister. Tested by: - Following logs in /var/lib/openqa/pool/<worker>/autoinst-log.txt - By canceling jobs before/during/after registration or finishing them - Checking that SCC keys are removed from scc.suse.com (Alpha Keys)
First of all: this change is not merged/deployd - so it didn't break anything yet. But I guess you're right, it will. So we need to treat scc registrations like assets - and unregister the least used used. I.e. do parts of what Martin did and upload the keys used in a job. But don't unregister immediately, but from a background job on the webui |
Thanks for noticing, we missed this when talking to qam/slenkins people about breaking stuff with this approach |
https://progress.opensuse.org/issues/11518
We need to consider canceled & failed jobs, so de-registration must be
performed from worker. It needs username & password that are generated
during registration and exported into SCC_DEREGISTER variable.
Worker unregister from scc using by calling SCC url with:
DELETE /connect/systems
There is a short window between system registration and set_var("SCC_DEREGISTER"), when system would not unregister.
Tested by:
After successful job:
SLES: http://dhcp91.suse.cz/tests/2772
JeOS: http://dhcp91.suse.cz/tests/2771
Job canceled:
QAM SLES-12-GA: http://dhcp91.suse.cz/tests/2778
SLES: http://dhcp91.suse.cz/tests/2774
JeOS: http://dhcp91.suse.cz/tests/2773