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

qa/tasks/cephadm: add generic templating where subst_vip was used #55719

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

phlogistonjohn
Copy link
Contributor

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

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional) - sort of
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket tests only
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show 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

@adk3798
Copy link
Contributor

adk3798 commented Feb 28, 2024

https://pulpito.ceph.com/adking-2024-02-27_05:08:20-orch:cephadm-wip-adk-testing-2024-02-26-1600-distro-default-smithi/

not going to go over the failures in the regular detail as we're still cleaning up the in cluster log stuff, but it was mostly just things we still need to add to ignorelists and the mds_upgrade_sequence test having issues. Only test that failed due to PRs in the run was https://pulpito.ceph.com/adking-2024-02-27_05:08:20-orch:cephadm-wip-adk-testing-2024-02-26-1600-distro-default-smithi/7574464 so we can't merge the PRs making changes to mgr/nfs but everything else seems to be okay.

Copy link
Contributor

@adk3798 adk3798 left a comment

Choose a reason for hiding this comment

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

qa/tasks/cephadm.py Outdated Show resolved Hide resolved
qa/tasks/cephadm.py Outdated Show resolved Hide resolved
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>
@adk3798 adk3798 merged commit a5b9d64 into ceph:main Mar 1, 2024
11 of 12 checks passed
@phlogistonjohn phlogistonjohn deleted the jjm-teuth-tasks-cephadm-jt branch March 14, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants