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

Updating submodule packages to drop-ins quadlet files #700

Merged
merged 7 commits into from
Feb 15, 2025

Conversation

Yarboa
Copy link
Collaborator

@Yarboa Yarboa commented Jan 7, 2025

resolves #674

During latest changes:

  • subpackages use drop-in qudlet files Under QM etc/containers/systemd/qm.container.d/ dir Qm nested container
  • quadlets moved to subsystems/ dir

Summary by Sourcery

Update submodule packages to use drop-in quadlet files for configuration, moving them under the 'etc/containers/systemd/qm.container.d/' directory. Refactor Makefiles to standardize the build process and update documentation to reflect these changes.

Enhancements:

  • Refactor Makefiles across various subsystems to standardize the build process and improve maintainability.

Build:

  • Update Makefiles to use dynamic variables for RPM build directories and versioning, enhancing flexibility in the build process.

Documentation:

  • Update README.md to reflect changes in the build process, specifically the use of the 'TARGETS' variable for building subpackages.

@Yarboa Yarboa self-assigned this Jan 7, 2025
@Yarboa Yarboa marked this pull request as draft January 7, 2025 18:00
@Yarboa Yarboa marked this pull request as ready for review January 7, 2025 18:03
@Yarboa Yarboa marked this pull request as draft January 7, 2025 18:04
@Yarboa
Copy link
Collaborator Author

Yarboa commented Jan 7, 2025

Delete old files under

  • ./etc/qm/containers/containers.conf.d/ except to qm_dropin_img_tempdir.conf
  • Finish qm-windowmanager.spec updates

@Yarboa Yarboa marked this pull request as ready for review January 14, 2025 20:30
@Yarboa Yarboa marked this pull request as draft January 14, 2025 20:30
@Yarboa Yarboa force-pushed the move-quadlets branch 3 times, most recently from b51fd71 to 0238dbd Compare January 15, 2025 12:01
@Yarboa Yarboa marked this pull request as ready for review January 15, 2025 12:28
@Yarboa Yarboa marked this pull request as draft January 20, 2025 15:00
@Yarboa Yarboa force-pushed the move-quadlets branch 2 times, most recently from 5b52ae8 to b5c2324 Compare January 21, 2025 18:19
resolves containers#674
During latest changes all subpackages use drop-in qudlet files
Under QM etc/containers/systemd/qm.container.d/ dir
Qm nested container quadlets moved to subsystems/ dir
Update to quadlet files

Signed-off-by: Yariv Rachmani <[email protected]>
It seems that subpackaged rpm was not set correctly
Make subpackages creation could be done with the following command
make TARGETS=kvm subpackages

Signed-off-by: Yariv Rachmani <[email protected]>
make TARGETS=windowmanager subpackages
Adding missing qm qualets

Signed-off-by: Yariv Rachmani <[email protected]>
Signed-off-by: Yariv Rachmani <[email protected]>
Signed-off-by: Yariv Rachmani <[email protected]>
make TARGETS=dvb subpackages
make TARGETS=img_tmpdir subpackages
make TARGETS=input subpackages
make TARGETS=radio subpackages
make TARGETS=tesxt2speech subpackages
make TARGETS=tty7 subpackages
make TARGETS=ttyUSB0 subpackages

Signed-off-by: Yariv Rachmani <[email protected]>
@Yarboa Yarboa marked this pull request as ready for review February 10, 2025 21:04
Copy link

sourcery-ai bot commented Feb 10, 2025

Reviewer's Guide by Sourcery

This pull request refactors and standardizes the handling of submodule drop‐in configuration files by moving them to the new quadlet file structure under the systemd directory, updating spec files and Makefiles with consistent RPM build variables and version patterns, and adjusting configuration file formats to use the new [Container] syntax. It also updates the documentation and build commands accordingly.

Refactored Makefile Structure for Subpackages (Class Diagram)

classDiagram
    class MakefileBase {
      +RPM_TOPDIR : string
      +VERSION : string
      +ROOTDIR : string
      +dist() void
    }

    class SubpackageMakefile {
      +SPECFILE : string
      +target() void
    }

    MakefileBase <|-- SubpackageMakefile

    note for MakefileBase "Common variables and methods used across all subsystem Makefiles."
    note for SubpackageMakefile "Each subsystem (kvm, sound, video, etc.) defines its SPECFILE and build targets based on the standardized variables."
Loading

File-Level Changes

Change Details Files
Standardize drop-in configuration file paths and formats
  • Moved drop-in configuration files from the old etc/qm/containers/containers.conf.d/ directory to the new etc/containers/systemd/qm.container.d/ location
  • Updated installation paths in spec files for subpackages (video, tty7, ttyUSB0, sound, radio, dvb, etc.) to use the new directory structure
  • Modified drop-in configuration file content to adopt the new [Container] and AddDevice syntax instead of legacy lists
rpm/video/video.spec
rpm/windowmanager/windowmanager.spec
rpm/tty7/tty7.spec
rpm/dvb/dvb.spec
rpm/sound/sound.spec
rpm/radio/radio.spec
rpm/input/input.spec
rpm/ttyUSB0/ttyUSB0.spec
etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_video.conf
etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_snd.conf
etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_input.conf
etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_tty7.conf
etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_ttyUSB0.conf
Refactor Makefiles for consistent RPM build configuration
  • Introduced unified definitions for RPM_TOPDIR, VERSION, and ROOTDIR across Makefiles
  • Updated tar transform commands to use new file naming conventions
  • Renamed and adjusted local build target names (e.g. kvm, windowmanager, img_tempdir, video, sound, input, radio, tty7, ttyUSB0, qm-text2speech)
