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

Adapted Interdomain to common proto folder

- Moved imports from *.proto folder to common.proto folder
- Removed interdomain's genproto.sh script
- Minor code and linting fixing
- Arranged requirements to accelerate Docker image creation
- Updated Dockerfile
- Arranged GitLab CI/CD pipeline
parent b1169fb0
No related branches found
No related tags found
1 merge request!54Release 2.0.0
Showing
with 60 additions and 3632 deletions
...@@ -13,23 +13,25 @@ ...@@ -13,23 +13,25 @@
# limitations under the License. # limitations under the License.
# Build, tag and push the Docker image to the GitLab registry # Build, tag and push the Docker image to the GitLab registry
build service: build interdomain:
variables: variables:
IMAGE_NAME: 'service' # name of the microservice IMAGE_NAME: 'interdomain' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
stage: build stage: build
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script: 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 tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
after_script: after_script:
- docker images --filter="dangling=true" --quiet | xargs -r docker rmi - docker images --filter="dangling=true" --quiet | xargs -r docker rmi
rules: 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 == "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: - changes:
- src/common/**/*.py
- proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/*.py
...@@ -37,13 +39,13 @@ build service: ...@@ -37,13 +39,13 @@ build service:
- .gitlab-ci.yml - .gitlab-ci.yml
# Apply unit test to the component # Apply unit test to the component
unit test service: unit test interdomain:
variables: variables:
IMAGE_NAME: 'service' # name of the microservice IMAGE_NAME: 'interdomain' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
stage: unit_test stage: unit_test
needs: needs:
- build service - build interdomain
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi
...@@ -62,8 +64,10 @@ unit test service: ...@@ -62,8 +64,10 @@ unit test service:
- docker network rm teraflowbridge - docker network rm teraflowbridge
rules: 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 == "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: - changes:
- src/common/**/*.py
- proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/*.py
...@@ -76,13 +80,13 @@ unit test service: ...@@ -76,13 +80,13 @@ unit test service:
junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml
# Deployment of the service in Kubernetes Cluster # Deployment of the service in Kubernetes Cluster
deploy service: deploy interdomain:
variables: variables:
IMAGE_NAME: 'service' # name of the microservice IMAGE_NAME: 'interdomain' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
stage: deploy stage: deploy
needs: needs:
- unit test service - unit test interdomain
# - integ_test execute # - integ_test execute
script: script:
- 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM python:3-slim FROM python:3.9-slim
# Install dependencies # Install dependencies
RUN apt-get --yes --quiet --quiet update && \ RUN apt-get --yes --quiet --quiet update && \
...@@ -28,27 +28,46 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ ...@@ -28,27 +28,46 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
chmod +x /bin/grpc_health_probe chmod +x /bin/grpc_health_probe
# Get generic Python packages # Get generic Python packages
RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade setuptools wheel
RUN python3 -m pip install --upgrade pip-tools
# Set working directory # Get common Python packages
# Note: this step enables sharing the previous Docker build steps among all the Python components
WORKDIR /var/teraflow WORKDIR /var/teraflow
COPY common_requirements.in common_requirements.in
RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
RUN python3 -m pip install -r common_requirements.txt
# Create module sub-folders # Add common files into working directory
WORKDIR /var/teraflow/common
COPY src/common/. ./
RUN rm -rf proto
# Create proto sub-folder, copy .proto files, and generate Python code
RUN mkdir -p /var/teraflow/common/proto
WORKDIR /var/teraflow/common/proto
RUN touch __init__.py
COPY proto/*.proto ./
RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
RUN rm *.proto
RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
# Create component sub-folders, get specific Python packages
RUN mkdir -p /var/teraflow/interdomain RUN mkdir -p /var/teraflow/interdomain
WORKDIR /var/teraflow/interdomain
COPY src/interdomain/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN python3 -m pip install -r requirements.txt
# Add component files into working directory
WORKDIR /var/teraflow
COPY src/context/. context/
COPY src/device/. device/
COPY src/interdomain/. interdomain/
COPY src/monitoring/. monitoring/
COPY src/service/. service/
COPY src/slice/. slice/
# Get Python packages per module # Start the service
COPY interdomain/requirements.in interdomain/requirements.in
RUN pip-compile --output-file=interdomain/requirements.txt interdomain/requirements.in
RUN python3 -m pip install -r interdomain/requirements.txt
# Add files into working directory
COPY common/. common
COPY context/. context
COPY device/. device
COPY interdomain/. interdomain
COPY monitoring/. monitoring
COPY service/. service
COPY slice/. slice
# Start interdomain service
ENTRYPOINT ["python", "-m", "interdomain.service"] ENTRYPOINT ["python", "-m", "interdomain.service"]
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
import grpc, logging import grpc, logging
from common.Constants import ServiceNameEnum from common.Constants import ServiceNameEnum
from common.Settings import get_service_host, get_service_port_grpc from common.Settings import get_service_host, get_service_port_grpc
from common.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController
from common.proto.interdomain_pb2_grpc import InterdomainServiceStub
from common.tools.client.RetryDecorator import retry, delay_exponential from common.tools.client.RetryDecorator import retry, delay_exponential
from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.grpc.Tools import grpc_message_to_json_string
from interdomain.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController
from interdomain.proto.interdomain_pb2_grpc import InterdomainServiceStub
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
MAX_RETRIES = 15 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 kpi_sample_types.proto
python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto interdomain.proto
python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto slice.proto
rm proto/context_pb2_grpc.py
rm proto/kpi_sample_types_pb2_grpc.py
rm proto/slice_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/kpi_sample_types_pb2.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/interdomain_pb2.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/interdomain_pb2_grpc.py
sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/slice_pb2.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.
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: interdomain.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='interdomain.proto',
package='interdomain',
syntax='proto3',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\x11interdomain.proto\x12\x0binterdomain\x1a\rcontext.proto2\xc4\x02\n\x12InterdomainService\x12\x32\n\x0cRequestSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12L\n\x0c\x41uthenticate\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12\x31\n\x0bLookUpSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x39\n\x15OrderSliceFromCatalog\x12\x0e.context.Slice\x1a\x0e.context.Slice\"\x00\x12>\n\x1a\x43reateSliceAndAddToCatalog\x12\x0e.context.Slice\x1a\x0e.context.Slice\"\x00\x62\x06proto3'
,
dependencies=[context__pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_INTERDOMAINSERVICE = _descriptor.ServiceDescriptor(
name='InterdomainService',
full_name='interdomain.InterdomainService',
file=DESCRIPTOR,
index=0,
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_start=50,
serialized_end=374,
methods=[
_descriptor.MethodDescriptor(
name='RequestSlice',
full_name='interdomain.InterdomainService.RequestSlice',
index=0,
containing_service=None,
input_type=context__pb2._SLICE,
output_type=context__pb2._SLICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='Authenticate',
full_name='interdomain.InterdomainService.Authenticate',
index=1,
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='LookUpSlice',
full_name='interdomain.InterdomainService.LookUpSlice',
index=2,
containing_service=None,
input_type=context__pb2._SLICE,
output_type=context__pb2._SLICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='OrderSliceFromCatalog',
full_name='interdomain.InterdomainService.OrderSliceFromCatalog',
index=3,
containing_service=None,
input_type=context__pb2._SLICE,
output_type=context__pb2._SLICE,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='CreateSliceAndAddToCatalog',
full_name='interdomain.InterdomainService.CreateSliceAndAddToCatalog',
index=4,
containing_service=None,
input_type=context__pb2._SLICE,
output_type=context__pb2._SLICE,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
])
_sym_db.RegisterServiceDescriptor(_INTERDOMAINSERVICE)
DESCRIPTOR.services_by_name['InterdomainService'] = _INTERDOMAINSERVICE
# @@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 InterdomainServiceStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.RequestSlice = channel.unary_unary(
'/interdomain.InterdomainService/RequestSlice',
request_serializer=context__pb2.Slice.SerializeToString,
response_deserializer=context__pb2.SliceId.FromString,
)
self.Authenticate = channel.unary_unary(
'/interdomain.InterdomainService/Authenticate',
request_serializer=context__pb2.TeraFlowController.SerializeToString,
response_deserializer=context__pb2.AuthenticationResult.FromString,
)
self.LookUpSlice = channel.unary_unary(
'/interdomain.InterdomainService/LookUpSlice',
request_serializer=context__pb2.Slice.SerializeToString,
response_deserializer=context__pb2.SliceId.FromString,
)
self.OrderSliceFromCatalog = channel.unary_unary(
'/interdomain.InterdomainService/OrderSliceFromCatalog',
request_serializer=context__pb2.Slice.SerializeToString,
response_deserializer=context__pb2.Slice.FromString,
)
self.CreateSliceAndAddToCatalog = channel.unary_unary(
'/interdomain.InterdomainService/CreateSliceAndAddToCatalog',
request_serializer=context__pb2.Slice.SerializeToString,
response_deserializer=context__pb2.Slice.FromString,
)
class InterdomainServiceServicer(object):
"""Missing associated documentation comment in .proto file."""
def RequestSlice(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 Authenticate(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 LookUpSlice(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 OrderSliceFromCatalog(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 CreateSliceAndAddToCatalog(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_InterdomainServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'RequestSlice': grpc.unary_unary_rpc_method_handler(
servicer.RequestSlice,
request_deserializer=context__pb2.Slice.FromString,
response_serializer=context__pb2.SliceId.SerializeToString,
),
'Authenticate': grpc.unary_unary_rpc_method_handler(
servicer.Authenticate,
request_deserializer=context__pb2.TeraFlowController.FromString,
response_serializer=context__pb2.AuthenticationResult.SerializeToString,
),
'LookUpSlice': grpc.unary_unary_rpc_method_handler(
servicer.LookUpSlice,
request_deserializer=context__pb2.Slice.FromString,
response_serializer=context__pb2.SliceId.SerializeToString,
),
'OrderSliceFromCatalog': grpc.unary_unary_rpc_method_handler(
servicer.OrderSliceFromCatalog,
request_deserializer=context__pb2.Slice.FromString,
response_serializer=context__pb2.Slice.SerializeToString,
),
'CreateSliceAndAddToCatalog': grpc.unary_unary_rpc_method_handler(
servicer.CreateSliceAndAddToCatalog,
request_deserializer=context__pb2.Slice.FromString,
response_serializer=context__pb2.Slice.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'interdomain.InterdomainService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class InterdomainService(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def RequestSlice(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, '/interdomain.InterdomainService/RequestSlice',
context__pb2.Slice.SerializeToString,
context__pb2.SliceId.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Authenticate(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, '/interdomain.InterdomainService/Authenticate',
context__pb2.TeraFlowController.SerializeToString,
context__pb2.AuthenticationResult.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def LookUpSlice(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, '/interdomain.InterdomainService/LookUpSlice',
context__pb2.Slice.SerializeToString,
context__pb2.SliceId.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def OrderSliceFromCatalog(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, '/interdomain.InterdomainService/OrderSliceFromCatalog',
context__pb2.Slice.SerializeToString,
context__pb2.Slice.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def CreateSliceAndAddToCatalog(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, '/interdomain.InterdomainService/CreateSliceAndAddToCatalog',
context__pb2.Slice.SerializeToString,
context__pb2.Slice.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
# -*- 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: slice.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='slice.proto',
package='slice',
syntax='proto3',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\x0bslice.proto\x12\x05slice\x1a\rcontext.proto2\xa7\x01\n\x0cSliceService\x12\x31\n\x0b\x43reateSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bUpdateSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0b\x44\x65leteSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3'
,
dependencies=[context__pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_SLICESERVICE = _descriptor.ServiceDescriptor(
name='SliceService',
full_name='slice.SliceService',
file=DESCRIPTOR,
index=0,
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_start=38,
serialized_end=205,
methods=[
_descriptor.MethodDescriptor(
name='CreateSlice',
full_name='slice.SliceService.CreateSlice',
index=0,
containing_service=None,
input_type=context__pb2._SLICE,
output_type=context__pb2._SLICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='UpdateSlice',
full_name='slice.SliceService.UpdateSlice',
index=1,
containing_service=None,
input_type=context__pb2._SLICE,
output_type=context__pb2._SLICEID,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
_descriptor.MethodDescriptor(
name='DeleteSlice',
full_name='slice.SliceService.DeleteSlice',
index=2,
containing_service=None,
input_type=context__pb2._SLICEID,
output_type=context__pb2._EMPTY,
serialized_options=None,
create_key=_descriptor._internal_create_key,
),
])
_sym_db.RegisterServiceDescriptor(_SLICESERVICE)
DESCRIPTOR.services_by_name['SliceService'] = _SLICESERVICE
# @@protoc_insertion_point(module_scope)
grpcio==1.43.0
grpcio-health-checking==1.43.0
prometheus-client==0.13.0
protobuf==3.19.3
pytest==6.2.5
pytest-benchmark==3.4.1
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
from common.Constants import ServiceNameEnum from common.Constants import ServiceNameEnum
from common.Settings import get_service_port_grpc from common.Settings import get_service_port_grpc
from common.proto.interdomain_pb2_grpc import add_InterdomainServiceServicer_to_server
from common.tools.service.GenericGrpcService import GenericGrpcService from common.tools.service.GenericGrpcService import GenericGrpcService
from interdomain.proto.interdomain_pb2_grpc import add_InterdomainServiceServicer_to_server
from .InterdomainServiceServicerImpl import InterdomainServiceServicerImpl from .InterdomainServiceServicerImpl import InterdomainServiceServicerImpl
from .RemoteDomainClients import RemoteDomainClients from .RemoteDomainClients import RemoteDomainClients
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
import grpc, logging import grpc, logging
from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method
from common.proto.context_pb2 import (
AuthenticationResult, Slice, SliceId, SliceStatus, SliceStatusEnum, TeraFlowController)
from common.proto.interdomain_pb2_grpc import InterdomainServiceServicer
#from common.tools.grpc.Tools import grpc_message_to_json_string #from common.tools.grpc.Tools import grpc_message_to_json_string
from context.client.ContextClient import ContextClient from context.client.ContextClient import ContextClient
from context.proto.context_pb2 import SliceStatusEnum
from interdomain.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController
from interdomain.proto.interdomain_pb2_grpc import InterdomainServiceServicer
from interdomain.service.RemoteDomainClients import RemoteDomainClients from interdomain.service.RemoteDomainClients import RemoteDomainClients
from slice.client.SliceClient import SliceClient from slice.client.SliceClient import SliceClient
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import logging, socket import logging, socket
from common.Constants import DEFAULT_CONTEXT_UUID from common.Constants import DEFAULT_CONTEXT_UUID
from common.Settings import get_setting from common.Settings import get_setting
from common.proto.context_pb2 import TeraFlowController
from interdomain.Config import GRPC_SERVICE_PORT from interdomain.Config import GRPC_SERVICE_PORT
from interdomain.client.InterdomainClient import InterdomainClient from interdomain.client.InterdomainClient import InterdomainClient
from interdomain.proto.context_pb2 import TeraFlowController
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
......
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