Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
183 changes: 183 additions & 0 deletions cam/grpc/scheduler_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# 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 scheduler_pb2 as scheduler__pb2

GRPC_GENERATED_VERSION = '1.71.0'
GRPC_VERSION = grpc.__version__
_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:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in scheduler_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}.'
)


class SchedulerStub(object):
"""Missing associated documentation comment in .proto file."""

def __init__(self, channel):
"""Constructor.

Args:
channel: A grpc.Channel.
"""
self.Enqueue = channel.unary_unary(
'/cam.Scheduler/Enqueue',
request_serializer=scheduler__pb2.EnqueueRequest.SerializeToString,
response_deserializer=scheduler__pb2.EnqueueReply.FromString,
_registered_method=True)
self.Dequeue = channel.unary_unary(
'/cam.Scheduler/Dequeue',
request_serializer=scheduler__pb2.DequeueRequest.SerializeToString,
response_deserializer=scheduler__pb2.DequeueReply.FromString,
_registered_method=True)
self.Reprioritise = channel.unary_unary(
'/cam.Scheduler/Reprioritise',
request_serializer=scheduler__pb2.ReprioritiseRequest.SerializeToString,
response_deserializer=scheduler__pb2.ReprioritiseReply.FromString,
_registered_method=True)


class SchedulerServicer(object):
"""Missing associated documentation comment in .proto file."""

def Enqueue(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def Dequeue(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def Reprioritise(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_SchedulerServicer_to_server(servicer, server):
rpc_method_handlers = {
'Enqueue': grpc.unary_unary_rpc_method_handler(
servicer.Enqueue,
request_deserializer=scheduler__pb2.EnqueueRequest.FromString,
response_serializer=scheduler__pb2.EnqueueReply.SerializeToString,
),
'Dequeue': grpc.unary_unary_rpc_method_handler(
servicer.Dequeue,
request_deserializer=scheduler__pb2.DequeueRequest.FromString,
response_serializer=scheduler__pb2.DequeueReply.SerializeToString,
),
'Reprioritise': grpc.unary_unary_rpc_method_handler(
servicer.Reprioritise,
request_deserializer=scheduler__pb2.ReprioritiseRequest.FromString,
response_serializer=scheduler__pb2.ReprioritiseReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'cam.Scheduler', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('cam.Scheduler', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class Scheduler(object):
"""Missing associated documentation comment in .proto file."""

@staticmethod
def Enqueue(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,
'/cam.Scheduler/Enqueue',
scheduler__pb2.EnqueueRequest.SerializeToString,
scheduler__pb2.EnqueueReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def Dequeue(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,
'/cam.Scheduler/Dequeue',
scheduler__pb2.DequeueRequest.SerializeToString,
scheduler__pb2.DequeueReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def Reprioritise(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,
'/cam.Scheduler/Reprioritise',
scheduler__pb2.ReprioritiseRequest.SerializeToString,
scheduler__pb2.ReprioritiseReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
23 changes: 3 additions & 20 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
[pytest]
# -vv: verbose test names
# -s : show print/logs live
# --disable-warnings: skip warning noise
addopts = -vv -s --disable-warnings

# live CLI logging of INFO+ with timestamps
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s %(levelname).1s %(message)s
log_cli_date_format = %H:%M:%S

# capture DEBUG+ to a file for post‑mortem
logger_cli = true
logger_cli_level = INFO
logger_file = server.log
logger_file_level = DEBUG
logger_file_format = %(asctime)s %(levelname).1s %(name)s:%(lineno)d %(message)s

markers =
timeout: mark test to fail if it runs longer than given time
pythonpath =
src
.
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ packaging==25.0
pluggy==1.5.0
prometheus_client==0.21.1
propcache==0.3.1
protobuf==6.30.2
protobuf<6.0dev
pycparser==2.22
pydantic==2.11.3
pydantic_core==2.34.1
PyGithub==2.6.1
PyJWT==2.10.1
PyNaCl==1.5.0
Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions src/grpc_gen/scheduler_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
4 changes: 4 additions & 0 deletions src/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
pythonpath =
src
.
52 changes: 2 additions & 50 deletions src/scheduler_pb2.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,2 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: scheduler.proto
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
5,
29,
0,
'',
'scheduler.proto'
)
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()




DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fscheduler.proto\x12\x03\x63\x61m\"4\n\x03Job\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x0f\n\x07payload\x18\x03 \x01(\t\"\'\n\x0e\x45nqueueRequest\x12\x15\n\x03job\x18\x01 \x01(\x0b\x32\x08.cam.Job\"\x0e\n\x0c\x45nqueueReply\"\x10\n\x0e\x44\x65queueRequest\"%\n\x0c\x44\x65queueReply\x12\x15\n\x03job\x18\x01 \x01(\x0b\x32\x08.cam.Job\"6\n\x13ReprioritiseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0bnewPriority\x18\x02 \x01(\x05\"\x13\n\x11ReprioritiseReply2\xb3\x01\n\tScheduler\x12\x31\n\x07\x45nqueue\x12\x13.cam.EnqueueRequest\x1a\x11.cam.EnqueueReply\x12\x31\n\x07\x44\x65queue\x12\x13.cam.DequeueRequest\x1a\x11.cam.DequeueReply\x12@\n\x0cReprioritise\x12\x18.cam.ReprioritiseRequest\x1a\x16.cam.ReprioritiseReplyb\x06proto3')

_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scheduler_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
DESCRIPTOR._loaded_options = None
_globals['_JOB']._serialized_start=24
_globals['_JOB']._serialized_end=76
_globals['_ENQUEUEREQUEST']._serialized_start=78
_globals['_ENQUEUEREQUEST']._serialized_end=117
_globals['_ENQUEUEREPLY']._serialized_start=119
_globals['_ENQUEUEREPLY']._serialized_end=133
_globals['_DEQUEUEREQUEST']._serialized_start=135
_globals['_DEQUEUEREQUEST']._serialized_end=151
_globals['_DEQUEUEREPLY']._serialized_start=153
_globals['_DEQUEUEREPLY']._serialized_end=190
_globals['_REPRIORITISEREQUEST']._serialized_start=192
_globals['_REPRIORITISEREQUEST']._serialized_end=246
_globals['_REPRIORITISEREPLY']._serialized_start=248
_globals['_REPRIORITISEREPLY']._serialized_end=267
_globals['_SCHEDULER']._serialized_start=270
_globals['_SCHEDULER']._serialized_end=449
# @@protoc_insertion_point(module_scope)
# shim: keep old import paths working
from cam.grpc.scheduler_pb2 import * # noqa: F401,F403
Loading