Skip to content
Snippets Groups Projects
Commit 226d1087 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Adapted Compute to common proto folder

- Moved imports from *.proto folder to common.proto folder
- Removed compute's genproto.sh script
- Minor code and linting fixing
- Arranged requirements to accelerate Docker image creation
- Updated Dockerfile
- Arranged GitLab CI/CD pipeline
parent e64a8f9d
No related branches found
No related tags found
1 merge request!54Release 2.0.0
Showing
with 20 additions and 3701 deletions
......@@ -21,16 +21,17 @@ build compute:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/
- docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
after_script:
- docker images --filter="dangling=true" --quiet | xargs -r docker rmi
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- changes:
- src/common/**/*.py
- proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py
......@@ -65,6 +66,8 @@ unit test compute:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- changes:
- src/common/**/*.py
- proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py
......
......@@ -15,11 +15,11 @@
import grpc, logging
from common.Constants import ServiceNameEnum
from common.Settings import get_service_host, get_service_port_grpc
from common.proto.compute_pb2_grpc import ComputeServiceStub
from common.proto.context_pb2 import (
AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController)
from common.tools.client.RetryDecorator import retry, delay_exponential
from common.tools.grpc.Tools import grpc_message_to_json_string
from compute.proto.compute_pb2_grpc import ComputeServiceStub
from compute.proto.context_pb2 import (
AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController)
LOGGER = logging.getLogger(__name__)
MAX_RETRIES = 15
......
#!/bin/bash -eu
#
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Make folder containing the script the root folder for its execution
cd $(dirname $0)
rm -rf proto/*.py
rm -rf proto/__pycache__
tee proto/__init__.py << EOF > /dev/null
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
EOF
python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto
python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto
python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto compute.proto
python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto
rm proto/context_pb2_grpc.py
rm proto/service_pb2_grpc.py
rm proto/kpi_sample_types_pb2_grpc.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/compute_pb2.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/compute_pb2_grpc.py
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: compute.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from . import context_pb2 as context__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='compute.proto',
package='compute',
syntax='proto3',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\rcompute.proto\x12\x07\x63ompute\x1a\rcontext.proto2\x89\x04\n\x0e\x43omputeService\x12P\n\x10\x43heckCredentials\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12L\n\x1cGetConnectivityServiceStatus\x12\x12.context.ServiceId\x1a\x16.context.ServiceStatus\"\x00\x12\x43\n\x19\x43reateConnectivityService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x41\n\x17\x45\x64itConnectivityService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12?\n\x19\x44\x65leteConnectivityService\x12\x10.context.Service\x1a\x0e.context.Empty\"\x00\x12L\n GetAllActiveConnectivityServices\x12\x0e.context.Empty\x1a\x16.context.ServiceIdList\"\x00\x12@\n\x1c\x43learAllConnectivityServices\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3'
,
dependencies=[context__pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_COMPUTESERVICE = _descriptor.ServiceDescriptor(
name='ComputeService',
full_name='compute.ComputeService',
file=DESCRIPTOR,
index=0,
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_start=42,
serialized_end=563,
methods=[
_descriptor.MethodDescriptor(
name='CheckCredentials',
full_name='compute.ComputeService.CheckCredentials',
index=0,
containing_service=None,
input_type=context__pb2._TERAFLOWCONTROLLER,
output_type=context__pb2._AUTHENTICATIONRESULT,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='GetConnectivityServiceStatus',
full_name='compute.ComputeService.GetConnectivityServiceStatus',
index=1,
containing_service=None,
input_type=context__pb2._SERVICEID,
output_type=context__pb2._SERVICESTATUS,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='CreateConnectivityService',
full_name='compute.ComputeService.CreateConnectivityService',
index=2,
containing_service=None,
input_type=context__pb2._SERVICE,
output_type=context__pb2._SERVICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='EditConnectivityService',
full_name='compute.ComputeService.EditConnectivityService',
index=3,
containing_service=None,
input_type=context__pb2._SERVICE,
output_type=context__pb2._SERVICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='DeleteConnectivityService',
full_name='compute.ComputeService.DeleteConnectivityService',
index=4,
containing_service=None,
input_type=context__pb2._SERVICE,
output_type=context__pb2._EMPTY,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='GetAllActiveConnectivityServices',
full_name='compute.ComputeService.GetAllActiveConnectivityServices',
index=5,
containing_service=None,
input_type=context__pb2._EMPTY,
output_type=context__pb2._SERVICEIDLIST,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='ClearAllConnectivityServices',
full_name='compute.ComputeService.ClearAllConnectivityServices',
index=6,
containing_service=None,
input_type=context__pb2._EMPTY,
output_type=context__pb2._EMPTY,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
])
_sym_db.RegisterServiceDescriptor(_COMPUTESERVICE)
DESCRIPTOR.services_by_name['ComputeService'] = _COMPUTESERVICE
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from . import context_pb2 as context__pb2
class ComputeServiceStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.CheckCredentials = channel.unary_unary(
'/compute.ComputeService/CheckCredentials',
request_serializer=context__pb2.TeraFlowController.SerializeToString,
response_deserializer=context__pb2.AuthenticationResult.FromString,
)
self.GetConnectivityServiceStatus = channel.unary_unary(
'/compute.ComputeService/GetConnectivityServiceStatus',
request_serializer=context__pb2.ServiceId.SerializeToString,
response_deserializer=context__pb2.ServiceStatus.FromString,
)
self.CreateConnectivityService = channel.unary_unary(
'/compute.ComputeService/CreateConnectivityService',
request_serializer=context__pb2.Service.SerializeToString,
response_deserializer=context__pb2.ServiceId.FromString,
)
self.EditConnectivityService = channel.unary_unary(
'/compute.ComputeService/EditConnectivityService',
request_serializer=context__pb2.Service.SerializeToString,
response_deserializer=context__pb2.ServiceId.FromString,
)
self.DeleteConnectivityService = channel.unary_unary(
'/compute.ComputeService/DeleteConnectivityService',
request_serializer=context__pb2.Service.SerializeToString,
response_deserializer=context__pb2.Empty.FromString,
)
self.GetAllActiveConnectivityServices = channel.unary_unary(
'/compute.ComputeService/GetAllActiveConnectivityServices',
request_serializer=context__pb2.Empty.SerializeToString,
response_deserializer=context__pb2.ServiceIdList.FromString,
)
self.ClearAllConnectivityServices = channel.unary_unary(
'/compute.ComputeService/ClearAllConnectivityServices',
request_serializer=context__pb2.Empty.SerializeToString,
response_deserializer=context__pb2.Empty.FromString,
)
class ComputeServiceServicer(object):
"""Missing associated documentation comment in .proto file."""
def CheckCredentials(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 GetConnectivityServiceStatus(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 CreateConnectivityService(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 EditConnectivityService(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 DeleteConnectivityService(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 GetAllActiveConnectivityServices(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 ClearAllConnectivityServices(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_ComputeServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'CheckCredentials': grpc.unary_unary_rpc_method_handler(
servicer.CheckCredentials,
request_deserializer=context__pb2.TeraFlowController.FromString,
response_serializer=context__pb2.AuthenticationResult.SerializeToString,
),
'GetConnectivityServiceStatus': grpc.unary_unary_rpc_method_handler(
servicer.GetConnectivityServiceStatus,
request_deserializer=context__pb2.ServiceId.FromString,
response_serializer=context__pb2.ServiceStatus.SerializeToString,
),
'CreateConnectivityService': grpc.unary_unary_rpc_method_handler(
servicer.CreateConnectivityService,
request_deserializer=context__pb2.Service.FromString,
response_serializer=context__pb2.ServiceId.SerializeToString,
),
'EditConnectivityService': grpc.unary_unary_rpc_method_handler(
servicer.EditConnectivityService,
request_deserializer=context__pb2.Service.FromString,
response_serializer=context__pb2.ServiceId.SerializeToString,
),
'DeleteConnectivityService': grpc.unary_unary_rpc_method_handler(
servicer.DeleteConnectivityService,
request_deserializer=context__pb2.Service.FromString,
response_serializer=context__pb2.Empty.SerializeToString,
),
'GetAllActiveConnectivityServices': grpc.unary_unary_rpc_method_handler(
servicer.GetAllActiveConnectivityServices,
request_deserializer=context__pb2.Empty.FromString,
response_serializer=context__pb2.ServiceIdList.SerializeToString,
),
'ClearAllConnectivityServices': grpc.unary_unary_rpc_method_handler(
servicer.ClearAllConnectivityServices,
request_deserializer=context__pb2.Empty.FromString,
response_serializer=context__pb2.Empty.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'compute.ComputeService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class ComputeService(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def CheckCredentials(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, '/compute.ComputeService/CheckCredentials',
context__pb2.TeraFlowController.SerializeToString,
context__pb2.AuthenticationResult.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetConnectivityServiceStatus(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, '/compute.ComputeService/GetConnectivityServiceStatus',
context__pb2.ServiceId.SerializeToString,
context__pb2.ServiceStatus.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def CreateConnectivityService(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, '/compute.ComputeService/CreateConnectivityService',
context__pb2.Service.SerializeToString,
context__pb2.ServiceId.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def EditConnectivityService(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, '/compute.ComputeService/EditConnectivityService',
context__pb2.Service.SerializeToString,
context__pb2.ServiceId.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def DeleteConnectivityService(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, '/compute.ComputeService/DeleteConnectivityService',
context__pb2.Service.SerializeToString,
context__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetAllActiveConnectivityServices(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, '/compute.ComputeService/GetAllActiveConnectivityServices',
context__pb2.Empty.SerializeToString,
context__pb2.ServiceIdList.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ClearAllConnectivityServices(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, '/compute.ComputeService/ClearAllConnectivityServices',
context__pb2.Empty.SerializeToString,
context__pb2.Empty.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kpi_sample_types.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='kpi_sample_types.proto',
package='kpi_sample_types',
syntax='proto3',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3'
)
_KPISAMPLETYPE = _descriptor.EnumDescriptor(
name='KpiSampleType',
full_name='kpi_sample_types.KpiSampleType',
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='KPISAMPLETYPE_UNKNOWN', index=0, number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
],
containing_type=None,
serialized_options=None,
serialized_start=45,
serialized_end=235,
)
_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE)
KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE)
KPISAMPLETYPE_UNKNOWN = 0
KPISAMPLETYPE_PACKETS_TRANSMITTED = 101
KPISAMPLETYPE_PACKETS_RECEIVED = 102
KPISAMPLETYPE_BYTES_TRANSMITTED = 201
KPISAMPLETYPE_BYTES_RECEIVED = 202
DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
# @@protoc_insertion_point(module_scope)
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from . import context_pb2 as context__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='service.proto',
package='service',
syntax='proto3',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3'
,
dependencies=[context__pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_SERVICESERVICE = _descriptor.ServiceDescriptor(
name='ServiceService',
full_name='service.ServiceService',
file=DESCRIPTOR,
index=0,
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_start=42,
serialized_end=227,
methods=[
_descriptor.MethodDescriptor(
name='CreateService',
full_name='service.ServiceService.CreateService',
index=0,
containing_service=None,
input_type=context__pb2._SERVICE,
output_type=context__pb2._SERVICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='UpdateService',
full_name='service.ServiceService.UpdateService',
index=1,
containing_service=None,
input_type=context__pb2._SERVICE,
output_type=context__pb2._SERVICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='DeleteService',
full_name='service.ServiceService.DeleteService',
index=2,
containing_service=None,
input_type=context__pb2._SERVICEID,
output_type=context__pb2._EMPTY,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
])
_sym_db.RegisterServiceDescriptor(_SERVICESERVICE)
DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE
# @@protoc_insertion_point(module_scope)
Flask==2.0.2
Flask-HTTPAuth==4.5.0
Flask-RESTful==0.3.9
grpcio==1.43.0
grpcio-health-checking==1.43.0
jsonschema==4.4.0
prometheus-client==0.13.0
protobuf==3.19.3
pytest==6.2.5
pytest-benchmark==3.4.1
requests==2.27.1
coverage==6.3
......@@ -14,8 +14,8 @@
from common.Constants import ServiceNameEnum
from common.Settings import get_service_port_grpc
from common.proto.compute_pb2_grpc import add_ComputeServiceServicer_to_server
from common.tools.service.GenericGrpcService import GenericGrpcService
from compute.proto.compute_pb2_grpc import add_ComputeServiceServicer_to_server
from compute.service.ComputeServiceServicerImpl import ComputeServiceServicerImpl
class ComputeService(GenericGrpcService):
......
......@@ -13,10 +13,10 @@
# limitations under the License.
import grpc, logging
from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method
from compute.proto.compute_pb2_grpc import ComputeServiceServicer
from compute.proto.context_pb2 import (
from common.proto.context_pb2 import (
AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController)
from common.proto.compute_pb2_grpc import ComputeServiceServicer
from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method
LOGGER = logging.getLogger(__name__)
......
......@@ -17,10 +17,9 @@ from flask import request
from flask.json import jsonify
from flask_restful import Resource
from common.Constants import DEFAULT_CONTEXT_UUID
from common.proto.context_pb2 import ServiceId, ServiceStatusEnum, SliceStatusEnum
from context.client.ContextClient import ContextClient
from context.proto.context_pb2 import ServiceId, SliceStatusEnum
from service.client.ServiceClient import ServiceClient
from service.proto.context_pb2 import ServiceStatusEnum
from .tools.Authentication import HTTP_AUTH
from .tools.ContextMethods import get_service, get_slice
from .tools.HttpStatusCodes import HTTP_GATEWAYTIMEOUT, HTTP_NOCONTENT, HTTP_OK, HTTP_SERVERERROR
......
......@@ -19,10 +19,9 @@ from flask.json import jsonify
from flask_restful import Resource
from werkzeug.exceptions import UnsupportedMediaType
from common.Constants import DEFAULT_CONTEXT_UUID
from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum, SliceStatusEnum, Slice
from service.client.ServiceClient import ServiceClient
from service.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum
from slice.client.SliceClient import SliceClient
from slice.proto.context_pb2 import SliceStatusEnum, Slice
from .schemas.vpn_service import SCHEMA_VPN_SERVICE
from .tools.Authentication import HTTP_AUTH
from .tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR
......
......@@ -20,10 +20,9 @@ from flask.json import jsonify
from flask.wrappers import Response
from flask_restful import Resource
from werkzeug.exceptions import UnsupportedMediaType
from common.Settings import get_setting
from common.proto.context_pb2 import ConfigActionEnum, Service, Slice
from common.tools.grpc.Tools import grpc_message_to_json_string
from context.client.ContextClient import ContextClient
from context.proto.context_pb2 import ConfigActionEnum, Service, Slice
from service.client.ServiceClient import ServiceClient
from slice.client.SliceClient import SliceClient
from .schemas.site_network_access import SCHEMA_SITE_NETWORK_ACCESS
......
import grpc, logging
from typing import Optional
from common.Constants import DEFAULT_CONTEXT_UUID
from common.proto.context_pb2 import Service, ServiceId, Slice, SliceId
from context.client.ContextClient import ContextClient
from context.proto.context_pb2 import Service, ServiceId, Slice, SliceId
LOGGER = logging.getLogger(__name__)
......
......@@ -16,13 +16,13 @@ import os
from typing import Union
from common.Constants import ServiceNameEnum
from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name
from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server
from common.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server
from common.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server
from common.tests.MockServicerImpl_Context import MockServicerImpl_Context
from common.tests.MockServicerImpl_Service import MockServicerImpl_Service
from common.tests.MockServicerImpl_Slice import MockServicerImpl_Slice
from common.tools.service.GenericGrpcService import GenericGrpcService
from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server
from service.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server
from slice.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server
LOCAL_HOST = '127.0.0.1'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment