-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add support to convert checkpoint archives to OCI images #125
base: main
Are you sure you want to change the base?
Add support to convert checkpoint archives to OCI images #125
Conversation
a4c6832
to
090cfe8
Compare
I will add test cases gradually. |
Thanks for this PR. It looks like the right approach. Unfortunately, now that the PR exists, I am no longer sure this is right thing to do. This PR pulls in so many dependencies (over 3000 files), that maybe this was not a good idea after all. |
@adrianreber yes I noticed that also, I am not getting any solution of this problem right now, do you have any advise for me ? |
It is definitely not a good idea to add all these dependencies. A much simpler solution would be to use something like |
What about using |
Not sure about exec. Maybe it should just be a shell script. Not sure. |
If we use shell script, then where should we store it(maybe in $HOME/.checkpointctl/scripts) ? |
No, if we offer a shell script it should follow what make install does. It could also be somewhere in libexec and then be called by exec as suggested by Radostin. |
5d3598c
to
974cb90
Compare
Now if we use script, we have to ensure that user have buildah installed or we can add buildah installation as a part of checkpointctl installation. |
Yes, we will document it and the actual dependencies is up to the package managers in the distributions. The script can also check for |
974cb90
to
d30d438
Compare
@adrianreber @rst0git PTAL, If there is no major refactoring required, I can start working on tests. |
Why does the PR now still add over 16000 lines of code? Something is not right. |
1 similar comment
Why does the PR now still add over 16000 lines of code? Something is not right. |
d30d438
to
00ca229
Compare
yes I am checking that. |
00ca229
to
8496613
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
- Coverage 76.42% 72.16% -4.27%
==========================================
Files 11 13 +2
Lines 1442 1541 +99
==========================================
+ Hits 1102 1112 +10
- Misses 266 355 +89
Partials 74 74 ☔ View full report in Codecov by Sentry. |
Good first try. I must confess I am still unsure which direction we should go, but let's try and see where this leads us. Please add your script to the |
For the destination directory of the script I am currently thinking about $ rpm -ql git | grep libexec
/usr/libexec/git-core/git-contacts
/usr/libexec/git-core/git-credential-netrc
/usr/libexec/git-core/git-filter-branch
/usr/libexec/git-core/git-request-pull We need to figure out what other distributions are using for internal scripts. |
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash has a builtin optarg parser which would be nicer than purely positional parameters.
Also add checks that all the input files actually exist.
I would also say, instead of container engine specific annotations, which are almost not used at all (the only important one if name for CRI-O at least, but we can also change that), let's own the annotations in this package. We should also move the annotation definition to lib, so that all projects reading the annotations can easily import them from checkpointctl. Maybe start almost all annotation with @rst0git do you remember which annotation are actually used by Podman? CRI-O is just looking for |
We currently use the runtime name to identify an OCI image that contains checkpoint. This functionality needs be extended (in Podman and CRI-O) to verify the comparability of the system before running |
Right. But are any of the annotations already verified today or is that just an idea for the future? |
In Podman we currently use only checkpointRuntimeName, found := imgData[i].Annotations[define.CheckpointAnnotationRuntimeName]
if !found {
return false, fmt.Errorf("image is not a checkpoint: %s", imgID)
}
if hostInfo.Host.OCIRuntime.Name != checkpointRuntimeName {
return false, fmt.Errorf("container image \"%s\" requires runtime: \"%s\"", imgID, checkpointRuntimeName)
} |
This is a good idea. |
I thought |
@Parthiba-Hazra
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html
|
8496613
to
1f4c74c
Compare
@rst0git @adrianreber do we need to keep those annotation's format unchanged or change it to similar what we are doing here( |
We talked a bit about it and we are not sure. Naming things is hard 😉 . As this is all about CRIU I think we could go with something like |
yes, this looks way better and reasonable - |
@adrianreber @rst0git Any update on the annotation's name? Is this the final format - Also, shouldn't this annotation's name be
|
@Parthiba-Hazra If you open another pull request with the updated annotations, we can discuss the format there. |
@Parthiba-Hazra hi! Is there any update on the status of this pull request? |
As far as I can remember, this PR can be opened after resolving conflicts as the annotations PR was merged. |
@Parthiba-Hazra great! Would you like to rebase this PR and mark it ready for review? |
1f4c74c
to
24b08c2
Compare
- With this enhancement, users can now build OCI images from checkpoint archives using the `checkpointctl build` command. This command accepts checkpoint archive and a image name as input and generates an OCI image suitable for use with container runtimes like CRI-O or Podman. Users can inspect the image to get information about runtime, container, pod, namespace, image name etc. Signed-off-by: Parthiba-Hazra <[email protected]>
24b08c2
to
c6d1a17
Compare
Resolves: #52
This PR introduce a new command
checkpointctl build
, which can be used to convert checkpoint archives to OCI images. The command accepts a checkpoint archive and a image name as input and generates an OCI image suitable for use with container runtimes like CRI-O or Podman.we can inspect the image using podman -