Regenerate protobuf files

tools/gen-criapi was used with the latest protobuf dependencies
to generate compatible files. This makes Zun Compute work again
with the current implementation of protobuf.

In addition, fix two issues that causes gate failure.

Depends-On: https://review.opendev.org/c/openstack/kuryr-libnetwork/+/851549
Closes-Bug: #1982924
Change-Id: Id1032709f6e3b11b718b3df6a6ac3531a9c99824
This commit is contained in:
Radosław Piliszek 2022-07-27 10:43:56 +02:00 committed by hongbin
parent a4e5688a68
commit 40dd541bb1
5 changed files with 1901 additions and 7092 deletions

View File

@ -19,3 +19,4 @@ testtools>=2.4.0 # MIT
stestr>=3.1.0 # Apache-2.0
Pygments>=2.7.2 # BSD license
python-zunclient>=4.1.0 # Apache-2.0
WebTest>=2.0.26 # MIT

View File

@ -18,6 +18,7 @@ from oslo_utils import timeutils
from zun.common import exception
from zun.common import policy
from zun.common import utils
class RequestContext(context.RequestContext):
@ -92,7 +93,7 @@ class RequestContext(context.RequestContext):
'auth_token_info': self.auth_token_info,
'password': self.password,
'all_projects': self.all_projects,
'timestamp': timeutils.strtime(self.timestamp) if
'timestamp': utils.strtime(self.timestamp) if
hasattr(self, 'timestamp') else None
})
return value

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,7 @@
# under the License.
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from zun.criapi import api_pb2 as zun_dot_criapi_dot_api__pb2
@ -126,6 +127,16 @@ class RuntimeServiceStub(object):
request_serializer=zun_dot_criapi_dot_api__pb2.ListContainerStatsRequest.SerializeToString,
response_deserializer=zun_dot_criapi_dot_api__pb2.ListContainerStatsResponse.FromString,
)
self.PodSandboxStats = channel.unary_unary(
'/runtime.v1alpha2.RuntimeService/PodSandboxStats',
request_serializer=zun_dot_criapi_dot_api__pb2.PodSandboxStatsRequest.SerializeToString,
response_deserializer=zun_dot_criapi_dot_api__pb2.PodSandboxStatsResponse.FromString,
)
self.ListPodSandboxStats = channel.unary_unary(
'/runtime.v1alpha2.RuntimeService/ListPodSandboxStats',
request_serializer=zun_dot_criapi_dot_api__pb2.ListPodSandboxStatsRequest.SerializeToString,
response_deserializer=zun_dot_criapi_dot_api__pb2.ListPodSandboxStatsResponse.FromString,
)
self.UpdateRuntimeConfig = channel.unary_unary(
'/runtime.v1alpha2.RuntimeService/UpdateRuntimeConfig',
request_serializer=zun_dot_criapi_dot_api__pb2.UpdateRuntimeConfigRequest.SerializeToString,
@ -215,7 +226,8 @@ class RuntimeServiceServicer(object):
"""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.
TODO: what must the runtime do after the grace period is reached?
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!')
@ -307,6 +319,21 @@ class RuntimeServiceServicer(object):
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.
"""
@ -424,6 +451,16 @@ def add_RuntimeServiceServicer_to_server(servicer, server):
request_deserializer=zun_dot_criapi_dot_api__pb2.ListContainerStatsRequest.FromString,
response_serializer=zun_dot_criapi_dot_api__pb2.ListContainerStatsResponse.SerializeToString,
),
'PodSandboxStats': grpc.unary_unary_rpc_method_handler(
servicer.PodSandboxStats,
request_deserializer=zun_dot_criapi_dot_api__pb2.PodSandboxStatsRequest.FromString,
response_serializer=zun_dot_criapi_dot_api__pb2.PodSandboxStatsResponse.SerializeToString,
),
'ListPodSandboxStats': grpc.unary_unary_rpc_method_handler(
servicer.ListPodSandboxStats,
request_deserializer=zun_dot_criapi_dot_api__pb2.ListPodSandboxStatsRequest.FromString,
response_serializer=zun_dot_criapi_dot_api__pb2.ListPodSandboxStatsResponse.SerializeToString,
),
'UpdateRuntimeConfig': grpc.unary_unary_rpc_method_handler(
servicer.UpdateRuntimeConfig,
request_deserializer=zun_dot_criapi_dot_api__pb2.UpdateRuntimeConfigRequest.FromString,
@ -440,6 +477,420 @@ def add_RuntimeServiceServicer_to_server(servicer, server):
server.add_generic_rpc_handlers((generic_handler,))
# 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.v1alpha2.RuntimeService/Version',
zun_dot_criapi_dot_api__pb2.VersionRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.VersionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/RunPodSandbox',
zun_dot_criapi_dot_api__pb2.RunPodSandboxRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.RunPodSandboxResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/StopPodSandbox',
zun_dot_criapi_dot_api__pb2.StopPodSandboxRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.StopPodSandboxResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/RemovePodSandbox',
zun_dot_criapi_dot_api__pb2.RemovePodSandboxRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.RemovePodSandboxResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/PodSandboxStatus',
zun_dot_criapi_dot_api__pb2.PodSandboxStatusRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.PodSandboxStatusResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ListPodSandbox',
zun_dot_criapi_dot_api__pb2.ListPodSandboxRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ListPodSandboxResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/CreateContainer',
zun_dot_criapi_dot_api__pb2.CreateContainerRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.CreateContainerResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/StartContainer',
zun_dot_criapi_dot_api__pb2.StartContainerRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.StartContainerResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/StopContainer',
zun_dot_criapi_dot_api__pb2.StopContainerRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.StopContainerResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/RemoveContainer',
zun_dot_criapi_dot_api__pb2.RemoveContainerRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.RemoveContainerResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ListContainers',
zun_dot_criapi_dot_api__pb2.ListContainersRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ListContainersResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ContainerStatus',
zun_dot_criapi_dot_api__pb2.ContainerStatusRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ContainerStatusResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/UpdateContainerResources',
zun_dot_criapi_dot_api__pb2.UpdateContainerResourcesRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.UpdateContainerResourcesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ReopenContainerLog',
zun_dot_criapi_dot_api__pb2.ReopenContainerLogRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ReopenContainerLogResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ExecSync',
zun_dot_criapi_dot_api__pb2.ExecSyncRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ExecSyncResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/Exec',
zun_dot_criapi_dot_api__pb2.ExecRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ExecResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/Attach',
zun_dot_criapi_dot_api__pb2.AttachRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.AttachResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/PortForward',
zun_dot_criapi_dot_api__pb2.PortForwardRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.PortForwardResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ContainerStats',
zun_dot_criapi_dot_api__pb2.ContainerStatsRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ContainerStatsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ListContainerStats',
zun_dot_criapi_dot_api__pb2.ListContainerStatsRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ListContainerStatsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/PodSandboxStats',
zun_dot_criapi_dot_api__pb2.PodSandboxStatsRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.PodSandboxStatsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/ListPodSandboxStats',
zun_dot_criapi_dot_api__pb2.ListPodSandboxStatsRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ListPodSandboxStatsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/UpdateRuntimeConfig',
zun_dot_criapi_dot_api__pb2.UpdateRuntimeConfigRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.UpdateRuntimeConfigResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.RuntimeService/Status',
zun_dot_criapi_dot_api__pb2.StatusRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.StatusResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
class ImageServiceStub(object):
"""ImageService defines the public APIs for managing images.
"""
@ -552,3 +1003,94 @@ def add_ImageServiceServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'runtime.v1alpha2.ImageService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# 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.v1alpha2.ImageService/ListImages',
zun_dot_criapi_dot_api__pb2.ListImagesRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ListImagesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.ImageService/ImageStatus',
zun_dot_criapi_dot_api__pb2.ImageStatusRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ImageStatusResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.ImageService/PullImage',
zun_dot_criapi_dot_api__pb2.PullImageRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.PullImageResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.ImageService/RemoveImage',
zun_dot_criapi_dot_api__pb2.RemoveImageRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.RemoveImageResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@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.v1alpha2.ImageService/ImageFsInfo',
zun_dot_criapi_dot_api__pb2.ImageFsInfoRequest.SerializeToString,
zun_dot_criapi_dot_api__pb2.ImageFsInfoResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

File diff suppressed because one or more lines are too long