Skip to content
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 annotations to the state json #484

Merged
merged 1 commit into from
Jun 3, 2016
Merged

Conversation

duglin
Copy link
Contributor

@duglin duglin commented Jun 2, 2016

Closes: #480

Signed-off-by: Doug Davis [email protected]

@wking
Copy link
Contributor

wking commented Jun 2, 2016

On Thu, Jun 02, 2016 at 01:25:37PM -0700, Doug Davis wrote:

  • Add annotations to the state json

For previous work in this direction, see #188 (which was about adding
runtime-specified annotations to the state). I think that was closed
prematurely after the config-author-specified annotations landed in
#331 1. Is there still interest in the runtime-specified
annotations use-case that lead to #188? For example, runC apparently
injects a ‘bundle’ field into annotations to get it into the state
JSON 2.

When I suggested including config-author-specified content in the
state 3, @gao-feng pointed out that you could retrieve that
information via bundlePath 4. If that route to the annotations is
not acceptable, should we just copy the whole config.json into the
state JSON 5? If not, how do we pick and choose what gets copied
over?

@crosbymichael
Copy link
Member

crosbymichael commented Jun 2, 2016

LGTM

Approved with PullApprove

@mrunalp
Copy link
Contributor

mrunalp commented Jun 3, 2016

While this looks fine, we need to be clear about what we copy from the configuration to the state as it is essentially redundant.

@crosbymichael
Copy link
Member

@mrunalp yes, Since annotations are more user defined "labels" for a container not part of the configuration that create the container and its settings it makes since for something like this to be added to the state allow it to be a queried

@mrunalp
Copy link
Contributor

mrunalp commented Jun 3, 2016

@crosbymichael They could also potentially be used to implement extensions that aren't yet in the spec.

@crosbymichael
Copy link
Member

@mrunalp yep, its something for external tooling, the runtime will just passthough and take no actions on the values.

@mrunalp
Copy link
Contributor

mrunalp commented Jun 3, 2016

I am fine merging for now and we could maybe revisit if we see a need to move other values into the state. Thanks!

@mrunalp
Copy link
Contributor

mrunalp commented Jun 3, 2016

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit 34901c1 into opencontainers:master Jun 3, 2016
@duglin duglin deleted the ShowAnnot branch July 20, 2016 10:53
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jan 11, 2018
The spec was not very clear on how state annotations are related to
[config annotations.  In the pull-request that landed state
annotations, it sounds like these were supposed to be copied opaquely
from the config [1].  It's still not clear to me why we'd copy
annotations but not the rest of the config [2], but I'm leaving that
alone for now.

There was previous interest in runtime-specified annotations [3,4]
(e.g. a RunV socket path [5]), but this commit does not allow runtimes
to inject additional entries because I don't like:

* Relying on config authors to avoid squatting on the namespace used
  by the runtime (if ties are broken in favor of the config) or
* Silently clobbering configured annotations (if ties are broken in
  favor of the runtime).

My preference would be to follow [3] and:

* Only include runtime-specified information in the state annotations.
* Require state readers to follow 'bundle' to the config.json if they
  wanted configured annotations (or embed the whole config.json in the
  state).

But with 1.0 released and spec-maintainer comments like [1], I think
it's too late to return to that approach.  If we want to expose
runtime-specified annotations, I think we'll need a new state
property.  There has been previous discussion of using "labels" and
"annotations" to carry both types of information in the state [6], and
while it's not as elegant as a full config copy, the
labels/annotations approach is still viable.

[1]: opencontainers#484 (comment)
[2]: opencontainers#484 (comment)
[3]: opencontainers#188
[4]: opencontainers#331 (comment)
[5]: opencontainers#188 (comment)
[6]: opencontainers#331 (comment)

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jan 11, 2018
The spec was not very clear on how state annotations are related to
config annotations.  In the pull-request that landed state
annotations, it sounds like these were supposed to be copied opaquely
from the config [1].  It's still not clear to me why we'd copy
annotations but not the rest of the config [2], but I'm leaving that
alone for now.

There was previous interest in runtime-specified annotations [3,4]
(e.g. a RunV socket path [5]), but this commit does not allow runtimes
to inject additional entries because I don't like:

* Relying on config authors to avoid squatting on the namespace used
  by the runtime (if ties are broken in favor of the config) or
* Silently clobbering configured annotations (if ties are broken in
  favor of the runtime).

My preference would be to follow [3] and:

* Only include runtime-specified information in the state annotations.
* Require state readers to follow 'bundle' to the config.json if they
  wanted configured annotations (or embed the whole config.json in the
  state).

But with 1.0 released and spec-maintainer comments like [1], I think
it's too late to return to that approach.  If we want to expose
runtime-specified annotations, I think we'll need a new state
property.  There has been previous discussion of using "labels" and
"annotations" to carry both types of information in the state [6], and
while it's not as elegant as a full config copy, the
labels/annotations approach is still viable.

[1]: opencontainers#484 (comment)
[2]: opencontainers#484 (comment)
[3]: opencontainers#188
[4]: opencontainers#331 (comment)
[5]: opencontainers#188 (comment)
[6]: opencontainers#331 (comment)

Signed-off-by: W. Trevor King <[email protected]>
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.

4 participants