Commit d89126d4 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

BGPLS Speaker component:

- Updated Manifest resources
- Removed unneeded imports
- Corrected dependencies in Dockerfile
- Added missing requirements
parent 6079df21
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -45,11 +45,11 @@ spec:
            command: ["/bin/grpc_health_probe", "-addr=:20030"]
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
            cpu: 250m
            memory: 128Mi
          limits:
            cpu: 500m
            memory: 512Mi
            cpu: 1000m
            memory: 1024Mi
---
apiVersion: v1
kind: Service
+2 −4
Original line number Diff line number Diff line
@@ -135,10 +135,8 @@ COPY --from=build /var/teraflow/bgpls/service/java/netphony-topology/target/bgp-

# Add component files into working directory
WORKDIR /var/teraflow
COPY src/context/. context/
COPY src/device/. device/
COPY src/pathcomp/frontend/. pathcomp/frontend/
COPY src/service/. service/
COPY src/context/__init__.py context/__init__.py
COPY src/context/client/. context/client/
COPY src/bgpls_speaker/. bgpls_speaker/

# Start the service
+1 −0
Original line number Diff line number Diff line
@@ -12,5 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

lxml==4.9.1
pytz==2021.3
xmltodict==0.12.0
+6 −11
Original line number Diff line number Diff line
@@ -12,21 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import grpc, json, logging
from typing import Optional
import grpc, logging
from bgpls_speaker.service.tools.DiscoveredDBManager import  DiscoveredDBManager, GetContextDevices
from bgpls_speaker.service.tools.GrpcServer import GrpcServer
from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method
from common.method_wrappers.ServiceExceptions import AlreadyExistsException, InvalidArgumentException
from common.proto.context_pb2 import (DeviceId, Empty, EndPointId, Link, LinkId, Service, ServiceId, ServiceStatusEnum, ServiceTypeEnum, TopologyId,ContextId,Topology
    ,Device,DeviceDriverEnum, Uuid)
from common.proto.pathcomp_pb2 import PathCompRequest
from common.proto.service_pb2_grpc import ServiceServiceServicer
from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string
from common.proto.context_pb2 import DeviceId, Empty, EndPointId, Link, LinkId, Uuid
from context.client.ContextClient import ContextClient
from pathcomp.frontend.client.PathCompClient import PathCompClient
from common.proto.bgpls_pb2 import (BgplsSpeaker,BgplsSpeakerId, DiscoveredDeviceList,DiscoveredDevice,
                                    DiscoveredLink,DiscoveredLinkList,NodeDescriptors,BgplsSpeakerList)
from common.proto.bgpls_pb2 import (
    BgplsSpeaker, BgplsSpeakerId, DiscoveredDeviceList, DiscoveredDevice,
    DiscoveredLink, DiscoveredLinkList, NodeDescriptors, BgplsSpeakerList
)
from common.proto.bgpls_pb2_grpc import BgplsServiceServicer

LOGGER = logging.getLogger(__name__)
+2 −7
Original line number Diff line number Diff line
@@ -12,16 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging, signal, sys, threading, time
import logging, signal, sys, threading
from prometheus_client import start_http_server
from common.Constants import ServiceNameEnum
from common.Settings import (
    ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port,
    wait_for_environment_variables)
from context.client.ContextClient import ContextClient
from common.Settings import get_log_level, get_metrics_port
from .tools.DiscoveredDBManager import DiscoveredDBManager
from .BgplsService import BgplsService
from .tools.JavaRunner import JavaRunner
from .tools.GrpcServer import GrpcServer

terminate = threading.Event()