Skip to content

Commit

Permalink
[0.10.1] update shards ci && enable pq case (#2804)
Browse files Browse the repository at this point in the history
* update cron on 0.10.1

Signed-off-by: zw <zw@milvus.io>

* enable ivf_pq <ip> search cases on GPU

Signed-off-by: zw <zw@milvus.io>

* [skip ci] debug

Signed-off-by: zw <zw@milvus.io>

* [skip ci] add artifacts

Signed-off-by: zw <zw@milvus.io>

* update shards ci && enable pq case

Signed-off-by: zw <zw@milvus.io>

* update assertion for pq

Signed-off-by: zw <zw@milvus.io>

* disable rnsg: issue #2813

Signed-off-by: zw <zw@milvus.io>

* add binary version in log file name

Signed-off-by: zw <zw@milvus.io>

Co-authored-by: zw <zw@milvus.io>
  • Loading branch information
2 people authored and JinHai-CN committed Jul 18, 2020
1 parent f80c592 commit b9380bc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
8 changes: 6 additions & 2 deletions ci/jenkins/step/shardsDevNightlyTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ timeout(time: 180, unit: 'MINUTES') {
retry(3) {
try {
dir ('charts/milvus') {
sh "helm install --wait --timeout 300s --set cluster.enabled=true --set persistence.enabled=true --set image.repository=registry.zilliz.com/milvus/engine --set mishards.image.tag=test --set image.tag=${DOCKER_VERSION} --set image.pullPolicy=Always --set service.type=ClusterIP -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml --namespace milvus ${env.SHARDS_HELM_RELEASE_NAME} ."
if ("${BINARY_VERSION}" == "CPU") {
sh "helm install --wait --timeout 300s --set cluster.enabled=true --set persistence.enabled=true --set image.repository=registry.zilliz.com/milvus/engine --set mishards.image.tag=test --set mishards.image.pullPolicy=Always --set image.tag=${DOCKER_VERSION} --set image.pullPolicy=Always --set service.type=ClusterIP -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml --namespace milvus ${env.SHARDS_HELM_RELEASE_NAME} ."
} else {
sh "helm install --wait --timeout 300s --set cluster.enabled=true --set persistence.enabled=true --set image.repository=registry.zilliz.com/milvus/engine --set mishards.image.tag=test --set mishards.image.pullPolicy=Always --set gpu.enabled=true --set image.tag=${DOCKER_VERSION} --set image.pullPolicy=Always --set service.type=ClusterIP -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml --namespace milvus ${env.SHARDS_HELM_RELEASE_NAME} ."
}
}
} catch (exc) {
def helmStatusCMD = "helm get manifest --namespace milvus ${env.SHARDS_HELM_RELEASE_NAME} | kubectl describe -n milvus -f - && \
Expand All @@ -26,6 +30,6 @@ timeout(time: 180, unit: 'MINUTES') {

dir ("tests/milvus_python_test") {
sh 'python3 -m pip install -r requirements.txt'
sh "pytest . --level=2 --alluredir=\"test_out/dev/shards/\" --ip ${env.SHARDS_HELM_RELEASE_NAME}.milvus.svc.cluster.local >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_shards_dev_test.log"
sh "pytest . --level=2 --alluredir=\"test_out/dev/shards/\" --ip ${env.SHARDS_HELM_RELEASE_NAME}.milvus.svc.cluster.local >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_${BINARY_VERSION}_shards_dev_test.log"
}
}
6 changes: 3 additions & 3 deletions ci/jenkins/step/singleDevNightlyTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ timeout(time: 180, unit: 'MINUTES') {
dir ("tests/milvus_python_test") {
// sh 'python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com'
sh 'python3 -m pip install -r requirements.txt'
sh "pytest . --level=2 --alluredir=\"test_out/dev/single/mysql\" --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_mysql_dev_test.log"
sh "pytest . --level=2 --alluredir=\"test_out/dev/single/mysql\" --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_${BINARY_VERSION}_mysql_dev_test.log"
}
// sqlite database backend test
load "ci/jenkins/step/cleanupSingleDev.groovy"
Expand All @@ -52,7 +52,7 @@ timeout(time: 180, unit: 'MINUTES') {
}
}
dir ("tests/milvus_python_test") {
sh "pytest . --level=2 --alluredir=\"test_out/dev/single/sqlite\" --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_sqlite_dev_test.log"
sh "pytest . --level=1 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --port=19121 --handler=HTTP"
sh "pytest . --level=2 --alluredir=\"test_out/dev/single/sqlite\" --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_${BINARY_VERSION}_sqlite_dev_test.log"
sh "pytest . --level=1 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --port=19121 --handler=HTTP >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_${BINARY_VERSION}_sqlite_http_dev_test.log"
}
}
2 changes: 1 addition & 1 deletion ci/jenkins/step/singleDevTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ timeout(time: 120, unit: 'MINUTES') {
dir ("tests/milvus_python_test") {
// sh 'python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com'
sh 'python3 -m pip install -r requirements.txt'
sh "pytest . --alluredir=\"test_out/dev/single/mysql\" --level=1 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --service ${env.HELM_RELEASE_NAME} >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_mysql_dev_test.log"
sh "pytest . --alluredir=\"test_out/dev/single/mysql\" --level=1 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --service ${env.HELM_RELEASE_NAME} >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_${BINARY_VERSION}_mysql_dev_test.log"
// sh "pytest test_restart.py --alluredir=\"test_out/dev/single/mysql\" --level=3 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --service ${env.HELM_RELEASE_NAME}"
}
}
2 changes: 1 addition & 1 deletion tests/milvus_python_test/entity/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
collection_id = "test_add"
ADD_TIMEOUT = 60
tag = "1970-01-01"
add_interval_time = 5
add_interval_time = 5
nb = 6000


Expand Down
18 changes: 6 additions & 12 deletions tests/milvus_python_test/entity/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ def get_index(self, request, connect):
if str(connect._cmd("mode")[1]) == "CPU":
if request.param["index_type"] == IndexType.IVF_SQ8H:
pytest.skip("sq8h not support in CPU mode")
if str(connect._cmd("mode")[1]) == "GPU":
if request.param["index_type"] == IndexType.IVF_PQ:
pytest.skip("ivfpq not support in GPU mode")
return request.param

@pytest.fixture(
Expand Down Expand Up @@ -167,20 +164,18 @@ def test_search_l2_index_params(self, connect, collection, get_simple_index):
index_param = get_simple_index["index_param"]
index_type = get_simple_index["index_type"]
logging.getLogger().info(get_simple_index)
if index_type == IndexType.IVF_PQ:
pytest.skip("Skip PQ")

vectors, ids = self.init_data(connect, collection)
status = connect.create_index(collection, index_type, index_param)
query_vec = [vectors[0]]
query_vec = [vectors[0], vectors[1]]
search_param = get_search_param(index_type)
status, result = connect.search(collection, top_k, query_vec, params=search_param)
logging.getLogger().info(result)
if top_k <= 1024:
assert status.OK()
assert len(result[0]) == min(len(vectors), top_k)
assert check_result(result[0], ids[0])
assert result[0][0].distance <= epsilon
assert result[0][0].distance < result[0][1].distance
assert result[1][0].distance < result[1][1].distance
else:
assert not status.OK()

Expand Down Expand Up @@ -412,9 +407,8 @@ def test_search_ip_index_params(self, connect, ip_collection, get_simple_index):
index_param = get_simple_index["index_param"]
index_type = get_simple_index["index_type"]
logging.getLogger().info(get_simple_index)
if index_type in [IndexType.RNSG, IndexType.IVF_PQ]:
pytest.skip("rnsg not support in ip, skip pq")

if index_type in [IndexType.RNSG]:
pytest.skip("rnsg not support in ip")
vectors, ids = self.init_data(connect, ip_collection)
status = connect.create_index(ip_collection, index_type, index_param)
query_vec = [vectors[0]]
Expand All @@ -424,7 +418,7 @@ def test_search_ip_index_params(self, connect, ip_collection, get_simple_index):
assert status.OK()
assert len(result[0]) == min(len(vectors), top_k)
assert check_result(result[0], ids[0])
assert result[0][0].distance >= 1 - gen_inaccuracy(result[0][0].distance)
assert result[0][0].distance >= result[0][1].distance

def test_search_ip_large_nq_index_params(self, connect, ip_collection, get_simple_index):
'''
Expand Down

0 comments on commit b9380bc

Please sign in to comment.