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

runtime: Document state annotations as a copy of config annotations #946

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wking
Copy link
Contributor

@wking wking commented 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 (#484), it sounds like these were supposed to be copied opaquely from the config. It's still not clear to me why we'd copy annotations but not the rest of the config, but I'm leaving that
alone for now.

There was previous interest in runtime-specified annotations (e.g. a RunV socket path), 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 #118 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 this, 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, and while it's not as elegant as a full config copy, the labels/annotations approach is still viable.

Related to opencontainers/runc#1687. I'm not clear on whether libcontainer's Labels mixes configured and runtime-specified annotations or not, so I'm not sure if it would be compatible with this change. Looks like runc is removing their injected bundle, so opencontainers/runc#1687 would be compatible with this PR as it stands.

I don't think this is a breaking change, because the previous content of annotations was unspecified, so state consumers shouldn't have been relying on a particular semantic behavior.

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 <wking@tremily.us>
@wking
Copy link
Contributor Author

wking commented Jan 11, 2018

Travis failure is #945.

@cyphar
Copy link
Member

cyphar commented Jan 12, 2018

As an aside, regarding this:

Require state readers to follow bundle to the config.json if they wanted configured annotations (or embed the whole config.json in the state).

One of the plans I have for runc is to change our on-disk state storage so that it only stores the PID1 and a copy of the config, both for our own sanity but also to have a single source of truth for the state of the container. This would make this sort of requirement easier to deal with if we want to make it a requirement.

@wking
Copy link
Contributor Author

wking commented Feb 15, 2018

Closing/reopening to bump Travis with #945 landed.

@wking wking closed this Feb 15, 2018
@wking wking reopened this Feb 15, 2018
@vbatts
Copy link
Member

vbatts commented Apr 4, 2018

it was intentionally vague as that annotations field for runtime state was literally a holding bin so that implementations would just dump arbitrary values across the state.
I'm not inclined on this PR

@wking
Copy link
Contributor Author

wking commented Apr 4, 2018 via email

@vbatts
Copy link
Member

vbatts commented Apr 4, 2018 via email

@wking
Copy link
Contributor Author

wking commented Apr 4, 2018 via email

@vbatts
Copy link
Member

vbatts commented Dec 17, 2019

👎
I'm okay with this being vague and not imposing a workflow here

@h-vetinari h-vetinari mentioned this pull request Feb 3, 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.

None yet

3 participants