diff --git a/grpc_server/cri-api b/grpc_server/cri-api new file mode 160000 index 000000000..61d37877a --- /dev/null +++ b/grpc_server/cri-api @@ -0,0 +1 @@ +Subproject commit 61d37877aa1cb01c14bf51409138077468d4f45c diff --git a/grpc_server/test/cri.proto b/grpc_server/test/cri.proto new file mode 100644 index 000000000..5923931fc --- /dev/null +++ b/grpc_server/test/cri.proto @@ -0,0 +1,1931 @@ +// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` +syntax = "proto3"; + +package runtime.v1; +option go_package = "k8s.io/cri-api/pkg/apis/runtime/v1"; + +// Runtime service defines the public APIs for remote container runtimes +service RuntimeService { + // Version returns the runtime name, runtime version, and runtime API version. + rpc Version(VersionRequest) returns (VersionResponse) {} + + // RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure + // the sandbox is in the ready state on success. + rpc RunPodSandbox(RunPodSandboxRequest) returns (RunPodSandboxResponse) {} + // StopPodSandbox stops any running process that is part of the sandbox and + // reclaims network resources (e.g., IP addresses) allocated to the sandbox. + // If there are any running containers in the sandbox, they must be forcibly + // terminated. + // This call is idempotent, and must not return an error if all relevant + // resources have already been reclaimed. kubelet will call StopPodSandbox + // at least once before calling RemovePodSandbox. It will also attempt to + // reclaim resources eagerly, as soon as a sandbox is not needed. Hence, + // multiple StopPodSandbox calls are expected. + rpc StopPodSandbox(StopPodSandboxRequest) returns (StopPodSandboxResponse) {} + // RemovePodSandbox removes the sandbox. If there are any running containers + // in the sandbox, they must be forcibly terminated and removed. + // This call is idempotent, and must not return an error if the sandbox has + // already been removed. + rpc RemovePodSandbox(RemovePodSandboxRequest) returns (RemovePodSandboxResponse) {} + // PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not + // present, returns an error. + rpc PodSandboxStatus(PodSandboxStatusRequest) returns (PodSandboxStatusResponse) {} + // ListPodSandbox returns a list of PodSandboxes. + rpc ListPodSandbox(ListPodSandboxRequest) returns (ListPodSandboxResponse) {} + + // CreateContainer creates a new container in specified PodSandbox + rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse) {} + // StartContainer starts the container. + rpc StartContainer(StartContainerRequest) returns (StartContainerResponse) {} + // StopContainer stops a running container with a grace period (i.e., timeout). + // This call is idempotent, and must not return an error if the container has + // already been stopped. + // The runtime must forcibly kill the container after the grace period is + // reached. + rpc StopContainer(StopContainerRequest) returns (StopContainerResponse) {} + // RemoveContainer removes the container. If the container is running, the + // container must be forcibly removed. + // This call is idempotent, and must not return an error if the container has + // already been removed. + rpc RemoveContainer(RemoveContainerRequest) returns (RemoveContainerResponse) {} + // ListContainers lists all containers by filters. + rpc ListContainers(ListContainersRequest) returns (ListContainersResponse) {} + // ContainerStatus returns status of the container. If the container is not + // present, returns an error. + rpc ContainerStatus(ContainerStatusRequest) returns (ContainerStatusResponse) {} + // UpdateContainerResources updates ContainerConfig of the container synchronously. + // If runtime fails to transactionally update the requested resources, an error is returned. + rpc UpdateContainerResources(UpdateContainerResourcesRequest) returns (UpdateContainerResourcesResponse) {} + // ReopenContainerLog asks runtime to reopen the stdout/stderr log file + // for the container. This is often called after the log file has been + // rotated. If the container is not running, container runtime can choose + // to either create a new log file and return nil, or return an error. + // Once it returns error, new container log file MUST NOT be created. + rpc ReopenContainerLog(ReopenContainerLogRequest) returns (ReopenContainerLogResponse) {} + + // ExecSync runs a command in a container synchronously. + rpc ExecSync(ExecSyncRequest) returns (ExecSyncResponse) {} + // Exec prepares a streaming endpoint to execute a command in the container. + rpc Exec(ExecRequest) returns (ExecResponse) {} + // Attach prepares a streaming endpoint to attach to a running container. + rpc Attach(AttachRequest) returns (AttachResponse) {} + // PortForward prepares a streaming endpoint to forward ports from a PodSandbox. + rpc PortForward(PortForwardRequest) returns (PortForwardResponse) {} + + // ContainerStats returns stats of the container. If the container does not + // exist, the call returns an error. + rpc ContainerStats(ContainerStatsRequest) returns (ContainerStatsResponse) {} + // ListContainerStats returns stats of all running containers. + rpc ListContainerStats(ListContainerStatsRequest) returns (ListContainerStatsResponse) {} + + // PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not + // exist, the call returns an error. + rpc PodSandboxStats(PodSandboxStatsRequest) returns (PodSandboxStatsResponse) {} + // ListPodSandboxStats returns stats of the pod sandboxes matching a filter. + rpc ListPodSandboxStats(ListPodSandboxStatsRequest) returns (ListPodSandboxStatsResponse) {} + + // UpdateRuntimeConfig updates the runtime configuration based on the given request. + rpc UpdateRuntimeConfig(UpdateRuntimeConfigRequest) returns (UpdateRuntimeConfigResponse) {} + + // Status returns the status of the runtime. + rpc Status(StatusRequest) returns (StatusResponse) {} + + // CheckpointContainer checkpoints a container + rpc CheckpointContainer(CheckpointContainerRequest) returns (CheckpointContainerResponse) {} + + // GetContainerEvents gets container events from the CRI runtime + rpc GetContainerEvents(GetEventsRequest) returns (stream ContainerEventResponse) {} + + // ListMetricDescriptors gets the descriptors for the metrics that will be returned in ListPodSandboxMetrics. + // This list should be static at startup: either the client and server restart together when + // adding or removing metrics descriptors, or they should not change. + // Put differently, if ListPodSandboxMetrics references a name that is not described in the initial + // ListMetricDescriptors call, then the metric will not be broadcasted. + rpc ListMetricDescriptors(ListMetricDescriptorsRequest) returns (ListMetricDescriptorsResponse) {} + + // ListPodSandboxMetrics gets pod sandbox metrics from CRI Runtime + rpc ListPodSandboxMetrics(ListPodSandboxMetricsRequest) returns (ListPodSandboxMetricsResponse) {} + + // RuntimeConfig returns configuration information of the runtime. + // A couple of notes: + // - The RuntimeConfigRequest object is not to be confused with the contents of UpdateRuntimeConfigRequest. + // The former is for having runtime tell Kubelet what to do, the latter vice versa. + // - It is the expectation of the Kubelet that these fields are static for the lifecycle of the Kubelet. + // The Kubelet will not re-request the RuntimeConfiguration after startup, and CRI implementations should + // avoid updating them without a full node reboot. + rpc RuntimeConfig(RuntimeConfigRequest) returns (RuntimeConfigResponse) {} +} + +// ImageService defines the public APIs for managing images. +service ImageService { + // ListImages lists existing images. + rpc ListImages(ListImagesRequest) returns (ListImagesResponse) {} + // ImageStatus returns the status of the image. If the image is not + // present, returns a response with ImageStatusResponse.Image set to + // nil. + rpc ImageStatus(ImageStatusRequest) returns (ImageStatusResponse) {} + // PullImage pulls an image with authentication config. + rpc PullImage(PullImageRequest) returns (PullImageResponse) {} + // RemoveImage removes the image. + // This call is idempotent, and must not return an error if the image has + // already been removed. + rpc RemoveImage(RemoveImageRequest) returns (RemoveImageResponse) {} + // ImageFSInfo returns information of the filesystem that is used to store images. + rpc ImageFsInfo(ImageFsInfoRequest) returns (ImageFsInfoResponse) {} +} + +message VersionRequest { + // Version of the kubelet runtime API. + string version = 1; +} + +message VersionResponse { + // Version of the kubelet runtime API. + string version = 1; + // Name of the container runtime. + string runtime_name = 2; + // Version of the container runtime. The string must be + // semver-compatible. + string runtime_version = 3; + // API version of the container runtime. The string must be + // semver-compatible. + string runtime_api_version = 4; +} + +// DNSConfig specifies the DNS servers and search domains of a sandbox. +message DNSConfig { + // List of DNS servers of the cluster. + repeated string servers = 1; + // List of DNS search domains of the cluster. + repeated string searches = 2; + // List of DNS options. See https://linux.die.net/man/5/resolv.conf + // for all available options. + repeated string options = 3; +} + +enum Protocol { + TCP = 0; + UDP = 1; + SCTP = 2; +} + +// PortMapping specifies the port mapping configurations of a sandbox. +message PortMapping { + // Protocol of the port mapping. + Protocol protocol = 1; + // Port number within the container. Default: 0 (not specified). + int32 container_port = 2; + // Port number on the host. Default: 0 (not specified). + int32 host_port = 3; + // Host IP. + string host_ip = 4; +} + +enum MountPropagation { + // No mount propagation ("rprivate" in Linux terminology). + PROPAGATION_PRIVATE = 0; + // Mounts get propagated from the host to the container ("rslave" in Linux). + PROPAGATION_HOST_TO_CONTAINER = 1; + // Mounts get propagated from the host to the container and from the + // container to the host ("rshared" in Linux). + PROPAGATION_BIDIRECTIONAL = 2; +} + +// Mount specifies a host volume to mount into a container. +message Mount { + // Path of the mount within the container. + string container_path = 1; + // Path of the mount on the host. If the hostPath doesn't exist, then runtimes + // should report error. If the hostpath is a symbolic link, runtimes should + // follow the symlink and mount the real destination to container. + string host_path = 2; + // If set, the mount is read-only. + bool readonly = 3; + // If set, the mount needs SELinux relabeling. + bool selinux_relabel = 4; + // Requested propagation mode. + MountPropagation propagation = 5; + // UidMappings specifies the runtime UID mappings for the mount. + repeated IDMapping uidMappings = 6; + // GidMappings specifies the runtime GID mappings for the mount. + repeated IDMapping gidMappings = 7; + // If set to true, the mount is made recursive read-only. + // In this CRI API, recursive_read_only is a plain true/false boolean, although its equivalent + // in the Kubernetes core API is a quaternary that can be nil, "Enabled", "IfPossible", or "Disabled". + // kubelet translates that quaternary value in the core API into a boolean in this CRI API. + // Remarks: + // - nil is just treated as false + // - when set to true, readonly must be explicitly set to true, and propagation must be PRIVATE (0). + // - (readonly == false && recursive_read_only == false) does not make the mount read-only. + bool recursive_read_only = 8; + // Mount an image reference (image ID, with or without digest), which is a + // special use case for OCI volume mounts. If this field is set, then + // host_path should be unset. All OCI mounts are per feature definition + // readonly. The kubelet does an PullImage RPC and evaluates the returned + // PullImageResponse.image_ref value, which is then set to the + // ImageSpec.image field. Runtimes are expected to mount the image as + // required. + // Introduced in the OCI Volume Source KEP: https://kep.k8s.io/4639 + ImageSpec image = 9; +} + +// IDMapping describes host to container ID mappings for a pod sandbox. +message IDMapping { + // HostId is the id on the host. + uint32 host_id = 1; + // ContainerId is the id in the container. + uint32 container_id = 2; + // Length is the size of the range to map. + uint32 length = 3; +} + +// A NamespaceMode describes the intended namespace configuration for each +// of the namespaces (Network, PID, IPC) in NamespaceOption. Runtimes should +// map these modes as appropriate for the technology underlying the runtime. +enum NamespaceMode { + // A POD namespace is common to all containers in a pod. + // For example, a container with a PID namespace of POD expects to view + // all of the processes in all of the containers in the pod. + POD = 0; + // A CONTAINER namespace is restricted to a single container. + // For example, a container with a PID namespace of CONTAINER expects to + // view only the processes in that container. + CONTAINER = 1; + // A NODE namespace is the namespace of the Kubernetes node. + // For example, a container with a PID namespace of NODE expects to view + // all of the processes on the host running the kubelet. + NODE = 2; + // TARGET targets the namespace of another container. When this is specified, + // a target_id must be specified in NamespaceOption and refer to a container + // previously created with NamespaceMode CONTAINER. This containers namespace + // will be made to match that of container target_id. + // For example, a container with a PID namespace of TARGET expects to view + // all of the processes that container target_id can view. + TARGET = 3; +} + +// UserNamespace describes the intended user namespace configuration for a pod sandbox. +message UserNamespace { + // Mode is the NamespaceMode for this UserNamespace. + // Note: NamespaceMode for UserNamespace currently supports only POD and NODE, not CONTAINER OR TARGET. + NamespaceMode mode = 1; + + // Uids specifies the UID mappings for the user namespace. + repeated IDMapping uids = 2; + + // Gids specifies the GID mappings for the user namespace. + repeated IDMapping gids = 3; +} + +// NamespaceOption provides options for Linux namespaces. +message NamespaceOption { + // Network namespace for this container/sandbox. + // Note: There is currently no way to set CONTAINER scoped network in the Kubernetes API. + // Namespaces currently set by the kubelet: POD, NODE + NamespaceMode network = 1; + // PID namespace for this container/sandbox. + // Note: The CRI default is POD, but the v1.PodSpec default is CONTAINER. + // The kubelet's runtime manager will set this to CONTAINER explicitly for v1 pods. + // Namespaces currently set by the kubelet: POD, CONTAINER, NODE, TARGET + NamespaceMode pid = 2; + // IPC namespace for this container/sandbox. + // Note: There is currently no way to set CONTAINER scoped IPC in the Kubernetes API. + // Namespaces currently set by the kubelet: POD, NODE + NamespaceMode ipc = 3; + // Target Container ID for NamespaceMode of TARGET. This container must have been + // previously created in the same pod. It is not possible to specify different targets + // for each namespace. + string target_id = 4; + // UsernsOptions for this pod sandbox. + // The Kubelet picks the user namespace configuration to use for the pod sandbox. The mappings + // are specified as part of the UserNamespace struct. If the struct is nil, then the POD mode + // must be assumed. This is done for backward compatibility with older Kubelet versions that + // do not set a user namespace. + UserNamespace userns_options = 5; +} + +// SupplementalGroupsPolicy defines how supplemental groups +// of the first container processes are calculated. +enum SupplementalGroupsPolicy { + // Merge means that the container's provided SupplementalGroups + // and FsGroup (specified in SecurityContext) will be merged with + // the primary user's groups as defined in the container image + // (in /etc/group). + Merge = 0; + // Strict means that the container's provided SupplementalGroups + // and FsGroup (specified in SecurityContext) will be used instead of + // any groups defined in the container image. + Strict = 1; +} + +// Int64Value is the wrapper of int64. +message Int64Value { + // The value. + int64 value = 1; +} + +// LinuxSandboxSecurityContext holds linux security configuration that will be +// applied to a sandbox. Note that: +// 1) It does not apply to containers in the pods. +// 2) It may not be applicable to a PodSandbox which does not contain any running +// process. +message LinuxSandboxSecurityContext { + // Configurations for the sandbox's namespaces. + // This will be used only if the PodSandbox uses namespace for isolation. + NamespaceOption namespace_options = 1; + // Optional SELinux context to be applied. + SELinuxOption selinux_options = 2; + // UID to run sandbox processes as, when applicable. + Int64Value run_as_user = 3; + // GID to run sandbox processes as, when applicable. run_as_group should only + // be specified when run_as_user is specified; otherwise, the runtime MUST error. + Int64Value run_as_group = 8; + // If set, the root filesystem of the sandbox is read-only. + bool readonly_rootfs = 4; + // List of groups applied to the first process run in each container. + // supplemental_groups_policy can control how groups will be calculated. + repeated int64 supplemental_groups = 5; + // supplemental_groups_policy defines how supplemental groups of the first + // container processes are calculated. + // Valid values are "Merge" and "Strict". + // If not specified, "Merge" is used. + SupplementalGroupsPolicy supplemental_groups_policy = 11; + // Indicates whether the sandbox will be asked to run a privileged + // container. If a privileged container is to be executed within it, this + // MUST be true. + // This allows a sandbox to take additional security precautions if no + // privileged containers are expected to be run. + bool privileged = 6; + // Seccomp profile for the sandbox. + SecurityProfile seccomp = 9; + // AppArmor profile for the sandbox. + SecurityProfile apparmor = 10; + // Seccomp profile for the sandbox, candidate values are: + // * runtime/default: the default profile for the container runtime + // * unconfined: unconfined profile, ie, no seccomp sandboxing + // * localhost/: the profile installed on the node. + // is the full path of the profile. + // Default: "", which is identical with unconfined. + string seccomp_profile_path = 7 [deprecated=true]; +} + +// A security profile which can be used for sandboxes and containers. +message SecurityProfile { + // Available profile types. + enum ProfileType { + // The container runtime default profile should be used. + RuntimeDefault = 0; + // Disable the feature for the sandbox or the container. + Unconfined = 1; + // A pre-defined profile on the node should be used. + Localhost = 2; + } + // Indicator which `ProfileType` should be applied. + ProfileType profile_type = 1; + // Indicates that a pre-defined profile on the node should be used. + // Must only be set if `ProfileType` is `Localhost`. + // For seccomp, it must be an absolute path to the seccomp profile. + // For AppArmor, this field is the AppArmor `/` + string localhost_ref = 2; +} + +// LinuxPodSandboxConfig holds platform-specific configurations for Linux +// host platforms and Linux-based containers. +message LinuxPodSandboxConfig { + // Parent cgroup of the PodSandbox. + // The cgroupfs style syntax will be used, but the container runtime can + // convert it to systemd semantics if needed. + string cgroup_parent = 1; + // LinuxSandboxSecurityContext holds sandbox security attributes. + LinuxSandboxSecurityContext security_context = 2; + // Sysctls holds linux sysctls config for the sandbox. + map sysctls = 3; + // Optional overhead represents the overheads associated with this sandbox + LinuxContainerResources overhead = 4; + // Optional resources represents the sum of container resources for this sandbox + LinuxContainerResources resources = 5; +} + +// PodSandboxMetadata holds all necessary information for building the sandbox name. +// The container runtime is encouraged to expose the metadata associated with the +// PodSandbox in its user interface for better user experience. For example, +// the runtime can construct a unique PodSandboxName based on the metadata. +message PodSandboxMetadata { + // Pod name of the sandbox. Same as the pod name in the Pod ObjectMeta. + string name = 1; + // Pod UID of the sandbox. Same as the pod UID in the Pod ObjectMeta. + string uid = 2; + // Pod namespace of the sandbox. Same as the pod namespace in the Pod ObjectMeta. + string namespace = 3; + // Attempt number of creating the sandbox. Default: 0. + uint32 attempt = 4; +} + +// PodSandboxConfig holds all the required and optional fields for creating a +// sandbox. +message PodSandboxConfig { + // Metadata of the sandbox. This information will uniquely identify the + // sandbox, and the runtime should leverage this to ensure correct + // operation. The runtime may also use this information to improve UX, such + // as by constructing a readable name. + PodSandboxMetadata metadata = 1; + // Hostname of the sandbox. Hostname could only be empty when the pod + // network namespace is NODE. + string hostname = 2; + // Path to the directory on the host in which container log files are + // stored. + // By default the log of a container going into the LogDirectory will be + // hooked up to STDOUT and STDERR. However, the LogDirectory may contain + // binary log files with structured logging data from the individual + // containers. For example, the files might be newline separated JSON + // structured logs, systemd-journald journal files, gRPC trace files, etc. + // E.g., + // PodSandboxConfig.LogDirectory = `/var/log/pods/__/` + // ContainerConfig.LogPath = `containerName/Instance#.log` + string log_directory = 3; + // DNS config for the sandbox. + DNSConfig dns_config = 4; + // Port mappings for the sandbox. + repeated PortMapping port_mappings = 5; + // Key-value pairs that may be used to scope and select individual resources. + map labels = 6; + // Unstructured key-value map that may be set by the kubelet to store and + // retrieve arbitrary metadata. This will include any annotations set on a + // pod through the Kubernetes API. + // + // Annotations MUST NOT be altered by the runtime; the annotations stored + // here MUST be returned in the PodSandboxStatus associated with the pod + // this PodSandboxConfig creates. + // + // In general, in order to preserve a well-defined interface between the + // kubelet and the container runtime, annotations SHOULD NOT influence + // runtime behaviour. + // + // Annotations can also be useful for runtime authors to experiment with + // new features that are opaque to the Kubernetes APIs (both user-facing + // and the CRI). Whenever possible, however, runtime authors SHOULD + // consider proposing new typed fields for any new features instead. + map annotations = 7; + // Optional configurations specific to Linux hosts. + LinuxPodSandboxConfig linux = 8; + // Optional configurations specific to Windows hosts. + WindowsPodSandboxConfig windows = 9; +} + +message RunPodSandboxRequest { + // Configuration for creating a PodSandbox. + PodSandboxConfig config = 1; + // Named runtime configuration to use for this PodSandbox. + // If the runtime handler is unknown, this request should be rejected. An + // empty string should select the default handler, equivalent to the + // behavior before this feature was added. + // See https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class + string runtime_handler = 2; +} + +message RunPodSandboxResponse { + // ID of the PodSandbox to run. + string pod_sandbox_id = 1; +} + +message StopPodSandboxRequest { + // ID of the PodSandbox to stop. + string pod_sandbox_id = 1; +} + +message StopPodSandboxResponse {} + +message RemovePodSandboxRequest { + // ID of the PodSandbox to remove. + string pod_sandbox_id = 1; +} + +message RemovePodSandboxResponse {} + +message PodSandboxStatusRequest { + // ID of the PodSandbox for which to retrieve status. + string pod_sandbox_id = 1; + // Verbose indicates whether to return extra information about the pod sandbox. + bool verbose = 2; +} + +// PodIP represents an ip of a Pod +message PodIP{ + // an ip is a string representation of an IPv4 or an IPv6 + string ip = 1; +} +// PodSandboxNetworkStatus is the status of the network for a PodSandbox. +// Currently ignored for pods sharing the host networking namespace. +message PodSandboxNetworkStatus { + // IP address of the PodSandbox. + string ip = 1; + // list of additional ips (not inclusive of PodSandboxNetworkStatus.Ip) of the PodSandBoxNetworkStatus + repeated PodIP additional_ips = 2; +} + +// Namespace contains paths to the namespaces. +message Namespace { + // Namespace options for Linux namespaces. + NamespaceOption options = 2; +} + +// LinuxSandboxStatus contains status specific to Linux sandboxes. +message LinuxPodSandboxStatus { + // Paths to the sandbox's namespaces. + Namespace namespaces = 1; +} + +enum PodSandboxState { + SANDBOX_READY = 0; + SANDBOX_NOTREADY = 1; +} + +// PodSandboxStatus contains the status of the PodSandbox. +message PodSandboxStatus { + // ID of the sandbox. + string id = 1; + // Metadata of the sandbox. + PodSandboxMetadata metadata = 2; + // State of the sandbox. + PodSandboxState state = 3; + // Creation timestamp of the sandbox in nanoseconds. Must be > 0. + int64 created_at = 4; + // Network contains network status if network is handled by the runtime. + PodSandboxNetworkStatus network = 5; + // Linux-specific status to a pod sandbox. + LinuxPodSandboxStatus linux = 6; + // Labels are key-value pairs that may be used to scope and select individual resources. + map labels = 7; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding PodSandboxConfig used to + // instantiate the pod sandbox this status represents. + map annotations = 8; + // runtime configuration used for this PodSandbox. + string runtime_handler = 9; +} + +message PodSandboxStatusResponse { + // Status of the PodSandbox. + PodSandboxStatus status = 1; + // Info is extra information of the PodSandbox. The key could be arbitrary string, and + // value should be in json format. The information could include anything useful for + // debug, e.g. network namespace for linux container based container runtime. + // It should only be returned non-empty when Verbose is true. + map info = 2; + // Container statuses + repeated ContainerStatus containers_statuses = 3; + // Timestamp at which container and pod statuses were recorded + int64 timestamp = 4; +} + +// PodSandboxStateValue is the wrapper of PodSandboxState. +message PodSandboxStateValue { + // State of the sandbox. + PodSandboxState state = 1; +} + +// PodSandboxFilter is used to filter a list of PodSandboxes. +// All those fields are combined with 'AND' +message PodSandboxFilter { + // ID of the sandbox. + string id = 1; + // State of the sandbox. + PodSandboxStateValue state = 2; + // LabelSelector to select matches. + // Only api.MatchLabels is supported for now and the requirements + // are ANDed. MatchExpressions is not supported yet. + map label_selector = 3; +} + +message ListPodSandboxRequest { + // PodSandboxFilter to filter a list of PodSandboxes. + PodSandboxFilter filter = 1; +} + + +// PodSandbox contains minimal information about a sandbox. +message PodSandbox { + // ID of the PodSandbox. + string id = 1; + // Metadata of the PodSandbox. + PodSandboxMetadata metadata = 2; + // State of the PodSandbox. + PodSandboxState state = 3; + // Creation timestamps of the PodSandbox in nanoseconds. Must be > 0. + int64 created_at = 4; + // Labels of the PodSandbox. + map labels = 5; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding PodSandboxConfig used to + // instantiate this PodSandbox. + map annotations = 6; + // runtime configuration used for this PodSandbox. + string runtime_handler = 7; +} + +message ListPodSandboxResponse { + // List of PodSandboxes. + repeated PodSandbox items = 1; +} + +message PodSandboxStatsRequest { + // ID of the pod sandbox for which to retrieve stats. + string pod_sandbox_id = 1; +} + +message PodSandboxStatsResponse { + PodSandboxStats stats = 1; +} + +// PodSandboxStatsFilter is used to filter the list of pod sandboxes to retrieve stats for. +// All those fields are combined with 'AND'. +message PodSandboxStatsFilter { + // ID of the pod sandbox. + string id = 1; + // LabelSelector to select matches. + // Only api.MatchLabels is supported for now and the requirements + // are ANDed. MatchExpressions is not supported yet. + map label_selector = 2; +} + +message ListPodSandboxStatsRequest { + // Filter for the list request. + PodSandboxStatsFilter filter = 1; +} + +message ListPodSandboxStatsResponse { + // Stats of the pod sandbox. + repeated PodSandboxStats stats = 1; +} + +// PodSandboxAttributes provides basic information of the pod sandbox. +message PodSandboxAttributes { + // ID of the pod sandbox. + string id = 1; + // Metadata of the pod sandbox. + PodSandboxMetadata metadata = 2; + // Key-value pairs that may be used to scope and select individual resources. + map labels = 3; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding PodSandboxStatus used to + // instantiate the PodSandbox this status represents. + map annotations = 4; +} + +// PodSandboxStats provides the resource usage statistics for a pod. +// The linux or windows field will be populated depending on the platform. +message PodSandboxStats { + // Information of the pod. + PodSandboxAttributes attributes = 1; + // Stats from linux. + LinuxPodSandboxStats linux = 2; + // Stats from windows. + WindowsPodSandboxStats windows = 3; +} + +// LinuxPodSandboxStats provides the resource usage statistics for a pod sandbox on linux. +message LinuxPodSandboxStats { + // CPU usage gathered for the pod sandbox. + CpuUsage cpu = 1; + // Memory usage gathered for the pod sandbox. + MemoryUsage memory = 2; + // Network usage gathered for the pod sandbox + NetworkUsage network = 3; + // Stats pertaining to processes in the pod sandbox. + ProcessUsage process = 4; + // Stats of containers in the measured pod sandbox. + repeated ContainerStats containers = 5; +} + +// WindowsPodSandboxStats provides the resource usage statistics for a pod sandbox on windows +message WindowsPodSandboxStats { + // CPU usage gathered for the pod sandbox. + WindowsCpuUsage cpu = 1; + // Memory usage gathered for the pod sandbox. + WindowsMemoryUsage memory = 2; + // Network usage gathered for the pod sandbox + WindowsNetworkUsage network = 3; + // Stats pertaining to processes in the pod sandbox. + WindowsProcessUsage process = 4; + // Stats of containers in the measured pod sandbox. + repeated WindowsContainerStats containers = 5; +} + +// NetworkUsage contains data about network resources. +message NetworkUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Stats for the default network interface. + NetworkInterfaceUsage default_interface = 2; + // Stats for all found network interfaces, excluding the default. + repeated NetworkInterfaceUsage interfaces = 3; +} + +// WindowsNetworkUsage contains data about network resources specific to Windows. +message WindowsNetworkUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Stats for the default network interface. + WindowsNetworkInterfaceUsage default_interface = 2; + // Stats for all found network interfaces, excluding the default. + repeated WindowsNetworkInterfaceUsage interfaces = 3; +} + +// NetworkInterfaceUsage contains resource value data about a network interface. +message NetworkInterfaceUsage { + // The name of the network interface. + string name = 1; + // Cumulative count of bytes received. + UInt64Value rx_bytes = 2; + // Cumulative count of receive errors encountered. + UInt64Value rx_errors = 3; + // Cumulative count of bytes transmitted. + UInt64Value tx_bytes = 4; + // Cumulative count of transmit errors encountered. + UInt64Value tx_errors = 5; +} + +// WindowsNetworkInterfaceUsage contains resource value data about a network interface specific for Windows. +message WindowsNetworkInterfaceUsage { + // The name of the network interface. + string name = 1; + // Cumulative count of bytes received. + UInt64Value rx_bytes = 2; + // Cumulative count of receive errors encountered. + UInt64Value rx_packets_dropped = 3; + // Cumulative count of bytes transmitted. + UInt64Value tx_bytes = 4; + // Cumulative count of transmit errors encountered. + UInt64Value tx_packets_dropped = 5; +} + +// ProcessUsage are stats pertaining to processes. +message ProcessUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Number of processes. + UInt64Value process_count = 2; +} + +// WindowsProcessUsage are stats pertaining to processes specific to Windows. +message WindowsProcessUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Number of processes. + UInt64Value process_count = 2; +} + +// ImageSpec is an internal representation of an image. +message ImageSpec { + // Container's Image field (e.g. imageID or imageDigest). + string image = 1; + // Unstructured key-value map holding arbitrary metadata. + // ImageSpec Annotations can be used to help the runtime target specific + // images in multi-arch images. + map annotations = 2; + // The container image reference specified by the user (e.g. image[:tag] or digest). + // Only set if available within the RPC context. + string user_specified_image = 18; + // Runtime handler to use for pulling the image. + // If the runtime handler is unknown, the request should be rejected. + // An empty string would select the default runtime handler. + string runtime_handler = 19; +} + +message KeyValue { + string key = 1; + string value = 2; +} + +// LinuxContainerResources specifies Linux specific configuration for +// resources. +message LinuxContainerResources { + // CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified). + int64 cpu_period = 1; + // CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified). + int64 cpu_quota = 2; + // CPU shares (relative weight vs. other containers). Default: 0 (not specified). + int64 cpu_shares = 3; + // Memory limit in bytes. Default: 0 (not specified). + int64 memory_limit_in_bytes = 4; + // OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified). + int64 oom_score_adj = 5; + // CpusetCpus constrains the allowed set of logical CPUs. Default: "" (not specified). + string cpuset_cpus = 6; + // CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified). + string cpuset_mems = 7; + // List of HugepageLimits to limit the HugeTLB usage of container per page size. Default: nil (not specified). + repeated HugepageLimit hugepage_limits = 8; + // Unified resources for cgroup v2. Default: nil (not specified). + // Each key/value in the map refers to the cgroup v2. + // e.g. "memory.max": "6937202688" or "io.weight": "default 100". + map unified = 9; + // Memory swap limit in bytes. Default 0 (not specified). + int64 memory_swap_limit_in_bytes = 10; +} + +// HugepageLimit corresponds to the file`hugetlb..limit_in_byte` in container level cgroup. +// For example, `PageSize=1GB`, `Limit=1073741824` means setting `1073741824` bytes to hugetlb.1GB.limit_in_bytes. +message HugepageLimit { + // The value of PageSize has the format B (2MB, 1GB), + // and must match the of the corresponding control file found in `hugetlb..limit_in_bytes`. + // The values of are intended to be parsed using base 1024("1KB" = 1024, "1MB" = 1048576, etc). + string page_size = 1; + // limit in bytes of hugepagesize HugeTLB usage. + uint64 limit = 2; +} + +// SELinuxOption are the labels to be applied to the container. +message SELinuxOption { + string user = 1; + string role = 2; + string type = 3; + string level = 4; +} + +// Capability contains the container capabilities to add or drop +// Dropping a capability will drop it from all sets. +// If a capability is added to only the add_capabilities list then it gets added to permitted, +// inheritable, effective and bounding sets, i.e. all sets except the ambient set. +// If a capability is added to only the add_ambient_capabilities list then it gets added to all sets, i.e permitted +// inheritable, effective, bounding and ambient sets. +// If a capability is added to add_capabilities and add_ambient_capabilities lists then it gets added to all sets, i.e. +// permitted, inheritable, effective, bounding and ambient sets. +message Capability { + // List of capabilities to add. + repeated string add_capabilities = 1; + // List of capabilities to drop. + repeated string drop_capabilities = 2; + // List of ambient capabilities to add. + repeated string add_ambient_capabilities = 3; +} + +// LinuxContainerSecurityContext holds linux security configuration that will be applied to a container. +message LinuxContainerSecurityContext { + // Capabilities to add or drop. + Capability capabilities = 1; + // If set, run container in privileged mode. + // Privileged mode is incompatible with the following options. If + // privileged is set, the following features MAY have no effect: + // 1. capabilities + // 2. selinux_options + // 4. seccomp + // 5. apparmor + // + // Privileged mode implies the following specific options are applied: + // 1. All capabilities are added. + // 2. Sensitive paths, such as kernel module paths within sysfs, are not masked. + // 3. Any sysfs and procfs mounts are mounted RW. + // 4. AppArmor confinement is not applied. + // 5. Seccomp restrictions are not applied. + // 6. The device cgroup does not restrict access to any devices. + // 7. All devices from the host's /dev are available within the container. + // 8. SELinux restrictions are not applied (e.g. label=disabled). + bool privileged = 2; + // Configurations for the container's namespaces. + // Only used if the container uses namespace for isolation. + NamespaceOption namespace_options = 3; + // SELinux context to be optionally applied. + SELinuxOption selinux_options = 4; + // UID to run the container process as. Only one of run_as_user and + // run_as_username can be specified at a time. + Int64Value run_as_user = 5; + // GID to run the container process as. run_as_group should only be specified + // when run_as_user or run_as_username is specified; otherwise, the runtime + // MUST error. + Int64Value run_as_group = 12; + // User name to run the container process as. If specified, the user MUST + // exist in the container image (i.e. in the /etc/passwd inside the image), + // and be resolved there by the runtime; otherwise, the runtime MUST error. + string run_as_username = 6; + // If set, the root filesystem of the container is read-only. + bool readonly_rootfs = 7; + // List of groups applied to the first process run in each container. + // supplemental_groups_policy can control how groups will be calculated. + repeated int64 supplemental_groups = 8; + // supplemental_groups_policy defines how supplemental groups of the first + // container processes are calculated. + // Valid values are "Merge" and "Strict". + // If not specified, "Merge" is used. + SupplementalGroupsPolicy supplemental_groups_policy = 17; + // no_new_privs defines if the flag for no_new_privs should be set on the + // container. + bool no_new_privs = 11; + // masked_paths is a slice of paths that should be masked by the container + // runtime, this can be passed directly to the OCI spec. + repeated string masked_paths = 13; + // readonly_paths is a slice of paths that should be set as readonly by the + // container runtime, this can be passed directly to the OCI spec. + repeated string readonly_paths = 14; + // Seccomp profile for the container. + SecurityProfile seccomp = 15; + // AppArmor profile for the container. + SecurityProfile apparmor = 16; + // AppArmor profile for the container, candidate values are: + // * runtime/default: equivalent to not specifying a profile. + // * unconfined: no profiles are loaded + // * localhost/: profile loaded on the node + // (localhost) by name. The possible profile names are detailed at + // https://gitlab.com/apparmor/apparmor/-/wikis/AppArmor_Core_Policy_Reference + string apparmor_profile = 9 [deprecated=true]; + // Seccomp profile for the container, candidate values are: + // * runtime/default: the default profile for the container runtime + // * unconfined: unconfined profile, ie, no seccomp sandboxing + // * localhost/: the profile installed on the node. + // is the full path of the profile. + // Default: "", which is identical with unconfined. + string seccomp_profile_path = 10 [deprecated=true]; +} + +// LinuxContainerConfig contains platform-specific configuration for +// Linux-based containers. +message LinuxContainerConfig { + // Resources specification for the container. + LinuxContainerResources resources = 1; + // LinuxContainerSecurityContext configuration for the container. + LinuxContainerSecurityContext security_context = 2; +} + +message LinuxContainerUser { + // uid is the primary uid initially attached to the first process in the container + int64 uid = 1; + // gid is the primary gid initially attached to the first process in the container + int64 gid = 2; + // supplemental_groups are the supplemental groups initially attached to the first process in the container + repeated int64 supplemental_groups = 3; +} + +// WindowsNamespaceOption provides options for Windows namespaces. +message WindowsNamespaceOption { + // Network namespace for this container/sandbox. + // Namespaces currently set by the kubelet: POD, NODE + NamespaceMode network = 1; +} + +// WindowsSandboxSecurityContext holds platform-specific configurations that will be +// applied to a sandbox. +// These settings will only apply to the sandbox container. +message WindowsSandboxSecurityContext { + // User name to run the container process as. If specified, the user MUST + // exist in the container image and be resolved there by the runtime; + // otherwise, the runtime MUST return error. + string run_as_username = 1; + + // The contents of the GMSA credential spec to use to run this container. + string credential_spec = 2; + + // Indicates whether the container requested to run as a HostProcess container. + bool host_process = 3; + + // Configuration for the sandbox's namespaces + WindowsNamespaceOption namespace_options = 4; +} + +// WindowsPodSandboxConfig holds platform-specific configurations for Windows +// host platforms and Windows-based containers. +message WindowsPodSandboxConfig { + // WindowsSandboxSecurityContext holds sandbox security attributes. + WindowsSandboxSecurityContext security_context = 1; +} + +// WindowsContainerSecurityContext holds windows security configuration that will be applied to a container. +message WindowsContainerSecurityContext { + // User name to run the container process as. If specified, the user MUST + // exist in the container image and be resolved there by the runtime; + // otherwise, the runtime MUST return error. + string run_as_username = 1; + + // The contents of the GMSA credential spec to use to run this container. + string credential_spec = 2; + + // Indicates whether a container is to be run as a HostProcess container. + bool host_process = 3; +} + +// WindowsContainerConfig contains platform-specific configuration for +// Windows-based containers. +message WindowsContainerConfig { + // Resources specification for the container. + WindowsContainerResources resources = 1; + // WindowsContainerSecurityContext configuration for the container. + WindowsContainerSecurityContext security_context = 2; +} + +// WindowsContainerResources specifies Windows specific configuration for +// resources. +message WindowsContainerResources { + // CPU shares (relative weight vs. other containers). Default: 0 (not specified). + int64 cpu_shares = 1; + // Number of CPUs available to the container. Default: 0 (not specified). + int64 cpu_count = 2; + // Specifies the portion of processor cycles that this container can use as a percentage times 100. + int64 cpu_maximum = 3; + // Memory limit in bytes. Default: 0 (not specified). + int64 memory_limit_in_bytes = 4; + // Specifies the size of the rootfs / scratch space in bytes to be configured for this container. Default: 0 (not specified). + int64 rootfs_size_in_bytes = 5; +} + +// ContainerMetadata holds all necessary information for building the container +// name. The container runtime is encouraged to expose the metadata in its user +// interface for better user experience. E.g., runtime can construct a unique +// container name based on the metadata. Note that (name, attempt) is unique +// within a sandbox for the entire lifetime of the sandbox. +message ContainerMetadata { + // Name of the container. Same as the container name in the PodSpec. + string name = 1; + // Attempt number of creating the container. Default: 0. + uint32 attempt = 2; +} + +// Device specifies a host device to mount into a container. +message Device { + // Path of the device within the container. + string container_path = 1; + // Path of the device on the host. + string host_path = 2; + // Cgroups permissions of the device, candidates are one or more of + // * r - allows container to read from the specified device. + // * w - allows container to write to the specified device. + // * m - allows container to create device files that do not yet exist. + string permissions = 3; +} + +// CDIDevice specifies a CDI device information. +message CDIDevice { + // Fully qualified CDI device name + // for example: vendor.com/gpu=gpudevice1 + // see more details in the CDI specification: + // https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md + string name = 1; +} + +// ContainerConfig holds all the required and optional fields for creating a +// container. +message ContainerConfig { + // Metadata of the container. This information will uniquely identify the + // container, and the runtime should leverage this to ensure correct + // operation. The runtime may also use this information to improve UX, such + // as by constructing a readable name. + ContainerMetadata metadata = 1 ; + // Image to use. + ImageSpec image = 2; + // Command to execute (i.e., entrypoint for docker) + repeated string command = 3; + // Args for the Command (i.e., command for docker) + repeated string args = 4; + // Current working directory of the command. + string working_dir = 5; + // List of environment variable to set in the container. + repeated KeyValue envs = 6; + // Mounts for the container. + repeated Mount mounts = 7; + // Devices for the container. + repeated Device devices = 8; + // Key-value pairs that may be used to scope and select individual resources. + // Label keys are of the form: + // label-key ::= prefixed-name | name + // prefixed-name ::= prefix '/' name + // prefix ::= DNS_SUBDOMAIN + // name ::= DNS_LABEL + map labels = 9; + // Unstructured key-value map that may be used by the kubelet to store and + // retrieve arbitrary metadata. + // + // Annotations MUST NOT be altered by the runtime; the annotations stored + // here MUST be returned in the ContainerStatus associated with the container + // this ContainerConfig creates. + // + // In general, in order to preserve a well-defined interface between the + // kubelet and the container runtime, annotations SHOULD NOT influence + // runtime behaviour. + map annotations = 10; + // Path relative to PodSandboxConfig.LogDirectory for container to store + // the log (STDOUT and STDERR) on the host. + // E.g., + // PodSandboxConfig.LogDirectory = `/var/log/pods/__/` + // ContainerConfig.LogPath = `containerName/Instance#.log` + string log_path = 11; + + // Variables for interactive containers, these have very specialized + // use-cases (e.g. debugging). + bool stdin = 12; + bool stdin_once = 13; + bool tty = 14; + + // Configuration specific to Linux containers. + LinuxContainerConfig linux = 15; + // Configuration specific to Windows containers. + WindowsContainerConfig windows = 16; + + // CDI devices for the container. + repeated CDIDevice CDI_devices = 17; +} + +message CreateContainerRequest { + // ID of the PodSandbox in which the container should be created. + string pod_sandbox_id = 1; + // Config of the container. + ContainerConfig config = 2; + // Config of the PodSandbox. This is the same config that was passed + // to RunPodSandboxRequest to create the PodSandbox. It is passed again + // here just for easy reference. The PodSandboxConfig is immutable and + // remains the same throughout the lifetime of the pod. + PodSandboxConfig sandbox_config = 3; +} + +message CreateContainerResponse { + // ID of the created container. + string container_id = 1; +} + +message StartContainerRequest { + // ID of the container to start. + string container_id = 1; +} + +message StartContainerResponse {} + +message StopContainerRequest { + // ID of the container to stop. + string container_id = 1; + // Timeout in seconds to wait for the container to stop before forcibly + // terminating it. Default: 0 (forcibly terminate the container immediately) + int64 timeout = 2; +} + +message StopContainerResponse {} + +message RemoveContainerRequest { + // ID of the container to remove. + string container_id = 1; +} + +message RemoveContainerResponse {} + +enum ContainerState { + CONTAINER_CREATED = 0; + CONTAINER_RUNNING = 1; + CONTAINER_EXITED = 2; + CONTAINER_UNKNOWN = 3; +} + +// ContainerStateValue is the wrapper of ContainerState. +message ContainerStateValue { + // State of the container. + ContainerState state = 1; +} + +// ContainerFilter is used to filter containers. +// All those fields are combined with 'AND' +message ContainerFilter { + // ID of the container. + string id = 1; + // State of the container. + ContainerStateValue state = 2; + // ID of the PodSandbox. + string pod_sandbox_id = 3; + // LabelSelector to select matches. + // Only api.MatchLabels is supported for now and the requirements + // are ANDed. MatchExpressions is not supported yet. + map label_selector = 4; +} + +message ListContainersRequest { + ContainerFilter filter = 1; +} + +// Container provides the runtime information for a container, such as ID, hash, +// state of the container. +message Container { + // ID of the container, used by the container runtime to identify + // a container. + string id = 1; + // ID of the sandbox to which this container belongs. + string pod_sandbox_id = 2; + // Metadata of the container. + ContainerMetadata metadata = 3; + // Spec of the image. + ImageSpec image = 4; + // Digested reference to the image in use. + string image_ref = 5; + // State of the container. + ContainerState state = 6; + // Creation time of the container in nanoseconds. + int64 created_at = 7; + // Key-value pairs that may be used to scope and select individual resources. + map labels = 8; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding ContainerConfig used to + // instantiate this Container. + map annotations = 9; + // Reference to the unique identifier of the image, on the node, as + // returned in the image service apis. + // + // Note: The image_ref above has been historically used by container + // runtimes to reference images by digest. The image_ref has been also used + // in the kubelet image garbage collection, which does not work with + // digests at all. To separate and avoid possible misusage, we now + // introduce the image_id field, which should always refer to a unique + // image identifier on the node. + string image_id = 10; +} + +message ListContainersResponse { + // List of containers. + repeated Container containers = 1; +} + +message ContainerStatusRequest { + // ID of the container for which to retrieve status. + string container_id = 1; + // Verbose indicates whether to return extra information about the container. + bool verbose = 2; +} + +// ContainerStatus represents the status of a container. +message ContainerStatus { + // ID of the container. + string id = 1; + // Metadata of the container. + ContainerMetadata metadata = 2; + // Status of the container. + ContainerState state = 3; + // Creation time of the container in nanoseconds. + int64 created_at = 4; + // Start time of the container in nanoseconds. Default: 0 (not specified). + int64 started_at = 5; + // Finish time of the container in nanoseconds. Default: 0 (not specified). + int64 finished_at = 6; + // Exit code of the container. Only required when finished_at != 0. Default: 0. + int32 exit_code = 7; + // Spec of the image. + ImageSpec image = 8; + // Digested reference to the image in use. + string image_ref = 9; + // Brief CamelCase string explaining why container is in its current state. + // Must be set to "OOMKilled" for containers terminated by cgroup-based Out-of-Memory killer. + string reason = 10; + // Human-readable message indicating details about why container is in its + // current state. + string message = 11; + // Key-value pairs that may be used to scope and select individual resources. + map labels = 12; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding ContainerConfig used to + // instantiate the Container this status represents. + map annotations = 13; + // Mounts for the container. + repeated Mount mounts = 14; + // Log path of container. + string log_path = 15; + // Resource limits configuration of the container. + ContainerResources resources = 16; + // Reference to the unique identifier of the image, on the node, as + // returned in the image service apis. + // + // Note: The image_ref above has been historically used by container + // runtimes to reference images by digest. To separate and avoid possible + // misusage, we now introduce the image_id field, which should always refer + // to a unique image identifier on the node. + string image_id = 17; + // User identities initially attached to the container + ContainerUser user = 18; +} + +message ContainerStatusResponse { + // Status of the container. + ContainerStatus status = 1; + // Info is extra information of the Container. The key could be arbitrary string, and + // value should be in json format. The information could include anything useful for + // debug, e.g. pid for linux container based container runtime. + // It should only be returned non-empty when Verbose is true. + map info = 2; +} + +// ContainerResources holds resource limits configuration for a container. +message ContainerResources { + // Resource limits configuration specific to Linux container. + LinuxContainerResources linux = 1; + // Resource limits configuration specific to Windows container. + WindowsContainerResources windows = 2; +} + +message ContainerUser { + // User identities initially attached to first process in the Linux container. + // Note that the actual running identity can be changed if the process has enough privilege to do so. + LinuxContainerUser linux = 1; + + // User identities initially attached to first process in the Windows container + // This is just reserved for future use. + // WindowsContainerUser windows = 2; +} + + +message UpdateContainerResourcesRequest { + // ID of the container to update. + string container_id = 1; + // Resource configuration specific to Linux containers. + LinuxContainerResources linux = 2; + // Resource configuration specific to Windows containers. + WindowsContainerResources windows = 3; + // Unstructured key-value map holding arbitrary additional information for + // container resources updating. This can be used for specifying experimental + // resources to update or other options to use when updating the container. + map annotations = 4; +} + +message UpdateContainerResourcesResponse {} + +message ExecSyncRequest { + // ID of the container. + string container_id = 1; + // Command to execute. + repeated string cmd = 2; + // Timeout in seconds to stop the command. Default: 0 (run forever). + int64 timeout = 3; +} + +message ExecSyncResponse { + // Captured command stdout output. + // The runtime should cap the output of this response to 16MB. + // If the stdout of the command produces more than 16MB, the remaining output + // should be discarded, and the command should proceed with no error. + // See CVE-2022-1708 and CVE-2022-31030 for more information. + bytes stdout = 1; + // Captured command stderr output. + // The runtime should cap the output of this response to 16MB. + // If the stderr of the command produces more than 16MB, the remaining output + // should be discarded, and the command should proceed with no error. + // See CVE-2022-1708 and CVE-2022-31030 for more information. + bytes stderr = 2; + // Exit code the command finished with. Default: 0 (success). + int32 exit_code = 3; +} + +message ExecRequest { + // ID of the container in which to execute the command. + string container_id = 1; + // Command to execute. + repeated string cmd = 2; + // Whether to exec the command in a TTY. + bool tty = 3; + // Whether to stream stdin. + // One of `stdin`, `stdout`, and `stderr` MUST be true. + bool stdin = 4; + // Whether to stream stdout. + // One of `stdin`, `stdout`, and `stderr` MUST be true. + bool stdout = 5; + // Whether to stream stderr. + // One of `stdin`, `stdout`, and `stderr` MUST be true. + // If `tty` is true, `stderr` MUST be false. Multiplexing is not supported + // in this case. The output of stdout and stderr will be combined to a + // single stream. + bool stderr = 6; +} + +message ExecResponse { + // Fully qualified URL of the exec streaming server. + string url = 1; +} + +message AttachRequest { + // ID of the container to which to attach. + string container_id = 1; + // Whether to stream stdin. + // One of `stdin`, `stdout`, and `stderr` MUST be true. + bool stdin = 2; + // Whether the process being attached is running in a TTY. + // This must match the TTY setting in the ContainerConfig. + bool tty = 3; + // Whether to stream stdout. + // One of `stdin`, `stdout`, and `stderr` MUST be true. + bool stdout = 4; + // Whether to stream stderr. + // One of `stdin`, `stdout`, and `stderr` MUST be true. + // If `tty` is true, `stderr` MUST be false. Multiplexing is not supported + // in this case. The output of stdout and stderr will be combined to a + // single stream. + bool stderr = 5; +} + +message AttachResponse { + // Fully qualified URL of the attach streaming server. + string url = 1; +} + +message PortForwardRequest { + // ID of the container to which to forward the port. + string pod_sandbox_id = 1; + // Port to forward. + repeated int32 port = 2; +} + +message PortForwardResponse { + // Fully qualified URL of the port-forward streaming server. + string url = 1; +} + +message ImageFilter { + // Spec of the image. + ImageSpec image = 1; +} + +message ListImagesRequest { + // Filter to list images. + ImageFilter filter = 1; +} + +// Basic information about a container image. +message Image { + // ID of the image. + string id = 1; + // Other names by which this image is known. + repeated string repo_tags = 2; + // Digests by which this image is known. + repeated string repo_digests = 3; + // Size of the image in bytes. Must be > 0. + uint64 size = 4; + // UID that will run the command(s). This is used as a default if no user is + // specified when creating the container. UID and the following user name + // are mutually exclusive. + Int64Value uid = 5; + // User name that will run the command(s). This is used if UID is not set + // and no user is specified when creating container. + string username = 6; + // ImageSpec for image which includes annotations + ImageSpec spec = 7; + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + bool pinned = 8; +} + +message ListImagesResponse { + // List of images. + repeated Image images = 1; +} + +message ImageStatusRequest { + // Spec of the image. + ImageSpec image = 1; + // Verbose indicates whether to return extra information about the image. + bool verbose = 2; +} + +message ImageStatusResponse { + // Status of the image. + Image image = 1; + // Info is extra information of the Image. The key could be arbitrary string, and + // value should be in json format. The information could include anything useful + // for debug, e.g. image config for oci image based container runtime. + // It should only be returned non-empty when Verbose is true. + map info = 2; +} + +// AuthConfig contains authorization information for connecting to a registry. +message AuthConfig { + string username = 1; + string password = 2; + string auth = 3; + string server_address = 4; + // IdentityToken is used to authenticate the user and get + // an access token for the registry. + string identity_token = 5; + // RegistryToken is a bearer token to be sent to a registry + string registry_token = 6; +} + +message PullImageRequest { + // Spec of the image. + ImageSpec image = 1; + // Authentication configuration for pulling the image. + AuthConfig auth = 2; + // Config of the PodSandbox, which is used to pull image in PodSandbox context. + PodSandboxConfig sandbox_config = 3; +} + +message PullImageResponse { + // Reference to the image in use. For most runtimes, this should be an + // image ID or digest. + string image_ref = 1; +} + +message RemoveImageRequest { + // Spec of the image to remove. + ImageSpec image = 1; +} + +message RemoveImageResponse {} + +message NetworkConfig { + // CIDR to use for pod IP addresses. If the CIDR is empty, runtimes + // should omit it. + string pod_cidr = 1; +} + +message RuntimeConfig { + NetworkConfig network_config = 1; +} + +message UpdateRuntimeConfigRequest { + RuntimeConfig runtime_config = 1; +} + +message UpdateRuntimeConfigResponse {} + +// RuntimeCondition contains condition information for the runtime. +// There are 2 kinds of runtime conditions: +// 1. Required conditions: Conditions are required for kubelet to work +// properly. If any required condition is unmet, the node will be not ready. +// The required conditions include: +// * RuntimeReady: RuntimeReady means the runtime is up and ready to accept +// basic containers e.g. container only needs host network. +// * NetworkReady: NetworkReady means the runtime network is up and ready to +// accept containers which require container network. +// 2. Optional conditions: Conditions are informative to the user, but kubelet +// will not rely on. Since condition type is an arbitrary string, all conditions +// not required are optional. These conditions will be exposed to users to help +// them understand the status of the system. +message RuntimeCondition { + // Type of runtime condition. + string type = 1; + // Status of the condition, one of true/false. Default: false. + bool status = 2; + // Brief CamelCase string containing reason for the condition's last transition. + string reason = 3; + // Human-readable message indicating details about last transition. + string message = 4; +} + +// RuntimeStatus is information about the current status of the runtime. +message RuntimeStatus { + // List of current observed runtime conditions. + repeated RuntimeCondition conditions = 1; +} + +message StatusRequest { + // Verbose indicates whether to return extra information about the runtime. + bool verbose = 1; +} + +message RuntimeHandlerFeatures { + // recursive_read_only_mounts is set to true if the runtime handler supports + // recursive read-only mounts. + // For runc-compatible runtimes, availability of this feature can be detected by checking whether + // the Linux kernel version is >= 5.12, and, `runc features | jq .mountOptions` contains "rro". + bool recursive_read_only_mounts = 1; + + // user_namespaces is set to true if the runtime handler supports user namespaces as implemented + // in Kubernetes. This means support for both, user namespaces and idmap mounts. + bool user_namespaces = 2; +} + +message RuntimeHandler { + // Name must be unique in StatusResponse. + // An empty string denotes the default handler. + string name = 1; + // Supported features. + RuntimeHandlerFeatures features = 2; +} + +message StatusResponse { + // Status of the Runtime. + RuntimeStatus status = 1; + // Info is extra information of the Runtime. The key could be arbitrary string, and + // value should be in json format. The information could include anything useful for + // debug, e.g. plugins used by the container runtime. + // It should only be returned non-empty when Verbose is true. + map info = 2; + // Runtime handlers. + repeated RuntimeHandler runtime_handlers = 3; +} + +message ImageFsInfoRequest {} + +// UInt64Value is the wrapper of uint64. +message UInt64Value { + // The value. + uint64 value = 1; +} + +// FilesystemIdentifier uniquely identify the filesystem. +message FilesystemIdentifier{ + // Mountpoint of a filesystem. + string mountpoint = 1; +} + +// FilesystemUsage provides the filesystem usage information. +message FilesystemUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // The unique identifier of the filesystem. + FilesystemIdentifier fs_id = 2; + // UsedBytes represents the bytes used for images on the filesystem. + // This may differ from the total bytes used on the filesystem and may not + // equal CapacityBytes - AvailableBytes. + UInt64Value used_bytes = 3; + // InodesUsed represents the inodes used by the images. + // This may not equal InodesCapacity - InodesAvailable because the underlying + // filesystem may also be used for purposes other than storing images. + UInt64Value inodes_used = 4; +} + +// WindowsFilesystemUsage provides the filesystem usage information specific to Windows. +message WindowsFilesystemUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // The unique identifier of the filesystem. + FilesystemIdentifier fs_id = 2; + // UsedBytes represents the bytes used for images on the filesystem. + // This may differ from the total bytes used on the filesystem and may not + // equal CapacityBytes - AvailableBytes. + UInt64Value used_bytes = 3; +} + +message ImageFsInfoResponse { + // Information of image filesystem(s). + repeated FilesystemUsage image_filesystems = 1; + // Information of container filesystem(s). + // This is an optional field, may be used for example if container and image + // storage are separated. + // Default will be to return this as empty. + repeated FilesystemUsage container_filesystems = 2; +} + +message ContainerStatsRequest{ + // ID of the container for which to retrieve stats. + string container_id = 1; +} + +message ContainerStatsResponse { + // Stats of the container. + ContainerStats stats = 1; +} + +message ListContainerStatsRequest{ + // Filter for the list request. + ContainerStatsFilter filter = 1; +} + +// ContainerStatsFilter is used to filter containers. +// All those fields are combined with 'AND' +message ContainerStatsFilter { + // ID of the container. + string id = 1; + // ID of the PodSandbox. + string pod_sandbox_id = 2; + // LabelSelector to select matches. + // Only api.MatchLabels is supported for now and the requirements + // are ANDed. MatchExpressions is not supported yet. + map label_selector = 3; +} + +message ListContainerStatsResponse { + // Stats of the container. + repeated ContainerStats stats = 1; +} + +// ContainerAttributes provides basic information of the container. +message ContainerAttributes { + // ID of the container. + string id = 1; + // Metadata of the container. + ContainerMetadata metadata = 2; + // Key-value pairs that may be used to scope and select individual resources. + map labels = 3; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding ContainerConfig used to + // instantiate the Container this status represents. + map annotations = 4; +} + +// ContainerStats provides the resource usage statistics for a container. +message ContainerStats { + // Information of the container. + ContainerAttributes attributes = 1; + // CPU usage gathered from the container. + CpuUsage cpu = 2; + // Memory usage gathered from the container. + MemoryUsage memory = 3; + // Usage of the writable layer. + FilesystemUsage writable_layer = 4; + // Swap usage gathered from the container. + SwapUsage swap = 5; +} + +// WindowsContainerStats provides the resource usage statistics for a container specific for Windows +message WindowsContainerStats { + // Information of the container. + ContainerAttributes attributes = 1; + // CPU usage gathered from the container. + WindowsCpuUsage cpu = 2; + // Memory usage gathered from the container. + WindowsMemoryUsage memory = 3; + // Usage of the writable layer. + WindowsFilesystemUsage writable_layer = 4; +} + +// CpuUsage provides the CPU usage information. +message CpuUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Cumulative CPU usage (sum across all cores) since object creation. + UInt64Value usage_core_nano_seconds = 2; + // Total CPU usage (sum of all cores) averaged over the sample window. + // The "core" unit can be interpreted as CPU core-nanoseconds per second. + UInt64Value usage_nano_cores = 3; +} + +// WindowsCpuUsage provides the CPU usage information specific to Windows +message WindowsCpuUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Cumulative CPU usage (sum across all cores) since object creation. + UInt64Value usage_core_nano_seconds = 2; + // Total CPU usage (sum of all cores) averaged over the sample window. + // The "core" unit can be interpreted as CPU core-nanoseconds per second. + UInt64Value usage_nano_cores = 3; +} + +// MemoryUsage provides the memory usage information. +message MemoryUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // The amount of working set memory in bytes. + UInt64Value working_set_bytes = 2; + // Available memory for use. This is defined as the memory limit - workingSetBytes. + UInt64Value available_bytes = 3; + // Total memory in use. This includes all memory regardless of when it was accessed. + UInt64Value usage_bytes = 4; + // The amount of anonymous and swap cache memory (includes transparent hugepages). + UInt64Value rss_bytes = 5; + // Cumulative number of minor page faults. + UInt64Value page_faults = 6; + // Cumulative number of major page faults. + UInt64Value major_page_faults = 7; +} + +message SwapUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // Available swap for use. This is defined as the swap limit - swapUsageBytes. + UInt64Value swap_available_bytes = 2; + // Total memory in use. This includes all memory regardless of when it was accessed. + UInt64Value swap_usage_bytes = 3; +} + +// WindowsMemoryUsage provides the memory usage information specific to Windows +message WindowsMemoryUsage { + // Timestamp in nanoseconds at which the information were collected. Must be > 0. + int64 timestamp = 1; + // The amount of working set memory in bytes. + UInt64Value working_set_bytes = 2; + // Available memory for use. This is defined as the memory limit - commit_memory_bytes. + UInt64Value available_bytes = 3; + // Cumulative number of page faults. + UInt64Value page_faults = 4; + // Total commit memory in use. Commit memory is total of physical and virtual memory in use. + UInt64Value commit_memory_bytes = 5; +} + +message ReopenContainerLogRequest { + // ID of the container for which to reopen the log. + string container_id = 1; +} + +message ReopenContainerLogResponse{ +} + +message CheckpointContainerRequest { + // ID of the container to be checkpointed. + string container_id = 1; + // Location of the checkpoint archive used for export + string location = 2; + // Timeout in seconds for the checkpoint to complete. + // Timeout of zero means to use the CRI default. + // Timeout > 0 means to use the user specified timeout. + int64 timeout = 3; +} + +message CheckpointContainerResponse {} + +message GetEventsRequest {} + +message ContainerEventResponse { + // ID of the container + string container_id = 1; + + // Type of the container event + ContainerEventType container_event_type = 2; + + // Creation timestamp of this event + int64 created_at = 3; + + // Sandbox status + PodSandboxStatus pod_sandbox_status = 4; + + // Container statuses + repeated ContainerStatus containers_statuses = 5; +} + +enum ContainerEventType { + // Container created + CONTAINER_CREATED_EVENT = 0; + + // Container started + CONTAINER_STARTED_EVENT = 1; + + // Container stopped + CONTAINER_STOPPED_EVENT = 2; + + // Container deleted + CONTAINER_DELETED_EVENT = 3; +} + +message ListMetricDescriptorsRequest {} + +message ListMetricDescriptorsResponse { + repeated MetricDescriptor descriptors = 1; +} + +message MetricDescriptor { + // The name field will be used as a unique identifier of this MetricDescriptor, + // and be used in conjunction with the Metric structure to populate the full Metric. + string name = 1; + string help = 2; + // When a metric uses this metric descriptor, it should only define + // labels that have previously been declared in label_keys. + // It is the responsibility of the runtime to correctly keep sorted the keys and values. + // If the two slices have different length, the behavior is undefined. + repeated string label_keys = 3; +} + +message ListPodSandboxMetricsRequest {} + +message ListPodSandboxMetricsResponse { + repeated PodSandboxMetrics pod_metrics = 1; +} + +message PodSandboxMetrics { + string pod_sandbox_id = 1; + repeated Metric metrics = 2; + repeated ContainerMetrics container_metrics = 3; +} + +message ContainerMetrics { + string container_id = 1; + repeated Metric metrics = 2; +} + +message Metric { + // Name must match a name previously returned in a MetricDescriptors call, + // otherwise, it will be ignored. + string name = 1; + // Timestamp should be 0 if the metric was gathered live. + // If it was cached, the Timestamp should reflect the time it was collected. + int64 timestamp = 2; + MetricType metric_type = 3; + // The corresponding LabelValues to the LabelKeys defined in the MetricDescriptor. + // It is the responsibility of the runtime to correctly keep sorted the keys and values. + // If the two slices have different length, the behavior is undefined. + repeated string label_values = 4; + UInt64Value value = 5; +} + +enum MetricType { + COUNTER = 0; + GAUGE = 1; +} + +message RuntimeConfigRequest {} + +message RuntimeConfigResponse { + // Configuration information for Linux-based runtimes. This field contains + // global runtime configuration options that are not specific to runtime + // handlers. + LinuxRuntimeConfiguration linux = 1; +} + +message LinuxRuntimeConfiguration { + // Cgroup driver to use + // Note: this field should not change for the lifecycle of the Kubelet, + // or while there are running containers. + // The Kubelet will not re-request this after startup, and will construct the cgroup + // hierarchy assuming it is static. + // If the runtime wishes to change this value, it must be accompanied by removal of + // all pods, and a restart of the Kubelet. The easiest way to do this is with a full node reboot. + CgroupDriver cgroup_driver = 1; +} + +enum CgroupDriver { + SYSTEMD = 0; + CGROUPFS = 1; +} + diff --git a/grpc_server/test/cri_pb2.py b/grpc_server/test/cri_pb2.py new file mode 100644 index 000000000..e690b03e2 --- /dev/null +++ b/grpc_server/test/cri_pb2.py @@ -0,0 +1,469 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: cri.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tcri.proto\x12\nruntime.v1\"!\n\x0eVersionRequest\x12\x0f\n\x07version\x18\x01 \x01(\t\"n\n\x0fVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x14\n\x0cruntime_name\x18\x02 \x01(\t\x12\x17\n\x0fruntime_version\x18\x03 \x01(\t\x12\x1b\n\x13runtime_api_version\x18\x04 \x01(\t\"?\n\tDNSConfig\x12\x0f\n\x07servers\x18\x01 \x03(\t\x12\x10\n\x08searches\x18\x02 \x03(\t\x12\x0f\n\x07options\x18\x03 \x03(\t\"q\n\x0bPortMapping\x12&\n\x08protocol\x18\x01 \x01(\x0e\x32\x14.runtime.v1.Protocol\x12\x16\n\x0e\x63ontainer_port\x18\x02 \x01(\x05\x12\x11\n\thost_port\x18\x03 \x01(\x05\x12\x0f\n\x07host_ip\x18\x04 \x01(\t\"\xab\x02\n\x05Mount\x12\x16\n\x0e\x63ontainer_path\x18\x01 \x01(\t\x12\x11\n\thost_path\x18\x02 \x01(\t\x12\x10\n\x08readonly\x18\x03 \x01(\x08\x12\x17\n\x0fselinux_relabel\x18\x04 \x01(\x08\x12\x31\n\x0bpropagation\x18\x05 \x01(\x0e\x32\x1c.runtime.v1.MountPropagation\x12*\n\x0buidMappings\x18\x06 \x03(\x0b\x32\x15.runtime.v1.IDMapping\x12*\n\x0bgidMappings\x18\x07 \x03(\x0b\x32\x15.runtime.v1.IDMapping\x12\x1b\n\x13recursive_read_only\x18\x08 \x01(\x08\x12$\n\x05image\x18\t \x01(\x0b\x32\x15.runtime.v1.ImageSpec\"B\n\tIDMapping\x12\x0f\n\x07host_id\x18\x01 \x01(\r\x12\x14\n\x0c\x63ontainer_id\x18\x02 \x01(\r\x12\x0e\n\x06length\x18\x03 \x01(\r\"\x82\x01\n\rUserNamespace\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x19.runtime.v1.NamespaceMode\x12#\n\x04uids\x18\x02 \x03(\x0b\x32\x15.runtime.v1.IDMapping\x12#\n\x04gids\x18\x03 \x03(\x0b\x32\x15.runtime.v1.IDMapping\"\xd3\x01\n\x0fNamespaceOption\x12*\n\x07network\x18\x01 \x01(\x0e\x32\x19.runtime.v1.NamespaceMode\x12&\n\x03pid\x18\x02 \x01(\x0e\x32\x19.runtime.v1.NamespaceMode\x12&\n\x03ipc\x18\x03 \x01(\x0e\x32\x19.runtime.v1.NamespaceMode\x12\x11\n\ttarget_id\x18\x04 \x01(\t\x12\x31\n\x0euserns_options\x18\x05 \x01(\x0b\x32\x19.runtime.v1.UserNamespace\"\x1b\n\nInt64Value\x12\r\n\x05value\x18\x01 \x01(\x03\"\xf7\x03\n\x1bLinuxSandboxSecurityContext\x12\x36\n\x11namespace_options\x18\x01 \x01(\x0b\x32\x1b.runtime.v1.NamespaceOption\x12\x32\n\x0fselinux_options\x18\x02 \x01(\x0b\x32\x19.runtime.v1.SELinuxOption\x12+\n\x0brun_as_user\x18\x03 \x01(\x0b\x32\x16.runtime.v1.Int64Value\x12,\n\x0crun_as_group\x18\x08 \x01(\x0b\x32\x16.runtime.v1.Int64Value\x12\x17\n\x0freadonly_rootfs\x18\x04 \x01(\x08\x12\x1b\n\x13supplemental_groups\x18\x05 \x03(\x03\x12H\n\x1asupplemental_groups_policy\x18\x0b \x01(\x0e\x32$.runtime.v1.SupplementalGroupsPolicy\x12\x12\n\nprivileged\x18\x06 \x01(\x08\x12,\n\x07seccomp\x18\t \x01(\x0b\x32\x1b.runtime.v1.SecurityProfile\x12-\n\x08\x61pparmor\x18\n \x01(\x0b\x32\x1b.runtime.v1.SecurityProfile\x12 \n\x14seccomp_profile_path\x18\x07 \x01(\tB\x02\x18\x01\"\xa9\x01\n\x0fSecurityProfile\x12=\n\x0cprofile_type\x18\x01 \x01(\x0e\x32\'.runtime.v1.SecurityProfile.ProfileType\x12\x15\n\rlocalhost_ref\x18\x02 \x01(\t\"@\n\x0bProfileType\x12\x12\n\x0eRuntimeDefault\x10\x00\x12\x0e\n\nUnconfined\x10\x01\x12\r\n\tLocalhost\x10\x02\"\xd1\x02\n\x15LinuxPodSandboxConfig\x12\x15\n\rcgroup_parent\x18\x01 \x01(\t\x12\x41\n\x10security_context\x18\x02 \x01(\x0b\x32\'.runtime.v1.LinuxSandboxSecurityContext\x12?\n\x07sysctls\x18\x03 \x03(\x0b\x32..runtime.v1.LinuxPodSandboxConfig.SysctlsEntry\x12\x35\n\x08overhead\x18\x04 \x01(\x0b\x32#.runtime.v1.LinuxContainerResources\x12\x36\n\tresources\x18\x05 \x01(\x0b\x32#.runtime.v1.LinuxContainerResources\x1a.\n\x0cSysctlsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"S\n\x12PodSandboxMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03uid\x18\x02 \x01(\t\x12\x11\n\tnamespace\x18\x03 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x04 \x01(\r\"\x91\x04\n\x10PodSandboxConfig\x12\x30\n\x08metadata\x18\x01 \x01(\x0b\x32\x1e.runtime.v1.PodSandboxMetadata\x12\x10\n\x08hostname\x18\x02 \x01(\t\x12\x15\n\rlog_directory\x18\x03 \x01(\t\x12)\n\ndns_config\x18\x04 \x01(\x0b\x32\x15.runtime.v1.DNSConfig\x12.\n\rport_mappings\x18\x05 \x03(\x0b\x32\x17.runtime.v1.PortMapping\x12\x38\n\x06labels\x18\x06 \x03(\x0b\x32(.runtime.v1.PodSandboxConfig.LabelsEntry\x12\x42\n\x0b\x61nnotations\x18\x07 \x03(\x0b\x32-.runtime.v1.PodSandboxConfig.AnnotationsEntry\x12\x30\n\x05linux\x18\x08 \x01(\x0b\x32!.runtime.v1.LinuxPodSandboxConfig\x12\x34\n\x07windows\x18\t \x01(\x0b\x32#.runtime.v1.WindowsPodSandboxConfig\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"]\n\x14RunPodSandboxRequest\x12,\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1c.runtime.v1.PodSandboxConfig\x12\x17\n\x0fruntime_handler\x18\x02 \x01(\t\"/\n\x15RunPodSandboxResponse\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\"/\n\x15StopPodSandboxRequest\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\"\x18\n\x16StopPodSandboxResponse\"1\n\x17RemovePodSandboxRequest\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\"\x1a\n\x18RemovePodSandboxResponse\"B\n\x17PodSandboxStatusRequest\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\x12\x0f\n\x07verbose\x18\x02 \x01(\x08\"\x13\n\x05PodIP\x12\n\n\x02ip\x18\x01 \x01(\t\"P\n\x17PodSandboxNetworkStatus\x12\n\n\x02ip\x18\x01 \x01(\t\x12)\n\x0e\x61\x64\x64itional_ips\x18\x02 \x03(\x0b\x32\x11.runtime.v1.PodIP\"9\n\tNamespace\x12,\n\x07options\x18\x02 \x01(\x0b\x32\x1b.runtime.v1.NamespaceOption\"B\n\x15LinuxPodSandboxStatus\x12)\n\nnamespaces\x18\x01 \x01(\x0b\x32\x15.runtime.v1.Namespace\"\xf2\x03\n\x10PodSandboxStatus\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x08metadata\x18\x02 \x01(\x0b\x32\x1e.runtime.v1.PodSandboxMetadata\x12*\n\x05state\x18\x03 \x01(\x0e\x32\x1b.runtime.v1.PodSandboxState\x12\x12\n\ncreated_at\x18\x04 \x01(\x03\x12\x34\n\x07network\x18\x05 \x01(\x0b\x32#.runtime.v1.PodSandboxNetworkStatus\x12\x30\n\x05linux\x18\x06 \x01(\x0b\x32!.runtime.v1.LinuxPodSandboxStatus\x12\x38\n\x06labels\x18\x07 \x03(\x0b\x32(.runtime.v1.PodSandboxStatus.LabelsEntry\x12\x42\n\x0b\x61nnotations\x18\x08 \x03(\x0b\x32-.runtime.v1.PodSandboxStatus.AnnotationsEntry\x12\x17\n\x0fruntime_handler\x18\t \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x80\x02\n\x18PodSandboxStatusResponse\x12,\n\x06status\x18\x01 \x01(\x0b\x32\x1c.runtime.v1.PodSandboxStatus\x12<\n\x04info\x18\x02 \x03(\x0b\x32..runtime.v1.PodSandboxStatusResponse.InfoEntry\x12\x38\n\x13\x63ontainers_statuses\x18\x03 \x03(\x0b\x32\x1b.runtime.v1.ContainerStatus\x12\x11\n\ttimestamp\x18\x04 \x01(\x03\x1a+\n\tInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"B\n\x14PodSandboxStateValue\x12*\n\x05state\x18\x01 \x01(\x0e\x32\x1b.runtime.v1.PodSandboxState\"\xce\x01\n\x10PodSandboxFilter\x12\n\n\x02id\x18\x01 \x01(\t\x12/\n\x05state\x18\x02 \x01(\x0b\x32 .runtime.v1.PodSandboxStateValue\x12G\n\x0elabel_selector\x18\x03 \x03(\x0b\x32/.runtime.v1.PodSandboxFilter.LabelSelectorEntry\x1a\x34\n\x12LabelSelectorEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x15ListPodSandboxRequest\x12,\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x1c.runtime.v1.PodSandboxFilter\"\xf8\x02\n\nPodSandbox\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x08metadata\x18\x02 \x01(\x0b\x32\x1e.runtime.v1.PodSandboxMetadata\x12*\n\x05state\x18\x03 \x01(\x0e\x32\x1b.runtime.v1.PodSandboxState\x12\x12\n\ncreated_at\x18\x04 \x01(\x03\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".runtime.v1.PodSandbox.LabelsEntry\x12<\n\x0b\x61nnotations\x18\x06 \x03(\x0b\x32\'.runtime.v1.PodSandbox.AnnotationsEntry\x12\x17\n\x0fruntime_handler\x18\x07 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"?\n\x16ListPodSandboxResponse\x12%\n\x05items\x18\x01 \x03(\x0b\x32\x16.runtime.v1.PodSandbox\"0\n\x16PodSandboxStatsRequest\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\"E\n\x17PodSandboxStatsResponse\x12*\n\x05stats\x18\x01 \x01(\x0b\x32\x1b.runtime.v1.PodSandboxStats\"\xa7\x01\n\x15PodSandboxStatsFilter\x12\n\n\x02id\x18\x01 \x01(\t\x12L\n\x0elabel_selector\x18\x02 \x03(\x0b\x32\x34.runtime.v1.PodSandboxStatsFilter.LabelSelectorEntry\x1a\x34\n\x12LabelSelectorEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"O\n\x1aListPodSandboxStatsRequest\x12\x31\n\x06\x66ilter\x18\x01 \x01(\x0b\x32!.runtime.v1.PodSandboxStatsFilter\"I\n\x1bListPodSandboxStatsResponse\x12*\n\x05stats\x18\x01 \x03(\x0b\x32\x1b.runtime.v1.PodSandboxStats\"\xbd\x02\n\x14PodSandboxAttributes\x12\n\n\x02id\x18\x01 \x01(\t\x12\x30\n\x08metadata\x18\x02 \x01(\x0b\x32\x1e.runtime.v1.PodSandboxMetadata\x12<\n\x06labels\x18\x03 \x03(\x0b\x32,.runtime.v1.PodSandboxAttributes.LabelsEntry\x12\x46\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32\x31.runtime.v1.PodSandboxAttributes.AnnotationsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xad\x01\n\x0fPodSandboxStats\x12\x34\n\nattributes\x18\x01 \x01(\x0b\x32 .runtime.v1.PodSandboxAttributes\x12/\n\x05linux\x18\x02 \x01(\x0b\x32 .runtime.v1.LinuxPodSandboxStats\x12\x33\n\x07windows\x18\x03 \x01(\x0b\x32\".runtime.v1.WindowsPodSandboxStats\"\xe8\x01\n\x14LinuxPodSandboxStats\x12!\n\x03\x63pu\x18\x01 \x01(\x0b\x32\x14.runtime.v1.CpuUsage\x12\'\n\x06memory\x18\x02 \x01(\x0b\x32\x17.runtime.v1.MemoryUsage\x12)\n\x07network\x18\x03 \x01(\x0b\x32\x18.runtime.v1.NetworkUsage\x12)\n\x07process\x18\x04 \x01(\x0b\x32\x18.runtime.v1.ProcessUsage\x12.\n\ncontainers\x18\x05 \x03(\x0b\x32\x1a.runtime.v1.ContainerStats\"\x8d\x02\n\x16WindowsPodSandboxStats\x12(\n\x03\x63pu\x18\x01 \x01(\x0b\x32\x1b.runtime.v1.WindowsCpuUsage\x12.\n\x06memory\x18\x02 \x01(\x0b\x32\x1e.runtime.v1.WindowsMemoryUsage\x12\x30\n\x07network\x18\x03 \x01(\x0b\x32\x1f.runtime.v1.WindowsNetworkUsage\x12\x30\n\x07process\x18\x04 \x01(\x0b\x32\x1f.runtime.v1.WindowsProcessUsage\x12\x35\n\ncontainers\x18\x05 \x03(\x0b\x32!.runtime.v1.WindowsContainerStats\"\x96\x01\n\x0cNetworkUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12<\n\x11\x64\x65\x66\x61ult_interface\x18\x02 \x01(\x0b\x32!.runtime.v1.NetworkInterfaceUsage\x12\x35\n\ninterfaces\x18\x03 \x03(\x0b\x32!.runtime.v1.NetworkInterfaceUsage\"\xab\x01\n\x13WindowsNetworkUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x43\n\x11\x64\x65\x66\x61ult_interface\x18\x02 \x01(\x0b\x32(.runtime.v1.WindowsNetworkInterfaceUsage\x12<\n\ninterfaces\x18\x03 \x03(\x0b\x32(.runtime.v1.WindowsNetworkInterfaceUsage\"\xd3\x01\n\x15NetworkInterfaceUsage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12)\n\x08rx_bytes\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12*\n\trx_errors\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12)\n\x08tx_bytes\x18\x04 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12*\n\ttx_errors\x18\x05 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\xec\x01\n\x1cWindowsNetworkInterfaceUsage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12)\n\x08rx_bytes\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x33\n\x12rx_packets_dropped\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12)\n\x08tx_bytes\x18\x04 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x33\n\x12tx_packets_dropped\x18\x05 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"Q\n\x0cProcessUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12.\n\rprocess_count\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"X\n\x13WindowsProcessUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12.\n\rprocess_count\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\xc2\x01\n\tImageSpec\x12\r\n\x05image\x18\x01 \x01(\t\x12;\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32&.runtime.v1.ImageSpec.AnnotationsEntry\x12\x1c\n\x14user_specified_image\x18\x12 \x01(\t\x12\x17\n\x0fruntime_handler\x18\x13 \x01(\t\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xff\x02\n\x17LinuxContainerResources\x12\x12\n\ncpu_period\x18\x01 \x01(\x03\x12\x11\n\tcpu_quota\x18\x02 \x01(\x03\x12\x12\n\ncpu_shares\x18\x03 \x01(\x03\x12\x1d\n\x15memory_limit_in_bytes\x18\x04 \x01(\x03\x12\x15\n\room_score_adj\x18\x05 \x01(\x03\x12\x13\n\x0b\x63puset_cpus\x18\x06 \x01(\t\x12\x13\n\x0b\x63puset_mems\x18\x07 \x01(\t\x12\x32\n\x0fhugepage_limits\x18\x08 \x03(\x0b\x32\x19.runtime.v1.HugepageLimit\x12\x41\n\x07unified\x18\t \x03(\x0b\x32\x30.runtime.v1.LinuxContainerResources.UnifiedEntry\x12\"\n\x1amemory_swap_limit_in_bytes\x18\n \x01(\x03\x1a.\n\x0cUnifiedEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"1\n\rHugepageLimit\x12\x11\n\tpage_size\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x04\"H\n\rSELinuxOption\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\r\n\x05level\x18\x04 \x01(\t\"c\n\nCapability\x12\x18\n\x10\x61\x64\x64_capabilities\x18\x01 \x03(\t\x12\x19\n\x11\x64rop_capabilities\x18\x02 \x03(\t\x12 \n\x18\x61\x64\x64_ambient_capabilities\x18\x03 \x03(\t\"\xa2\x05\n\x1dLinuxContainerSecurityContext\x12,\n\x0c\x63\x61pabilities\x18\x01 \x01(\x0b\x32\x16.runtime.v1.Capability\x12\x12\n\nprivileged\x18\x02 \x01(\x08\x12\x36\n\x11namespace_options\x18\x03 \x01(\x0b\x32\x1b.runtime.v1.NamespaceOption\x12\x32\n\x0fselinux_options\x18\x04 \x01(\x0b\x32\x19.runtime.v1.SELinuxOption\x12+\n\x0brun_as_user\x18\x05 \x01(\x0b\x32\x16.runtime.v1.Int64Value\x12,\n\x0crun_as_group\x18\x0c \x01(\x0b\x32\x16.runtime.v1.Int64Value\x12\x17\n\x0frun_as_username\x18\x06 \x01(\t\x12\x17\n\x0freadonly_rootfs\x18\x07 \x01(\x08\x12\x1b\n\x13supplemental_groups\x18\x08 \x03(\x03\x12H\n\x1asupplemental_groups_policy\x18\x11 \x01(\x0e\x32$.runtime.v1.SupplementalGroupsPolicy\x12\x14\n\x0cno_new_privs\x18\x0b \x01(\x08\x12\x14\n\x0cmasked_paths\x18\r \x03(\t\x12\x16\n\x0ereadonly_paths\x18\x0e \x03(\t\x12,\n\x07seccomp\x18\x0f \x01(\x0b\x32\x1b.runtime.v1.SecurityProfile\x12-\n\x08\x61pparmor\x18\x10 \x01(\x0b\x32\x1b.runtime.v1.SecurityProfile\x12\x1c\n\x10\x61pparmor_profile\x18\t \x01(\tB\x02\x18\x01\x12 \n\x14seccomp_profile_path\x18\n \x01(\tB\x02\x18\x01\"\x93\x01\n\x14LinuxContainerConfig\x12\x36\n\tresources\x18\x01 \x01(\x0b\x32#.runtime.v1.LinuxContainerResources\x12\x43\n\x10security_context\x18\x02 \x01(\x0b\x32).runtime.v1.LinuxContainerSecurityContext\"K\n\x12LinuxContainerUser\x12\x0b\n\x03uid\x18\x01 \x01(\x03\x12\x0b\n\x03gid\x18\x02 \x01(\x03\x12\x1b\n\x13supplemental_groups\x18\x03 \x03(\x03\"D\n\x16WindowsNamespaceOption\x12*\n\x07network\x18\x01 \x01(\x0e\x32\x19.runtime.v1.NamespaceMode\"\xa6\x01\n\x1dWindowsSandboxSecurityContext\x12\x17\n\x0frun_as_username\x18\x01 \x01(\t\x12\x17\n\x0f\x63redential_spec\x18\x02 \x01(\t\x12\x14\n\x0chost_process\x18\x03 \x01(\x08\x12=\n\x11namespace_options\x18\x04 \x01(\x0b\x32\".runtime.v1.WindowsNamespaceOption\"^\n\x17WindowsPodSandboxConfig\x12\x43\n\x10security_context\x18\x01 \x01(\x0b\x32).runtime.v1.WindowsSandboxSecurityContext\"i\n\x1fWindowsContainerSecurityContext\x12\x17\n\x0frun_as_username\x18\x01 \x01(\t\x12\x17\n\x0f\x63redential_spec\x18\x02 \x01(\t\x12\x14\n\x0chost_process\x18\x03 \x01(\x08\"\x99\x01\n\x16WindowsContainerConfig\x12\x38\n\tresources\x18\x01 \x01(\x0b\x32%.runtime.v1.WindowsContainerResources\x12\x45\n\x10security_context\x18\x02 \x01(\x0b\x32+.runtime.v1.WindowsContainerSecurityContext\"\x94\x01\n\x19WindowsContainerResources\x12\x12\n\ncpu_shares\x18\x01 \x01(\x03\x12\x11\n\tcpu_count\x18\x02 \x01(\x03\x12\x13\n\x0b\x63pu_maximum\x18\x03 \x01(\x03\x12\x1d\n\x15memory_limit_in_bytes\x18\x04 \x01(\x03\x12\x1c\n\x14rootfs_size_in_bytes\x18\x05 \x01(\x03\"2\n\x11\x43ontainerMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07\x61ttempt\x18\x02 \x01(\r\"H\n\x06\x44\x65vice\x12\x16\n\x0e\x63ontainer_path\x18\x01 \x01(\t\x12\x11\n\thost_path\x18\x02 \x01(\t\x12\x13\n\x0bpermissions\x18\x03 \x01(\t\"\x19\n\tCDIDevice\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xbb\x05\n\x0f\x43ontainerConfig\x12/\n\x08metadata\x18\x01 \x01(\x0b\x32\x1d.runtime.v1.ContainerMetadata\x12$\n\x05image\x18\x02 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\x12\x0f\n\x07\x63ommand\x18\x03 \x03(\t\x12\x0c\n\x04\x61rgs\x18\x04 \x03(\t\x12\x13\n\x0bworking_dir\x18\x05 \x01(\t\x12\"\n\x04\x65nvs\x18\x06 \x03(\x0b\x32\x14.runtime.v1.KeyValue\x12!\n\x06mounts\x18\x07 \x03(\x0b\x32\x11.runtime.v1.Mount\x12#\n\x07\x64\x65vices\x18\x08 \x03(\x0b\x32\x12.runtime.v1.Device\x12\x37\n\x06labels\x18\t \x03(\x0b\x32\'.runtime.v1.ContainerConfig.LabelsEntry\x12\x41\n\x0b\x61nnotations\x18\n \x03(\x0b\x32,.runtime.v1.ContainerConfig.AnnotationsEntry\x12\x10\n\x08log_path\x18\x0b \x01(\t\x12\r\n\x05stdin\x18\x0c \x01(\x08\x12\x12\n\nstdin_once\x18\r \x01(\x08\x12\x0b\n\x03tty\x18\x0e \x01(\x08\x12/\n\x05linux\x18\x0f \x01(\x0b\x32 .runtime.v1.LinuxContainerConfig\x12\x33\n\x07windows\x18\x10 \x01(\x0b\x32\".runtime.v1.WindowsContainerConfig\x12*\n\x0b\x43\x44I_devices\x18\x11 \x03(\x0b\x32\x15.runtime.v1.CDIDevice\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x93\x01\n\x16\x43reateContainerRequest\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\x12+\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x1b.runtime.v1.ContainerConfig\x12\x34\n\x0esandbox_config\x18\x03 \x01(\x0b\x32\x1c.runtime.v1.PodSandboxConfig\"/\n\x17\x43reateContainerResponse\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\"-\n\x15StartContainerRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\"\x18\n\x16StartContainerResponse\"=\n\x14StopContainerRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\x0f\n\x07timeout\x18\x02 \x01(\x03\"\x17\n\x15StopContainerResponse\".\n\x16RemoveContainerRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\"\x19\n\x17RemoveContainerResponse\"@\n\x13\x43ontainerStateValue\x12)\n\x05state\x18\x01 \x01(\x0e\x32\x1a.runtime.v1.ContainerState\"\xe3\x01\n\x0f\x43ontainerFilter\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\x05state\x18\x02 \x01(\x0b\x32\x1f.runtime.v1.ContainerStateValue\x12\x16\n\x0epod_sandbox_id\x18\x03 \x01(\t\x12\x46\n\x0elabel_selector\x18\x04 \x03(\x0b\x32..runtime.v1.ContainerFilter.LabelSelectorEntry\x1a\x34\n\x12LabelSelectorEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"D\n\x15ListContainersRequest\x12+\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x1b.runtime.v1.ContainerFilter\"\xbd\x03\n\tContainer\x12\n\n\x02id\x18\x01 \x01(\t\x12\x16\n\x0epod_sandbox_id\x18\x02 \x01(\t\x12/\n\x08metadata\x18\x03 \x01(\x0b\x32\x1d.runtime.v1.ContainerMetadata\x12$\n\x05image\x18\x04 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\x12\x11\n\timage_ref\x18\x05 \x01(\t\x12)\n\x05state\x18\x06 \x01(\x0e\x32\x1a.runtime.v1.ContainerState\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x12\x31\n\x06labels\x18\x08 \x03(\x0b\x32!.runtime.v1.Container.LabelsEntry\x12;\n\x0b\x61nnotations\x18\t \x03(\x0b\x32&.runtime.v1.Container.AnnotationsEntry\x12\x10\n\x08image_id\x18\n \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"C\n\x16ListContainersResponse\x12)\n\ncontainers\x18\x01 \x03(\x0b\x32\x15.runtime.v1.Container\"?\n\x16\x43ontainerStatusRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\x0f\n\x07verbose\x18\x02 \x01(\x08\"\xa5\x05\n\x0f\x43ontainerStatus\x12\n\n\x02id\x18\x01 \x01(\t\x12/\n\x08metadata\x18\x02 \x01(\x0b\x32\x1d.runtime.v1.ContainerMetadata\x12)\n\x05state\x18\x03 \x01(\x0e\x32\x1a.runtime.v1.ContainerState\x12\x12\n\ncreated_at\x18\x04 \x01(\x03\x12\x12\n\nstarted_at\x18\x05 \x01(\x03\x12\x13\n\x0b\x66inished_at\x18\x06 \x01(\x03\x12\x11\n\texit_code\x18\x07 \x01(\x05\x12$\n\x05image\x18\x08 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\x12\x11\n\timage_ref\x18\t \x01(\t\x12\x0e\n\x06reason\x18\n \x01(\t\x12\x0f\n\x07message\x18\x0b \x01(\t\x12\x37\n\x06labels\x18\x0c \x03(\x0b\x32\'.runtime.v1.ContainerStatus.LabelsEntry\x12\x41\n\x0b\x61nnotations\x18\r \x03(\x0b\x32,.runtime.v1.ContainerStatus.AnnotationsEntry\x12!\n\x06mounts\x18\x0e \x03(\x0b\x32\x11.runtime.v1.Mount\x12\x10\n\x08log_path\x18\x0f \x01(\t\x12\x31\n\tresources\x18\x10 \x01(\x0b\x32\x1e.runtime.v1.ContainerResources\x12\x10\n\x08image_id\x18\x11 \x01(\t\x12\'\n\x04user\x18\x12 \x01(\x0b\x32\x19.runtime.v1.ContainerUser\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb0\x01\n\x17\x43ontainerStatusResponse\x12+\n\x06status\x18\x01 \x01(\x0b\x32\x1b.runtime.v1.ContainerStatus\x12;\n\x04info\x18\x02 \x03(\x0b\x32-.runtime.v1.ContainerStatusResponse.InfoEntry\x1a+\n\tInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x80\x01\n\x12\x43ontainerResources\x12\x32\n\x05linux\x18\x01 \x01(\x0b\x32#.runtime.v1.LinuxContainerResources\x12\x36\n\x07windows\x18\x02 \x01(\x0b\x32%.runtime.v1.WindowsContainerResources\">\n\rContainerUser\x12-\n\x05linux\x18\x01 \x01(\x0b\x32\x1e.runtime.v1.LinuxContainerUser\"\xaa\x02\n\x1fUpdateContainerResourcesRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\x32\n\x05linux\x18\x02 \x01(\x0b\x32#.runtime.v1.LinuxContainerResources\x12\x36\n\x07windows\x18\x03 \x01(\x0b\x32%.runtime.v1.WindowsContainerResources\x12Q\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32<.runtime.v1.UpdateContainerResourcesRequest.AnnotationsEntry\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\"\n UpdateContainerResourcesResponse\"E\n\x0f\x45xecSyncRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\x0b\n\x03\x63md\x18\x02 \x03(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\x03\"E\n\x10\x45xecSyncResponse\x12\x0e\n\x06stdout\x18\x01 \x01(\x0c\x12\x0e\n\x06stderr\x18\x02 \x01(\x0c\x12\x11\n\texit_code\x18\x03 \x01(\x05\"l\n\x0b\x45xecRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\x0b\n\x03\x63md\x18\x02 \x03(\t\x12\x0b\n\x03tty\x18\x03 \x01(\x08\x12\r\n\x05stdin\x18\x04 \x01(\x08\x12\x0e\n\x06stdout\x18\x05 \x01(\x08\x12\x0e\n\x06stderr\x18\x06 \x01(\x08\"\x1b\n\x0c\x45xecResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"a\n\rAttachRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\r\n\x05stdin\x18\x02 \x01(\x08\x12\x0b\n\x03tty\x18\x03 \x01(\x08\x12\x0e\n\x06stdout\x18\x04 \x01(\x08\x12\x0e\n\x06stderr\x18\x05 \x01(\x08\"\x1d\n\x0e\x41ttachResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\":\n\x12PortForwardRequest\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x03(\x05\"\"\n\x13PortForwardResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"3\n\x0bImageFilter\x12$\n\x05image\x18\x01 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\"<\n\x11ListImagesRequest\x12\'\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x17.runtime.v1.ImageFilter\"\xb6\x01\n\x05Image\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\trepo_tags\x18\x02 \x03(\t\x12\x14\n\x0crepo_digests\x18\x03 \x03(\t\x12\x0c\n\x04size\x18\x04 \x01(\x04\x12#\n\x03uid\x18\x05 \x01(\x0b\x32\x16.runtime.v1.Int64Value\x12\x10\n\x08username\x18\x06 \x01(\t\x12#\n\x04spec\x18\x07 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\x12\x0e\n\x06pinned\x18\x08 \x01(\x08\"7\n\x12ListImagesResponse\x12!\n\x06images\x18\x01 \x03(\x0b\x32\x11.runtime.v1.Image\"K\n\x12ImageStatusRequest\x12$\n\x05image\x18\x01 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\x12\x0f\n\x07verbose\x18\x02 \x01(\x08\"\x9d\x01\n\x13ImageStatusResponse\x12 \n\x05image\x18\x01 \x01(\x0b\x32\x11.runtime.v1.Image\x12\x37\n\x04info\x18\x02 \x03(\x0b\x32).runtime.v1.ImageStatusResponse.InfoEntry\x1a+\n\tInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x86\x01\n\nAuthConfig\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12\x0c\n\x04\x61uth\x18\x03 \x01(\t\x12\x16\n\x0eserver_address\x18\x04 \x01(\t\x12\x16\n\x0eidentity_token\x18\x05 \x01(\t\x12\x16\n\x0eregistry_token\x18\x06 \x01(\t\"\x94\x01\n\x10PullImageRequest\x12$\n\x05image\x18\x01 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\x12$\n\x04\x61uth\x18\x02 \x01(\x0b\x32\x16.runtime.v1.AuthConfig\x12\x34\n\x0esandbox_config\x18\x03 \x01(\x0b\x32\x1c.runtime.v1.PodSandboxConfig\"&\n\x11PullImageResponse\x12\x11\n\timage_ref\x18\x01 \x01(\t\":\n\x12RemoveImageRequest\x12$\n\x05image\x18\x01 \x01(\x0b\x32\x15.runtime.v1.ImageSpec\"\x15\n\x13RemoveImageResponse\"!\n\rNetworkConfig\x12\x10\n\x08pod_cidr\x18\x01 \x01(\t\"B\n\rRuntimeConfig\x12\x31\n\x0enetwork_config\x18\x01 \x01(\x0b\x32\x19.runtime.v1.NetworkConfig\"O\n\x1aUpdateRuntimeConfigRequest\x12\x31\n\x0eruntime_config\x18\x01 \x01(\x0b\x32\x19.runtime.v1.RuntimeConfig\"\x1d\n\x1bUpdateRuntimeConfigResponse\"Q\n\x10RuntimeCondition\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\x08\x12\x0e\n\x06reason\x18\x03 \x01(\t\x12\x0f\n\x07message\x18\x04 \x01(\t\"A\n\rRuntimeStatus\x12\x30\n\nconditions\x18\x01 \x03(\x0b\x32\x1c.runtime.v1.RuntimeCondition\" \n\rStatusRequest\x12\x0f\n\x07verbose\x18\x01 \x01(\x08\"U\n\x16RuntimeHandlerFeatures\x12\"\n\x1arecursive_read_only_mounts\x18\x01 \x01(\x08\x12\x17\n\x0fuser_namespaces\x18\x02 \x01(\x08\"T\n\x0eRuntimeHandler\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32\".runtime.v1.RuntimeHandlerFeatures\"\xd2\x01\n\x0eStatusResponse\x12)\n\x06status\x18\x01 \x01(\x0b\x32\x19.runtime.v1.RuntimeStatus\x12\x32\n\x04info\x18\x02 \x03(\x0b\x32$.runtime.v1.StatusResponse.InfoEntry\x12\x34\n\x10runtime_handlers\x18\x03 \x03(\x0b\x32\x1a.runtime.v1.RuntimeHandler\x1a+\n\tInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x14\n\x12ImageFsInfoRequest\"\x1c\n\x0bUInt64Value\x12\r\n\x05value\x18\x01 \x01(\x04\"*\n\x14\x46ilesystemIdentifier\x12\x12\n\nmountpoint\x18\x01 \x01(\t\"\xb0\x01\n\x0f\x46ilesystemUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12/\n\x05\x66s_id\x18\x02 \x01(\x0b\x32 .runtime.v1.FilesystemIdentifier\x12+\n\nused_bytes\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12,\n\x0binodes_used\x18\x04 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\x89\x01\n\x16WindowsFilesystemUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12/\n\x05\x66s_id\x18\x02 \x01(\x0b\x32 .runtime.v1.FilesystemIdentifier\x12+\n\nused_bytes\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\x89\x01\n\x13ImageFsInfoResponse\x12\x36\n\x11image_filesystems\x18\x01 \x03(\x0b\x32\x1b.runtime.v1.FilesystemUsage\x12:\n\x15\x63ontainer_filesystems\x18\x02 \x03(\x0b\x32\x1b.runtime.v1.FilesystemUsage\"-\n\x15\x43ontainerStatsRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\"C\n\x16\x43ontainerStatsResponse\x12)\n\x05stats\x18\x01 \x01(\x0b\x32\x1a.runtime.v1.ContainerStats\"M\n\x19ListContainerStatsRequest\x12\x30\n\x06\x66ilter\x18\x01 \x01(\x0b\x32 .runtime.v1.ContainerStatsFilter\"\xbd\x01\n\x14\x43ontainerStatsFilter\x12\n\n\x02id\x18\x01 \x01(\t\x12\x16\n\x0epod_sandbox_id\x18\x02 \x01(\t\x12K\n\x0elabel_selector\x18\x03 \x03(\x0b\x32\x33.runtime.v1.ContainerStatsFilter.LabelSelectorEntry\x1a\x34\n\x12LabelSelectorEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"G\n\x1aListContainerStatsResponse\x12)\n\x05stats\x18\x01 \x03(\x0b\x32\x1a.runtime.v1.ContainerStats\"\xb9\x02\n\x13\x43ontainerAttributes\x12\n\n\x02id\x18\x01 \x01(\t\x12/\n\x08metadata\x18\x02 \x01(\x0b\x32\x1d.runtime.v1.ContainerMetadata\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.runtime.v1.ContainerAttributes.LabelsEntry\x12\x45\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32\x30.runtime.v1.ContainerAttributes.AnnotationsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xeb\x01\n\x0e\x43ontainerStats\x12\x33\n\nattributes\x18\x01 \x01(\x0b\x32\x1f.runtime.v1.ContainerAttributes\x12!\n\x03\x63pu\x18\x02 \x01(\x0b\x32\x14.runtime.v1.CpuUsage\x12\'\n\x06memory\x18\x03 \x01(\x0b\x32\x17.runtime.v1.MemoryUsage\x12\x33\n\x0ewritable_layer\x18\x04 \x01(\x0b\x32\x1b.runtime.v1.FilesystemUsage\x12#\n\x04swap\x18\x05 \x01(\x0b\x32\x15.runtime.v1.SwapUsage\"\xe2\x01\n\x15WindowsContainerStats\x12\x33\n\nattributes\x18\x01 \x01(\x0b\x32\x1f.runtime.v1.ContainerAttributes\x12(\n\x03\x63pu\x18\x02 \x01(\x0b\x32\x1b.runtime.v1.WindowsCpuUsage\x12.\n\x06memory\x18\x03 \x01(\x0b\x32\x1e.runtime.v1.WindowsMemoryUsage\x12:\n\x0ewritable_layer\x18\x04 \x01(\x0b\x32\".runtime.v1.WindowsFilesystemUsage\"\x8a\x01\n\x08\x43puUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x38\n\x17usage_core_nano_seconds\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x31\n\x10usage_nano_cores\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\x91\x01\n\x0fWindowsCpuUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x38\n\x17usage_core_nano_seconds\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x31\n\x10usage_nano_cores\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\xc2\x02\n\x0bMemoryUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x32\n\x11working_set_bytes\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x30\n\x0f\x61vailable_bytes\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12,\n\x0busage_bytes\x18\x04 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12*\n\trss_bytes\x18\x05 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12,\n\x0bpage_faults\x18\x06 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x32\n\x11major_page_faults\x18\x07 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\x88\x01\n\tSwapUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x35\n\x14swap_available_bytes\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x31\n\x10swap_usage_bytes\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\xf1\x01\n\x12WindowsMemoryUsage\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12\x32\n\x11working_set_bytes\x18\x02 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x30\n\x0f\x61vailable_bytes\x18\x03 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12,\n\x0bpage_faults\x18\x04 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\x12\x34\n\x13\x63ommit_memory_bytes\x18\x05 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"1\n\x19ReopenContainerLogRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\"\x1c\n\x1aReopenContainerLogResponse\"U\n\x1a\x43heckpointContainerRequest\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\x03\"\x1d\n\x1b\x43heckpointContainerResponse\"\x12\n\x10GetEventsRequest\"\xf4\x01\n\x16\x43ontainerEventResponse\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12<\n\x14\x63ontainer_event_type\x18\x02 \x01(\x0e\x32\x1e.runtime.v1.ContainerEventType\x12\x12\n\ncreated_at\x18\x03 \x01(\x03\x12\x38\n\x12pod_sandbox_status\x18\x04 \x01(\x0b\x32\x1c.runtime.v1.PodSandboxStatus\x12\x38\n\x13\x63ontainers_statuses\x18\x05 \x03(\x0b\x32\x1b.runtime.v1.ContainerStatus\"\x1e\n\x1cListMetricDescriptorsRequest\"R\n\x1dListMetricDescriptorsResponse\x12\x31\n\x0b\x64\x65scriptors\x18\x01 \x03(\x0b\x32\x1c.runtime.v1.MetricDescriptor\"B\n\x10MetricDescriptor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04help\x18\x02 \x01(\t\x12\x12\n\nlabel_keys\x18\x03 \x03(\t\"\x1e\n\x1cListPodSandboxMetricsRequest\"S\n\x1dListPodSandboxMetricsResponse\x12\x32\n\x0bpod_metrics\x18\x01 \x03(\x0b\x32\x1d.runtime.v1.PodSandboxMetrics\"\x89\x01\n\x11PodSandboxMetrics\x12\x16\n\x0epod_sandbox_id\x18\x01 \x01(\t\x12#\n\x07metrics\x18\x02 \x03(\x0b\x32\x12.runtime.v1.Metric\x12\x37\n\x11\x63ontainer_metrics\x18\x03 \x03(\x0b\x32\x1c.runtime.v1.ContainerMetrics\"M\n\x10\x43ontainerMetrics\x12\x14\n\x0c\x63ontainer_id\x18\x01 \x01(\t\x12#\n\x07metrics\x18\x02 \x03(\x0b\x32\x12.runtime.v1.Metric\"\x94\x01\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x03\x12+\n\x0bmetric_type\x18\x03 \x01(\x0e\x32\x16.runtime.v1.MetricType\x12\x14\n\x0clabel_values\x18\x04 \x03(\t\x12&\n\x05value\x18\x05 \x01(\x0b\x32\x17.runtime.v1.UInt64Value\"\x16\n\x14RuntimeConfigRequest\"M\n\x15RuntimeConfigResponse\x12\x34\n\x05linux\x18\x01 \x01(\x0b\x32%.runtime.v1.LinuxRuntimeConfiguration\"L\n\x19LinuxRuntimeConfiguration\x12/\n\rcgroup_driver\x18\x01 \x01(\x0e\x32\x18.runtime.v1.CgroupDriver*&\n\x08Protocol\x12\x07\n\x03TCP\x10\x00\x12\x07\n\x03UDP\x10\x01\x12\x08\n\x04SCTP\x10\x02*m\n\x10MountPropagation\x12\x17\n\x13PROPAGATION_PRIVATE\x10\x00\x12!\n\x1dPROPAGATION_HOST_TO_CONTAINER\x10\x01\x12\x1d\n\x19PROPAGATION_BIDIRECTIONAL\x10\x02*=\n\rNamespaceMode\x12\x07\n\x03POD\x10\x00\x12\r\n\tCONTAINER\x10\x01\x12\x08\n\x04NODE\x10\x02\x12\n\n\x06TARGET\x10\x03*1\n\x18SupplementalGroupsPolicy\x12\t\n\x05Merge\x10\x00\x12\n\n\x06Strict\x10\x01*:\n\x0fPodSandboxState\x12\x11\n\rSANDBOX_READY\x10\x00\x12\x14\n\x10SANDBOX_NOTREADY\x10\x01*k\n\x0e\x43ontainerState\x12\x15\n\x11\x43ONTAINER_CREATED\x10\x00\x12\x15\n\x11\x43ONTAINER_RUNNING\x10\x01\x12\x14\n\x10\x43ONTAINER_EXITED\x10\x02\x12\x15\n\x11\x43ONTAINER_UNKNOWN\x10\x03*\x88\x01\n\x12\x43ontainerEventType\x12\x1b\n\x17\x43ONTAINER_CREATED_EVENT\x10\x00\x12\x1b\n\x17\x43ONTAINER_STARTED_EVENT\x10\x01\x12\x1b\n\x17\x43ONTAINER_STOPPED_EVENT\x10\x02\x12\x1b\n\x17\x43ONTAINER_DELETED_EVENT\x10\x03*$\n\nMetricType\x12\x0b\n\x07\x43OUNTER\x10\x00\x12\t\n\x05GAUGE\x10\x01*)\n\x0c\x43groupDriver\x12\x0b\n\x07SYSTEMD\x10\x00\x12\x0c\n\x08\x43GROUPFS\x10\x01\x32\xfe\x14\n\x0eRuntimeService\x12\x44\n\x07Version\x12\x1a.runtime.v1.VersionRequest\x1a\x1b.runtime.v1.VersionResponse\"\x00\x12V\n\rRunPodSandbox\x12 .runtime.v1.RunPodSandboxRequest\x1a!.runtime.v1.RunPodSandboxResponse\"\x00\x12Y\n\x0eStopPodSandbox\x12!.runtime.v1.StopPodSandboxRequest\x1a\".runtime.v1.StopPodSandboxResponse\"\x00\x12_\n\x10RemovePodSandbox\x12#.runtime.v1.RemovePodSandboxRequest\x1a$.runtime.v1.RemovePodSandboxResponse\"\x00\x12_\n\x10PodSandboxStatus\x12#.runtime.v1.PodSandboxStatusRequest\x1a$.runtime.v1.PodSandboxStatusResponse\"\x00\x12Y\n\x0eListPodSandbox\x12!.runtime.v1.ListPodSandboxRequest\x1a\".runtime.v1.ListPodSandboxResponse\"\x00\x12\\\n\x0f\x43reateContainer\x12\".runtime.v1.CreateContainerRequest\x1a#.runtime.v1.CreateContainerResponse\"\x00\x12Y\n\x0eStartContainer\x12!.runtime.v1.StartContainerRequest\x1a\".runtime.v1.StartContainerResponse\"\x00\x12V\n\rStopContainer\x12 .runtime.v1.StopContainerRequest\x1a!.runtime.v1.StopContainerResponse\"\x00\x12\\\n\x0fRemoveContainer\x12\".runtime.v1.RemoveContainerRequest\x1a#.runtime.v1.RemoveContainerResponse\"\x00\x12Y\n\x0eListContainers\x12!.runtime.v1.ListContainersRequest\x1a\".runtime.v1.ListContainersResponse\"\x00\x12\\\n\x0f\x43ontainerStatus\x12\".runtime.v1.ContainerStatusRequest\x1a#.runtime.v1.ContainerStatusResponse\"\x00\x12w\n\x18UpdateContainerResources\x12+.runtime.v1.UpdateContainerResourcesRequest\x1a,.runtime.v1.UpdateContainerResourcesResponse\"\x00\x12\x65\n\x12ReopenContainerLog\x12%.runtime.v1.ReopenContainerLogRequest\x1a&.runtime.v1.ReopenContainerLogResponse\"\x00\x12G\n\x08\x45xecSync\x12\x1b.runtime.v1.ExecSyncRequest\x1a\x1c.runtime.v1.ExecSyncResponse\"\x00\x12;\n\x04\x45xec\x12\x17.runtime.v1.ExecRequest\x1a\x18.runtime.v1.ExecResponse\"\x00\x12\x41\n\x06\x41ttach\x12\x19.runtime.v1.AttachRequest\x1a\x1a.runtime.v1.AttachResponse\"\x00\x12P\n\x0bPortForward\x12\x1e.runtime.v1.PortForwardRequest\x1a\x1f.runtime.v1.PortForwardResponse\"\x00\x12Y\n\x0e\x43ontainerStats\x12!.runtime.v1.ContainerStatsRequest\x1a\".runtime.v1.ContainerStatsResponse\"\x00\x12\x65\n\x12ListContainerStats\x12%.runtime.v1.ListContainerStatsRequest\x1a&.runtime.v1.ListContainerStatsResponse\"\x00\x12\\\n\x0fPodSandboxStats\x12\".runtime.v1.PodSandboxStatsRequest\x1a#.runtime.v1.PodSandboxStatsResponse\"\x00\x12h\n\x13ListPodSandboxStats\x12&.runtime.v1.ListPodSandboxStatsRequest\x1a\'.runtime.v1.ListPodSandboxStatsResponse\"\x00\x12h\n\x13UpdateRuntimeConfig\x12&.runtime.v1.UpdateRuntimeConfigRequest\x1a\'.runtime.v1.UpdateRuntimeConfigResponse\"\x00\x12\x41\n\x06Status\x12\x19.runtime.v1.StatusRequest\x1a\x1a.runtime.v1.StatusResponse\"\x00\x12h\n\x13\x43heckpointContainer\x12&.runtime.v1.CheckpointContainerRequest\x1a\'.runtime.v1.CheckpointContainerResponse\"\x00\x12Z\n\x12GetContainerEvents\x12\x1c.runtime.v1.GetEventsRequest\x1a\".runtime.v1.ContainerEventResponse\"\x00\x30\x01\x12n\n\x15ListMetricDescriptors\x12(.runtime.v1.ListMetricDescriptorsRequest\x1a).runtime.v1.ListMetricDescriptorsResponse\"\x00\x12n\n\x15ListPodSandboxMetrics\x12(.runtime.v1.ListPodSandboxMetricsRequest\x1a).runtime.v1.ListPodSandboxMetricsResponse\"\x00\x12V\n\rRuntimeConfig\x12 .runtime.v1.RuntimeConfigRequest\x1a!.runtime.v1.RuntimeConfigResponse\"\x00\x32\x9f\x03\n\x0cImageService\x12M\n\nListImages\x12\x1d.runtime.v1.ListImagesRequest\x1a\x1e.runtime.v1.ListImagesResponse\"\x00\x12P\n\x0bImageStatus\x12\x1e.runtime.v1.ImageStatusRequest\x1a\x1f.runtime.v1.ImageStatusResponse\"\x00\x12J\n\tPullImage\x12\x1c.runtime.v1.PullImageRequest\x1a\x1d.runtime.v1.PullImageResponse\"\x00\x12P\n\x0bRemoveImage\x12\x1e.runtime.v1.RemoveImageRequest\x1a\x1f.runtime.v1.RemoveImageResponse\"\x00\x12P\n\x0bImageFsInfo\x12\x1e.runtime.v1.ImageFsInfoRequest\x1a\x1f.runtime.v1.ImageFsInfoResponse\"\x00\x42$Z\"k8s.io/cri-api/pkg/apis/runtime/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cri_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'Z\"k8s.io/cri-api/pkg/apis/runtime/v1' + _globals['_LINUXSANDBOXSECURITYCONTEXT'].fields_by_name['seccomp_profile_path']._loaded_options = None + _globals['_LINUXSANDBOXSECURITYCONTEXT'].fields_by_name['seccomp_profile_path']._serialized_options = b'\030\001' + _globals['_LINUXPODSANDBOXCONFIG_SYSCTLSENTRY']._loaded_options = None + _globals['_LINUXPODSANDBOXCONFIG_SYSCTLSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXCONFIG_LABELSENTRY']._loaded_options = None + _globals['_PODSANDBOXCONFIG_LABELSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXCONFIG_ANNOTATIONSENTRY']._loaded_options = None + _globals['_PODSANDBOXCONFIG_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXSTATUS_LABELSENTRY']._loaded_options = None + _globals['_PODSANDBOXSTATUS_LABELSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXSTATUS_ANNOTATIONSENTRY']._loaded_options = None + _globals['_PODSANDBOXSTATUS_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXSTATUSRESPONSE_INFOENTRY']._loaded_options = None + _globals['_PODSANDBOXSTATUSRESPONSE_INFOENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXFILTER_LABELSELECTORENTRY']._loaded_options = None + _globals['_PODSANDBOXFILTER_LABELSELECTORENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOX_LABELSENTRY']._loaded_options = None + _globals['_PODSANDBOX_LABELSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOX_ANNOTATIONSENTRY']._loaded_options = None + _globals['_PODSANDBOX_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXSTATSFILTER_LABELSELECTORENTRY']._loaded_options = None + _globals['_PODSANDBOXSTATSFILTER_LABELSELECTORENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXATTRIBUTES_LABELSENTRY']._loaded_options = None + _globals['_PODSANDBOXATTRIBUTES_LABELSENTRY']._serialized_options = b'8\001' + _globals['_PODSANDBOXATTRIBUTES_ANNOTATIONSENTRY']._loaded_options = None + _globals['_PODSANDBOXATTRIBUTES_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_IMAGESPEC_ANNOTATIONSENTRY']._loaded_options = None + _globals['_IMAGESPEC_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_LINUXCONTAINERRESOURCES_UNIFIEDENTRY']._loaded_options = None + _globals['_LINUXCONTAINERRESOURCES_UNIFIEDENTRY']._serialized_options = b'8\001' + _globals['_LINUXCONTAINERSECURITYCONTEXT'].fields_by_name['apparmor_profile']._loaded_options = None + _globals['_LINUXCONTAINERSECURITYCONTEXT'].fields_by_name['apparmor_profile']._serialized_options = b'\030\001' + _globals['_LINUXCONTAINERSECURITYCONTEXT'].fields_by_name['seccomp_profile_path']._loaded_options = None + _globals['_LINUXCONTAINERSECURITYCONTEXT'].fields_by_name['seccomp_profile_path']._serialized_options = b'\030\001' + _globals['_CONTAINERCONFIG_LABELSENTRY']._loaded_options = None + _globals['_CONTAINERCONFIG_LABELSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERCONFIG_ANNOTATIONSENTRY']._loaded_options = None + _globals['_CONTAINERCONFIG_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERFILTER_LABELSELECTORENTRY']._loaded_options = None + _globals['_CONTAINERFILTER_LABELSELECTORENTRY']._serialized_options = b'8\001' + _globals['_CONTAINER_LABELSENTRY']._loaded_options = None + _globals['_CONTAINER_LABELSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINER_ANNOTATIONSENTRY']._loaded_options = None + _globals['_CONTAINER_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERSTATUS_LABELSENTRY']._loaded_options = None + _globals['_CONTAINERSTATUS_LABELSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERSTATUS_ANNOTATIONSENTRY']._loaded_options = None + _globals['_CONTAINERSTATUS_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERSTATUSRESPONSE_INFOENTRY']._loaded_options = None + _globals['_CONTAINERSTATUSRESPONSE_INFOENTRY']._serialized_options = b'8\001' + _globals['_UPDATECONTAINERRESOURCESREQUEST_ANNOTATIONSENTRY']._loaded_options = None + _globals['_UPDATECONTAINERRESOURCESREQUEST_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_IMAGESTATUSRESPONSE_INFOENTRY']._loaded_options = None + _globals['_IMAGESTATUSRESPONSE_INFOENTRY']._serialized_options = b'8\001' + _globals['_STATUSRESPONSE_INFOENTRY']._loaded_options = None + _globals['_STATUSRESPONSE_INFOENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERSTATSFILTER_LABELSELECTORENTRY']._loaded_options = None + _globals['_CONTAINERSTATSFILTER_LABELSELECTORENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERATTRIBUTES_LABELSENTRY']._loaded_options = None + _globals['_CONTAINERATTRIBUTES_LABELSENTRY']._serialized_options = b'8\001' + _globals['_CONTAINERATTRIBUTES_ANNOTATIONSENTRY']._loaded_options = None + _globals['_CONTAINERATTRIBUTES_ANNOTATIONSENTRY']._serialized_options = b'8\001' + _globals['_PROTOCOL']._serialized_start=19825 + _globals['_PROTOCOL']._serialized_end=19863 + _globals['_MOUNTPROPAGATION']._serialized_start=19865 + _globals['_MOUNTPROPAGATION']._serialized_end=19974 + _globals['_NAMESPACEMODE']._serialized_start=19976 + _globals['_NAMESPACEMODE']._serialized_end=20037 + _globals['_SUPPLEMENTALGROUPSPOLICY']._serialized_start=20039 + _globals['_SUPPLEMENTALGROUPSPOLICY']._serialized_end=20088 + _globals['_PODSANDBOXSTATE']._serialized_start=20090 + _globals['_PODSANDBOXSTATE']._serialized_end=20148 + _globals['_CONTAINERSTATE']._serialized_start=20150 + _globals['_CONTAINERSTATE']._serialized_end=20257 + _globals['_CONTAINEREVENTTYPE']._serialized_start=20260 + _globals['_CONTAINEREVENTTYPE']._serialized_end=20396 + _globals['_METRICTYPE']._serialized_start=20398 + _globals['_METRICTYPE']._serialized_end=20434 + _globals['_CGROUPDRIVER']._serialized_start=20436 + _globals['_CGROUPDRIVER']._serialized_end=20477 + _globals['_VERSIONREQUEST']._serialized_start=25 + _globals['_VERSIONREQUEST']._serialized_end=58 + _globals['_VERSIONRESPONSE']._serialized_start=60 + _globals['_VERSIONRESPONSE']._serialized_end=170 + _globals['_DNSCONFIG']._serialized_start=172 + _globals['_DNSCONFIG']._serialized_end=235 + _globals['_PORTMAPPING']._serialized_start=237 + _globals['_PORTMAPPING']._serialized_end=350 + _globals['_MOUNT']._serialized_start=353 + _globals['_MOUNT']._serialized_end=652 + _globals['_IDMAPPING']._serialized_start=654 + _globals['_IDMAPPING']._serialized_end=720 + _globals['_USERNAMESPACE']._serialized_start=723 + _globals['_USERNAMESPACE']._serialized_end=853 + _globals['_NAMESPACEOPTION']._serialized_start=856 + _globals['_NAMESPACEOPTION']._serialized_end=1067 + _globals['_INT64VALUE']._serialized_start=1069 + _globals['_INT64VALUE']._serialized_end=1096 + _globals['_LINUXSANDBOXSECURITYCONTEXT']._serialized_start=1099 + _globals['_LINUXSANDBOXSECURITYCONTEXT']._serialized_end=1602 + _globals['_SECURITYPROFILE']._serialized_start=1605 + _globals['_SECURITYPROFILE']._serialized_end=1774 + _globals['_SECURITYPROFILE_PROFILETYPE']._serialized_start=1710 + _globals['_SECURITYPROFILE_PROFILETYPE']._serialized_end=1774 + _globals['_LINUXPODSANDBOXCONFIG']._serialized_start=1777 + _globals['_LINUXPODSANDBOXCONFIG']._serialized_end=2114 + _globals['_LINUXPODSANDBOXCONFIG_SYSCTLSENTRY']._serialized_start=2068 + _globals['_LINUXPODSANDBOXCONFIG_SYSCTLSENTRY']._serialized_end=2114 + _globals['_PODSANDBOXMETADATA']._serialized_start=2116 + _globals['_PODSANDBOXMETADATA']._serialized_end=2199 + _globals['_PODSANDBOXCONFIG']._serialized_start=2202 + _globals['_PODSANDBOXCONFIG']._serialized_end=2731 + _globals['_PODSANDBOXCONFIG_LABELSENTRY']._serialized_start=2634 + _globals['_PODSANDBOXCONFIG_LABELSENTRY']._serialized_end=2679 + _globals['_PODSANDBOXCONFIG_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_PODSANDBOXCONFIG_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_RUNPODSANDBOXREQUEST']._serialized_start=2733 + _globals['_RUNPODSANDBOXREQUEST']._serialized_end=2826 + _globals['_RUNPODSANDBOXRESPONSE']._serialized_start=2828 + _globals['_RUNPODSANDBOXRESPONSE']._serialized_end=2875 + _globals['_STOPPODSANDBOXREQUEST']._serialized_start=2877 + _globals['_STOPPODSANDBOXREQUEST']._serialized_end=2924 + _globals['_STOPPODSANDBOXRESPONSE']._serialized_start=2926 + _globals['_STOPPODSANDBOXRESPONSE']._serialized_end=2950 + _globals['_REMOVEPODSANDBOXREQUEST']._serialized_start=2952 + _globals['_REMOVEPODSANDBOXREQUEST']._serialized_end=3001 + _globals['_REMOVEPODSANDBOXRESPONSE']._serialized_start=3003 + _globals['_REMOVEPODSANDBOXRESPONSE']._serialized_end=3029 + _globals['_PODSANDBOXSTATUSREQUEST']._serialized_start=3031 + _globals['_PODSANDBOXSTATUSREQUEST']._serialized_end=3097 + _globals['_PODIP']._serialized_start=3099 + _globals['_PODIP']._serialized_end=3118 + _globals['_PODSANDBOXNETWORKSTATUS']._serialized_start=3120 + _globals['_PODSANDBOXNETWORKSTATUS']._serialized_end=3200 + _globals['_NAMESPACE']._serialized_start=3202 + _globals['_NAMESPACE']._serialized_end=3259 + _globals['_LINUXPODSANDBOXSTATUS']._serialized_start=3261 + _globals['_LINUXPODSANDBOXSTATUS']._serialized_end=3327 + _globals['_PODSANDBOXSTATUS']._serialized_start=3330 + _globals['_PODSANDBOXSTATUS']._serialized_end=3828 + _globals['_PODSANDBOXSTATUS_LABELSENTRY']._serialized_start=2634 + _globals['_PODSANDBOXSTATUS_LABELSENTRY']._serialized_end=2679 + _globals['_PODSANDBOXSTATUS_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_PODSANDBOXSTATUS_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_PODSANDBOXSTATUSRESPONSE']._serialized_start=3831 + _globals['_PODSANDBOXSTATUSRESPONSE']._serialized_end=4087 + _globals['_PODSANDBOXSTATUSRESPONSE_INFOENTRY']._serialized_start=4044 + _globals['_PODSANDBOXSTATUSRESPONSE_INFOENTRY']._serialized_end=4087 + _globals['_PODSANDBOXSTATEVALUE']._serialized_start=4089 + _globals['_PODSANDBOXSTATEVALUE']._serialized_end=4155 + _globals['_PODSANDBOXFILTER']._serialized_start=4158 + _globals['_PODSANDBOXFILTER']._serialized_end=4364 + _globals['_PODSANDBOXFILTER_LABELSELECTORENTRY']._serialized_start=4312 + _globals['_PODSANDBOXFILTER_LABELSELECTORENTRY']._serialized_end=4364 + _globals['_LISTPODSANDBOXREQUEST']._serialized_start=4366 + _globals['_LISTPODSANDBOXREQUEST']._serialized_end=4435 + _globals['_PODSANDBOX']._serialized_start=4438 + _globals['_PODSANDBOX']._serialized_end=4814 + _globals['_PODSANDBOX_LABELSENTRY']._serialized_start=2634 + _globals['_PODSANDBOX_LABELSENTRY']._serialized_end=2679 + _globals['_PODSANDBOX_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_PODSANDBOX_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_LISTPODSANDBOXRESPONSE']._serialized_start=4816 + _globals['_LISTPODSANDBOXRESPONSE']._serialized_end=4879 + _globals['_PODSANDBOXSTATSREQUEST']._serialized_start=4881 + _globals['_PODSANDBOXSTATSREQUEST']._serialized_end=4929 + _globals['_PODSANDBOXSTATSRESPONSE']._serialized_start=4931 + _globals['_PODSANDBOXSTATSRESPONSE']._serialized_end=5000 + _globals['_PODSANDBOXSTATSFILTER']._serialized_start=5003 + _globals['_PODSANDBOXSTATSFILTER']._serialized_end=5170 + _globals['_PODSANDBOXSTATSFILTER_LABELSELECTORENTRY']._serialized_start=4312 + _globals['_PODSANDBOXSTATSFILTER_LABELSELECTORENTRY']._serialized_end=4364 + _globals['_LISTPODSANDBOXSTATSREQUEST']._serialized_start=5172 + _globals['_LISTPODSANDBOXSTATSREQUEST']._serialized_end=5251 + _globals['_LISTPODSANDBOXSTATSRESPONSE']._serialized_start=5253 + _globals['_LISTPODSANDBOXSTATSRESPONSE']._serialized_end=5326 + _globals['_PODSANDBOXATTRIBUTES']._serialized_start=5329 + _globals['_PODSANDBOXATTRIBUTES']._serialized_end=5646 + _globals['_PODSANDBOXATTRIBUTES_LABELSENTRY']._serialized_start=2634 + _globals['_PODSANDBOXATTRIBUTES_LABELSENTRY']._serialized_end=2679 + _globals['_PODSANDBOXATTRIBUTES_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_PODSANDBOXATTRIBUTES_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_PODSANDBOXSTATS']._serialized_start=5649 + _globals['_PODSANDBOXSTATS']._serialized_end=5822 + _globals['_LINUXPODSANDBOXSTATS']._serialized_start=5825 + _globals['_LINUXPODSANDBOXSTATS']._serialized_end=6057 + _globals['_WINDOWSPODSANDBOXSTATS']._serialized_start=6060 + _globals['_WINDOWSPODSANDBOXSTATS']._serialized_end=6329 + _globals['_NETWORKUSAGE']._serialized_start=6332 + _globals['_NETWORKUSAGE']._serialized_end=6482 + _globals['_WINDOWSNETWORKUSAGE']._serialized_start=6485 + _globals['_WINDOWSNETWORKUSAGE']._serialized_end=6656 + _globals['_NETWORKINTERFACEUSAGE']._serialized_start=6659 + _globals['_NETWORKINTERFACEUSAGE']._serialized_end=6870 + _globals['_WINDOWSNETWORKINTERFACEUSAGE']._serialized_start=6873 + _globals['_WINDOWSNETWORKINTERFACEUSAGE']._serialized_end=7109 + _globals['_PROCESSUSAGE']._serialized_start=7111 + _globals['_PROCESSUSAGE']._serialized_end=7192 + _globals['_WINDOWSPROCESSUSAGE']._serialized_start=7194 + _globals['_WINDOWSPROCESSUSAGE']._serialized_end=7282 + _globals['_IMAGESPEC']._serialized_start=7285 + _globals['_IMAGESPEC']._serialized_end=7479 + _globals['_IMAGESPEC_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_IMAGESPEC_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_KEYVALUE']._serialized_start=7481 + _globals['_KEYVALUE']._serialized_end=7519 + _globals['_LINUXCONTAINERRESOURCES']._serialized_start=7522 + _globals['_LINUXCONTAINERRESOURCES']._serialized_end=7905 + _globals['_LINUXCONTAINERRESOURCES_UNIFIEDENTRY']._serialized_start=7859 + _globals['_LINUXCONTAINERRESOURCES_UNIFIEDENTRY']._serialized_end=7905 + _globals['_HUGEPAGELIMIT']._serialized_start=7907 + _globals['_HUGEPAGELIMIT']._serialized_end=7956 + _globals['_SELINUXOPTION']._serialized_start=7958 + _globals['_SELINUXOPTION']._serialized_end=8030 + _globals['_CAPABILITY']._serialized_start=8032 + _globals['_CAPABILITY']._serialized_end=8131 + _globals['_LINUXCONTAINERSECURITYCONTEXT']._serialized_start=8134 + _globals['_LINUXCONTAINERSECURITYCONTEXT']._serialized_end=8808 + _globals['_LINUXCONTAINERCONFIG']._serialized_start=8811 + _globals['_LINUXCONTAINERCONFIG']._serialized_end=8958 + _globals['_LINUXCONTAINERUSER']._serialized_start=8960 + _globals['_LINUXCONTAINERUSER']._serialized_end=9035 + _globals['_WINDOWSNAMESPACEOPTION']._serialized_start=9037 + _globals['_WINDOWSNAMESPACEOPTION']._serialized_end=9105 + _globals['_WINDOWSSANDBOXSECURITYCONTEXT']._serialized_start=9108 + _globals['_WINDOWSSANDBOXSECURITYCONTEXT']._serialized_end=9274 + _globals['_WINDOWSPODSANDBOXCONFIG']._serialized_start=9276 + _globals['_WINDOWSPODSANDBOXCONFIG']._serialized_end=9370 + _globals['_WINDOWSCONTAINERSECURITYCONTEXT']._serialized_start=9372 + _globals['_WINDOWSCONTAINERSECURITYCONTEXT']._serialized_end=9477 + _globals['_WINDOWSCONTAINERCONFIG']._serialized_start=9480 + _globals['_WINDOWSCONTAINERCONFIG']._serialized_end=9633 + _globals['_WINDOWSCONTAINERRESOURCES']._serialized_start=9636 + _globals['_WINDOWSCONTAINERRESOURCES']._serialized_end=9784 + _globals['_CONTAINERMETADATA']._serialized_start=9786 + _globals['_CONTAINERMETADATA']._serialized_end=9836 + _globals['_DEVICE']._serialized_start=9838 + _globals['_DEVICE']._serialized_end=9910 + _globals['_CDIDEVICE']._serialized_start=9912 + _globals['_CDIDEVICE']._serialized_end=9937 + _globals['_CONTAINERCONFIG']._serialized_start=9940 + _globals['_CONTAINERCONFIG']._serialized_end=10639 + _globals['_CONTAINERCONFIG_LABELSENTRY']._serialized_start=2634 + _globals['_CONTAINERCONFIG_LABELSENTRY']._serialized_end=2679 + _globals['_CONTAINERCONFIG_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_CONTAINERCONFIG_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_CREATECONTAINERREQUEST']._serialized_start=10642 + _globals['_CREATECONTAINERREQUEST']._serialized_end=10789 + _globals['_CREATECONTAINERRESPONSE']._serialized_start=10791 + _globals['_CREATECONTAINERRESPONSE']._serialized_end=10838 + _globals['_STARTCONTAINERREQUEST']._serialized_start=10840 + _globals['_STARTCONTAINERREQUEST']._serialized_end=10885 + _globals['_STARTCONTAINERRESPONSE']._serialized_start=10887 + _globals['_STARTCONTAINERRESPONSE']._serialized_end=10911 + _globals['_STOPCONTAINERREQUEST']._serialized_start=10913 + _globals['_STOPCONTAINERREQUEST']._serialized_end=10974 + _globals['_STOPCONTAINERRESPONSE']._serialized_start=10976 + _globals['_STOPCONTAINERRESPONSE']._serialized_end=10999 + _globals['_REMOVECONTAINERREQUEST']._serialized_start=11001 + _globals['_REMOVECONTAINERREQUEST']._serialized_end=11047 + _globals['_REMOVECONTAINERRESPONSE']._serialized_start=11049 + _globals['_REMOVECONTAINERRESPONSE']._serialized_end=11074 + _globals['_CONTAINERSTATEVALUE']._serialized_start=11076 + _globals['_CONTAINERSTATEVALUE']._serialized_end=11140 + _globals['_CONTAINERFILTER']._serialized_start=11143 + _globals['_CONTAINERFILTER']._serialized_end=11370 + _globals['_CONTAINERFILTER_LABELSELECTORENTRY']._serialized_start=4312 + _globals['_CONTAINERFILTER_LABELSELECTORENTRY']._serialized_end=4364 + _globals['_LISTCONTAINERSREQUEST']._serialized_start=11372 + _globals['_LISTCONTAINERSREQUEST']._serialized_end=11440 + _globals['_CONTAINER']._serialized_start=11443 + _globals['_CONTAINER']._serialized_end=11888 + _globals['_CONTAINER_LABELSENTRY']._serialized_start=2634 + _globals['_CONTAINER_LABELSENTRY']._serialized_end=2679 + _globals['_CONTAINER_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_CONTAINER_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_LISTCONTAINERSRESPONSE']._serialized_start=11890 + _globals['_LISTCONTAINERSRESPONSE']._serialized_end=11957 + _globals['_CONTAINERSTATUSREQUEST']._serialized_start=11959 + _globals['_CONTAINERSTATUSREQUEST']._serialized_end=12022 + _globals['_CONTAINERSTATUS']._serialized_start=12025 + _globals['_CONTAINERSTATUS']._serialized_end=12702 + _globals['_CONTAINERSTATUS_LABELSENTRY']._serialized_start=2634 + _globals['_CONTAINERSTATUS_LABELSENTRY']._serialized_end=2679 + _globals['_CONTAINERSTATUS_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_CONTAINERSTATUS_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_CONTAINERSTATUSRESPONSE']._serialized_start=12705 + _globals['_CONTAINERSTATUSRESPONSE']._serialized_end=12881 + _globals['_CONTAINERSTATUSRESPONSE_INFOENTRY']._serialized_start=4044 + _globals['_CONTAINERSTATUSRESPONSE_INFOENTRY']._serialized_end=4087 + _globals['_CONTAINERRESOURCES']._serialized_start=12884 + _globals['_CONTAINERRESOURCES']._serialized_end=13012 + _globals['_CONTAINERUSER']._serialized_start=13014 + _globals['_CONTAINERUSER']._serialized_end=13076 + _globals['_UPDATECONTAINERRESOURCESREQUEST']._serialized_start=13079 + _globals['_UPDATECONTAINERRESOURCESREQUEST']._serialized_end=13377 + _globals['_UPDATECONTAINERRESOURCESREQUEST_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_UPDATECONTAINERRESOURCESREQUEST_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_UPDATECONTAINERRESOURCESRESPONSE']._serialized_start=13379 + _globals['_UPDATECONTAINERRESOURCESRESPONSE']._serialized_end=13413 + _globals['_EXECSYNCREQUEST']._serialized_start=13415 + _globals['_EXECSYNCREQUEST']._serialized_end=13484 + _globals['_EXECSYNCRESPONSE']._serialized_start=13486 + _globals['_EXECSYNCRESPONSE']._serialized_end=13555 + _globals['_EXECREQUEST']._serialized_start=13557 + _globals['_EXECREQUEST']._serialized_end=13665 + _globals['_EXECRESPONSE']._serialized_start=13667 + _globals['_EXECRESPONSE']._serialized_end=13694 + _globals['_ATTACHREQUEST']._serialized_start=13696 + _globals['_ATTACHREQUEST']._serialized_end=13793 + _globals['_ATTACHRESPONSE']._serialized_start=13795 + _globals['_ATTACHRESPONSE']._serialized_end=13824 + _globals['_PORTFORWARDREQUEST']._serialized_start=13826 + _globals['_PORTFORWARDREQUEST']._serialized_end=13884 + _globals['_PORTFORWARDRESPONSE']._serialized_start=13886 + _globals['_PORTFORWARDRESPONSE']._serialized_end=13920 + _globals['_IMAGEFILTER']._serialized_start=13922 + _globals['_IMAGEFILTER']._serialized_end=13973 + _globals['_LISTIMAGESREQUEST']._serialized_start=13975 + _globals['_LISTIMAGESREQUEST']._serialized_end=14035 + _globals['_IMAGE']._serialized_start=14038 + _globals['_IMAGE']._serialized_end=14220 + _globals['_LISTIMAGESRESPONSE']._serialized_start=14222 + _globals['_LISTIMAGESRESPONSE']._serialized_end=14277 + _globals['_IMAGESTATUSREQUEST']._serialized_start=14279 + _globals['_IMAGESTATUSREQUEST']._serialized_end=14354 + _globals['_IMAGESTATUSRESPONSE']._serialized_start=14357 + _globals['_IMAGESTATUSRESPONSE']._serialized_end=14514 + _globals['_IMAGESTATUSRESPONSE_INFOENTRY']._serialized_start=4044 + _globals['_IMAGESTATUSRESPONSE_INFOENTRY']._serialized_end=4087 + _globals['_AUTHCONFIG']._serialized_start=14517 + _globals['_AUTHCONFIG']._serialized_end=14651 + _globals['_PULLIMAGEREQUEST']._serialized_start=14654 + _globals['_PULLIMAGEREQUEST']._serialized_end=14802 + _globals['_PULLIMAGERESPONSE']._serialized_start=14804 + _globals['_PULLIMAGERESPONSE']._serialized_end=14842 + _globals['_REMOVEIMAGEREQUEST']._serialized_start=14844 + _globals['_REMOVEIMAGEREQUEST']._serialized_end=14902 + _globals['_REMOVEIMAGERESPONSE']._serialized_start=14904 + _globals['_REMOVEIMAGERESPONSE']._serialized_end=14925 + _globals['_NETWORKCONFIG']._serialized_start=14927 + _globals['_NETWORKCONFIG']._serialized_end=14960 + _globals['_RUNTIMECONFIG']._serialized_start=14962 + _globals['_RUNTIMECONFIG']._serialized_end=15028 + _globals['_UPDATERUNTIMECONFIGREQUEST']._serialized_start=15030 + _globals['_UPDATERUNTIMECONFIGREQUEST']._serialized_end=15109 + _globals['_UPDATERUNTIMECONFIGRESPONSE']._serialized_start=15111 + _globals['_UPDATERUNTIMECONFIGRESPONSE']._serialized_end=15140 + _globals['_RUNTIMECONDITION']._serialized_start=15142 + _globals['_RUNTIMECONDITION']._serialized_end=15223 + _globals['_RUNTIMESTATUS']._serialized_start=15225 + _globals['_RUNTIMESTATUS']._serialized_end=15290 + _globals['_STATUSREQUEST']._serialized_start=15292 + _globals['_STATUSREQUEST']._serialized_end=15324 + _globals['_RUNTIMEHANDLERFEATURES']._serialized_start=15326 + _globals['_RUNTIMEHANDLERFEATURES']._serialized_end=15411 + _globals['_RUNTIMEHANDLER']._serialized_start=15413 + _globals['_RUNTIMEHANDLER']._serialized_end=15497 + _globals['_STATUSRESPONSE']._serialized_start=15500 + _globals['_STATUSRESPONSE']._serialized_end=15710 + _globals['_STATUSRESPONSE_INFOENTRY']._serialized_start=4044 + _globals['_STATUSRESPONSE_INFOENTRY']._serialized_end=4087 + _globals['_IMAGEFSINFOREQUEST']._serialized_start=15712 + _globals['_IMAGEFSINFOREQUEST']._serialized_end=15732 + _globals['_UINT64VALUE']._serialized_start=15734 + _globals['_UINT64VALUE']._serialized_end=15762 + _globals['_FILESYSTEMIDENTIFIER']._serialized_start=15764 + _globals['_FILESYSTEMIDENTIFIER']._serialized_end=15806 + _globals['_FILESYSTEMUSAGE']._serialized_start=15809 + _globals['_FILESYSTEMUSAGE']._serialized_end=15985 + _globals['_WINDOWSFILESYSTEMUSAGE']._serialized_start=15988 + _globals['_WINDOWSFILESYSTEMUSAGE']._serialized_end=16125 + _globals['_IMAGEFSINFORESPONSE']._serialized_start=16128 + _globals['_IMAGEFSINFORESPONSE']._serialized_end=16265 + _globals['_CONTAINERSTATSREQUEST']._serialized_start=16267 + _globals['_CONTAINERSTATSREQUEST']._serialized_end=16312 + _globals['_CONTAINERSTATSRESPONSE']._serialized_start=16314 + _globals['_CONTAINERSTATSRESPONSE']._serialized_end=16381 + _globals['_LISTCONTAINERSTATSREQUEST']._serialized_start=16383 + _globals['_LISTCONTAINERSTATSREQUEST']._serialized_end=16460 + _globals['_CONTAINERSTATSFILTER']._serialized_start=16463 + _globals['_CONTAINERSTATSFILTER']._serialized_end=16652 + _globals['_CONTAINERSTATSFILTER_LABELSELECTORENTRY']._serialized_start=4312 + _globals['_CONTAINERSTATSFILTER_LABELSELECTORENTRY']._serialized_end=4364 + _globals['_LISTCONTAINERSTATSRESPONSE']._serialized_start=16654 + _globals['_LISTCONTAINERSTATSRESPONSE']._serialized_end=16725 + _globals['_CONTAINERATTRIBUTES']._serialized_start=16728 + _globals['_CONTAINERATTRIBUTES']._serialized_end=17041 + _globals['_CONTAINERATTRIBUTES_LABELSENTRY']._serialized_start=2634 + _globals['_CONTAINERATTRIBUTES_LABELSENTRY']._serialized_end=2679 + _globals['_CONTAINERATTRIBUTES_ANNOTATIONSENTRY']._serialized_start=2681 + _globals['_CONTAINERATTRIBUTES_ANNOTATIONSENTRY']._serialized_end=2731 + _globals['_CONTAINERSTATS']._serialized_start=17044 + _globals['_CONTAINERSTATS']._serialized_end=17279 + _globals['_WINDOWSCONTAINERSTATS']._serialized_start=17282 + _globals['_WINDOWSCONTAINERSTATS']._serialized_end=17508 + _globals['_CPUUSAGE']._serialized_start=17511 + _globals['_CPUUSAGE']._serialized_end=17649 + _globals['_WINDOWSCPUUSAGE']._serialized_start=17652 + _globals['_WINDOWSCPUUSAGE']._serialized_end=17797 + _globals['_MEMORYUSAGE']._serialized_start=17800 + _globals['_MEMORYUSAGE']._serialized_end=18122 + _globals['_SWAPUSAGE']._serialized_start=18125 + _globals['_SWAPUSAGE']._serialized_end=18261 + _globals['_WINDOWSMEMORYUSAGE']._serialized_start=18264 + _globals['_WINDOWSMEMORYUSAGE']._serialized_end=18505 + _globals['_REOPENCONTAINERLOGREQUEST']._serialized_start=18507 + _globals['_REOPENCONTAINERLOGREQUEST']._serialized_end=18556 + _globals['_REOPENCONTAINERLOGRESPONSE']._serialized_start=18558 + _globals['_REOPENCONTAINERLOGRESPONSE']._serialized_end=18586 + _globals['_CHECKPOINTCONTAINERREQUEST']._serialized_start=18588 + _globals['_CHECKPOINTCONTAINERREQUEST']._serialized_end=18673 + _globals['_CHECKPOINTCONTAINERRESPONSE']._serialized_start=18675 + _globals['_CHECKPOINTCONTAINERRESPONSE']._serialized_end=18704 + _globals['_GETEVENTSREQUEST']._serialized_start=18706 + _globals['_GETEVENTSREQUEST']._serialized_end=18724 + _globals['_CONTAINEREVENTRESPONSE']._serialized_start=18727 + _globals['_CONTAINEREVENTRESPONSE']._serialized_end=18971 + _globals['_LISTMETRICDESCRIPTORSREQUEST']._serialized_start=18973 + _globals['_LISTMETRICDESCRIPTORSREQUEST']._serialized_end=19003 + _globals['_LISTMETRICDESCRIPTORSRESPONSE']._serialized_start=19005 + _globals['_LISTMETRICDESCRIPTORSRESPONSE']._serialized_end=19087 + _globals['_METRICDESCRIPTOR']._serialized_start=19089 + _globals['_METRICDESCRIPTOR']._serialized_end=19155 + _globals['_LISTPODSANDBOXMETRICSREQUEST']._serialized_start=19157 + _globals['_LISTPODSANDBOXMETRICSREQUEST']._serialized_end=19187 + _globals['_LISTPODSANDBOXMETRICSRESPONSE']._serialized_start=19189 + _globals['_LISTPODSANDBOXMETRICSRESPONSE']._serialized_end=19272 + _globals['_PODSANDBOXMETRICS']._serialized_start=19275 + _globals['_PODSANDBOXMETRICS']._serialized_end=19412 + _globals['_CONTAINERMETRICS']._serialized_start=19414 + _globals['_CONTAINERMETRICS']._serialized_end=19491 + _globals['_METRIC']._serialized_start=19494 + _globals['_METRIC']._serialized_end=19642 + _globals['_RUNTIMECONFIGREQUEST']._serialized_start=19644 + _globals['_RUNTIMECONFIGREQUEST']._serialized_end=19666 + _globals['_RUNTIMECONFIGRESPONSE']._serialized_start=19668 + _globals['_RUNTIMECONFIGRESPONSE']._serialized_end=19745 + _globals['_LINUXRUNTIMECONFIGURATION']._serialized_start=19747 + _globals['_LINUXRUNTIMECONFIGURATION']._serialized_end=19823 + _globals['_RUNTIMESERVICE']._serialized_start=20480 + _globals['_RUNTIMESERVICE']._serialized_end=23166 + _globals['_IMAGESERVICE']._serialized_start=23169 + _globals['_IMAGESERVICE']._serialized_end=23584 +# @@protoc_insertion_point(module_scope) diff --git a/grpc_server/test/cri_pb2_grpc.py b/grpc_server/test/cri_pb2_grpc.py new file mode 100644 index 000000000..1af94965a --- /dev/null +++ b/grpc_server/test/cri_pb2_grpc.py @@ -0,0 +1,1632 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +import cri_pb2 as cri__pb2 + +GRPC_GENERATED_VERSION = '1.64.1' +GRPC_VERSION = grpc.__version__ +EXPECTED_ERROR_RELEASE = '1.65.0' +SCHEDULED_RELEASE_DATE = 'June 25, 2024' +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + warnings.warn( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in cri_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},' + + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.', + RuntimeWarning + ) + + +class RuntimeServiceStub(object): + """Runtime service defines the public APIs for remote container runtimes + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Version = channel.unary_unary( + '/runtime.v1.RuntimeService/Version', + request_serializer=cri__pb2.VersionRequest.SerializeToString, + response_deserializer=cri__pb2.VersionResponse.FromString, + _registered_method=True) + self.RunPodSandbox = channel.unary_unary( + '/runtime.v1.RuntimeService/RunPodSandbox', + request_serializer=cri__pb2.RunPodSandboxRequest.SerializeToString, + response_deserializer=cri__pb2.RunPodSandboxResponse.FromString, + _registered_method=True) + self.StopPodSandbox = channel.unary_unary( + '/runtime.v1.RuntimeService/StopPodSandbox', + request_serializer=cri__pb2.StopPodSandboxRequest.SerializeToString, + response_deserializer=cri__pb2.StopPodSandboxResponse.FromString, + _registered_method=True) + self.RemovePodSandbox = channel.unary_unary( + '/runtime.v1.RuntimeService/RemovePodSandbox', + request_serializer=cri__pb2.RemovePodSandboxRequest.SerializeToString, + response_deserializer=cri__pb2.RemovePodSandboxResponse.FromString, + _registered_method=True) + self.PodSandboxStatus = channel.unary_unary( + '/runtime.v1.RuntimeService/PodSandboxStatus', + request_serializer=cri__pb2.PodSandboxStatusRequest.SerializeToString, + response_deserializer=cri__pb2.PodSandboxStatusResponse.FromString, + _registered_method=True) + self.ListPodSandbox = channel.unary_unary( + '/runtime.v1.RuntimeService/ListPodSandbox', + request_serializer=cri__pb2.ListPodSandboxRequest.SerializeToString, + response_deserializer=cri__pb2.ListPodSandboxResponse.FromString, + _registered_method=True) + self.CreateContainer = channel.unary_unary( + '/runtime.v1.RuntimeService/CreateContainer', + request_serializer=cri__pb2.CreateContainerRequest.SerializeToString, + response_deserializer=cri__pb2.CreateContainerResponse.FromString, + _registered_method=True) + self.StartContainer = channel.unary_unary( + '/runtime.v1.RuntimeService/StartContainer', + request_serializer=cri__pb2.StartContainerRequest.SerializeToString, + response_deserializer=cri__pb2.StartContainerResponse.FromString, + _registered_method=True) + self.StopContainer = channel.unary_unary( + '/runtime.v1.RuntimeService/StopContainer', + request_serializer=cri__pb2.StopContainerRequest.SerializeToString, + response_deserializer=cri__pb2.StopContainerResponse.FromString, + _registered_method=True) + self.RemoveContainer = channel.unary_unary( + '/runtime.v1.RuntimeService/RemoveContainer', + request_serializer=cri__pb2.RemoveContainerRequest.SerializeToString, + response_deserializer=cri__pb2.RemoveContainerResponse.FromString, + _registered_method=True) + self.ListContainers = channel.unary_unary( + '/runtime.v1.RuntimeService/ListContainers', + request_serializer=cri__pb2.ListContainersRequest.SerializeToString, + response_deserializer=cri__pb2.ListContainersResponse.FromString, + _registered_method=True) + self.ContainerStatus = channel.unary_unary( + '/runtime.v1.RuntimeService/ContainerStatus', + request_serializer=cri__pb2.ContainerStatusRequest.SerializeToString, + response_deserializer=cri__pb2.ContainerStatusResponse.FromString, + _registered_method=True) + self.UpdateContainerResources = channel.unary_unary( + '/runtime.v1.RuntimeService/UpdateContainerResources', + request_serializer=cri__pb2.UpdateContainerResourcesRequest.SerializeToString, + response_deserializer=cri__pb2.UpdateContainerResourcesResponse.FromString, + _registered_method=True) + self.ReopenContainerLog = channel.unary_unary( + '/runtime.v1.RuntimeService/ReopenContainerLog', + request_serializer=cri__pb2.ReopenContainerLogRequest.SerializeToString, + response_deserializer=cri__pb2.ReopenContainerLogResponse.FromString, + _registered_method=True) + self.ExecSync = channel.unary_unary( + '/runtime.v1.RuntimeService/ExecSync', + request_serializer=cri__pb2.ExecSyncRequest.SerializeToString, + response_deserializer=cri__pb2.ExecSyncResponse.FromString, + _registered_method=True) + self.Exec = channel.unary_unary( + '/runtime.v1.RuntimeService/Exec', + request_serializer=cri__pb2.ExecRequest.SerializeToString, + response_deserializer=cri__pb2.ExecResponse.FromString, + _registered_method=True) + self.Attach = channel.unary_unary( + '/runtime.v1.RuntimeService/Attach', + request_serializer=cri__pb2.AttachRequest.SerializeToString, + response_deserializer=cri__pb2.AttachResponse.FromString, + _registered_method=True) + self.PortForward = channel.unary_unary( + '/runtime.v1.RuntimeService/PortForward', + request_serializer=cri__pb2.PortForwardRequest.SerializeToString, + response_deserializer=cri__pb2.PortForwardResponse.FromString, + _registered_method=True) + self.ContainerStats = channel.unary_unary( + '/runtime.v1.RuntimeService/ContainerStats', + request_serializer=cri__pb2.ContainerStatsRequest.SerializeToString, + response_deserializer=cri__pb2.ContainerStatsResponse.FromString, + _registered_method=True) + self.ListContainerStats = channel.unary_unary( + '/runtime.v1.RuntimeService/ListContainerStats', + request_serializer=cri__pb2.ListContainerStatsRequest.SerializeToString, + response_deserializer=cri__pb2.ListContainerStatsResponse.FromString, + _registered_method=True) + self.PodSandboxStats = channel.unary_unary( + '/runtime.v1.RuntimeService/PodSandboxStats', + request_serializer=cri__pb2.PodSandboxStatsRequest.SerializeToString, + response_deserializer=cri__pb2.PodSandboxStatsResponse.FromString, + _registered_method=True) + self.ListPodSandboxStats = channel.unary_unary( + '/runtime.v1.RuntimeService/ListPodSandboxStats', + request_serializer=cri__pb2.ListPodSandboxStatsRequest.SerializeToString, + response_deserializer=cri__pb2.ListPodSandboxStatsResponse.FromString, + _registered_method=True) + self.UpdateRuntimeConfig = channel.unary_unary( + '/runtime.v1.RuntimeService/UpdateRuntimeConfig', + request_serializer=cri__pb2.UpdateRuntimeConfigRequest.SerializeToString, + response_deserializer=cri__pb2.UpdateRuntimeConfigResponse.FromString, + _registered_method=True) + self.Status = channel.unary_unary( + '/runtime.v1.RuntimeService/Status', + request_serializer=cri__pb2.StatusRequest.SerializeToString, + response_deserializer=cri__pb2.StatusResponse.FromString, + _registered_method=True) + self.CheckpointContainer = channel.unary_unary( + '/runtime.v1.RuntimeService/CheckpointContainer', + request_serializer=cri__pb2.CheckpointContainerRequest.SerializeToString, + response_deserializer=cri__pb2.CheckpointContainerResponse.FromString, + _registered_method=True) + self.GetContainerEvents = channel.unary_stream( + '/runtime.v1.RuntimeService/GetContainerEvents', + request_serializer=cri__pb2.GetEventsRequest.SerializeToString, + response_deserializer=cri__pb2.ContainerEventResponse.FromString, + _registered_method=True) + self.ListMetricDescriptors = channel.unary_unary( + '/runtime.v1.RuntimeService/ListMetricDescriptors', + request_serializer=cri__pb2.ListMetricDescriptorsRequest.SerializeToString, + response_deserializer=cri__pb2.ListMetricDescriptorsResponse.FromString, + _registered_method=True) + self.ListPodSandboxMetrics = channel.unary_unary( + '/runtime.v1.RuntimeService/ListPodSandboxMetrics', + request_serializer=cri__pb2.ListPodSandboxMetricsRequest.SerializeToString, + response_deserializer=cri__pb2.ListPodSandboxMetricsResponse.FromString, + _registered_method=True) + self.RuntimeConfig = channel.unary_unary( + '/runtime.v1.RuntimeService/RuntimeConfig', + request_serializer=cri__pb2.RuntimeConfigRequest.SerializeToString, + response_deserializer=cri__pb2.RuntimeConfigResponse.FromString, + _registered_method=True) + + +class RuntimeServiceServicer(object): + """Runtime service defines the public APIs for remote container runtimes + """ + + def Version(self, request, context): + """Version returns the runtime name, runtime version, and runtime API version. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RunPodSandbox(self, request, context): + """RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure + the sandbox is in the ready state on success. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StopPodSandbox(self, request, context): + """StopPodSandbox stops any running process that is part of the sandbox and + reclaims network resources (e.g., IP addresses) allocated to the sandbox. + If there are any running containers in the sandbox, they must be forcibly + terminated. + This call is idempotent, and must not return an error if all relevant + resources have already been reclaimed. kubelet will call StopPodSandbox + at least once before calling RemovePodSandbox. It will also attempt to + reclaim resources eagerly, as soon as a sandbox is not needed. Hence, + multiple StopPodSandbox calls are expected. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemovePodSandbox(self, request, context): + """RemovePodSandbox removes the sandbox. If there are any running containers + in the sandbox, they must be forcibly terminated and removed. + This call is idempotent, and must not return an error if the sandbox has + already been removed. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PodSandboxStatus(self, request, context): + """PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not + present, returns an error. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListPodSandbox(self, request, context): + """ListPodSandbox returns a list of PodSandboxes. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateContainer(self, request, context): + """CreateContainer creates a new container in specified PodSandbox + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StartContainer(self, request, context): + """StartContainer starts the container. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StopContainer(self, request, context): + """StopContainer stops a running container with a grace period (i.e., timeout). + This call is idempotent, and must not return an error if the container has + already been stopped. + The runtime must forcibly kill the container after the grace period is + reached. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveContainer(self, request, context): + """RemoveContainer removes the container. If the container is running, the + container must be forcibly removed. + This call is idempotent, and must not return an error if the container has + already been removed. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListContainers(self, request, context): + """ListContainers lists all containers by filters. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ContainerStatus(self, request, context): + """ContainerStatus returns status of the container. If the container is not + present, returns an error. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateContainerResources(self, request, context): + """UpdateContainerResources updates ContainerConfig of the container synchronously. + If runtime fails to transactionally update the requested resources, an error is returned. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ReopenContainerLog(self, request, context): + """ReopenContainerLog asks runtime to reopen the stdout/stderr log file + for the container. This is often called after the log file has been + rotated. If the container is not running, container runtime can choose + to either create a new log file and return nil, or return an error. + Once it returns error, new container log file MUST NOT be created. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ExecSync(self, request, context): + """ExecSync runs a command in a container synchronously. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Exec(self, request, context): + """Exec prepares a streaming endpoint to execute a command in the container. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Attach(self, request, context): + """Attach prepares a streaming endpoint to attach to a running container. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PortForward(self, request, context): + """PortForward prepares a streaming endpoint to forward ports from a PodSandbox. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ContainerStats(self, request, context): + """ContainerStats returns stats of the container. If the container does not + exist, the call returns an error. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListContainerStats(self, request, context): + """ListContainerStats returns stats of all running containers. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PodSandboxStats(self, request, context): + """PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not + exist, the call returns an error. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListPodSandboxStats(self, request, context): + """ListPodSandboxStats returns stats of the pod sandboxes matching a filter. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateRuntimeConfig(self, request, context): + """UpdateRuntimeConfig updates the runtime configuration based on the given request. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Status(self, request, context): + """Status returns the status of the runtime. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CheckpointContainer(self, request, context): + """CheckpointContainer checkpoints a container + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetContainerEvents(self, request, context): + """GetContainerEvents gets container events from the CRI runtime + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListMetricDescriptors(self, request, context): + """ListMetricDescriptors gets the descriptors for the metrics that will be returned in ListPodSandboxMetrics. + This list should be static at startup: either the client and server restart together when + adding or removing metrics descriptors, or they should not change. + Put differently, if ListPodSandboxMetrics references a name that is not described in the initial + ListMetricDescriptors call, then the metric will not be broadcasted. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListPodSandboxMetrics(self, request, context): + """ListPodSandboxMetrics gets pod sandbox metrics from CRI Runtime + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RuntimeConfig(self, request, context): + """RuntimeConfig returns configuration information of the runtime. + A couple of notes: + - The RuntimeConfigRequest object is not to be confused with the contents of UpdateRuntimeConfigRequest. + The former is for having runtime tell Kubelet what to do, the latter vice versa. + - It is the expectation of the Kubelet that these fields are static for the lifecycle of the Kubelet. + The Kubelet will not re-request the RuntimeConfiguration after startup, and CRI implementations should + avoid updating them without a full node reboot. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_RuntimeServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Version': grpc.unary_unary_rpc_method_handler( + servicer.Version, + request_deserializer=cri__pb2.VersionRequest.FromString, + response_serializer=cri__pb2.VersionResponse.SerializeToString, + ), + 'RunPodSandbox': grpc.unary_unary_rpc_method_handler( + servicer.RunPodSandbox, + request_deserializer=cri__pb2.RunPodSandboxRequest.FromString, + response_serializer=cri__pb2.RunPodSandboxResponse.SerializeToString, + ), + 'StopPodSandbox': grpc.unary_unary_rpc_method_handler( + servicer.StopPodSandbox, + request_deserializer=cri__pb2.StopPodSandboxRequest.FromString, + response_serializer=cri__pb2.StopPodSandboxResponse.SerializeToString, + ), + 'RemovePodSandbox': grpc.unary_unary_rpc_method_handler( + servicer.RemovePodSandbox, + request_deserializer=cri__pb2.RemovePodSandboxRequest.FromString, + response_serializer=cri__pb2.RemovePodSandboxResponse.SerializeToString, + ), + 'PodSandboxStatus': grpc.unary_unary_rpc_method_handler( + servicer.PodSandboxStatus, + request_deserializer=cri__pb2.PodSandboxStatusRequest.FromString, + response_serializer=cri__pb2.PodSandboxStatusResponse.SerializeToString, + ), + 'ListPodSandbox': grpc.unary_unary_rpc_method_handler( + servicer.ListPodSandbox, + request_deserializer=cri__pb2.ListPodSandboxRequest.FromString, + response_serializer=cri__pb2.ListPodSandboxResponse.SerializeToString, + ), + 'CreateContainer': grpc.unary_unary_rpc_method_handler( + servicer.CreateContainer, + request_deserializer=cri__pb2.CreateContainerRequest.FromString, + response_serializer=cri__pb2.CreateContainerResponse.SerializeToString, + ), + 'StartContainer': grpc.unary_unary_rpc_method_handler( + servicer.StartContainer, + request_deserializer=cri__pb2.StartContainerRequest.FromString, + response_serializer=cri__pb2.StartContainerResponse.SerializeToString, + ), + 'StopContainer': grpc.unary_unary_rpc_method_handler( + servicer.StopContainer, + request_deserializer=cri__pb2.StopContainerRequest.FromString, + response_serializer=cri__pb2.StopContainerResponse.SerializeToString, + ), + 'RemoveContainer': grpc.unary_unary_rpc_method_handler( + servicer.RemoveContainer, + request_deserializer=cri__pb2.RemoveContainerRequest.FromString, + response_serializer=cri__pb2.RemoveContainerResponse.SerializeToString, + ), + 'ListContainers': grpc.unary_unary_rpc_method_handler( + servicer.ListContainers, + request_deserializer=cri__pb2.ListContainersRequest.FromString, + response_serializer=cri__pb2.ListContainersResponse.SerializeToString, + ), + 'ContainerStatus': grpc.unary_unary_rpc_method_handler( + servicer.ContainerStatus, + request_deserializer=cri__pb2.ContainerStatusRequest.FromString, + response_serializer=cri__pb2.ContainerStatusResponse.SerializeToString, + ), + 'UpdateContainerResources': grpc.unary_unary_rpc_method_handler( + servicer.UpdateContainerResources, + request_deserializer=cri__pb2.UpdateContainerResourcesRequest.FromString, + response_serializer=cri__pb2.UpdateContainerResourcesResponse.SerializeToString, + ), + 'ReopenContainerLog': grpc.unary_unary_rpc_method_handler( + servicer.ReopenContainerLog, + request_deserializer=cri__pb2.ReopenContainerLogRequest.FromString, + response_serializer=cri__pb2.ReopenContainerLogResponse.SerializeToString, + ), + 'ExecSync': grpc.unary_unary_rpc_method_handler( + servicer.ExecSync, + request_deserializer=cri__pb2.ExecSyncRequest.FromString, + response_serializer=cri__pb2.ExecSyncResponse.SerializeToString, + ), + 'Exec': grpc.unary_unary_rpc_method_handler( + servicer.Exec, + request_deserializer=cri__pb2.ExecRequest.FromString, + response_serializer=cri__pb2.ExecResponse.SerializeToString, + ), + 'Attach': grpc.unary_unary_rpc_method_handler( + servicer.Attach, + request_deserializer=cri__pb2.AttachRequest.FromString, + response_serializer=cri__pb2.AttachResponse.SerializeToString, + ), + 'PortForward': grpc.unary_unary_rpc_method_handler( + servicer.PortForward, + request_deserializer=cri__pb2.PortForwardRequest.FromString, + response_serializer=cri__pb2.PortForwardResponse.SerializeToString, + ), + 'ContainerStats': grpc.unary_unary_rpc_method_handler( + servicer.ContainerStats, + request_deserializer=cri__pb2.ContainerStatsRequest.FromString, + response_serializer=cri__pb2.ContainerStatsResponse.SerializeToString, + ), + 'ListContainerStats': grpc.unary_unary_rpc_method_handler( + servicer.ListContainerStats, + request_deserializer=cri__pb2.ListContainerStatsRequest.FromString, + response_serializer=cri__pb2.ListContainerStatsResponse.SerializeToString, + ), + 'PodSandboxStats': grpc.unary_unary_rpc_method_handler( + servicer.PodSandboxStats, + request_deserializer=cri__pb2.PodSandboxStatsRequest.FromString, + response_serializer=cri__pb2.PodSandboxStatsResponse.SerializeToString, + ), + 'ListPodSandboxStats': grpc.unary_unary_rpc_method_handler( + servicer.ListPodSandboxStats, + request_deserializer=cri__pb2.ListPodSandboxStatsRequest.FromString, + response_serializer=cri__pb2.ListPodSandboxStatsResponse.SerializeToString, + ), + 'UpdateRuntimeConfig': grpc.unary_unary_rpc_method_handler( + servicer.UpdateRuntimeConfig, + request_deserializer=cri__pb2.UpdateRuntimeConfigRequest.FromString, + response_serializer=cri__pb2.UpdateRuntimeConfigResponse.SerializeToString, + ), + 'Status': grpc.unary_unary_rpc_method_handler( + servicer.Status, + request_deserializer=cri__pb2.StatusRequest.FromString, + response_serializer=cri__pb2.StatusResponse.SerializeToString, + ), + 'CheckpointContainer': grpc.unary_unary_rpc_method_handler( + servicer.CheckpointContainer, + request_deserializer=cri__pb2.CheckpointContainerRequest.FromString, + response_serializer=cri__pb2.CheckpointContainerResponse.SerializeToString, + ), + 'GetContainerEvents': grpc.unary_stream_rpc_method_handler( + servicer.GetContainerEvents, + request_deserializer=cri__pb2.GetEventsRequest.FromString, + response_serializer=cri__pb2.ContainerEventResponse.SerializeToString, + ), + 'ListMetricDescriptors': grpc.unary_unary_rpc_method_handler( + servicer.ListMetricDescriptors, + request_deserializer=cri__pb2.ListMetricDescriptorsRequest.FromString, + response_serializer=cri__pb2.ListMetricDescriptorsResponse.SerializeToString, + ), + 'ListPodSandboxMetrics': grpc.unary_unary_rpc_method_handler( + servicer.ListPodSandboxMetrics, + request_deserializer=cri__pb2.ListPodSandboxMetricsRequest.FromString, + response_serializer=cri__pb2.ListPodSandboxMetricsResponse.SerializeToString, + ), + 'RuntimeConfig': grpc.unary_unary_rpc_method_handler( + servicer.RuntimeConfig, + request_deserializer=cri__pb2.RuntimeConfigRequest.FromString, + response_serializer=cri__pb2.RuntimeConfigResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'runtime.v1.RuntimeService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('runtime.v1.RuntimeService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class RuntimeService(object): + """Runtime service defines the public APIs for remote container runtimes + """ + + @staticmethod + def Version(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/Version', + cri__pb2.VersionRequest.SerializeToString, + cri__pb2.VersionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RunPodSandbox(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/RunPodSandbox', + cri__pb2.RunPodSandboxRequest.SerializeToString, + cri__pb2.RunPodSandboxResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StopPodSandbox(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/StopPodSandbox', + cri__pb2.StopPodSandboxRequest.SerializeToString, + cri__pb2.StopPodSandboxResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemovePodSandbox(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/RemovePodSandbox', + cri__pb2.RemovePodSandboxRequest.SerializeToString, + cri__pb2.RemovePodSandboxResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def PodSandboxStatus(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/PodSandboxStatus', + cri__pb2.PodSandboxStatusRequest.SerializeToString, + cri__pb2.PodSandboxStatusResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListPodSandbox(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ListPodSandbox', + cri__pb2.ListPodSandboxRequest.SerializeToString, + cri__pb2.ListPodSandboxResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateContainer(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/CreateContainer', + cri__pb2.CreateContainerRequest.SerializeToString, + cri__pb2.CreateContainerResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StartContainer(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/StartContainer', + cri__pb2.StartContainerRequest.SerializeToString, + cri__pb2.StartContainerResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StopContainer(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/StopContainer', + cri__pb2.StopContainerRequest.SerializeToString, + cri__pb2.StopContainerResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemoveContainer(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/RemoveContainer', + cri__pb2.RemoveContainerRequest.SerializeToString, + cri__pb2.RemoveContainerResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListContainers(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ListContainers', + cri__pb2.ListContainersRequest.SerializeToString, + cri__pb2.ListContainersResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ContainerStatus(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ContainerStatus', + cri__pb2.ContainerStatusRequest.SerializeToString, + cri__pb2.ContainerStatusResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateContainerResources(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/UpdateContainerResources', + cri__pb2.UpdateContainerResourcesRequest.SerializeToString, + cri__pb2.UpdateContainerResourcesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ReopenContainerLog(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ReopenContainerLog', + cri__pb2.ReopenContainerLogRequest.SerializeToString, + cri__pb2.ReopenContainerLogResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ExecSync(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ExecSync', + cri__pb2.ExecSyncRequest.SerializeToString, + cri__pb2.ExecSyncResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Exec(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/Exec', + cri__pb2.ExecRequest.SerializeToString, + cri__pb2.ExecResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Attach(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/Attach', + cri__pb2.AttachRequest.SerializeToString, + cri__pb2.AttachResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def PortForward(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/PortForward', + cri__pb2.PortForwardRequest.SerializeToString, + cri__pb2.PortForwardResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ContainerStats(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ContainerStats', + cri__pb2.ContainerStatsRequest.SerializeToString, + cri__pb2.ContainerStatsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListContainerStats(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ListContainerStats', + cri__pb2.ListContainerStatsRequest.SerializeToString, + cri__pb2.ListContainerStatsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def PodSandboxStats(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/PodSandboxStats', + cri__pb2.PodSandboxStatsRequest.SerializeToString, + cri__pb2.PodSandboxStatsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListPodSandboxStats(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ListPodSandboxStats', + cri__pb2.ListPodSandboxStatsRequest.SerializeToString, + cri__pb2.ListPodSandboxStatsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateRuntimeConfig(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/UpdateRuntimeConfig', + cri__pb2.UpdateRuntimeConfigRequest.SerializeToString, + cri__pb2.UpdateRuntimeConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Status(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/Status', + cri__pb2.StatusRequest.SerializeToString, + cri__pb2.StatusResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CheckpointContainer(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/CheckpointContainer', + cri__pb2.CheckpointContainerRequest.SerializeToString, + cri__pb2.CheckpointContainerResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetContainerEvents(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/runtime.v1.RuntimeService/GetContainerEvents', + cri__pb2.GetEventsRequest.SerializeToString, + cri__pb2.ContainerEventResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListMetricDescriptors(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ListMetricDescriptors', + cri__pb2.ListMetricDescriptorsRequest.SerializeToString, + cri__pb2.ListMetricDescriptorsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListPodSandboxMetrics(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/ListPodSandboxMetrics', + cri__pb2.ListPodSandboxMetricsRequest.SerializeToString, + cri__pb2.ListPodSandboxMetricsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RuntimeConfig(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.RuntimeService/RuntimeConfig', + cri__pb2.RuntimeConfigRequest.SerializeToString, + cri__pb2.RuntimeConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + +class ImageServiceStub(object): + """ImageService defines the public APIs for managing images. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListImages = channel.unary_unary( + '/runtime.v1.ImageService/ListImages', + request_serializer=cri__pb2.ListImagesRequest.SerializeToString, + response_deserializer=cri__pb2.ListImagesResponse.FromString, + _registered_method=True) + self.ImageStatus = channel.unary_unary( + '/runtime.v1.ImageService/ImageStatus', + request_serializer=cri__pb2.ImageStatusRequest.SerializeToString, + response_deserializer=cri__pb2.ImageStatusResponse.FromString, + _registered_method=True) + self.PullImage = channel.unary_unary( + '/runtime.v1.ImageService/PullImage', + request_serializer=cri__pb2.PullImageRequest.SerializeToString, + response_deserializer=cri__pb2.PullImageResponse.FromString, + _registered_method=True) + self.RemoveImage = channel.unary_unary( + '/runtime.v1.ImageService/RemoveImage', + request_serializer=cri__pb2.RemoveImageRequest.SerializeToString, + response_deserializer=cri__pb2.RemoveImageResponse.FromString, + _registered_method=True) + self.ImageFsInfo = channel.unary_unary( + '/runtime.v1.ImageService/ImageFsInfo', + request_serializer=cri__pb2.ImageFsInfoRequest.SerializeToString, + response_deserializer=cri__pb2.ImageFsInfoResponse.FromString, + _registered_method=True) + + +class ImageServiceServicer(object): + """ImageService defines the public APIs for managing images. + """ + + def ListImages(self, request, context): + """ListImages lists existing images. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ImageStatus(self, request, context): + """ImageStatus returns the status of the image. If the image is not + present, returns a response with ImageStatusResponse.Image set to + nil. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PullImage(self, request, context): + """PullImage pulls an image with authentication config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveImage(self, request, context): + """RemoveImage removes the image. + This call is idempotent, and must not return an error if the image has + already been removed. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ImageFsInfo(self, request, context): + """ImageFSInfo returns information of the filesystem that is used to store images. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ImageServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListImages': grpc.unary_unary_rpc_method_handler( + servicer.ListImages, + request_deserializer=cri__pb2.ListImagesRequest.FromString, + response_serializer=cri__pb2.ListImagesResponse.SerializeToString, + ), + 'ImageStatus': grpc.unary_unary_rpc_method_handler( + servicer.ImageStatus, + request_deserializer=cri__pb2.ImageStatusRequest.FromString, + response_serializer=cri__pb2.ImageStatusResponse.SerializeToString, + ), + 'PullImage': grpc.unary_unary_rpc_method_handler( + servicer.PullImage, + request_deserializer=cri__pb2.PullImageRequest.FromString, + response_serializer=cri__pb2.PullImageResponse.SerializeToString, + ), + 'RemoveImage': grpc.unary_unary_rpc_method_handler( + servicer.RemoveImage, + request_deserializer=cri__pb2.RemoveImageRequest.FromString, + response_serializer=cri__pb2.RemoveImageResponse.SerializeToString, + ), + 'ImageFsInfo': grpc.unary_unary_rpc_method_handler( + servicer.ImageFsInfo, + request_deserializer=cri__pb2.ImageFsInfoRequest.FromString, + response_serializer=cri__pb2.ImageFsInfoResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'runtime.v1.ImageService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('runtime.v1.ImageService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class ImageService(object): + """ImageService defines the public APIs for managing images. + """ + + @staticmethod + def ListImages(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.ImageService/ListImages', + cri__pb2.ListImagesRequest.SerializeToString, + cri__pb2.ListImagesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ImageStatus(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.ImageService/ImageStatus', + cri__pb2.ImageStatusRequest.SerializeToString, + cri__pb2.ImageStatusResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def PullImage(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.ImageService/PullImage', + cri__pb2.PullImageRequest.SerializeToString, + cri__pb2.PullImageResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemoveImage(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.ImageService/RemoveImage', + cri__pb2.RemoveImageRequest.SerializeToString, + cri__pb2.RemoveImageResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ImageFsInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/runtime.v1.ImageService/ImageFsInfo', + cri__pb2.ImageFsInfoRequest.SerializeToString, + cri__pb2.ImageFsInfoResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/grpc_server/test/test_grpc_client.py b/grpc_server/test/test_grpc_client.py new file mode 100644 index 000000000..ec6fc8944 --- /dev/null +++ b/grpc_server/test/test_grpc_client.py @@ -0,0 +1,13 @@ +import grpc +import cri_pb2_grpc +import cri_pb2 + +def run(): + with grpc.insecure_channel('localhost:50052') as channel: + stub = cri_pb2_grpc.RuntimeServiceStub(channel) + request = cri_pb2.VersionRequest() + response = stub.Version(request) + print("CRI Version:", response.version) + +if __name__ == '__main__': + run() diff --git a/grpc_server/test/test_grpc_server.py b/grpc_server/test/test_grpc_server.py new file mode 100644 index 000000000..7bdd43a7f --- /dev/null +++ b/grpc_server/test/test_grpc_server.py @@ -0,0 +1,87 @@ +# created from cri.proto file +import cri_pb2_grpc +import cri_pb2 + +import grpc +from concurrent import futures +import subprocess + +# ImageService defines the public APIs for managing images. +class ImageServiceServicer(cri_pb2_grpc.ImageServiceServicer): + # Lists existing images + def ListImages(self, request, context): + print("in List Images") # DEBUG + + # creates empty respone + response = cri_pb2.ListImagesResponse() + + # calls ch-image list and stores stdout + cmd = "/usr/local/src/charliecloud/bin/ch-image" + ca = [cmd, "list"] + output = subprocess.check_output(ca, stderr=subprocess.STDOUT) + + # images as strings + # note: decode changes bytes to string, split converts string to array, and finally remove the empty string + images = output.decode("utf-8").split("\n")[:-1] + + # for every image in charliecloud cache: + # create an image object with the name as the ID and append to the repeated field + for img in images: + response.images.append(cri_pb2.Image(id=img)) # note: incomplete... image missing fields + + print(response.images) # DEBUG + return response + + # ImageFSInfo returns information of the filesystem that is used to store images. + def ImageFsInfo(self, request, context): + print("In Image Fs Info") # DEBUG + + # dummy placeholders + filesystem_info = cri_pb2.FilesystemUsage() + response = cri_pb2.ImageFsInfoResponse(image_filesystems=[filesystem_info]) + + return response + + + +# organise version information to return as protobuf +VERSION_INFO = { "KubeVersion": "v1", # version of the kubelet runtime api + "RuntimeName": "Charliecloud", # name of the container runtime (const) + "RuntimeApiVersion": "v0" } # api version of the container runtime (I do not really know what this is) + +# this is an implementation of CRI's RuntimeService: +# Runtime service defines the public APIs for remote container runtimes +class RuntimeServiceServicer(cri_pb2_grpc.RuntimeServiceServicer): + # Version returns the runtime name, runtime version and runtime API version. + def Version(self, request, context): + print("version") # DEBUG + response = cri_pb2.VersionResponse(version=VERSION_INFO["KubeVersion"], runtime_name = VERSION_INFO["RuntimeName"], runtime_api_version=VERSION_INFO["RuntimeApiVersion"]) + + # this is the Charliecloud command we run to get the ch-run version + cmd = "/usr/local/src/charliecloud/bin/ch-run" + ca = [cmd, "--version"] + + # for some reason version response is in STDERR + output = subprocess.check_output(ca, stderr=subprocess.STDOUT) + response.runtime_version = output.rstrip() # note: rstrip removes new line + + return response + + # dummy start container function + def StartContainer(self, request, context): + print("start container:", request.container_id) # DEBUG + return cri_pb2.StartContainerResponse() + + +def serve(): + server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + cri_pb2_grpc.add_RuntimeServiceServicer_to_server(RuntimeServiceServicer(), server) + cri_pb2_grpc.add_ImageServiceServicer_to_server(ImageServiceServicer(), server) + server.add_insecure_port(f'unix:///tmp/test.sock') + server.start() + print("Server listening on port 50052...") # DEBUG + server.wait_for_termination() + +if __name__ == '__main__': + # start gRPC server + serve() diff --git a/grpc_server/test/test_subprocess.py b/grpc_server/test/test_subprocess.py new file mode 100644 index 000000000..5d76e0720 --- /dev/null +++ b/grpc_server/test/test_subprocess.py @@ -0,0 +1,4 @@ +import subprocess + +test = subprocess.check_output(['ch-run', '--version']) +print(test)