Skip to content

cmd/ctr: create an image for checkpoint#1524

Closed
wenjianhn wants to merge 1 commit intocontainerd:masterfrom
wenjianhn:ctr-checkpoint-image
Closed

cmd/ctr: create an image for checkpoint#1524
wenjianhn wants to merge 1 commit intocontainerd:masterfrom
wenjianhn:ctr-checkpoint-image

Conversation

@wenjianhn
Copy link
Copy Markdown

This allows one to manage the checkpoints by using the ctr image
command.

The image is created with label "checkpoint=true". By default, it is
not included in the output of ctr images ls.
We can list the images by using the following command:
ctr images ls labels.checkpoint==true

Fixes #1026

Signed-off-by: Jacob Wen [email protected]

Comment thread cmd/ctr/checkpoint.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

containerd.io/checkpoint for consistency with containerd.io/uncompressed label?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

I would say that this ought to be done by the client for consistencies between users.

Comment thread cmd/ctr/checkpoint.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd say to use the digest as the name

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

This allows one to manage the checkpoints by using the `ctr image`
command.

The image is created with label "containerd.io/checkpoint". By
default, it is not included in the output of `ctr images ls`.
We can list the images by using the following command:
$ ctr images ls labels.containerd.\"io/checkpoint\"==true

Fixes containerd#1026

Signed-off-by: Jacob Wen <[email protected]>
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1524 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1524   +/-   ##
=======================================
  Coverage   42.61%   42.61%           
=======================================
  Files          24       24           
  Lines        3318     3318           
=======================================
  Hits         1414     1414           
  Misses       1581     1581           
  Partials      323      323

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d700a9c...8dca5f1. Read the comment docs.

Comment thread cmd/ctr/checkpoint.go
}

labels := map[string]string{
"containerd.io/checkpoint": "true",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this the label convention we are pushing?

@dmcgowan @crosbymichael

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well do we really need a label for this? Shouldn't a media type be enough for filter on?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, filtering on type would be way better.

@wenjianhn Could you try to make this work with the mediatype of the image?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Does application/vnd.oci.image.index.v1+json mean the image is a checkpoint?

@crosbymichael @stevvooe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, that means its an OCI index. I suppose we are not exposing the checkpoint at the top-level. The mediatype for the checkpoint will be buried in the manifests property of the index.

@crosbymichael Was this what you had in mind?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stevvooe ya that is correct that it should be a manifest list and the entire list represents a "checkpoint"

I'm not sure how we represent this at the image level, i guess labels but they should be adding in the containerd client.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@crosbymichael I think labeling the content here is sufficient. It provides a way of clients to indicate that something has some capability that might be expensive to calculate. These labels would be scoped to only containerd.

So, I guess, back to the question: is this the format we are using for labels?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stevvooe I think so. I just saw @dmcgowan GC pr that uses labels like this for GC objects.

@wenjianhn wenjianhn deleted the ctr-checkpoint-image branch October 19, 2017 01:45
mauriciovasquezbernal pushed a commit to kinvolk/containerd that referenced this pull request Nov 13, 2020
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.

6 participants