-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
qa/tasks/cephadm: add generic templating where subst_vip was used #55719
Conversation
9eb4f26
to
5029a3c
Compare
not going to go over the failures in the regular detail as we're still cleaning up the |
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.
Worked when testing, e.g. https://pulpito.ceph.com/adking-2024-02-27_05:08:20-orch:cephadm-wip-adk-testing-2024-02-26-1600-distro-default-smithi/7574467/ used the vip and vip.exec tasks and passed.
None of the callers of map_vips ever checks for a None return. So instead of handling any error conditions it would always just blow up with a semi-obscure TypeError. Convert the function to always raise an exception (one that tries to breifly explain the condition) when something goes wrong. I also take the opportunity to make more clearer logging and reduce an indentation level. Signed-off-by: John Mulligan <jmulligan@redhat.com>
Nothing outside of vip.py called map_vips, so let us make sure this is considered a private function and prefix it with the underscore. Signed-off-by: John Mulligan <jmulligan@redhat.com>
While testing my previous patches were correct I noticed that the string here was logged exactly as written, and was thus pretty useless. This was probably meant to be an f-string. So make it one. Also get rid of the unnecessary map call, the list and IP address type can repr themselves just fine IMO. Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add functions to cephadm.py that will be later used to template strings within the yaml files in the cephadm suites. This will be used to replace the specific subst_vip call with generic calls that let tests access "any" variables stored on the test ctx. Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
5029a3c
to
4f1f095
Compare
After some discussion with @adk3798 I decided to add more generic templating functions to qa/tasks/cephadm.py. Initially, this simply replaces the simple but rigid string-replacement based "templates" like
{{VIP0}}
with generic templates based on jinja2.AFAICT, jinja2 is already a dependency of teuthology so this PR doesn't add a new dependency.
Later this work will be reused when I add support for deploying a Samba AD DC for testing cephadm's smb service. It should also serve as foundational work for other cases where we have a value that varies from test to test and need to express that in a service spec or such.
NOTE: this only touches the tasks python code. It should primarily be tested by ensuring there are no regressions in a teuthology orch suite run.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
x
between the brackets:[x]
. Spaces and capitalization matter when checking off items this way.Checklist
opened tracker tickettests onlyShow available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows
jenkins test rook e2e