Complete python gRPC library and container (#6)
This commit is contained in:
@@ -3,8 +3,6 @@ plugins:
|
||||
- name: go
|
||||
out: go
|
||||
opt: paths=source_relative
|
||||
- name: python
|
||||
out: python/cursorius_pipeline_api_v2/proto
|
||||
- name: connect-go
|
||||
out: go
|
||||
opt: paths=source_relative
|
||||
|
||||
@@ -2,6 +2,22 @@
|
||||
|
||||
# Delete generated code
|
||||
rm -rf python/cursorius_pipeline_api_v2/proto
|
||||
mkdir -p python/cursorius_pipeline_api_v2/proto
|
||||
|
||||
# Generate grpc code
|
||||
# Generate python grpc code
|
||||
poetry -C "$PWD/python" install
|
||||
poetry -C python run \
|
||||
python -m grpc_tools.protoc \
|
||||
-I"api/v2" \
|
||||
--python_out=./python/cursorius_pipeline_api_v2 \
|
||||
--pyi_out=./python/cursorius_pipeline_api_v2 \
|
||||
--grpc_python_out=./python/cursorius_pipeline_api_v2 \
|
||||
api/v2/*
|
||||
|
||||
# Generate go grpc code
|
||||
buf generate
|
||||
|
||||
# Build python docker container
|
||||
pushd python
|
||||
docker build . -t cursorius-pipeline:v2
|
||||
popd
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Build python docker container
|
||||
pushd python
|
||||
docker build . -t git.ohea.xyz/cursorius/pipeline-api/cursorius-pipeline:v2
|
||||
docker push git.ohea.xyz/cursorius/pipeline-api/cursorius-pipeline:v2
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM python:3.11-alpine as builder
|
||||
|
||||
# Install poetry
|
||||
RUN apk add curl
|
||||
RUN curl -sSL https://install.python-poetry.org > install_poetry.py && \
|
||||
chmod +x install_poetry.py && \
|
||||
./install_poetry.py
|
||||
|
||||
COPY . /build
|
||||
WORKDIR /build
|
||||
RUN ~/.local/bin/poetry config virtualenvs.create false --local
|
||||
RUN pip3 install .
|
||||
|
||||
FROM python:3.11-alpine
|
||||
COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages
|
||||
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: get_runner.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
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
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10get_runner.proto\x12\x06\x61pi.v2\"(\n\x10GetRunnerOptions\x12\x14\n\x0c\x63lone_source\x18\x02 \x01(\x08\"K\n\x10GetRunnerRequest\x12\x0c\n\x04tags\x18\x01 \x03(\t\x12)\n\x07options\x18\x02 \x01(\x0b\x32\x18.api.v2.GetRunnerOptions\"\x1f\n\x11GetRunnerResponse\x12\n\n\x02id\x18\x01 \x01(\t2V\n\x10GetRunnerService\x12\x42\n\tGetRunner\x12\x18.api.v2.GetRunnerRequest\x1a\x19.api.v2.GetRunnerResponse\"\x00\x42\x35Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2b\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'get_runner_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2'
|
||||
_GETRUNNEROPTIONS._serialized_start=28
|
||||
_GETRUNNEROPTIONS._serialized_end=68
|
||||
_GETRUNNERREQUEST._serialized_start=70
|
||||
_GETRUNNERREQUEST._serialized_end=145
|
||||
_GETRUNNERRESPONSE._serialized_start=147
|
||||
_GETRUNNERRESPONSE._serialized_end=178
|
||||
_GETRUNNERSERVICE._serialized_start=180
|
||||
_GETRUNNERSERVICE._serialized_end=266
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,26 @@
|
||||
from google.protobuf.internal import containers as _containers
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor
|
||||
|
||||
class GetRunnerOptions(_message.Message):
|
||||
__slots__ = ["clone_source"]
|
||||
CLONE_SOURCE_FIELD_NUMBER: _ClassVar[int]
|
||||
clone_source: bool
|
||||
def __init__(self, clone_source: bool = ...) -> None: ...
|
||||
|
||||
class GetRunnerRequest(_message.Message):
|
||||
__slots__ = ["options", "tags"]
|
||||
OPTIONS_FIELD_NUMBER: _ClassVar[int]
|
||||
TAGS_FIELD_NUMBER: _ClassVar[int]
|
||||
options: GetRunnerOptions
|
||||
tags: _containers.RepeatedScalarFieldContainer[str]
|
||||
def __init__(self, tags: _Optional[_Iterable[str]] = ..., options: _Optional[_Union[GetRunnerOptions, _Mapping]] = ...) -> None: ...
|
||||
|
||||
class GetRunnerResponse(_message.Message):
|
||||
__slots__ = ["id"]
|
||||
ID_FIELD_NUMBER: _ClassVar[int]
|
||||
id: str
|
||||
def __init__(self, id: _Optional[str] = ...) -> None: ...
|
||||
@@ -0,0 +1,66 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
|
||||
import get_runner_pb2 as get__runner__pb2
|
||||
|
||||
|
||||
class GetRunnerServiceStub(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.GetRunner = channel.unary_unary(
|
||||
'/api.v2.GetRunnerService/GetRunner',
|
||||
request_serializer=get__runner__pb2.GetRunnerRequest.SerializeToString,
|
||||
response_deserializer=get__runner__pb2.GetRunnerResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class GetRunnerServiceServicer(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def GetRunner(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_GetRunnerServiceServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'GetRunner': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetRunner,
|
||||
request_deserializer=get__runner__pb2.GetRunnerRequest.FromString,
|
||||
response_serializer=get__runner__pb2.GetRunnerResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'api.v2.GetRunnerService', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class GetRunnerService(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
@staticmethod
|
||||
def GetRunner(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, '/api.v2.GetRunnerService/GetRunner',
|
||||
get__runner__pb2.GetRunnerRequest.SerializeToString,
|
||||
get__runner__pb2.GetRunnerResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
@@ -1,32 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: api/v2/get_runner.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
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
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x61pi/v2/get_runner.proto\x12\x06\x61pi.v2\"5\n\x10GetRunnerOptions\x12!\n\x0c\x63lone_source\x18\x02 \x01(\x08R\x0b\x63loneSource\"Z\n\x10GetRunnerRequest\x12\x12\n\x04tags\x18\x01 \x03(\tR\x04tags\x12\x32\n\x07options\x18\x02 \x01(\x0b\x32\x18.api.v2.GetRunnerOptionsR\x07options\"#\n\x11GetRunnerResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id2V\n\x10GetRunnerService\x12\x42\n\tGetRunner\x12\x18.api.v2.GetRunnerRequest\x1a\x19.api.v2.GetRunnerResponse\"\x00\x42\x35Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2b\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'api.v2.get_runner_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2'
|
||||
_GETRUNNEROPTIONS._serialized_start=35
|
||||
_GETRUNNEROPTIONS._serialized_end=88
|
||||
_GETRUNNERREQUEST._serialized_start=90
|
||||
_GETRUNNERREQUEST._serialized_end=180
|
||||
_GETRUNNERRESPONSE._serialized_start=182
|
||||
_GETRUNNERRESPONSE._serialized_end=217
|
||||
_GETRUNNERSERVICE._serialized_start=219
|
||||
_GETRUNNERSERVICE._serialized_end=305
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -1,30 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: api/v2/run_command.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
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
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x61pi/v2/run_command.proto\x12\x06\x61pi.v2\"Q\n\x11RunCommandRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n\x07\x63ommand\x18\x02 \x01(\tR\x07\x63ommand\x12\x12\n\x04\x61rgs\x18\x03 \x03(\tR\x04\x61rgs\"e\n\x12RunCommandResponse\x12\x1f\n\x0breturn_code\x18\x01 \x01(\x03R\nreturnCode\x12\x16\n\x06stdout\x18\x02 \x01(\tR\x06stdout\x12\x16\n\x06stderr\x18\x03 \x01(\tR\x06stderr2Z\n\x11RunCommandService\x12\x45\n\nRunCommand\x12\x19.api.v2.RunCommandRequest\x1a\x1a.api.v2.RunCommandResponse\"\x00\x42\x35Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2b\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'api.v2.run_command_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2'
|
||||
_RUNCOMMANDREQUEST._serialized_start=36
|
||||
_RUNCOMMANDREQUEST._serialized_end=117
|
||||
_RUNCOMMANDRESPONSE._serialized_start=119
|
||||
_RUNCOMMANDRESPONSE._serialized_end=220
|
||||
_RUNCOMMANDSERVICE._serialized_start=222
|
||||
_RUNCOMMANDSERVICE._serialized_end=312
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
+9
-9
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: api/v2/release_runner.proto
|
||||
# source: release_runner.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
@@ -13,18 +13,18 @@ _sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x61pi/v2/release_runner.proto\x12\x06\x61pi.v2\"&\n\x14ReleaseRunnerRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"\x17\n\x15ReleaseRunnerResponse2f\n\x14ReleaseRunnerService\x12N\n\rReleaseRunner\x12\x1c.api.v2.ReleaseRunnerRequest\x1a\x1d.api.v2.ReleaseRunnerResponse\"\x00\x42\x35Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2b\x06proto3')
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14release_runner.proto\x12\x06\x61pi.v2\"\"\n\x14ReleaseRunnerRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\x17\n\x15ReleaseRunnerResponse2f\n\x14ReleaseRunnerService\x12N\n\rReleaseRunner\x12\x1c.api.v2.ReleaseRunnerRequest\x1a\x1d.api.v2.ReleaseRunnerResponse\"\x00\x42\x35Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2b\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'api.v2.release_runner_pb2', globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'release_runner_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2'
|
||||
_RELEASERUNNERREQUEST._serialized_start=39
|
||||
_RELEASERUNNERREQUEST._serialized_end=77
|
||||
_RELEASERUNNERRESPONSE._serialized_start=79
|
||||
_RELEASERUNNERRESPONSE._serialized_end=102
|
||||
_RELEASERUNNERSERVICE._serialized_start=104
|
||||
_RELEASERUNNERSERVICE._serialized_end=206
|
||||
_RELEASERUNNERREQUEST._serialized_start=32
|
||||
_RELEASERUNNERREQUEST._serialized_end=66
|
||||
_RELEASERUNNERRESPONSE._serialized_start=68
|
||||
_RELEASERUNNERRESPONSE._serialized_end=91
|
||||
_RELEASERUNNERSERVICE._serialized_start=93
|
||||
_RELEASERUNNERSERVICE._serialized_end=195
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,15 @@
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from typing import ClassVar as _ClassVar, Optional as _Optional
|
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor
|
||||
|
||||
class ReleaseRunnerRequest(_message.Message):
|
||||
__slots__ = ["id"]
|
||||
ID_FIELD_NUMBER: _ClassVar[int]
|
||||
id: str
|
||||
def __init__(self, id: _Optional[str] = ...) -> None: ...
|
||||
|
||||
class ReleaseRunnerResponse(_message.Message):
|
||||
__slots__ = []
|
||||
def __init__(self) -> None: ...
|
||||
@@ -0,0 +1,66 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
|
||||
import release_runner_pb2 as release__runner__pb2
|
||||
|
||||
|
||||
class ReleaseRunnerServiceStub(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.ReleaseRunner = channel.unary_unary(
|
||||
'/api.v2.ReleaseRunnerService/ReleaseRunner',
|
||||
request_serializer=release__runner__pb2.ReleaseRunnerRequest.SerializeToString,
|
||||
response_deserializer=release__runner__pb2.ReleaseRunnerResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class ReleaseRunnerServiceServicer(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def ReleaseRunner(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_ReleaseRunnerServiceServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'ReleaseRunner': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.ReleaseRunner,
|
||||
request_deserializer=release__runner__pb2.ReleaseRunnerRequest.FromString,
|
||||
response_serializer=release__runner__pb2.ReleaseRunnerResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'api.v2.ReleaseRunnerService', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class ReleaseRunnerService(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
@staticmethod
|
||||
def ReleaseRunner(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, '/api.v2.ReleaseRunnerService/ReleaseRunner',
|
||||
release__runner__pb2.ReleaseRunnerRequest.SerializeToString,
|
||||
release__runner__pb2.ReleaseRunnerResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: run_command.proto
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
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
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11run_command.proto\x12\x06\x61pi.v2\">\n\x11RunCommandRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07\x63ommand\x18\x02 \x01(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x03(\t\"I\n\x12RunCommandResponse\x12\x13\n\x0breturn_code\x18\x01 \x01(\x03\x12\x0e\n\x06stdout\x18\x02 \x01(\t\x12\x0e\n\x06stderr\x18\x03 \x01(\t2Z\n\x11RunCommandService\x12\x45\n\nRunCommand\x12\x19.api.v2.RunCommandRequest\x1a\x1a.api.v2.RunCommandResponse\"\x00\x42\x35Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2b\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'run_command_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'Z3git.ohea.xyz/cursorius/pipeline-api/go/api/v2;apiv2'
|
||||
_RUNCOMMANDREQUEST._serialized_start=29
|
||||
_RUNCOMMANDREQUEST._serialized_end=91
|
||||
_RUNCOMMANDRESPONSE._serialized_start=93
|
||||
_RUNCOMMANDRESPONSE._serialized_end=166
|
||||
_RUNCOMMANDSERVICE._serialized_start=168
|
||||
_RUNCOMMANDSERVICE._serialized_end=258
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -0,0 +1,26 @@
|
||||
from google.protobuf.internal import containers as _containers
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Optional as _Optional
|
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor
|
||||
|
||||
class RunCommandRequest(_message.Message):
|
||||
__slots__ = ["args", "command", "id"]
|
||||
ARGS_FIELD_NUMBER: _ClassVar[int]
|
||||
COMMAND_FIELD_NUMBER: _ClassVar[int]
|
||||
ID_FIELD_NUMBER: _ClassVar[int]
|
||||
args: _containers.RepeatedScalarFieldContainer[str]
|
||||
command: str
|
||||
id: str
|
||||
def __init__(self, id: _Optional[str] = ..., command: _Optional[str] = ..., args: _Optional[_Iterable[str]] = ...) -> None: ...
|
||||
|
||||
class RunCommandResponse(_message.Message):
|
||||
__slots__ = ["return_code", "stderr", "stdout"]
|
||||
RETURN_CODE_FIELD_NUMBER: _ClassVar[int]
|
||||
STDERR_FIELD_NUMBER: _ClassVar[int]
|
||||
STDOUT_FIELD_NUMBER: _ClassVar[int]
|
||||
return_code: int
|
||||
stderr: str
|
||||
stdout: str
|
||||
def __init__(self, return_code: _Optional[int] = ..., stdout: _Optional[str] = ..., stderr: _Optional[str] = ...) -> None: ...
|
||||
@@ -0,0 +1,66 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
|
||||
import run_command_pb2 as run__command__pb2
|
||||
|
||||
|
||||
class RunCommandServiceStub(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.RunCommand = channel.unary_unary(
|
||||
'/api.v2.RunCommandService/RunCommand',
|
||||
request_serializer=run__command__pb2.RunCommandRequest.SerializeToString,
|
||||
response_deserializer=run__command__pb2.RunCommandResponse.FromString,
|
||||
)
|
||||
|
||||
|
||||
class RunCommandServiceServicer(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def RunCommand(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_RunCommandServiceServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'RunCommand': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.RunCommand,
|
||||
request_deserializer=run__command__pb2.RunCommandRequest.FromString,
|
||||
response_serializer=run__command__pb2.RunCommandResponse.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'api.v2.RunCommandService', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class RunCommandService(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
@staticmethod
|
||||
def RunCommand(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, '/api.v2.RunCommandService/RunCommand',
|
||||
run__command__pb2.RunCommandRequest.SerializeToString,
|
||||
run__command__pb2.RunCommandResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
Generated
+2
-2
@@ -122,7 +122,7 @@ setuptools = "*"
|
||||
name = "protobuf"
|
||||
version = "4.21.12"
|
||||
description = ""
|
||||
category = "dev"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
@@ -162,4 +162,4 @@ testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "0c477e71db20b2c0ce34e360193ad1ad4daf74992d092020d8375d33fcf71c07"
|
||||
content-hash = "dea7240c48a763ca267f13031b9c0af920f48757078bc97d8798a314a0b7360e"
|
||||
|
||||
@@ -10,6 +10,7 @@ packages = [{include = "cursorius_pipeline_api_v2"}]
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
grpcio = "^1.51.1"
|
||||
protobuf = "^4.21.12"
|
||||
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
|
||||
Reference in New Issue
Block a user