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

FR-6365 - Improve mountpoints handling #178

Merged
merged 11 commits into from
Jan 26, 2024
Merged

FR-6365 - Improve mountpoints handling #178

merged 11 commits into from
Jan 26, 2024

Conversation

upils
Copy link
Collaborator

@upils upils commented Jan 23, 2024

Notable changes in this PR:

  • when executing some commands needing to mount some mountpoints in the chroot:
    • unmounting and "teardown" commands are now only executed in defer statements
    • if these commands fail, they do not prevent others from running. The goal is to hopefully unmount as many mountpoints as possible is something is going wrong. Letting some mountpoint behind is not ideal but should not prevent the image building from completing.
  • run udevadm settle before tearing down mount points after package installation to hopefully make it more reliable
  • replace bind mounts where possible. Instead directly mount /proc and such.
  • specify the mount type to make sure mountpoints are correctly handled.
  • be more granular on /dev mounting.

Solves LP: #2049695

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (2e283da) 90.05% compared to head (e09205b) 79.50%.

Files Patch % Lines
internal/statemachine/classic_states.go 92.94% 5 Missing and 1 partial ⚠️
internal/statemachine/helper.go 91.89% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #178       +/-   ##
===========================================
- Coverage   90.05%   79.50%   -10.55%     
===========================================
  Files          13       13               
  Lines        3430     3504       +74     
===========================================
- Hits         3089     2786      -303     
- Misses        304      671      +367     
- Partials       37       47       +10     
Flag Coverage Δ
unittests 79.50% <92.45%> (-10.55%) ⬇️

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.

@mwhudson
Copy link
Contributor

This is probably fine. I think the commit message is a both a bit vague and a bit optimistic though? Something like "run udevadm settle before tearing down mount points after package installation to hopefully make it more reliable" or something would be better to me...

@upils
Copy link
Collaborator Author

upils commented Jan 24, 2024

Oh do not worry about the commit's messages for now, I am still investigating and will write proper commits when I have pinpointed the solution.

@upils upils changed the title FR-6365 - Improve unmounting after package installation FR-6365 - Improve mountpoints handling Jan 24, 2024
sil2100
sil2100 previously approved these changes Jan 25, 2024
Copy link
Collaborator

@sil2100 sil2100 left a comment

Choose a reason for hiding this comment

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

Looks good. The inline comments are non-important pokes.
Makes me actually think why we did bind-mount so many of the mountpoints to begin with. Must have been something I missed during reviews, since we don't even do that in livecd-rootfs. Anyway, this looks like the right way forward. Please proceed!

internal/statemachine/classic_states.go Show resolved Hide resolved
internal/statemachine/classic_test.go Outdated Show resolved Hide resolved
@sil2100
Copy link
Collaborator

sil2100 commented Jan 25, 2024

Oh, and don't forget to bump snapcraft.yaml! So that at least the edge snap gets a +snapX bump.

@upils
Copy link
Collaborator Author

upils commented Jan 25, 2024

Oh, and don't forget to bump snapcraft.yaml! So that at least the edge snap gets a +snapX bump.

Yes. I tend to do that just before merging because we already had several occasions where I needed to change it a few times because several other PR where merged just before merging the one I was working on.

sil2100
sil2100 previously approved these changes Jan 25, 2024
Error of the calling function is also kept and not discarded if some of the teardown command fail.
@upils upils merged commit 2c907b2 into main Jan 26, 2024
9 of 13 checks passed
@upils upils deleted the fix-umounting branch January 26, 2024 13:13
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.

3 participants