Skip to content

Adding initial draft of the Containerz yang model#1389

Open
alshabib wants to merge 2 commits intoopenconfig:masterfrom
alshabib:containerz
Open

Adding initial draft of the Containerz yang model#1389
alshabib wants to merge 2 commits intoopenconfig:masterfrom
alshabib:containerz

Conversation

@alshabib
Copy link
Copy Markdown

@alshabib alshabib commented Nov 9, 2025

Change Scope

This is a yang model for the gNOI.Containerz service.

This change is backwards compatible.

@alshabib alshabib requested a review from a team as a code owner November 9, 2025 16:50
@alshabib alshabib force-pushed the containerz branch 2 times, most recently from 3ea4065 to 3f56831 Compare November 9, 2025 16:53
description
"gRPC server containerz freshness-related data.";

container containers {
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.

Similar suggestion as above - consider grouping under containerz hierarchy first. If this is meant to be similar to docker ps outputs then can align as such. Any counters should go under child counters container at relevant hierarchy.


augment "/oc-sys:system/oc-sys-grpc:grpc-servers/oc-sys-grpc:grpc-server/" +
"oc-sys-grpc:state" {
when "../config[contains(services, 'oc-containerz:CONTAINERZ')]/enable = '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.

We don't allow for this kind of when statement using contains AFAIK.

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.

This concept was introduced in the gNSI related models

https://github.com/openconfig/public/blob/master/release/models/gnsi/openconfig-gnsi-authz.yang#L205

But this identity does not exist and each gRPC service domain should really bring in a distinct related container and group everything related underneath (commented above)

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.

Added the identity

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.

nit: if you're using this when statement, oc-containerz:CONTAINERZ should be oc-gnoi-containerz:CONTAINERZ to match the module prefix oc-gnoi-containerz you defined at the top of the file here

"gRPC server containerz freshness-related data.";

container containers {
list container {
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.

I see this as duplicative to the ListContainer RPC, which is fine in principle, but how do we expect the two to be used? I presume the thinking here is that some clients will just subscribe through gNMI to understand this state?

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.

Yes - the idea is to export base container telemetry to such that we do not depend on containers to export base telemetry that may cause a circular dependency.

"A timestamp of the last time a gRPC client succeeded
in establishing a connection to the server.";
}
leaf running-containers {
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 a useful metric if we also have the list of containers?

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.

It's gone ;)

@dplore
Copy link
Copy Markdown
Member

dplore commented Nov 12, 2025

/gcbrun

@OpenConfigBot
Copy link
Copy Markdown

No major YANG version changes in commit 6d0ec50

list container {
key "name";

leaf name {
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.

For openconfig style compliance, this needs to be a leafref to a leaf of the same name in a "state container"

for example:

list grpc-server {
key "name";
description
"The list of gRPC servers that are running on the device. Each
instance within this list corresponds to an individual gRPC listener
that listens on a single TCP port on the specified addresses.
Where there are multiple services that run on a single port, these
are enabled through the service leaf-list which uses the GRPC_SERVICE
identity to list the supported service types.";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the name of the service that is to be enabled.";
}
container config {
description
"Configuration parameters relating to the gRPC service.";
uses grpc-server-config;
}
container state {
config false;
description
"Operational state relating to the gRPC service.";
uses grpc-server-config;
}
uses connections-top;
}
}
}
grouping grpc-server-config {
description
"Configuration parameters corresponding to an individual gRPC
server.";
leaf name {
type string;
default "DEFAULT";
description
"The name of the gRPC server instance that is running on
the local system.
If the operator does not designate a name for the protocol
instance (e.g. config), the implementation should use the
name of 'DEFAULT' (e.g. state). In addition, for
implementations that support a single gRPC server instance,
the default value is recommended for consistency.";
}

Copy link
Copy Markdown
Author

@alshabib alshabib Feb 20, 2026

Choose a reason for hiding this comment

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

I remove the other container here.

description
"gRPC server containerz freshness-related data.";

container containers {
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.

Consider the same fields from a docker ps (or docker ls if the intent is only to show running containers)?

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.

That is not entirely possible as restarts or build-label are not directly returned from ps

@dplore dplore self-assigned this Nov 21, 2025
@dplore dplore moved this to Ready to discuss in OC Operator Review Dec 2, 2025
@dplore dplore moved this from Ready to discuss to Waiting for author in OC Operator Review Dec 2, 2025
@dplore
Copy link
Copy Markdown
Member

dplore commented Dec 2, 2025

FYI: set project review status to "waiting for author".

description
"Configuration data for Containerz";

uses containerz-config;
Copy link
Copy Markdown
Contributor

@brianneville brianneville Feb 26, 2026

Choose a reason for hiding this comment

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

this config is going to be directly underneath the /oc-sys:system/oc-sys-grpc:grpc-servers/oc-sys-grpc:grpc-server path - should we put it in a container so that it doesnt appear to be config for the gprc-server specifically?

e.g. right now the vrf leaf is at /system/grpc-servers/grpc-server[name=X]/config/vrf, and based on the path people could be misled into thinking that this should be the VRF for the grpc-server itself, rather than for the container runtime.
something like:
/system/grpc-servers/grpc-server[name=X]/containerz/config/vrf
would make it more clear that this is not for the grpc-server specifically

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 still dont think this should be on a per-grpc-server basis though - could you take a look at #1389 (comment) ?
having this config be under a global /system path (e.g. /system/containerz/config and /system/containerz/state) would make a lot more sense imo, and remove the ability for the client to push config that is conflicting across each grpc-server.

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

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

6 participants