-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adapt to v2.0.0 core #19
base: master
Are you sure you want to change the base?
Changes from all commits
bf1380a
f4d106b
662ab33
66694ea
15a7caa
358bd24
1c55126
d956551
e779c2c
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 |
---|---|---|
|
@@ -141,3 +141,7 @@ _logs/ | |
_rendered/ | ||
*instances.yaml | ||
nohup.out | ||
|
||
# cache | ||
enwiki-latest-abstract.xml | ||
wiki_dump.gz |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from jina import Flow, Document, DocumentArray | ||
|
||
f = Flow.load_config( | ||
'./local/index.yml' | ||
) | ||
|
||
d1 = Document(id=1, text='foo1 is foo fool full fu') | ||
d2 = Document(id=2, text='foo2 is foo fool full fu') | ||
d3 = Document(id=3, text='foo3 is foo fool full fu') | ||
|
||
|
||
def print_matches(req): # the callback function invoked when task is done | ||
for idx, d in enumerate(req.docs[0].matches[:3]): # print top-3 matches | ||
print(f'[{idx}]{d.score.value:2f}: "{d.text}"') | ||
|
||
|
||
with f: | ||
f.index(inputs=DocumentArray([d1, d2, d3])) | ||
|
||
with Flow.load_config( | ||
'./local/query.yml' | ||
) as f: | ||
f.search(inputs=d2, on_done=print_matches) |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,22 @@ | ||
jtype: Flow | ||
version: '1' | ||
with: | ||
rest_api: {{ JINA_GATEWAY_REST }} | ||
port_expose: {{ JINA_GATEWAY_PORT_EXPOSE }} | ||
workspace: $JINA_WORKDIR | ||
py_modules: | ||
- wiki_executors.py | ||
pods: | ||
- name: segmenter | ||
polling: any | ||
shards: {{ JINA_SEGMENTER_SHARDS }} | ||
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. why are we removing the sharding? Testing this as part of the stress test is one of the added values here I think? 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. same as above 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. Maybe I should convert this PR to a draft one. |
||
uses: segment.yml | ||
scheduling: {{ JINA_SCHEDULING }} | ||
read_only: true | ||
timeout_ready: 100000 | ||
uses: | ||
jtype: Segmenter | ||
- name: encoder | ||
polling: any | ||
scheduling: {{ JINA_SCHEDULING }} | ||
uses: encoder.yml | ||
shards: {{ JINA_ENCODER_SHARDS }} | ||
timeout_ready: 100000 | ||
read_only: true | ||
uses: | ||
jtype: TextEncoder | ||
- name: vec_idx | ||
polling: any | ||
scheduling: {{ JINA_SCHEDULING }} | ||
uses: annoy_indexer.yml | ||
shards: {{ JINA_VEC_INDEXER_SHARDS }} | ||
timeout_ready: 100000 | ||
uses: | ||
jtype: AnnoyIndexer | ||
- name: doc_idx | ||
polling: any | ||
scheduling: {{ JINA_SCHEDULING }} | ||
uses: doc.yml | ||
shards: {{ JINA_KV_INDEXER_SHARDS }} | ||
needs: gateway | ||
timeout_ready: 100000 | ||
uses: | ||
jtype: KeyValueIndexer | ||
needs: segmenter | ||
- name: join_all | ||
method: needs | ||
uses: _merge | ||
needs: [ doc_idx, vec_idx ] | ||
read_only: true | ||
timeout_ready: 100000 | ||
needs: [vec_idx, doc_idx] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,23 @@ | ||
jtype: Flow | ||
version: '1' | ||
with: | ||
read_only: true | ||
rest_api: {{ JINA_GATEWAY_REST }} | ||
port_expose: {{ JINA_GATEWAY_PORT_EXPOSE }} | ||
workspace: $JINA_WORKDIR | ||
py_modules: | ||
- wiki_executors.py | ||
pods: | ||
- name: segmenter | ||
polling: all | ||
shards: {{ JINA_SEGMENTER_SHARDS }} | ||
uses: segment.yml | ||
read_only: true | ||
uses: | ||
jtype: Segmenter | ||
- name: encoder | ||
polling: all | ||
scheduling: {{ JINA_SCHEDULING }} | ||
uses: encoder.yml | ||
shards: {{ JINA_ENCODER_SHARDS }} | ||
uses_after: chunk_merger.yml | ||
timeout_ready: -1 | ||
read_only: true | ||
uses: | ||
jtype: TextEncoder | ||
- name: vec_idx | ||
scheduling: {{ JINA_SCHEDULING }} | ||
uses: annoy_indexer.yml | ||
shards: {{ JINA_VEC_INDEXER_SHARDS }} | ||
polling: all | ||
uses_after: chunk_merger.yml | ||
timeout_ready: -1 | ||
- name: ranker | ||
polling: all | ||
shards: {{ JINA_RANKER_SHARDS }} | ||
uses: ranker.yml | ||
uses: | ||
jtype: AnnoyIndexer | ||
- name: doc_idx | ||
uses: doc.yml | ||
shards: {{ JINA_KV_INDEXER_SHARDS }} | ||
polling: all | ||
timeout_ready: 100000 | ||
uses: | ||
jtype: KeyValueIndexer | ||
- name: ranker | ||
uses: | ||
jtype: AggregateRanker | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
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.
Do we need this file in the PR? Looks like some local test to me which will not be used in the actual stress test? If you think its handy to have as some local test entry point, maybe generalize this and otherwise remove?
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.
@jacobowitz this will be removed after flow runs successfully, only for test purpose, shouldn't commit to the PR, good catch!
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.
thx for your review.
This PR is still in local progress.