summaryrefslogtreecommitdiffstats
path: root/src/python-common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #54786 from guits/fix_63729Adam King2023-12-131-1/+1
|\ | | | | | | | | python-common: fix osdspec_affinity check Reviewed-by: Adam King <adking@redhat.com>
| * python-common: fix osdspec_affinity checkGuillaume Abrioux2023-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no `service_id` is provided to service spec (osd) it results in OSDs created with "osdspec_affinity" attribute set to a string containing "None". The DriveSelection class relies on the comparison of the actual value of this attribute with the value of the service_id which has the python type `None` in that case. If any existing deployments were created without the service_id attribute, we now have to support this case and make sure the check won't filter out devices unexpectedly. Fixes: https://tracker.ceph.com/issues/63729 Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
* | Merge pull request #54681 from adk3798/device-limit-testingAdam King2023-12-132-8/+57
|\ \ | | | | | | | | | | | | | | | python-common/drive_selection: fix limit with existing devices Reviewed-by: Michael Fritch <mfritch@suse.com> Reviewed-by: Guillaume Abrioux <gabrioux@ibm.com>
| * | python-common/drive_selection: fix limit with existing devicesAdam King2023-11-292-8/+57
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When devices have already been used for OSDs, they are still allowed to pass filtering as they are still needed for the resulting ceph-volume lvm batch command. This was causing an issue with limit however. Limit adds the devices we've found that match the filter and existing OSD daemons tied to the spec. This allows double counting of devices that hae been used for OSDs, as they're counted in terms of being an existing device and that they match the filter. To avoid this issue, devices should only be counted towards the limit if they are not already part of an OSD. An additional note: The limit feature is only applied for data devices, so there is no need to worry about the effect of this change on selection of db, wal, or journal devices. Also, we would still want to not count these devices if they did end up passing the data device filter but had been used for a db/wal/journal device previously. Fixes: https://tracker.ceph.com/issues/63525 Signed-off-by: Adam King <adking@redhat.com>
* / mgr/rgwam: period doesn't have a realm_name anymoreCasey Bodley2023-12-111-1/+0
|/ | | | | | Fixes: https://tracker.ceph.com/issues/63783 Signed-off-by: Casey Bodley <cbodley@redhat.com>
* Merge pull request #54490 from ceph/nvmeof-controllerid-specAdam King2023-11-171-0/+9
|\ | | | | | | | | | | mgr/cephadm: Expose nvmeof gateway configuration parameters through specifications Reviewed-by: Adam King <adking@redhat.com> Reviewed-by: Aviv Caro <Aviv.Caro@ibm.com>
| * mgr/cephadm: Expose nvmeof gateway configuration parameters through ↵Alexander Indenbaum2023-11-151-0/+9
| | | | | | | | | | | | | | | | | | | | specifications - min_controller_id, max_controller_id: Enable the specification of minimum and maximum controller IDs utilized by the SPDK. Having distinct controller IDs is vital for configuring multipath setups. - enable_spdk_discovery_controller: Manage whether the SPDK or ceph-nvmeof discovery service is employed. The default value is set to False. Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
* | mgr/cephadm: support for regex based host patternsAdam King2023-11-142-19/+148
|/ | | | | | | | | | | | | | | | | | | | | For example, with hosts vm-00, vm-01, and vm-02 I was able to provide the placement service_type: node-exporter service_name: node-exporter placement: host_pattern: pattern: vm-00|vm-02 pattern_type: regex and it placed the node-exporter daemons on vm-00 and vm-02 but not vm-01. Obviously there are more advanced scenarios that justify this than listing two hosts, but using "|" as an OR like that is an example of something you can't do with the fnmatch version of the host pattern Signed-off-by: Adam King <adking@redhat.com>
* Merge pull request #52532 from guits/fix-tracker-58946Laura Flores2023-08-251-3/+4
|\ | | | | python-common: drive_selection: fix KeyError when osdspec_affinity is not set
| * python-common: drive_selection: fix KeyError when osdspec_affinity is not setGuillaume Abrioux2023-07-251-3/+4
| | | | | | | | | | | | | | | | | | | | When osdspec_affinity is not set, the drive selection code will fail. This can happen when a device has multiple LVs where some of are used by Ceph and at least one LV isn't used by Ceph. Fixes: https://tracker.ceph.com/issues/58946 Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
* | Merge pull request #52678 from phlogistonjohn/jjm-fix-test_valid_addrAdam King2023-08-151-3/+3
|\ \ | | | | | | | | | | | | python-common: fix valid_addr on python 3.11 Reviewed-by: Adam King <adking@redhat.com>
| * | python-common: fix valid_addr on python 3.11John Mulligan2023-07-271-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior on python 3.11 regarding IPv4 addresses in bracket has changed: ``` $ python3.8 -c 'from urllib.parse import urlparse; urlparse("http://[192.168.0.1]")' [john@edfu ~]$ python3.11 -c 'from urllib.parse import urlparse; urlparse("http://[192.168.0.1]")' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.11/urllib/parse.py", line 395, in urlparse splitresult = urlsplit(url, scheme, allow_fragments) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/urllib/parse.py", line 500, in urlsplit _check_bracketed_host(bracketed_host) File "/usr/lib64/python3.11/urllib/parse.py", line 448, in _check_bracketed_host raise ValueError(f"An IPv4 address cannot be in brackets") ValueError: An IPv4 address cannot be in brackets ``` This breaks the test in test_valid_addr that asserts that function valid_addr returns the string "IPv4 address wrapped in brackets is invalid". Move the step that checks for brackets and dots above the urllib check so that the function continues returning the expected string. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: add init_containers field to CustomContainerSpecJohn Mulligan2023-08-091-0/+15
| | | | | | | | | | | | | | This allows custom containers to run init containers before the primary container starts. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: reformat service_spec import lineJohn Mulligan2023-08-091-2/+15
| | | | | | | | | | | | Use the "black" style of multi-line import with parens. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: add InitContainerSpec typeJohn Mulligan2023-08-091-0/+97
|/ | | | | | | | The InitContainerSpec type will be used to define explicit "init containers" - containers that are expected to run and then exit and are executed prior to running a primary container. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* Merge pull request #50423 from rkachach/fix_issue_nmveofAdam King2023-07-251-5/+100
|\ | | | | | | | | mgr/cephadm: adding support for nvmeof Reviewed-by: Adam King <adking@redhat.com>
| * Adding support for extra args by using the field tgt_cmd_extra_argsRedouane Kachach2023-07-141-4/+11
| | | | | | | | Signed-off-by: Redouane Kachach <rkachach@redhat.com>
| * Adding more ports needed by nvmeof daemonRedouane Kachach2023-07-111-1/+1
| | | | | | | | Signed-off-by: Redouane Kachach <rkachach@redhat.com>
| * mgr/cephadm: Adding suppport for nvmeofRedouane Kachach2023-07-101-5/+93
| | | | | | | | | | | | Fixes: https://tracker.ceph.com/issues/61929 Signed-off-by: Redouane Kachach <rkachach@redhat.com>
* | Merge pull request #52122 from adk3798/teuth-test-custom-configAdam King2023-07-141-3/+24
|\ \ | | | | | | | | | | | | qa/cephadm: testing for extra daemon/container features Reviewed-by: John Mulligan <jmulligan@redhat.com>
| * | python-common/service_spec: add extra_entrypoint_args to CephExporter SpecAdam King2023-07-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Similar to the mon, there's no reason for Ceph Exporter in particular not to have this, it's just missing because of the timing of when it was merged in. Signed-off-by: Adam King <adking@redhat.com>
| * | mgr/cephadm: add extra_entrypoint_args to mon specAdam King2023-07-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There was no reason for the mon spec to not include this option. I believe this was just an oversight caused by the addition of the mon spec and extra_entrypoint_args in separate PRs around the same time. Signed-off-by: Adam King <adking@redhat.com>
| * | mgr/cephadm: add extra_container_args and custom_configs to CustomContainerAdam King2023-07-111-2/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | CustomContainer was skipped previously for the extra_container_args and custom_configs feature as these could already be done using other fields within the custom container service spec (the "args" and "files" fields respectively). It seems desirable for us to allow setting these things for custom containers the same as for other services for uniformity sake and this allows us to use custom containers to test these features. Signed-off-by: Adam King <adking@redhat.com>
* | Merge pull request #52020 from ↵Adam King2023-07-112-0/+7
|\ \ | |/ |/| | | | | | | | | Dazul/cephadm-keepalived-choose-unicast-or-interface cephadm: Split multicast interface and unicast_ip in keepalived.conf Reviewed-by: Adam King <adking@redhat.com>
| * Cephadm: Add first_virtual_router_id to generated yaml on testLuis Domingues2023-06-221-0/+1
| | | | | | | | | | | | | | It seems that the ServiceSpec, when dump to yaml will generate a yaml with first_virtual_router_id, as its default value is 50. Signed-off-by: Luis Domingues <domingues.luis@protonmail.ch>
| * cephadm: Add parameter to set keepalived's virtual router idLuis Domingues2023-06-221-0/+2
| | | | | | | | | | | | | | | | | | When deploying more than 1 ingress, two instances of keepalived can be generated with the same virtual_router_id. This commit adds posibility to change the virtual_router_id of keepalived from the spec file. Signed-off-by: Luis Domingues <domingues.luis@protonmail.ch>
| * cephadm: Split multicast interface and unicast_ip in keepalived.confLuis Domingues2023-06-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When deploying keepalived, cephadm set interface and unicast_src_ip in keepalived.conf. However, having both options are set, but if unicast_src_ip is not in the interface set by 'interface', the instrances of keepalived will not properly commuicate. This commit makes both options exclusive, and add an option to set either one or the other. Default is set to 'interface', as it seems multicast is the default way to deploy keepalived. Signed-off-by: Luis Domingues <domingues.luis@protonmail.ch>
* | xxx: DELETEME: hack to find invalid type assignmentsJohn Mulligan2023-06-291-0/+11
| | | | | | | | Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: extend arguments test to assert splitting behaviorJohn Mulligan2023-06-291-4/+44
| | | | | | | | | | | | | | Use the existing arguments test to verify that the ArgumentSpec objects split the arguments as intended. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: extend args handling test for new ArgumentSpec typeJohn Mulligan2023-06-291-0/+110
| | | | | | | | | | | | | | Add cases to test_extra_args_handling test to verify new behaviors brought in by the switch to ArgumentSpec and ArgumentList types. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: replace types for extra_*_args with ArgSpec based typesJohn Mulligan2023-06-293-34/+47
| | | | | | | | | | | | | | | | | | | | Use the ArgSpec, ArgumentList, and GeneralArgList types throughout the deployment module to support extra_container_args and extra_entrypoint_args. The GeneralArgList type supports all possible input forms while ArgumentList reflects the internal representation of the argument lists. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: add an ArgumentSpec type for handling argsJohn Mulligan2023-06-281-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new ArgumentSpec type to the deployment package. The ArgumentSpec serves a dual purpose: * to allow more advanced configuration of extra arguments * to keep backwards compatibility with string-based args The previous versions of cephadm supported supplying extra container and entrypoint arguments for fine-tuning of services and creating custom containers. However, this mode assumed that spaces in an argument always meant that the argument should be split into two parts: "--foo bar" becomes `["--foo", "bar"]`. In some cases there's a good reason to keep spaces as in "--title=My Little Cluster". When an argument is expressed as a single string the ArgumentSpec is designed to retain the existing behavior. When an argument is expressed as a JSON object then you can explicitly express if you want the argument split on spaces or not (not split is the default). The alternative was to keep using strings but add some level of shell-style quoting. This was discussed but deemed complex and difficult to read in YAML. Round tripping that data is also challenging. The JSON object approach also allows for future fields to be added providing for possible extensibility. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | mgr/cephadm: reformat ceph.deployment.service_spec import lineJohn Mulligan2023-06-261-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting https://peps.python.org/pep-0008/#maximum-line-length ``` The preferred way of wrapping long lines is by using Python’s implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation. ``` I also think it is much more readable and is similar to the style applied by automated code formatting tools like `black`. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: reformat ceph.deployment.service_spec import lineJohn Mulligan2023-06-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting https://peps.python.org/pep-0008/#maximum-line-length ``` The preferred way of wrapping long lines is by using Python’s implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation. ``` I also think it is much more readable and is similar to the style applied by automated code formatting tools like `black`. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | python-common: add tests for service spec extra args handlingJohn Mulligan2023-06-261-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | There were no existing tests for how the service spec(s) handled the extra_container_args and extra_entrypoint_args values. Add a short parametrized test function to assert some basic properties of how the arguments are currently handled. In particular, it asserts that the values can appear at the top-level of the YAML and under spec. This is in preparation for adding a more sophisticated argument type in the future. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* | Merge pull request #51924 from adk3798/limit-policy-log-levelAdam King2023-06-141-1/+1
|\ \ | | | | | | | | | | | | python-common/drive_selection: lower log level of limit policy message Reviewed-by: Redouane Kachach <rkachach@redhat.com>
| * | python-common/drive_selection: lower log level of limit policy messageAdam King2023-06-051-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | This gets logged every time cephadm tries to apply a relevant OSD spec and ends up spamming the logs. There's no reason we really need this to be at info rather than debug level, so let's lower it. Fixes: https://tracker.ceph.com/issues/61592 Signed-off-by: Adam King <adking@redhat.com>
* | Merge pull request #51861 from adk3798/spec-no-spec-validateAdam King2023-06-142-2/+14
|\ \ | |/ |/| | | | | python-common/drive_group: handle fields outside of 'spec' even when 'spec' is provided Reviewed-by: John Mulligan <jmulligan@redhat.com>
| * python-common/drive_group: handle fields outside of 'spec' even when 'spec' ↵Adam King2023-05-312-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mgr/cephadm: add enable_haproxy_protocol to ingress and nfs service specsJohn Mulligan2023-05-261-0/+4
|/ | | | | | | | | | Add a new boolean field, enable_haproxy_protocol, to both the ingress service spec and the nfs service spec. The ingress service spec needs the field to tell haproxy to enable proxy protocol (v2) support. The nfs service spec needs the field to allow the nfs server to accept proxy protocol messages. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* python-common: remove redundant call to mypy in tox.iniJohn Mulligan2023-05-181-1/+0
| | | | | | | | In the previous change to this tox.ini file, I created a dedicated env for running mypy but forgot to remove the previous call to mypy that was happening after the call to pytest. Signed-off-by: John Mulligan <jmulligan@redhat.com>
* Revert "ceph-volume: assign seastore as object store backend when deplying ↵Guillaume Abrioux2023-05-112-7/+2
| | | | | | crimson-osd using LVM with cephadm" Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
* Merge pull request #50392 from Svelar/seastore-cephadmSvelar2023-05-062-2/+7
|\ | | | | ceph-volume: assign seastore as object store backend when deplying crimson-osd using LVM with cephadm
| * translate: add new line at the endSvelar2023-03-161-1/+1
| | | | | | Signed-off-by: Svelar <sunrongqi@huawei.com>
| * Merge branch 'main' into seastore-cephadmSvelar2023-03-163-2/+16
| |\ | | | | | | Signed-off-by: Svelar <sunrongqi@huawei.com>
| * | ceph-volume: keep batch default statusRongqi Sun2023-03-141-68/+46
| | | | | | | | | | | | Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
| * | deployment: add seastore support.Rongqi Sun2023-02-242-2/+8
| | | | | | | | | | | | Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
* | | Merge pull request #51226 from jsoref/spelling-orchestratorAdam King2023-05-033-5/+5
|\ \ \ | | | | | | | | | | | | | | | | orchestrator: Fix spelling Reviewed-by: Adam King<adking@redhat.com>
| * | | orchestrator: fix spelling errorsJosh Soref2023-04-263-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * a new * accommodated * adopted * appended * because * bootstrap * bootstrapping * brackets * classes * cluster * compatible * completely * confusion * daemon * daemons * dashboard * enclosure * existing * explicit * following * format * host * implementation * inferred * keepalived * kubic * maintenance * necessarily * necessary * network * notifier * octopus * permanent * presenting * related * see * snapshot * stateful * the * track * version * wasn't * weird Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
* | | | Merge pull request #50613 from adk3798/grafana-anonymousAdam King2023-05-032-0/+12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | mgr/cephadm: allow configuring anonymous access for grafana Reviewed-by: Redouane Kachach <rkachach@redhat.com>