Merge branch 'master' of ssh://gerrit.opencord.org:29418/voltha
diff --git a/.gitignore b/.gitignore
index 11d18ed..ada7197 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,10 +30,10 @@
*.swp
# Protobuf output files
-voltha/core/protos/*.desc
-voltha/core/protos/*_pb2.py
-third_party/googleapis/**/*.desc
-third_party/googleapis/**/*_pb2.py
+#voltha/core/protos/*.desc
+#voltha/core/protos/*_pb2.py
+#third_party/googleapis/**/*.desc
+#third_party/googleapis/**/*_pb2.py
# Editors
*.bak
diff --git a/Dockerfile b/Dockerfile
index 03537b8..c6b17fb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,21 +15,24 @@
# limitations under the License.
#
-FROM alpine:3.1
+FROM ubuntu:xenial
MAINTAINER Zsolt Haraszti <zharaszt@ciena.com>
MAINTAINER Ali Al-Shabibi <ali.al-shabibi@onlab.us>
MAINTAINER Nathan Knuth <nathan.knuth@tibitcom.com>
# Update to have latest images
-RUN apk add --update python py-pip
+RUN apt-get update && \
+ apt-get install -y python python-pip openssl
COPY requirements.txt /tmp/requirements.txt
+# pip install cython enum34 six && \
# Install app dependencies
-RUN apk add build-base gcc abuild binutils python-dev libffi-dev openssl-dev git && \
+RUN apt-get install -y wget build-essential make gcc binutils python-dev libffi-dev libssl-dev git && \
pip install -r /tmp/requirements.txt && \
- apk del --purge build-base gcc abuild binutils python-dev libffi-dev openssl-dev git
+ apt-get purge -y wget build-essential make gcc binutils python-dev libffi-dev libssl-dev git && \
+ apt-get autoremove -y
# Bundle app source
COPY voltha /voltha
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
new file mode 100644
index 0000000..da1d7ae
--- /dev/null
+++ b/Dockerfile.alpine
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 the original author or authors.
+#
+# 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.
+#
+
+FROM alpine:3.4
+
+MAINTAINER Zsolt Haraszti <zharaszt@ciena.com>
+MAINTAINER Ali Al-Shabibi <ali.al-shabibi@onlab.us>
+MAINTAINER Nathan Knuth <nathan.knuth@tibitcom.com>
+
+# Update to have latest images
+RUN apk add --update python py-pip && \
+ apk --allow-untrusted --no-cache -X http://apkproxy.heroku.com/andyshinn/alpine-pkg-glibc add glibc glibc-bin
+
+COPY requirements.txt /tmp/requirements.txt
+
+# Install app dependencies
+RUN apk add build-base gcc abuild binutils python-dev libffi-dev openssl-dev git linux-headers && \
+ pip install cython enum34 six && \
+ pip install -r /tmp/requirements.txt && \
+ apk del --purge build-base gcc abuild binutils python-dev libffi-dev openssl-dev git linux-headers
+
+# Bundle app source
+COPY voltha /voltha
+
+# Exposing process and default entry point
+# EXPOSE 8000
+CMD ["python", "voltha/main.py"]
diff --git a/requirements.txt b/requirements.txt
index 5f9796f..a0f7c50 100755
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,6 @@
argparse==1.2.1
colorama>=0.2.5
+cython
decorator>=3.4.0
docker-py
fluent-logger>=0.4.3
diff --git a/voltha/core/protos/Makefile b/voltha/core/protos/Makefile
index 5452be7..dd5542b 100644
--- a/voltha/core/protos/Makefile
+++ b/voltha/core/protos/Makefile
@@ -22,7 +22,7 @@
default: build
-PROTO_FILES := $(wildcard *.proto) $(wildcard google/api/*proto)
+PROTO_FILES := $(wildcard *.proto) $(wildcard third_party/google/api/*proto)
PROTO_PB2_FILES := $(foreach f,$(PROTO_FILES),$(subst .proto,_pb2.py,$(f)))
PROTO_DESC_FILES := $(foreach f,$(PROTO_FILES),$(subst .proto,.desc,$(f)))
@@ -42,7 +42,7 @@
%_pb2.py: %.proto Makefile
@echo "Building protocol buffer artifacts from $<"
- env LD_LIBRARY_PATH=$(PROTOC_LIBDIR) python -m grpc.tools.protoc -I. -I$(VOLTHA_BASE)/third_party/googleapis --python_out=. --grpc_python_out=. --descriptor_set_out=$(basename $<).desc --include_source_info $<
+ env LD_LIBRARY_PATH=$(PROTOC_LIBDIR) python -m grpc.tools.protoc -I. -I./third_party --python_out=. --grpc_python_out=. --descriptor_set_out=$(basename $<).desc --include_source_info $<
clean:
rm -f $(PROTO_PB2_FILES) $(PROTO_DESC_FILES)
diff --git a/voltha/core/protos/google2 b/voltha/core/protos/google2
deleted file mode 120000
index 689c27a..0000000
--- a/voltha/core/protos/google2
+++ /dev/null
@@ -1 +0,0 @@
-../../../third_party/googleapis/google
\ No newline at end of file
diff --git a/third_party/googleapis/google/__init__.py b/voltha/core/protos/third_party/__init__.py
similarity index 100%
copy from third_party/googleapis/google/__init__.py
copy to voltha/core/protos/third_party/__init__.py
diff --git a/third_party/googleapis/LICENSE b/voltha/core/protos/third_party/google/LICENSE
similarity index 100%
rename from third_party/googleapis/LICENSE
rename to voltha/core/protos/third_party/google/LICENSE
diff --git a/third_party/googleapis/google/__init__.py b/voltha/core/protos/third_party/google/__init__.py
similarity index 100%
rename from third_party/googleapis/google/__init__.py
rename to voltha/core/protos/third_party/google/__init__.py
diff --git a/third_party/googleapis/google/api/__init__.py b/voltha/core/protos/third_party/google/api/__init__.py
similarity index 100%
rename from third_party/googleapis/google/api/__init__.py
rename to voltha/core/protos/third_party/google/api/__init__.py
diff --git a/voltha/core/protos/third_party/google/api/annotations.desc b/voltha/core/protos/third_party/google/api/annotations.desc
new file mode 100644
index 0000000..67f970d
--- /dev/null
+++ b/voltha/core/protos/third_party/google/api/annotations.desc
Binary files differ
diff --git a/third_party/googleapis/google/api/annotations.proto b/voltha/core/protos/third_party/google/api/annotations.proto
similarity index 100%
rename from third_party/googleapis/google/api/annotations.proto
rename to voltha/core/protos/third_party/google/api/annotations.proto
diff --git a/voltha/core/protos/third_party/google/api/annotations_pb2.py b/voltha/core/protos/third_party/google/api/annotations_pb2.py
new file mode 100644
index 0000000..2121854
--- /dev/null
+++ b/voltha/core/protos/third_party/google/api/annotations_pb2.py
@@ -0,0 +1,51 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: third_party/google/api/annotations.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+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
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from google.api import http_pb2 as google_dot_api_dot_http__pb2
+from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='third_party/google/api/annotations.proto',
+ package='google.api',
+ syntax='proto3',
+ serialized_pb=_b('\n(third_party/google/api/annotations.proto\x12\ngoogle.api\x1a\x15google/api/http.proto\x1a google/protobuf/descriptor.proto:E\n\x04http\x12\x1e.google.protobuf.MethodOptions\x18\xb0\xca\xbc\" \x01(\x0b\x32\x14.google.api.HttpRuleB$\n\x0e\x63om.google.apiB\x10\x41nnotationsProtoP\x01\x62\x06proto3')
+ ,
+ dependencies=[google_dot_api_dot_http__pb2.DESCRIPTOR,google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,])
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+
+HTTP_FIELD_NUMBER = 72295728
+http = _descriptor.FieldDescriptor(
+ name='http', full_name='google.api.http', index=0,
+ number=72295728, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=True, extension_scope=None,
+ options=None)
+
+DESCRIPTOR.extensions_by_name['http'] = http
+
+http.message_type = google_dot_api_dot_http__pb2._HTTPRULE
+google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(http)
+
+DESCRIPTOR.has_options = True
+DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\016com.google.apiB\020AnnotationsProtoP\001'))
+import grpc
+from grpc.beta import implementations as beta_implementations
+from grpc.beta import interfaces as beta_interfaces
+from grpc.framework.common import cardinality
+from grpc.framework.interfaces.face import utilities as face_utilities
+# @@protoc_insertion_point(module_scope)
diff --git a/voltha/core/protos/third_party/google/api/http.desc b/voltha/core/protos/third_party/google/api/http.desc
new file mode 100644
index 0000000..7b2513a
--- /dev/null
+++ b/voltha/core/protos/third_party/google/api/http.desc
Binary files differ
diff --git a/third_party/googleapis/google/api/http.proto b/voltha/core/protos/third_party/google/api/http.proto
similarity index 100%
rename from third_party/googleapis/google/api/http.proto
rename to voltha/core/protos/third_party/google/api/http.proto
diff --git a/voltha/core/protos/third_party/google/api/http_pb2.py b/voltha/core/protos/third_party/google/api/http_pb2.py
new file mode 100644
index 0000000..b3abb3f
--- /dev/null
+++ b/voltha/core/protos/third_party/google/api/http_pb2.py
@@ -0,0 +1,194 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: third_party/google/api/http.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+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
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='third_party/google/api/http.proto',
+ package='google.api',
+ syntax='proto3',
+ serialized_pb=_b('\n!third_party/google/api/http.proto\x12\ngoogle.api\"\xd8\x01\n\x08HttpRule\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tB\x1d\n\x0e\x63om.google.apiB\tHttpProtoP\x01\x62\x06proto3')
+)
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+
+
+
+_HTTPRULE = _descriptor.Descriptor(
+ name='HttpRule',
+ full_name='google.api.HttpRule',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='get', full_name='google.api.HttpRule.get', index=0,
+ number=2, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='put', full_name='google.api.HttpRule.put', index=1,
+ number=3, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='post', full_name='google.api.HttpRule.post', index=2,
+ number=4, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='delete', full_name='google.api.HttpRule.delete', index=3,
+ number=5, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='patch', full_name='google.api.HttpRule.patch', index=4,
+ number=6, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='custom', full_name='google.api.HttpRule.custom', index=5,
+ number=8, type=11, cpp_type=10, label=1,
+ has_default_value=False, default_value=None,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='body', full_name='google.api.HttpRule.body', index=6,
+ number=7, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='additional_bindings', full_name='google.api.HttpRule.additional_bindings', index=7,
+ number=11, type=11, cpp_type=10, label=3,
+ has_default_value=False, default_value=[],
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ _descriptor.OneofDescriptor(
+ name='pattern', full_name='google.api.HttpRule.pattern',
+ index=0, containing_type=None, fields=[]),
+ ],
+ serialized_start=50,
+ serialized_end=266,
+)
+
+
+_CUSTOMHTTPPATTERN = _descriptor.Descriptor(
+ name='CustomHttpPattern',
+ full_name='google.api.CustomHttpPattern',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='kind', full_name='google.api.CustomHttpPattern.kind', index=0,
+ number=1, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ _descriptor.FieldDescriptor(
+ name='path', full_name='google.api.CustomHttpPattern.path', index=1,
+ number=2, type=9, cpp_type=9, label=1,
+ has_default_value=False, default_value=_b("").decode('utf-8'),
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=268,
+ serialized_end=315,
+)
+
+_HTTPRULE.fields_by_name['custom'].message_type = _CUSTOMHTTPPATTERN
+_HTTPRULE.fields_by_name['additional_bindings'].message_type = _HTTPRULE
+_HTTPRULE.oneofs_by_name['pattern'].fields.append(
+ _HTTPRULE.fields_by_name['get'])
+_HTTPRULE.fields_by_name['get'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
+_HTTPRULE.oneofs_by_name['pattern'].fields.append(
+ _HTTPRULE.fields_by_name['put'])
+_HTTPRULE.fields_by_name['put'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
+_HTTPRULE.oneofs_by_name['pattern'].fields.append(
+ _HTTPRULE.fields_by_name['post'])
+_HTTPRULE.fields_by_name['post'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
+_HTTPRULE.oneofs_by_name['pattern'].fields.append(
+ _HTTPRULE.fields_by_name['delete'])
+_HTTPRULE.fields_by_name['delete'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
+_HTTPRULE.oneofs_by_name['pattern'].fields.append(
+ _HTTPRULE.fields_by_name['patch'])
+_HTTPRULE.fields_by_name['patch'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
+_HTTPRULE.oneofs_by_name['pattern'].fields.append(
+ _HTTPRULE.fields_by_name['custom'])
+_HTTPRULE.fields_by_name['custom'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
+DESCRIPTOR.message_types_by_name['HttpRule'] = _HTTPRULE
+DESCRIPTOR.message_types_by_name['CustomHttpPattern'] = _CUSTOMHTTPPATTERN
+
+HttpRule = _reflection.GeneratedProtocolMessageType('HttpRule', (_message.Message,), dict(
+ DESCRIPTOR = _HTTPRULE,
+ __module__ = 'third_party.google.api.http_pb2'
+ # @@protoc_insertion_point(class_scope:google.api.HttpRule)
+ ))
+_sym_db.RegisterMessage(HttpRule)
+
+CustomHttpPattern = _reflection.GeneratedProtocolMessageType('CustomHttpPattern', (_message.Message,), dict(
+ DESCRIPTOR = _CUSTOMHTTPPATTERN,
+ __module__ = 'third_party.google.api.http_pb2'
+ # @@protoc_insertion_point(class_scope:google.api.CustomHttpPattern)
+ ))
+_sym_db.RegisterMessage(CustomHttpPattern)
+
+
+DESCRIPTOR.has_options = True
+DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\016com.google.apiB\tHttpProtoP\001'))
+import grpc
+from grpc.beta import implementations as beta_implementations
+from grpc.beta import interfaces as beta_interfaces
+from grpc.framework.common import cardinality
+from grpc.framework.interfaces.face import utilities as face_utilities
+# @@protoc_insertion_point(module_scope)
diff --git a/voltha/core/protos/voltha.desc b/voltha/core/protos/voltha.desc
new file mode 100644
index 0000000..fdd58f5
--- /dev/null
+++ b/voltha/core/protos/voltha.desc
Binary files differ
diff --git a/voltha/core/protos/voltha_pb2.py b/voltha/core/protos/voltha_pb2.py
new file mode 100644
index 0000000..6337489
--- /dev/null
+++ b/voltha/core/protos/voltha_pb2.py
@@ -0,0 +1,220 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: voltha.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+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
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+ name='voltha.proto',
+ package='voltha',
+ syntax='proto3',
+ serialized_pb=_b('\n\x0cvoltha.proto\x12\x06voltha\x1a\x1cgoogle/api/annotations.proto\"\r\n\x0bNullMessage\"v\n\x0cHealthStatus\x12/\n\x05state\x18\x01 \x01(\x0e\x32 .voltha.HealthStatus.HealthState\"5\n\x0bHealthState\x12\x0b\n\x07HEALTHY\x10\x00\x12\x0e\n\nOVERLOADED\x10\x01\x12\t\n\x05\x44YING\x10\x02\x32\x61\n\rHealthService\x12P\n\x0fGetHealthStatus\x12\x13.voltha.NullMessage\x1a\x14.voltha.HealthStatus\"\x12\x82\xd3\xe4\x93\x02\x0c\x12\x07/health:\x01*B<\n\x13org.opencord.volthaB\x0cVolthaProtos\xaa\x02\x16Opencord.Voltha.Volthab\x06proto3')
+ ,
+ dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,])
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+
+
+_HEALTHSTATUS_HEALTHSTATE = _descriptor.EnumDescriptor(
+ name='HealthState',
+ full_name='voltha.HealthStatus.HealthState',
+ filename=None,
+ file=DESCRIPTOR,
+ values=[
+ _descriptor.EnumValueDescriptor(
+ name='HEALTHY', index=0, number=0,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='OVERLOADED', index=1, number=1,
+ options=None,
+ type=None),
+ _descriptor.EnumValueDescriptor(
+ name='DYING', index=2, number=2,
+ options=None,
+ type=None),
+ ],
+ containing_type=None,
+ options=None,
+ serialized_start=134,
+ serialized_end=187,
+)
+_sym_db.RegisterEnumDescriptor(_HEALTHSTATUS_HEALTHSTATE)
+
+
+_NULLMESSAGE = _descriptor.Descriptor(
+ name='NullMessage',
+ full_name='voltha.NullMessage',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ ],
+ options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=54,
+ serialized_end=67,
+)
+
+
+_HEALTHSTATUS = _descriptor.Descriptor(
+ name='HealthStatus',
+ full_name='voltha.HealthStatus',
+ filename=None,
+ file=DESCRIPTOR,
+ containing_type=None,
+ fields=[
+ _descriptor.FieldDescriptor(
+ name='state', full_name='voltha.HealthStatus.state', index=0,
+ number=1, type=14, cpp_type=8, label=1,
+ has_default_value=False, default_value=0,
+ message_type=None, enum_type=None, containing_type=None,
+ is_extension=False, extension_scope=None,
+ options=None),
+ ],
+ extensions=[
+ ],
+ nested_types=[],
+ enum_types=[
+ _HEALTHSTATUS_HEALTHSTATE,
+ ],
+ options=None,
+ is_extendable=False,
+ syntax='proto3',
+ extension_ranges=[],
+ oneofs=[
+ ],
+ serialized_start=69,
+ serialized_end=187,
+)
+
+_HEALTHSTATUS.fields_by_name['state'].enum_type = _HEALTHSTATUS_HEALTHSTATE
+_HEALTHSTATUS_HEALTHSTATE.containing_type = _HEALTHSTATUS
+DESCRIPTOR.message_types_by_name['NullMessage'] = _NULLMESSAGE
+DESCRIPTOR.message_types_by_name['HealthStatus'] = _HEALTHSTATUS
+
+NullMessage = _reflection.GeneratedProtocolMessageType('NullMessage', (_message.Message,), dict(
+ DESCRIPTOR = _NULLMESSAGE,
+ __module__ = 'voltha_pb2'
+ # @@protoc_insertion_point(class_scope:voltha.NullMessage)
+ ))
+_sym_db.RegisterMessage(NullMessage)
+
+HealthStatus = _reflection.GeneratedProtocolMessageType('HealthStatus', (_message.Message,), dict(
+ DESCRIPTOR = _HEALTHSTATUS,
+ __module__ = 'voltha_pb2'
+ # @@protoc_insertion_point(class_scope:voltha.HealthStatus)
+ ))
+_sym_db.RegisterMessage(HealthStatus)
+
+
+DESCRIPTOR.has_options = True
+DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\023org.opencord.volthaB\014VolthaProtos\252\002\026Opencord.Voltha.Voltha'))
+import grpc
+from grpc.beta import implementations as beta_implementations
+from grpc.beta import interfaces as beta_interfaces
+from grpc.framework.common import cardinality
+from grpc.framework.interfaces.face import utilities as face_utilities
+
+
+class HealthServiceStub(object):
+
+ def __init__(self, channel):
+ """Constructor.
+
+ Args:
+ channel: A grpc.Channel.
+ """
+ self.GetHealthStatus = channel.unary_unary(
+ '/voltha.HealthService/GetHealthStatus',
+ request_serializer=NullMessage.SerializeToString,
+ response_deserializer=HealthStatus.FromString,
+ )
+
+
+class HealthServiceServicer(object):
+
+ def GetHealthStatus(self, request, context):
+ """Return current health status of a Voltha instance
+ """
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
+
+def add_HealthServiceServicer_to_server(servicer, server):
+ rpc_method_handlers = {
+ 'GetHealthStatus': grpc.unary_unary_rpc_method_handler(
+ servicer.GetHealthStatus,
+ request_deserializer=NullMessage.FromString,
+ response_serializer=HealthStatus.SerializeToString,
+ ),
+ }
+ generic_handler = grpc.method_handlers_generic_handler(
+ 'voltha.HealthService', rpc_method_handlers)
+ server.add_generic_rpc_handlers((generic_handler,))
+
+
+class BetaHealthServiceServicer(object):
+ def GetHealthStatus(self, request, context):
+ """Return current health status of a Voltha instance
+ """
+ context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
+
+
+class BetaHealthServiceStub(object):
+ def GetHealthStatus(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
+ """Return current health status of a Voltha instance
+ """
+ raise NotImplementedError()
+ GetHealthStatus.future = None
+
+
+def beta_create_HealthService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
+ request_deserializers = {
+ ('voltha.HealthService', 'GetHealthStatus'): NullMessage.FromString,
+ }
+ response_serializers = {
+ ('voltha.HealthService', 'GetHealthStatus'): HealthStatus.SerializeToString,
+ }
+ method_implementations = {
+ ('voltha.HealthService', 'GetHealthStatus'): face_utilities.unary_unary_inline(servicer.GetHealthStatus),
+ }
+ server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
+ return beta_implementations.server(method_implementations, options=server_options)
+
+
+def beta_create_HealthService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
+ request_serializers = {
+ ('voltha.HealthService', 'GetHealthStatus'): NullMessage.SerializeToString,
+ }
+ response_deserializers = {
+ ('voltha.HealthService', 'GetHealthStatus'): HealthStatus.FromString,
+ }
+ cardinalities = {
+ 'GetHealthStatus': cardinality.Cardinality.UNARY_UNARY,
+ }
+ stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
+ return beta_implementations.dynamic_stub(channel, 'voltha.HealthService', cardinalities, options=stub_options)
+# @@protoc_insertion_point(module_scope)
diff --git a/voltha/main.py b/voltha/main.py
index 160eb76..43a57e8 100755
--- a/voltha/main.py
+++ b/voltha/main.py
@@ -19,11 +19,13 @@
import argparse
import os
+import sys
import time
-
import yaml
from twisted.internet.defer import inlineCallbacks
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
from voltha.coordinator import Coordinator
from voltha.dockerhelpers import get_my_containers_name
from voltha.nethelpers import get_my_primary_interface, get_my_primary_local_ipv4
diff --git a/voltha/northbound/grpc/pb2_loader.py b/voltha/northbound/grpc/pb2_loader.py
index 1ee9db9..4e0d41d 100644
--- a/voltha/northbound/grpc/pb2_loader.py
+++ b/voltha/northbound/grpc/pb2_loader.py
@@ -35,7 +35,7 @@
else:
return None
sys.modules['google.api'] = ModuleProxy()
-from voltha.core.protos.google2.api import http_pb2
-from voltha.core.protos.google2.api import annotations_pb2
+from voltha.core.protos.third_party.google.api import http_pb2
+from voltha.core.protos.third_party.google.api import annotations_pb2
#~~~~~~~~~~~~~~~~~~~~ end import hach ~~~~~~~~~~~~~~~~~~~~~~~~~