scan: optimize the OSTree case#917
Conversation
0561d48 to
38e37a2
Compare
|
@giuseppe lets talk tomorrow. im refactoring Scan right now. Would like to complete that and then we can fix the ostree mount point issues. |
Atomic/mount.py
Outdated
| def mount(self): | ||
| def _try_ostree_mount(self, best_mountpoint_for_storage): | ||
| if best_mountpoint_for_storage: | ||
| mountpoint = os.path.join(self.syscontainers.get_ostree_repo_location(), "tmp", str(os.getpid()), self.image) |
There was a problem hiding this comment.
Using getpid() in here is going to make it hard to avoid leaking them. I'd make it get_repo_location() + /tmp/atomic-mount or something. Then it's easy to have a cleanup function delete that directory. This is what we do in rpm-ostree. Now, inside that directory, maybe you do want a pid.
There was a problem hiding this comment.
thanks, I have pushed a fixup patch to change this to /tmp/atomic-mount.
|
@baude The changes to scan.py are quite limited. Are these patches going to conflict with the refactor you are working on? I am ok to resolve these conflicts on top of your work |
|
☔ The latest upstream changes (presumably f5419ec) made this pull request unmergeable. Please resolve the merge conflicts. |
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
It optimizes the OSTree case where we prefer to use the same file system of the repository for the checkout so that we can use hard links instead of copying files. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
let the storage choose the best mountpoint. Closes: projectatomic#916 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
97be3ef to
f005964
Compare
|
@baude rebased on top of your series |
|
one issue I've seen is that if the image is present in both repositories, scan fails with an unfriendly: Not sure how to handle this, if mount fails, iterate over all the backends until the image is found? |
|
@giuseppe ill look into that issue deeper but outside the context of this PR. Sound good? |
|
@baude, sure just wanted to point it out so that we could discuss it |
|
LGTM! |
It optimizes the OSTree case where we prefer to use the same file system of the repository for the checkout so that we can use hard links instead of copying files. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #917 Approved by: baude
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #917 Approved by: baude
|
☀️ Test successful - status-redhatci |
create hard links instead of copying files when possible.
Closes: #916