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

python-common/drive_group: handle fields outside of 'spec' even when 'spec' is provided #51861

Merged
merged 1 commit into from Jun 14, 2023

Conversation

adk3798
Copy link
Contributor

@adk3798 adk3798 commented May 31, 2023

Otherwise certain specs such as

service_type: osd
service_id: xxx
service_name: osd.xxx
placement:
  hosts:
  - vm-00 spec:
  osds_per_device: 2
data_devices:
  paths:
  - /dev/vde

fail to apply with

Error EINVAL: ServiceSpec: 'dict' object has no attribute 'validate'

which is not a useful error message. This is caused by the spec assuming all osd specific fields are either defined in the 'spec' section or outside of it, but not mixed in. We could also just consider these specs to be invalid and just raise a better error message, but it seems easier to make the minor adjustment for it to work, given there doesn't seem to be an issue with mixing the styles for specs for other service types.

Fixes: https://tracker.ceph.com/issues/61533

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • 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

…'spec' is provided

Otherwise certain specs such as

service_type: osd
service_id: xxx
service_name: osd.xxx
placement:
  hosts:
  - vm-00
spec:
  osds_per_device: 2
data_devices:
  paths:
  - /dev/vde

fail to apply with

Error EINVAL: ServiceSpec: 'dict' object has no attribute 'validate'

which is not a useful error message. This is caused by the
spec assuming all osd specific fields are either defined
in the 'spec' section or outside of it, but not mixed in.
We could also just consider these specs to be invalid
and just raise a better error message, but it seems easier
to make the minor adjustment for it to work, given there doesn't
seem to be an issue with mixing the styles for specs for
other service types.

Fixes: https://tracker.ceph.com/issues/61533

Signed-off-by: Adam King <adking@redhat.com>
Copy link
Contributor

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

LGTM.
I personally don't like how "loose" these yaml specs are in general, but that's how they are and consistency is good.

@adk3798
Copy link
Contributor Author

adk3798 commented Jun 14, 2023

https://pulpito.ceph.com/adking-2023-06-13_16:39:13-orch:cephadm-wip-adk-testing-2023-06-13-1036-distro-default-smithi/

Reruns of failed/dead jobs (some also marked still "running" in the original run at the time of writing this, due to the original ansible to set up the node not completing): https://pulpito.ceph.com/adking-2023-06-14_12:47:06-orch:cephadm-wip-adk-testing-2023-06-13-1036-distro-default-smithi/

After reruns, 2 failures:

Nothing there to block merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants