Comments (4)
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.
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.
@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.
Thank you so much for the detailed response.
from checkpointctl.
Related Issues (20)
- Make command fails HOT 9
- Release 1.1.X+ to remove indirect dependency related to CVE-2024-21626 HOT 2
- Dead link to Podman checkpoint HOT 1
- Add support for checkpoint conversion for different container runtimes/engines HOT 3
- Display network information of checkpoints created with Podman HOT 2
- Doubt - Relation with Kubernetes HOT 2
- Versioning? HOT 5
- Showing env and mounts HOT 2
- Extend checkpointctl to convert checkpoint archives to OCI images HOT 2
- Add support for showing information for multiple checkpoints HOT 7
- Add support for list command HOT 7
- Add integration test with podman HOT 3
- Process tree output looks not totally correct. HOT 7
- Extend the output format with a tree view HOT 1
- Extend `inspect` output format with JSON HOT 3
- Refactor `checkpointctl.go` and move commands into individual files HOT 16
- Update `README.md`
- Prune process tree by PID if specified
- Statisitics output adds `us` everywhere
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkpointctl.