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

feat: support for ostree systems #399

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Conversation

richm
Copy link
Contributor

@richm richm commented Oct 24, 2023

Feature: Allow running and testing the role with ostree managed nodes.

Reason: We have users who want to use the role to manage ostree
systems.

Result: Users can use the role to manage ostree managed nodes.
Signed-off-by: Rich Megginson [email protected]

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d871b5e) 13.69% compared to head (7ebb303) 13.69%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #399   +/-   ##
=======================================
  Coverage   13.69%   13.69%           
=======================================
  Files           8        8           
  Lines        1731     1731           
  Branches       79       79           
=======================================
  Hits          237      237           
  Misses       1494     1494           
Flag Coverage Δ
sanity 16.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

state: present
when: storage_skip_checks is not defined or
not "packages_installed" in storage_skip_checks
vars:
# for some reason the blivet module does not pick up on the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vojtechtrefny @japokorn I don't know why blivet does not add kpartx to the list of packages in this case. Without this, ostree image building does not know to add the kpartx package to the image, and some of the tests fail such as tests_change_fs and tests_change_mount, because the kpartx command is not available. Looks like devices/dm.py in blivet lists kpartx as a dependency, but not as a package, and the storage blivet module uses the package lists from the devices.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think kpartx is not listed in packages for DMDevice because all other Device Mapper devices (like all LVM and LUKS device classes) are based on it and we don't need kpartx for those -- only for MultiPath and linear DM devices with partitions. Do you have logs for the failed tests? I think the test suite should never run into a situation where the setup_partitions function is actually called so kpartx shouldn't be needed.

But we should definitely do a better work in blivet and be able to still work without kpartx without crashing/raising exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the error from running tests_change_mount.yml against an ostree image which has all of the packages reported by blivet:

Traceback (most recent call last):\r\n  File "/root/.ansible/tmp/ansible-tmp-1698677588.077884-2411506-87522188525601/AnsiballZ_blivet.py", line 107, in <module>
 _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1698677588.077884-2411506-87522188525601/AnsiballZ_blivet.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1698677588.077884-2411506-87522188525601/AnsiballZ_blivet.py", line 48, in invoke_module
    run_name=\'__main__\', alter_sys=True)
  File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)\r\n  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1983, in <module>
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1979, in main
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1931, in run_module
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1575, in manage_pool
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1323, in manage
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 1294, in _manage_volumes
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 594, in manage
  File "/tmp/ansible_blivet_payload_nf2a9eb0/ansible_blivet_payload.zip/ansible/modules/blivet.py", line 933, in _create
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/blivet.py", line 872, in create_device
    action_create_dev = ActionCreateDevice(device)
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/deviceaction.py", line 331, in __init__
    DeviceAction.__init__(self, device)
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/deviceaction.py", line 168, in __init__
    self._check_device_dependencies()
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/deviceaction.py", line 177, in _check_device_dependencies
    raise DependencyError("device type %s requires unavailable_dependencies: %s" % (self.device.type, dependencies_str))
blivet.errors.DependencyError: device type lvmlv requires unavailable_dependencies: kpartx:
application kpartx is not in $PATH

I don't know what is pulling in the kpartx dependency, but it is there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I forgot the dependencies are also inherited so all LVM devices depend on kpartx. As I said we'll fix this in blivet (storaged-project/blivet#1165), but for now let's keep the kpartx dependency in the extra packages here as well.

Feature: Allow running and testing the role with ostree managed nodes.

Reason: We have users who want to use the role to manage ostree
systems.

Result: Users can use the role to manage ostree managed nodes.
Signed-off-by: Rich Megginson <[email protected]>
@richm richm merged commit b04b22a into linux-system-roles:main Oct 30, 2023
19 checks passed
@richm richm deleted the ostree branch October 30, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants