Skip to content

Commit

Permalink
refactor: remove docarray proto from tests and makedocs (#4200)
Browse files Browse the repository at this point in the history
* test: remove docarray proto

* docs: refactor make doc
  • Loading branch information
JoanFM committed Jan 20, 2022
1 parent 305f4c3 commit dde78e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
5 changes: 1 addition & 4 deletions docs/makedoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ set -ex
if [[ $1 == "local-only" ]]; then
rm -rf api && make clean

cp $(pwd)/../docarray/proto/docarray.proto $(pwd)/../jina/proto
cp $(pwd)/../jina/proto
docker run --rm \
-v $(pwd)/proto:/out \
-v $(pwd)/../jina/proto:/protos \
ghcr.io/jina-ai/protoc-gen-doc --doc_opt=markdown,docs.md

rm $(pwd)/../jina/proto/docarray.proto
make dirhtml
else
export NUM_RELEASES=${NUM_RELEASES:-10}
Expand Down Expand Up @@ -46,12 +45,10 @@ else
echo -e "Branches to whitelist: ${SMV_BRANCH_WHITELIST}"
echo -e "Tags to whitelist: ${SMV_TAG_WHITELIST}"

cp $(pwd)/../docarray/proto/docarray.proto $(pwd)/../jina/proto
docker run --rm \
-v $(pwd)/proto:/out \
-v $(pwd)/../jina/proto:/protos \
ghcr.io/jina-ai/protoc-gen-doc --doc_opt=markdown,docs.md
rm $(pwd)/../jina/proto/docarray.proto

sphinx-multiversion . ${BUILD_DIR} -b dirhtml
mv -v _build/dirhtml/${LATEST_JINA_VERSION}/* _build/dirhtml
Expand Down
13 changes: 2 additions & 11 deletions docs/proto/index.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
````{tip}
To update `docarray` Protobuf:
```bash
cd docarrat
docker run -v $(pwd)/proto:/jina/proto jinaai/protogen
```
To update `jina` Protobuf:

```bash
docker run -v $(pwd)/jina/:/jina/ -v $(pwd)/docarray/:/docarray/ jinaai/protogen
docker run -v $(pwd)/jina/:/jina/ jinaai/protogen
```

````
```{include} docs.md
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@

from jina import Flow
from jina.serve.runtimes.gateway.http.models import _to_camel_case
from docarray.proto import docarray_pb2
from jina import Document
from jina import helper
from jina import Executor, requests
from tests import validate_callback

cur_dir = os.path.dirname(os.path.abspath(__file__))

_document_fields = sorted(
set(
_to_camel_case(k)
for k in list(docarray_pb2.DocumentProto().DESCRIPTOR.fields_by_name)
)
)

# check if this can be bypassed
IGNORED_FIELDS = ['embedding', 'scores', 'graphInfo', 'evaluations']

Expand Down

0 comments on commit dde78e3

Please sign in to comment.