VOL-1460 Updated core to use voltha-protos instead of local protos
Moved protos to python directory in order to maintain functionaly of containers built there.
Added capability to do local builds of protos
Added instructions on running dep ensure for getting protos.
Updated github.com/golang/protobuf version to v1.3.1
Change-Id: Ia6ef55f07f0d5dcb5b750d7c37b21b71db85bfc4
diff --git a/docker/Dockerfile.arouter b/docker/Dockerfile.arouter
index b1769a1..329fc68 100644
--- a/docker/Dockerfile.arouter
+++ b/docker/Dockerfile.arouter
@@ -9,22 +9,18 @@
ADD db $GOPATH/src/github.com/opencord/voltha-go/db
ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
+ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
# Copy required proto files
# ... VOLTHA proos
# Repeat here even if it's done in the base
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
ADD afrouter/arouter.json /src
+COPY vendor/github.com/opencord/voltha-protos/go/voltha.pb /src
#
# Copy generated executables here
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
-# Compile protobuf files
-# Repeat here even if it's done in the base
-RUN sh /src/protos/build_protos.sh /src/protos
-
# Build rw_core
RUN cd afrouter && go build -o /src/afrouter
@@ -39,7 +35,7 @@
# Copy required files
COPY --from=build-env /src/afrouter /app/
COPY --from=build-env /src/arouter.json /app/
-COPY --from=build-env /src/protos/voltha.pb /app/
+COPY --from=build-env /src/voltha.pb /app/
WORKDIR config
WORKDIR /app
diff --git a/docker/Dockerfile.arouterd b/docker/Dockerfile.arouterd
index 1755af1..f3c1dd3 100644
--- a/docker/Dockerfile.arouterd
+++ b/docker/Dockerfile.arouterd
@@ -13,11 +13,7 @@
ADD arouterd $GOPATH/src/github.com/opencord/voltha-go/arouterd
-# Copy required proto files
-# ... VOLTHA proos
# Repeate here even if done in base file
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
ADD afrouter/arouter.json /src
#
@@ -27,7 +23,6 @@
# Compile protobuf files
# Repeate here even if done in base file
RUN go get google.golang.org/genproto/googleapis/api/annotations
-RUN sh /src/protos/build_protos.sh /src/protos
# Build rw_core
RUN cd arouterd && go build -o /src/arouterd
diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base
index 3e6098c..1a22cd9 100644
--- a/docker/Dockerfile.base
+++ b/docker/Dockerfile.base
@@ -10,16 +10,11 @@
RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
# Prepare directory structure
-RUN ["mkdir", "-p", "/src", "src/protos"]
+RUN ["mkdir", "-p", "/src"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
+RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-go"]
RUN ["mkdir", "-p", "/share"]
-# Install golang protobuf
-#RUN go get github.com/golang/protobuf/protoc-gen-go
-#RUN go get google.golang.org/genproto/googleapis/rpc/status
-#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
-
# Copy files
#ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
#ADD common $GOPATH/src/github.com/opencord/voltha-go/common
@@ -28,11 +23,6 @@
ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
#ADD afrouter $GOPATH/src/github.com/opencord/voltha-go/afrouter
-
-# Copy required proto files
-# ... VOLTHA proos
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
ADD afrouter/arouter.json /src
#
@@ -41,13 +31,4 @@
#RUN ls -ltrR /go/src/github.com/opencord/voltha-go
-# Install golang protobuf
-#RUN go get github.com/golang/protobuf/protoc-gen-go
-#RUN go get google.golang.org/genproto/googleapis/rpc/status
-#RUN go get google.golang.org/grpc/binarylog/grpc_binarylog_v1
-RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
-
-# Compile protobuf files
-RUN sh /src/protos/build_protos.sh /src/protos
-
VOLUME /share
diff --git a/docker/Dockerfile.ro_core b/docker/Dockerfile.ro_core
index c7c6a70..0784f9a 100644
--- a/docker/Dockerfile.ro_core
+++ b/docker/Dockerfile.ro_core
@@ -11,9 +11,9 @@
RUN go get google.golang.org/genproto/googleapis/api/annotations
# Prepare directory structure
-RUN ["mkdir", "-p", "/src", "src/protos"]
+RUN ["mkdir", "-p", "/src"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
+RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-go"]
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
@@ -24,17 +24,6 @@
ADD kafka ./kafka
ADD vendor ./vendor
-# Install the protoc-gen-go
-RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
-
-# Copy required proto files
-# ... VOLTHA proos
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
-
-# Compile protobuf files
-RUN sh /src/protos/build_protos.sh /src/protos
-
# Build ro_core
RUN cd ro_core && go build -o /src/ro_core
diff --git a/docker/Dockerfile.rw_core b/docker/Dockerfile.rw_core
index 714ead7..8081beb 100644
--- a/docker/Dockerfile.rw_core
+++ b/docker/Dockerfile.rw_core
@@ -11,9 +11,9 @@
RUN go get google.golang.org/genproto/googleapis/api/annotations
# Prepare directory structure
-RUN ["mkdir", "-p", "/src", "src/protos"]
+RUN ["mkdir", "-p", "/src"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
+RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-go"]
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
@@ -24,17 +24,6 @@
ADD kafka ./kafka
ADD vendor ./vendor
-# Install the protoc-gen-go
-RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
-
-# Copy required proto files
-# ... VOLTHA proos
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
-
-# Compile protobuf files
-RUN sh /src/protos/build_protos.sh /src/protos
-
# Build rw_core
RUN cd rw_core && go build -o /src/rw_core
diff --git a/docker/Dockerfile.simulated_olt b/docker/Dockerfile.simulated_olt
index 6513c0e..d9251b0 100644
--- a/docker/Dockerfile.simulated_olt
+++ b/docker/Dockerfile.simulated_olt
@@ -11,9 +11,9 @@
RUN go get google.golang.org/genproto/googleapis/api/annotations
# Prepare directory structure
-RUN ["mkdir", "-p", "/src", "src/protos"]
+RUN ["mkdir", "-p", "/src"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
+RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-go"]
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
@@ -26,17 +26,6 @@
ADD kafka ./kafka
ADD vendor ./vendor
-# Install the protoc-gen-go
-RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
-
-# Copy required proto files
-# ... VOLTHA proos
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
-
-# Compile protobuf files
-RUN sh /src/protos/build_protos.sh /src/protos
-
# Build simulated_olt
RUN cd adapters/simulated_olt && go build -o /src/simulated_olt
diff --git a/docker/Dockerfile.simulated_onu b/docker/Dockerfile.simulated_onu
index 607ac6a..ae1588f 100644
--- a/docker/Dockerfile.simulated_onu
+++ b/docker/Dockerfile.simulated_onu
@@ -11,9 +11,9 @@
RUN go get google.golang.org/genproto/googleapis/api/annotations
# Prepare directory structure
-RUN ["mkdir", "-p", "/src", "src/protos"]
+RUN ["mkdir", "-p", "/src"]
RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
-RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
+RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha-go"]
WORKDIR $GOPATH/src/github.com/opencord/voltha-go
@@ -26,17 +26,6 @@
ADD kafka ./kafka
ADD vendor ./vendor
-# Install the protoc-gen-go
-RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
-
-# Copy required proto files
-# ... VOLTHA proos
-ADD protos/*.proto /src/protos/
-ADD protos/scripts/* /src/protos/
-
-# Compile protobuf files
-RUN sh /src/protos/build_protos.sh /src/protos
-
# Build simulated_onu
RUN cd adapters/simulated_onu && go build -o /src/simulated_onu