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

overlay, composefs: use data-only lower layers #1713

Merged
merged 5 commits into from
Oct 3, 2023

Conversation

giuseppe
Copy link
Member

use the new overlay data-only feature to mount the composefs data directory so there is no need for upper layers to create whiteouts to hide payload files.

The feature was added to Linux 6.5.

Signed-off-by: Giuseppe Scrivano [email protected]

@giuseppe giuseppe marked this pull request as ready for review September 13, 2023 15:33
@giuseppe giuseppe marked this pull request as draft September 13, 2023 18:32
@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 19118f6 to 5ff2951 Compare September 13, 2023 19:43
@giuseppe giuseppe marked this pull request as ready for review September 13, 2023 19:44
@nalind
Copy link
Member

nalind commented Sep 13, 2023

How is whether or not we can use a data-only lower layer determined? Is there a run-time feature test for this?

@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 5ff2951 to 514dbc0 Compare September 14, 2023 08:59
@giuseppe
Copy link
Member Author

How is whether or not we can use a data-only lower layer determined? Is there a run-time feature test for this?

I've added a run-time feature test. Without the data-only lower layers feature we are limited to mount only images with a single layer when using composefs. I don't think it is worth the extra complexity, so composefs is disabled when the feature is not present.

@alexlarsson PTAL

@giuseppe
Copy link
Member Author

we also need: #1712

@rhatdan
Copy link
Member

rhatdan commented Sep 14, 2023

#1712 is merged

@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 514dbc0 to b83bd45 Compare September 15, 2023 08:41
}
// absLowers is not valid anymore now as we have added composeFsLayers to it, so prevent
// its usage.
absLowers = nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

linter says: ineffectual assignment about this

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from b83bd45 to 210c31a Compare September 15, 2023 10:44
@giuseppe
Copy link
Member Author

ready for review

@rhatdan
Copy link
Member

rhatdan commented Sep 17, 2023

LGTM
@nalind @mtrmac @alexlarsson @flouthoc PTAL

Copy link
Member

@nalind nalind left a comment

Choose a reason for hiding this comment

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

I'd really like a test that ensures that the driver does the right thing when the feature is available and asked for, even if it has to be skipped in CI in the short-term.

@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 25e0478 to fbe981b Compare September 18, 2023 19:21
@giuseppe
Copy link
Member Author

I'd really like a test that ensures that the driver does the right thing when the feature is available and asked for, even if it has to be skipped in CI in the short-term.

Sure, I can add some tests. Do you think there is anything in particular we should test for? Once composefs is enabled, there should not be any visible difference for the users and the existing tests should still work

@nalind
Copy link
Member

nalind commented Sep 18, 2023

I'd really like a test that ensures that the driver does the right thing when the feature is available and asked for, even if it has to be skipped in CI in the short-term.

Sure, I can add some tests. Do you think there is anything in particular we should test for? Once composefs is enabled, there should not be any visible difference for the users and the existing tests should still work

Do we have tests that exercise using composefs layers as read-only layers?

@giuseppe
Copy link
Member Author

I'd really like a test that ensures that the driver does the right thing when the feature is available and asked for, even if it has to be skipped in CI in the short-term.

Sure, I can add some tests. Do you think there is anything in particular we should test for? Once composefs is enabled, there should not be any visible difference for the users and the existing tests should still work

Do we have tests that exercise using composefs layers as read-only layers?

I don't think it would be any different than the tests we already have, the only difference with composefs is that there will be more 2x lower layers (for each layer there is one overlay layer with the erofs file system and one for the data)

@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from fbe981b to 64284da Compare September 19, 2023 08:48
@giuseppe giuseppe marked this pull request as draft September 19, 2023 10:57
@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 8803c74 to 027416c Compare September 19, 2023 12:25
@giuseppe giuseppe marked this pull request as ready for review September 19, 2023 12:25
@rhatdan
Copy link
Member

rhatdan commented Sep 20, 2023

@mtrmac @nalind PTAL

@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from ebcf14d to 0287143 Compare September 22, 2023 07:29
@giuseppe
Copy link
Member Author

thanks, comments addressed in the current version

@giuseppe
Copy link
Member Author

can I get another review?

Copy link
Contributor

@alexlarsson alexlarsson left a comment

Choose a reason for hiding this comment

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

Minor comments, but looks good to me.

drivers/overlay/check.go Show resolved Hide resolved
cmd/containers-storage/diff.go Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 0287143 to c34d862 Compare September 25, 2023 11:33
@rhatdan
Copy link
Member

rhatdan commented Sep 26, 2023

@alexlarsson @nalind PTANL

Copy link
Contributor

@alexlarsson alexlarsson left a comment

Choose a reason for hiding this comment

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

lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexlarsson, giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Sep 27, 2023

@mtrmac @nalind another review?

if d.options.mountOptions is the empty string, we should not append an
empty option.

Signed-off-by: Giuseppe Scrivano <[email protected]>
use the new overlay data-only feature to mount the composefs data
directory so there is no need for upper layers to create whiteouts to
hide payload files.

The feature was added to Linux 6.5.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from c34d862 to 77fa03d Compare October 2, 2023 07:53
@giuseppe
Copy link
Member Author

giuseppe commented Oct 2, 2023

rebased, can you please take another look?

@giuseppe
Copy link
Member Author

giuseppe commented Oct 2, 2023

@nalind could you please take another look?

dataOnly := false
for _, lowerPath := range lowers {
if lowerPath == "" {
dataOnly = true
Copy link
Member

Choose a reason for hiding this comment

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

Should this loop be enforcing the "once we see a data-only layer, they should all be data-only layers" requirement that the kernel has?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure, if the input is not correct we'd get a similar error from Mount as we do if we call directly the syscall and we are not doing any validation in the mountOverlayFromMain function.

I don't think we need it, but if you prefer to have it, I'll add it

Copy link
Member

Choose a reason for hiding this comment

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

It's not a blocker for me so long as it's something we thought about, and not a "we didn't think of that" that becomes a problem later on.

tests/apply-diff.bats Outdated Show resolved Hide resolved
add a new command to exercise the ApplyDiff from a staging directory.

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the dataonly-overlay-composefs branch from 77fa03d to 42fa4a9 Compare October 3, 2023 07:46
@nalind
Copy link
Member

nalind commented Oct 3, 2023

LGTM

@mtrmac
Copy link
Collaborator

mtrmac commented Oct 3, 2023

/lgtm

(reflecting others’ reviews, really)

@openshift-ci openshift-ci bot added the lgtm label Oct 3, 2023
@rhatdan rhatdan merged commit 19c3c10 into containers:main Oct 3, 2023
18 checks passed
@cgwalters cgwalters added the area/composefs composefs related changes label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/composefs composefs related changes lgtm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants