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

feat: Include list of image layer directories in ContainerInfo #294

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

vadorovsky
Copy link
Member

For each container, try to retrieve information about image layers paths (from the host filesystem's perspective) and include them in ContainerInfo.

Copy link
Member

@banditopazzo banditopazzo left a comment

Choose a reason for hiding this comment

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

Please handle the unwraps

@vadorovsky vadorovsky force-pushed the vadorovsky/docker-openrc branch 2 times, most recently from 92015b8 to 871258e Compare June 27, 2024 13:38
@vadorovsky vadorovsky force-pushed the vadorovsky/docker-rootfs branch 2 times, most recently from 1fff278 to 4c2933f Compare July 1, 2024 05:43
Base automatically changed from vadorovsky/docker-openrc to main July 1, 2024 09:54
Copy link
Member

@banditopazzo banditopazzo left a comment

Choose a reason for hiding this comment

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

In general it seems fine, but there is no support for podman

crates/bpf-common/src/containers/mod.rs Outdated Show resolved Hide resolved
For each container, try to retrieve information about image layers paths
(from the host filesystem's perspective) and include them in
`ContainerInfo`.
This field is present only for OverlayFS driver. BTRFS doesn not use it.
The procedure for BTRFS is more complicated than for OverlayFS.
`GraphDriver` doesn't contain straightforward information. Instead, it
has to be retrieved with the following steps:

1. Using the given image ID, find an "imagedb entry". It's located in
   `/var/lib/docker/image/btrfs/imagedb/content/sha256/<image_id>`.
2. Get the list of layer checksums from that entry.
3. For each layer, check whether a "layerdb entry" exists. It's located
   in `/var/lib/docker/image/btrfs/layerdb/sha256/<layer_id>`. The
   layerdb directory contains a `cache-id` file.
4. That `cache-id` file contains an ID of a BTRFS subvolume. The
   subvolume can be found in `/var/lib/docker/btrfs/subvolumes/<cache_id>`.
Comment on lines 310 to 311
// TODO(vadorovsky): Parse layer information in Podman.
layers: Vec::new(),
Copy link
Member

Choose a reason for hiding this comment

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

what happened to the previous changes of #309 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I must've done a wrong git push -f. I restored them now, sorry.

Use libpod's image store and layer store to determine image layer
directories on the host for Podman.
@banditopazzo banditopazzo merged commit fc90778 into main Sep 18, 2024
21 checks passed
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.

2 participants