Bind-mount RH Cloud inventory reports into Foreman and Dynflow - #825
Bind-mount RH Cloud inventory reports into Foreman and Dynflow#825nofaralfasi wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change provisions ChangesForeman inventory integration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains from the reviewed changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| # can drop files on the host. | ||
| - name: Create RH Cloud inventory directory | ||
| ansible.builtin.file: | ||
| path: /var/lib/foreman/red_hat_inventory/exports |
There was a problem hiding this comment.
Let's just bind mount /var/lib/foreman
|
Is there an issue tracking re-design of the report generation to not rely on an admin SSHing into their Satellite but rather being able to use the API and download the report? |
I haven’t found a tracker for that redesign. SAT-48305 is only this PR: make the current rake path work in containers by bind-mounting the report directory. Generate and download via API already exist ( I can file a foreman_rh_cloud issue if we want to track moving this off the local filesystem. |
foreman_rh_cloud writes reports under /var/lib/foreman/red_hat_inventory. Without a shared host bind mount those files stay inside a single container, so rake generate cannot drop a retrievable file and Dynflow jobs cannot share reports with Foreman.
1f14946 to
4bb9eab
Compare
|
If the API and UI handle this for the user already, why do we need the rake task? |
|
I deployed this branch (4bb9eab) with
Mounting an empty host dir over it hides both. I then narrowed both
So the original Worth noting the mount is added unconditionally, while Three smaller things:
The UI/API path does justify the shared mount either way: generation runs in a dynflow worker writing to |
Why are you introducing these changes? (Problem description, related links)
foreman-rake rh_cloud_inventory:report:generatewrites reports under/var/lib/foreman/red_hat_inventory. In a containerized deploy that directory is not bind-mounted, so the file is not available on the host, and Foreman and Dynflow do not share the same tree./var/lib/foremanalready exists for IoP manual override files (root:root, not mounted into Foreman/Dynflow). This PR bind-mounts that directory so inventory reports (and anything else written there) are on the host and shared. See #647 and #755.Fixes: https://redhat.atlassian.net/browse/SAT-48305
What are the changes introduced in this pull request?
/var/lib/foreman(root:root,0755)/var/lib/foremaninto the Foreman and Dynflow containers (rw,z,U)rh_cloud_inventory:report:generatein theforeman-rakewrapperHow to test this pull request
Steps to reproduce:
./foremanctl deploy --add-feature rh-cloud(or--add-feature iop)/var/lib/foremanexists on the host/var/lib/foreman -> /var/lib/foreman):podman inspect foreman --format '{{json .Mounts}}'podman inspect dynflow-sidekiq-worker --format '{{json .Mounts}}'foreman-rake rh_cloud_inventory:report:generateand check/var/lib/foreman/red_hat_inventory/generated_reports/./forge test --pytest-args 'tests/feature/foreman/inventory_storage_test.py tests/feature/foreman/foreman_rake_test.py -vv'