subsystems/kvm/Makefile
subsystems/windowmanager/Makefile
subsystems/img_tempdir/Makefile
subsystems/video/Makefile
subsystems/ros2/Makefile
subsystems/sound/Makefile
subsystems/dvb/Makefile
subsystems/input/Makefile
subsystems/radio/Makefile
subsystems/ttyUSB0/Makefile
subsystems/text2speech/Makefile
Makefile
Update spec file templates and version details
  • Changed source tarball naming from v%{version} to qm--%{version}.tar.gz in multiple spec files
  • Bumped version numbers where applicable (e.g. kvm spec updated to version 0.6.9)
  • Added new spec macros such as debug_package and rootfs definitions to standardize builds
rpm/kvm/qm-kvm.spec
rpm/video/video.spec
rpm/windowmanager/windowmanager.spec
rpm/tty7/tty7.spec
rpm/dvb/dvb.spec
rpm/ros2/ros2_rolling.spec
rpm/sound/sound.spec
rpm/radio/radio.spec
rpm/input/input.spec
rpm/ttyUSB0/ttyUSB0.spec
rpm/img_tempdir/img_tempdir.spec
rpm/text2speech/text2speech.spec
Update README and build instructions
  • Modified README build commands to use the TARGETS and subpackages syntax instead of legacy subpackage targets
  • Updated examples for building and installing subpackages (input, video, sound, ros2, kvm, etc.)
README.md
Minor tooling and workflow improvements
  • Included updates to the version-update tool for improved consistency
  • Added a GitHub workflow file (.github/workflows/check-subpackages) to automatically check subpackage builds
tools/version-update
.github/workflows/check-subpackages

Assessment against linked issues

Issue Objective Addressed Explanation
#674 Create 'QM-extra' or QM-incubator repository The PR does not create a new repository or mention creating a separate repository for extra or incubator components.
#674 Split QM.spec file to QM-core and QM-incubator specs The PR does not split the main spec file into core and incubator specs. Instead, it updates various subpackage spec files to use drop-in quadlet files.
#674 Move non-core issues, files, docs, tests to 'QM-incubator' While the PR updates various subpackage configurations and moves some files around, it does not comprehensively move non-core components to a separate repository or incubator space.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Yarboa - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider renaming the 'dvp' target in the Makefile to 'dvb' to match the subsystem name and maintain consistency.
  • Ensure that all Makefile targets are correctly updated in the README examples to prevent confusion for users following the instructions.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Yarboa
Copy link
Collaborator Author

Yarboa commented Feb 10, 2025

@dougsland did not finish to verify all builds.
Need to add also github actions

@dougsland
Copy link
Collaborator

@dougsland did not finish to verify all builds. Need to add also github actions

Did you verify all bot suggestions make sense or not?

@Yarboa Yarboa marked this pull request as draft February 11, 2025 09:26
@Yarboa
Copy link
Collaborator Author

Yarboa commented Feb 11, 2025

@dougsland did not finish to verify all builds. Need to add also github actions

Did you verify all bot suggestions make sense or not?

Moving to draft again

@Yarboa Yarboa marked this pull request as ready for review February 11, 2025 18:51
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Yarboa - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The Makefiles are becoming more consistent, but there are still some inconsistencies in variable naming and usage, especially around the version and source archive names.
  • The spec files are inconsistent in whether they include the 'qm-' prefix in the Source0 URL.
  • Consider using a common macro or function to install drop-in configurations to avoid repetition in the spec files.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 2 issues found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

.PHONY: subpackages
subpackages: $(TARGETS)
$(TARGETS):
@echo "Entering directory: subsystem/$@"
Copy link

Choose a reason for hiding this comment

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

suggestion (bug_risk): Mismatch in directory naming in subpackages target

The echo message refers to 'subsystem/$@', but the actual directory path used is 'subsystems/$@'. For clarity, update the message to match the directory structure.

Suggested change
@echo "Entering directory: subsystem/$@"
@echo "Entering directory: subsystems/$@"

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Yarboa looks sane this comment.

make TARGETS=ros2 subpackages
Adding github workflow for subpackages
renaming rpm/ros2/rolling/ros2_rolling.spec ->
rpm/ros2/ros2_rolling.spec

Adding fixes based on tests added

Signed-off-by: Yariv Rachmani <[email protected]>
Mount=type=bind,source=/dev/tty5,target=/dev/tty5
Mount=type=bind,source=/dev/tty6,target=/dev/tty6
Mount=type=bind,source=/dev/tty7,target=/dev/tty7
Mount=type=bind,source=/dev/tty0,target=/dev/tty0
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks dup

@dougsland dougsland merged commit 1729549 into containers:main Feb 15, 2025
15 checks passed
@dougsland
Copy link
Collaborator

@Yarboa please address the minor comments in different patch. Also update our documentation in the main README.md

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.

Split demos, rpms and non QM core tests to different repo
2 participants