Giter Club home page Giter Club logo

Comments (4)

adrianreber avatar adrianreber commented on August 28, 2024 2

It appear that this issue need to be solved first (e.g to avoid unpacking all checkpoint files to get the size of the checkpoint).

Yes, I agree.

Use tar CLI inside the code like in the example given before by @rst0git

This is not really an option from my point of view and should be avoided. I also think it is not necessary.

There are two problems you need to solve. First is to only extract certain files. This can easily be done they way we did it in CRI-O: https://github.com/cri-o/cri-o/blob/main/server/container_restore.go#L107

You can use an exclude list.

The other part, getting the size of the rootfs and actual checkpoint data is a bit more difficult. From my point of view you need access to the low-level tar functionality: https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/checkpoint_container.go#L171

That is also easy, but the tar archive could be compressed. So you first need to do the appropriate decompression and then access the tar header to get the size by just reading the size information for each file from the tar header.

Without looking too deep into it I think it might be possible to use the function DecompressStream() from https://github.com/containers/storage/blob/main/pkg/archive/archive.go#L182. Once you have decompressed stream you should be able to loop over all files in the tar archive to extract the size information.

from checkpointctl.

rst0git avatar rst0git commented on August 28, 2024

It is worth noting that /tmp has limited size and checkpointctl show currently fails with large checkpoints because it tries to extract all files before reading any information. Extracting only the necessary files would fix this and significantly improve the performance of checkpointctl.

For example, the following command can be used to extract only the stats-dump file from a container checkpoint created with CRI-O:

tar --extract --file=./checkpoint.tar stats-dump

from checkpointctl.

behouba avatar behouba commented on August 28, 2024

@adrianreber , @rst0git as I am working on proposing something for the issue #53. It appear that this issue need to be solved first (e.g to avoid unpacking all checkpoint files to get the size of the checkpoint).
What do you think is preferred approach to solve this issue ?
I have considered two options:

  • Write custom function to unpack specified list of files (modified version of Unpack )
  • Use tar CLI inside the code like in the example given before by @rst0git

I am also wondering if there is any alternative approach using the archive package that I might not be aware of.

from checkpointctl.

behouba avatar behouba commented on August 28, 2024

Thank you so much for the detailed response.

from checkpointctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.