Compare commits

...

5 Commits

Author SHA1 Message Date
Joan Fontanals Martinez 60725c5751 chore: update versions 2023-06-22 15:37:01 +02:00
Joan Fontanals Martinez f5ca09bd79 Merge branch 'check-with-prints' of https://github.com/jina-ai/vectordb into check-with-prints
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
2023-06-22 14:19:01 +02:00
Joan Fontanals Martinez f71ecf8e52 test: add timeout ready 2023-06-22 11:47:20 +02:00
Joan Fontanals 095e0cabdc
Merge branch 'main' into check-with-prints 2023-06-22 09:30:04 +02:00
Joan Fontanals Martinez fb5c5be5d6 test: test with prints 2023-06-22 09:24:53 +02:00
5 changed files with 17 additions and 21 deletions

View File

@ -92,9 +92,7 @@ jobs:
pip install pytest-timeout
pip install flaky
pip install .
#pip install -U docarray[hnswlib]>=0.33.0
pip install git+https://github.com/jina-ai/jina.git@help-investigate
pip install git+https://github.com/docarray/docarray.git@main
pip install -U docarray[hnswlib]>=0.34.0
- name: Test
id: test
run: |
@ -126,9 +124,7 @@ jobs:
pip install pytest-timeout
pip install flaky
pip install .
#pip install -U docarray[hnswlib]>=0.33.0
pip install git+https://github.com/jina-ai/jina.git@help-investigate
pip install git+https://github.com/docarray/docarray.git@main
pip install -U docarray[hnswlib]>=0.34.0
- name: Test
id: test
run: |

View File

@ -1,3 +1,3 @@
jina>=3.17.0
jina>=3.18.0
click
#docarray[hnswlib]>=0.33.0
#docarray[hnswlib]>=0.34.0

View File

@ -56,4 +56,4 @@ setup(
)
import subprocess
subprocess.run(['pip', 'install', 'docarray[hnswlib]>=0.33.0'])
subprocess.run(['pip', 'install', 'docarray[hnswlib]>=0.34.0'])

View File

@ -31,7 +31,7 @@ def test_hnswlib_vectordb_batch(docs_to_index, replicas, shards, protocol, tmpdi
query = docs_to_index[:10]
port = random_port()
with HNSWVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, protocol=protocol, port=port,
uses_with={'ef': 5000}) as db:
uses_with={'ef': 5000}, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -53,7 +53,7 @@ def test_hnswlib_vectordb_single_query(docs_to_index, limit, replicas, shards, p
query = docs_to_index[100]
port = random_port()
with HNSWVectorDB[MyDoc](ef=5000).serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -73,7 +73,7 @@ def test_hnswlib_vectordb_delete(docs_to_index, replicas, shards, protocol, tmpd
port = random_port()
delete = MyDoc(id=query.id, text='', embedding=np.random.rand(128))
with HNSWVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, protocol=protocol, port=port,
uses_with={'ef': 5000}) as db:
uses_with={'ef': 5000}, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -103,7 +103,7 @@ def test_hnswlib_vectordb_udpate_text(docs_to_index, replicas, shards, protocol,
port = random_port()
update = MyDoc(id=query.id, text=query.text + '_changed', embedding=query.embedding)
with HNSWVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, protocol=protocol, port=port,
uses_with={'ef': 5000}) as db:
uses_with={'ef': 5000}, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -132,7 +132,7 @@ def test_hnswlib_vectordb_restore(docs_to_index, replicas, shards, protocol, tmp
port = random_port()
with HNSWVectorDB[MyDoc](ef=5000).serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(docs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -145,7 +145,7 @@ def test_hnswlib_vectordb_restore(docs_to_index, replicas, shards, protocol, tmp
assert res.scores[0] < 0.001 # some precision issues, should be 0.0
with HNSWVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol, uses_with={'ef': 5000}) as new_db:
protocol=protocol, uses_with={'ef': 5000}, timeout_ready=10000) as new_db:
time.sleep(2)
resp = new_db.search(docs=query)
assert len(resp) == len(query)

View File

@ -31,7 +31,7 @@ def test_inmemory_vectordb_batch(docs_to_index, replicas, shards, protocol, tmpd
query = docs_to_index[:10]
port = random_port()
with InMemoryExactNNVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -53,7 +53,7 @@ def test_inmemory_vectordb_single_query(docs_to_index, limit, replicas, shards,
query = docs_to_index[100]
port = random_port()
with InMemoryExactNNVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -73,7 +73,7 @@ def test_inmemory_vectordb_delete(docs_to_index, replicas, shards, protocol, tmp
port = random_port()
delete = MyDoc(id=query.id, text='', embedding=np.random.rand(128))
with InMemoryExactNNVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -103,7 +103,7 @@ def test_inmemory_vectordb_udpate_text(docs_to_index, replicas, shards, protocol
port = random_port()
update = MyDoc(id=query.id, text=query.text + '_changed', embedding=query.embedding)
with InMemoryExactNNVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(inputs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -132,7 +132,7 @@ def test_inmemory_vectordb_restore(docs_to_index, replicas, shards, protocol, tm
port = random_port()
with InMemoryExactNNVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as db:
protocol=protocol, timeout_ready=10000) as db:
db.index(docs=docs_to_index)
if replicas > 1:
time.sleep(2)
@ -145,7 +145,7 @@ def test_inmemory_vectordb_restore(docs_to_index, replicas, shards, protocol, tm
assert res.scores[0] > 0.99 # some precision issues, should be 1
with InMemoryExactNNVectorDB[MyDoc].serve(workspace=str(tmpdir), replicas=replicas, shards=shards, port=port,
protocol=protocol) as new_db:
protocol=protocol, timeout_ready=10000) as new_db:
time.sleep(2)
resp = new_db.search(docs=query)
assert len(resp) == len(query)