Skip to content

Add flag annotation #37289

Closed
jshachm wants to merge 2 commits intomoby:masterfrom
jshachm:add-flag-annotation
Closed

Add flag annotation #37289
jshachm wants to merge 2 commits intomoby:masterfrom
jshachm:add-flag-annotation

Conversation

@jshachm
Copy link

@jshachm jshachm commented Jun 15, 2018

As talked in #37262, it will be very useful to support annotations flag in docker cli.

Support annotation will bring a lot of benefits not only for dockershim model for kubernetes and also
native docker users will have additional ways to pass there key-value to container.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@WeiZhang555
Copy link
Contributor

I think this could be a better choice than #37262 and it's really useful for runtimes other than runc to do more custom works

@jshachm
Copy link
Author

jshachm commented Jun 18, 2018

there will be a related patch on cli and it already done. But I think we should let the dockerd lib get involved.

@egernst
Copy link

egernst commented Jun 19, 2018

@sboeuf
Copy link

sboeuf commented Jun 19, 2018

Looks good, this would be very useful indeed !

Copy link
Member

Choose a reason for hiding this comment

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

I feel like the naming around this is too generic. If we want to provide passthroughs to the OCI runtime then naming/structure should reflect this.

Copy link

Choose a reason for hiding this comment

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

Do you have something in mind that would be a less generic naming ?

Copy link
Author

Choose a reason for hiding this comment

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

@cpuguy83 you mean like OciAnnotations or RuntimeAnnotations or other things like these to indicate that this belongs to OCI spec

Copy link
Member

Choose a reason for hiding this comment

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

Maybe something like RuntimeAnnotations... but I'm curious why these configurations aren't passed down as runtime args?

Copy link

Choose a reason for hiding this comment

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

Well if we use args, this means everytime a new thing comes up, we'll need to get those changes accepted. Annotations is the most generic way to pass arguments that might not be defined yet.

Copy link
Member

Choose a reason for hiding this comment

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

Are these annotations unique for each individual container, or for the runtime that's used? (i.e., must each container have different annotations?)

Copy link

Choose a reason for hiding this comment

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

It's per container since they will be used to differentiate containers from pods.

jshachm added 2 commits June 26, 2018 10:11
Signed-off-by: Haomin <caihaomin@huawei.com>
Signed-off-by: Haomin <caihaomin@huawei.com>
@jshachm jshachm force-pushed the add-flag-annotation branch from ff5ebe7 to 8700ab2 Compare June 26, 2018 02:20
@jshachm
Copy link
Author

jshachm commented Jun 26, 2018

@cpuguy83 config updated~

@WeiZhang555
Copy link
Contributor

@jshachm
Copy link
Author

jshachm commented Jul 4, 2018

Hi All~ Can we get this design done ~~ 'cause it's really important for our vm based container and I think it will be really useful for docker users~
@cpuguy83 @thaJeztah @justincormack @runcom @tonistiigi

@cpuguy83
Copy link
Member

cpuguy83 commented Jul 4, 2018

We discussed this at the maintainers meeting last week without a real conclusion.
It is being looked at.

@jshachm
Copy link
Author

jshachm commented Jul 15, 2018

Anything new in come ? @cpuguy83 Hah~

@jshachm
Copy link
Author

jshachm commented Jul 23, 2018

ping docker maintainers @cpuguy83 @thaJeztah @tonistiigi @justincormack

@AkihiroSuda
Copy link
Member

ping @cpuguy83 ^^

@jshachm
Copy link
Author

jshachm commented Sep 18, 2018

anything new~ @cpuguy83 PLZ let us know~ it's a really useful option ^^

@derek derek bot added the rebuild/* label Dec 21, 2018
@derek derek bot added the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 22, 2018
@olljanat
Copy link
Contributor

@jshachm plz check those failing tests

@jshachm
Copy link
Author

jshachm commented Dec 22, 2018

@olljanat
Maybe @cpuguy83 will give us some more feedback.
Should we need this feature~~~? ^-^

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

I think this seems fine, but feel that the field needs be to moved to HostConfig.

Thanks for your patience on this. I wound up reviewing a similar (in goals) PR to this and pretty much came to the conclusion that this would be the best way forward, then low and behold I found this PR already exists.

Let me know if you still want to get this in.

MacAddress string `json:",omitempty"` // Mac Address of the container
OnBuild []string // ONBUILD metadata that were defined on the image Dockerfile
Labels map[string]string // List of labels set to this container
RuntimeAnnotations map[string]string // List of runtime annotations set to this container
Copy link
Member

Choose a reason for hiding this comment

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

This should probably go in HostConfig instead of Config because this becomes part of the image config which does not seem desirable... we already made this mistake with Labels which wound up creating a lot of problems that we really couldn't fix, unfortunately.

@jshachm
Copy link
Author

jshachm commented Apr 13, 2020

@cpuguy83 Hah It's just a bit long time~

I still want to get this in.

I will rebase first and get it done on the latest master branch...

Quit a long time... Hah

@thaJeztah
Copy link
Member

API side was implemented (but slightly different) in #45025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/failing-ci Indicates that the PR in its current state fails the test suite status/1-design-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.