Skip to content

Commit 2b291a3

Browse files
woopfeast-ci-bot
authored andcommitted
Automatic documentation generation for gRPC API (#403)
* Add documentation building for Core and Serving gRPC APIs * Remove staticly generated Python documentation
1 parent 3e25841 commit 2b291a3

File tree

121 files changed

+391
-35571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+391
-35571
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,5 @@ dmypy.json
173173
# Pyre type checker
174174
.pyre/
175175
.vscode
176+
177+
sdk/python/docs/html

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ clean-html:
4747
rm -rf $(PROJECT_ROOT)/dist
4848

4949
build-html:
50+
rm -rf $(PROJECT_ROOT)/dist/
5051
mkdir -p $(PROJECT_ROOT)/dist/python
52+
mkdir -p $(PROJECT_ROOT)/dist/grpc
53+
cd $(PROJECT_ROOT)/protos && $(MAKE) gen-docs
5154
cd $(PROJECT_ROOT)/sdk/python/docs && $(MAKE) html
5255
cp -r $(PROJECT_ROOT)/sdk/python/docs/html/* $(PROJECT_ROOT)/dist/python

docs/api/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

go.mod

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@ require (
55
github.com/Masterminds/semver v1.5.0 // indirect
66
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
77
github.com/ghodss/yaml v1.0.0
8+
github.com/gogo/protobuf v1.3.1 // indirect
89
github.com/golang/mock v1.2.0
910
github.com/golang/protobuf v1.3.2
10-
github.com/google/go-cmp v0.2.0
11-
github.com/google/uuid v1.1.1 // indirect
11+
github.com/google/go-cmp v0.3.0
1212
github.com/huandu/xstrings v1.2.0 // indirect
13-
github.com/imdario/mergo v0.3.8 // indirect
14-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1513
github.com/lyft/protoc-gen-validate v0.1.0 // indirect
1614
github.com/mitchellh/copystructure v1.0.0 // indirect
1715
github.com/mitchellh/go-homedir v1.1.0
1816
github.com/mwitkow/go-proto-validators v0.2.0 // indirect
1917
github.com/pseudomuto/protoc-gen-doc v1.3.0 // indirect
2018
github.com/pseudomuto/protokit v0.2.0 // indirect
21-
github.com/spf13/cobra v0.0.3
22-
github.com/spf13/viper v1.3.2
19+
github.com/spf13/cobra v0.0.4
20+
github.com/spf13/viper v1.4.0
2321
github.com/woop/protoc-gen-doc v1.3.0 // indirect
24-
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
25-
google.golang.org/grpc v1.19.1
26-
gopkg.in/yaml.v2 v2.2.2
22+
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
23+
google.golang.org/grpc v1.23.0
24+
gopkg.in/russross/blackfriday.v2 v2.0.0 // indirect
25+
gopkg.in/yaml.v2 v2.2.4
26+
istio.io/gogo-genproto v0.0.0-20191212213402-78a529a42cd8 // indirect
27+
istio.io/tools v0.0.0-20191228030621-c4eb6a11039c // indirect
2728
)
2829

2930
go 1.13

go.sum

Lines changed: 358 additions & 0 deletions
Large diffs are not rendered by default.

protos/Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,22 @@ gen-python:
1212
@$(foreach dir,$(dirs),python -m grpc_tools.protoc -I. --python_out=../sdk/python/ --mypy_out=../sdk/python/ feast/$(dir)/*.proto;)
1313
@$(foreach dir,$(service_dirs),python -m grpc_tools.protoc -I. --grpc_python_out=../sdk/python/ feast/$(dir)/*.proto;)
1414

15+
install-dependencies-docs:
16+
mkdir -p $$HOME/bin
17+
mkdir -p $$HOME/include
18+
go get github.com/golang/protobuf/proto && \
19+
go get gopkg.in/russross/blackfriday.v2 && \
20+
cd $$(mktemp -d) && \
21+
git clone https://github.com/istio/tools/ && \
22+
cd tools/cmd/protoc-gen-docs && \
23+
go build && \
24+
cp protoc-gen-docs $$HOME/bin && \
25+
cd $$HOME && curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protoc-3.11.2-linux-x86_64.zip && \
26+
unzip protoc-3.11.2-linux-x86_64.zip -d protoc3 && \
27+
mv protoc3/bin/* $$HOME/bin/ && \
28+
chmod +x $$HOME/bin/protoc && \
29+
mv protoc3/include/* $$HOME/include
30+
1531
gen-docs:
16-
protoc --doc_out=../docs/api/ --doc_opt=../docs/assets/protoc-gen-doc-markdown.tmpl,proto.md feast/core/*.proto feast/serving/*.proto feast/storage/*.proto feast/types/*.proto;
32+
protoc --docs_out=../dist/grpc feast/*/*.proto || \
33+
$(MAKE) install-dependencies-docs && PATH=$$HOME/bin:$$PATH protoc -I $$HOME/include/ -I . --docs_out=../dist/grpc feast/*/*.proto

sdk/python/docs/html/.buildinfo

Lines changed: 0 additions & 4 deletions
This file was deleted.
-1.88 MB
Binary file not shown.
-169 KB
Binary file not shown.
-180 KB
Binary file not shown.

0 commit comments

Comments
 (0)