From e9e359d847cc5ac80689a0d438661f67ffe20106 Mon Sep 17 00:00:00 2001 From: del-zhenwu <56623710+del-zhenwu@users.noreply.github.com> Date: Sun, 12 Jul 2020 15:44:40 +0800 Subject: [PATCH] [0.10.1] update shards ci && enable pq case (#2804) * update cron on 0.10.1 Signed-off-by: zw * enable ivf_pq search cases on GPU Signed-off-by: zw * [skip ci] debug Signed-off-by: zw * [skip ci] add artifacts Signed-off-by: zw * update shards ci && enable pq case Signed-off-by: zw * update assertion for pq Signed-off-by: zw * disable rnsg: issue #2813 Signed-off-by: zw * add binary version in log file name Signed-off-by: zw Co-authored-by: zw --- ci/jenkins/step/shardsDevNightlyTest.groovy | 8 ++++++-- ci/jenkins/step/singleDevNightlyTest.groovy | 6 +++--- ci/jenkins/step/singleDevTest.groovy | 2 +- .../entity/test_get_entity_by_id.py | 1 - tests/milvus_python_test/entity/test_insert.py | 2 +- tests/milvus_python_test/entity/test_search.py | 18 ++++++------------ 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ci/jenkins/step/shardsDevNightlyTest.groovy b/ci/jenkins/step/shardsDevNightlyTest.groovy index 1cef5de2..906390fe 100644 --- a/ci/jenkins/step/shardsDevNightlyTest.groovy +++ b/ci/jenkins/step/shardsDevNightlyTest.groovy @@ -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 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} ." + 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 - && \ @@ -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" } } diff --git a/ci/jenkins/step/singleDevNightlyTest.groovy b/ci/jenkins/step/singleDevNightlyTest.groovy index 388f3349..a25066c7 100644 --- a/ci/jenkins/step/singleDevNightlyTest.groovy +++ b/ci/jenkins/step/singleDevNightlyTest.groovy @@ -27,7 +27,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" @@ -54,7 +54,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 >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_sqlite_http_dev_test.log" + 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" } } diff --git a/ci/jenkins/step/singleDevTest.groovy b/ci/jenkins/step/singleDevTest.groovy index 7a36f417..9f8f6625 100644 --- a/ci/jenkins/step/singleDevTest.groovy +++ b/ci/jenkins/step/singleDevTest.groovy @@ -26,7 +26,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}" } } diff --git a/tests/milvus_python_test/entity/test_get_entity_by_id.py b/tests/milvus_python_test/entity/test_get_entity_by_id.py index 16b6f15a..8ad429c5 100644 --- a/tests/milvus_python_test/entity/test_get_entity_by_id.py +++ b/tests/milvus_python_test/entity/test_get_entity_by_id.py @@ -194,7 +194,6 @@ class TestGetBase: status, res = connect.get_entity_by_id(collection_new, [1]) assert not status.OK() - @pytest.mark.timeout(60) def test_get_vector_by_id_multithreads(self, connect, collection): vectors = gen_vectors(nb, dim) status, ids = connect.insert(collection, vectors) diff --git a/tests/milvus_python_test/entity/test_insert.py b/tests/milvus_python_test/entity/test_insert.py index f8604500..ea30388b 100644 --- a/tests/milvus_python_test/entity/test_insert.py +++ b/tests/milvus_python_test/entity/test_insert.py @@ -14,7 +14,7 @@ index_file_size = 10 collection_id = "test_add" ADD_TIMEOUT = 60 tag = "1970-01-01" -add_interval_time = 1.5 +add_interval_time = 5 nb = 6000 diff --git a/tests/milvus_python_test/entity/test_search.py b/tests/milvus_python_test/entity/test_search.py index f0b03036..01e5b591 100644 --- a/tests/milvus_python_test/entity/test_search.py +++ b/tests/milvus_python_test/entity/test_search.py @@ -80,9 +80,6 @@ class TestSearchBase: 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( @@ -167,12 +164,9 @@ class TestSearchBase: 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) @@ -180,7 +174,8 @@ class TestSearchBase: 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() @@ -412,9 +407,8 @@ class TestSearchBase: 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]] @@ -424,7 +418,7 @@ class TestSearchBase: 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): ''' -- GitLab