-
Notifications
You must be signed in to change notification settings - Fork 116
reference tensor proto of tensorflow #1729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
33cef00
7b2462c
a9f8154
25f5e1a
dd4044c
eb4b5bb
da52590
f7c02a0
6b605c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
PYTHON = python | ||
|
||
EDL_PROTO_FILE = elasticdl/proto/elasticdl.proto | ||
|
||
PROTO_PATH=elasticdl/proto | ||
GO_FILE_DIR = elasticdl/pkg/proto | ||
GO_PB_FILE = $(GO_FILE_DIR)/elasticdl.pb.go | ||
|
||
CXX = g++ | ||
CAPI_DIR = elasticdl/pkg/kernel/capi | ||
|
||
all: python_pb $(GO_PB_FILE) kernel | ||
all: python_pb go_pb kernel | ||
|
||
python_pb: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This target requires at least ${PROTO_PATH}/elasticdl.proto as its dependent. python_pb: elasticdl/proto/elasticdl.proto
... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
$(PYTHON) -m grpc_tools.protoc -I . $(EDL_PROTO_FILE) --python_out=. --grpc_python_out=. | ||
$(PYTHON) -m grpc_tools.protoc -I${TF_PATH} -I. \ | ||
${PROTO_PATH}/elasticdl.proto --python_out=. --grpc_python_out=. | ||
|
||
$(GO_PB_FILE): $(EDL_PROTO_FILE) | ||
go_pb: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This target requires at least one dependent ${PROTO_PATH}/elasticdl.proto go_pb: elasticdl/proto/elasticdl.proto
... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
mkdir -p $(GO_FILE_DIR) | ||
protoc -I . $< --go_out=plugins=grpc:. | ||
protoc -I${TF_PATH} ${TF_PATH}/tensorflow/core/framework/types.proto --go_out=${GOPATH}/src | ||
protoc -I${TF_PATH} ${TF_PATH}/tensorflow/core/framework/resource_handle.proto --go_out=${GOPATH}/src | ||
protoc -I${TF_PATH} ${TF_PATH}/tensorflow/core/framework/tensor_shape.proto --go_out=${GOPATH}/src | ||
protoc -I${TF_PATH} ${TF_PATH}/tensorflow/core/framework/tensor.proto --go_out=${GOPATH}/src | ||
protoc -I${TF_PATH} -I${PROTO_PATH} ${PROTO_PATH}/elasticdl.proto --go_out=plugins=grpc:. | ||
|
||
kernel: | ||
${CXX} -O3 -std=c++11 ${CAPI_DIR}/kernel_api.cc -c -o ${CAPI_DIR}/libkernel_api.o | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,11 +49,11 @@ RUN /install-protobuf.bash && rm /install-protobuf.bash | |
|
||
# Install elasticdl.org/elasticdl Go package | ||
ENV ELASTICDLPATH $GOPATH/src/elasticdl.org/elasticdl | ||
ENV TF_PATH /tmp/tensorflow | ||
RUN cd /tmp && git clone --depth=1 https://github.com/tensorflow/tensorflow.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding this line would significantly slow down the Docker build speed. @QiJune please follow up #1731 with @typhoonzero to use Docker build cache as much as possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wangkuiyi I compare two CI time of two PRs, PR 1726 and current PR
22min 55s is smaller than 23min 49s. It seems that downloading tensorflow will not influence the CI speed. I use |
||
COPY . /tmp/elasticdl | ||
RUN cd /tmp/elasticdl && make -f elasticdl/Makefile && \ | ||
mkdir -p $ELASTICDLPATH && \ | ||
RUN cd /tmp/elasticdl && mkdir -p $ELASTICDLPATH && \ | ||
make -f elasticdl/Makefile && \ | ||
cp -r /tmp/elasticdl/elasticdl/pkg $ELASTICDLPATH && \ | ||
cd $GOPATH/src/elasticdl.org/elasticdl && \ | ||
export GO111MODULE=on && \ | ||
go mod init elasticdl.org/elasticdl && \ | ||
go install ./... && cd / && rm -rf /tmp/elasticdl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer we don't define this variable, as its naming doesn't add much information. Instead, we could literally use
elasticdl/proto
in the following rules.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done