Skip to content

Commit

Permalink
Fix: cannot find the latest amd image tag (#692)
Browse files Browse the repository at this point in the history
/kind improvement
- fix: cannot get latest amd54 image tag
- fix: NewANNSearchRequest miss expr param
- fix: case error mag

Signed-off-by: ThreadDao <[email protected]>
  • Loading branch information
ThreadDao authored Apr 2, 2024
1 parent f2735a1 commit 7d66951
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/nightly_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
id: extracter
working-directory: ci/scripts
run: |
echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)"

- name: Create cluster
Expand Down Expand Up @@ -94,7 +96,9 @@ jobs:
id: extracter
working-directory: ci/scripts
run: |
echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)"

- name: Create cluster
Expand Down Expand Up @@ -152,7 +156,9 @@ jobs:
id: extracter
working-directory: ci/scripts
run: |
echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)"

- name: Create cluster
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
shell: bash
working-directory: ci/scripts
run: |
echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# export IMAGE_TAG=$IMAGE_TAG
# export IMAGE_REPO=$IMAGE_REPO
# export RELEASE_NAME=$RELEASE_NAME
Expand Down
3 changes: 2 additions & 1 deletion client/ann_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ type ANNSearchRequest struct {
limit int
}

func NewANNSearchRequest(fieldName string, metricsType entity.MetricType, vectors []entity.Vector, searchParam entity.SearchParam, limit int, options ...SearchQueryOptionFunc) *ANNSearchRequest {
func NewANNSearchRequest(fieldName string, metricsType entity.MetricType, expr string, vectors []entity.Vector, searchParam entity.SearchParam, limit int, options ...SearchQueryOptionFunc) *ANNSearchRequest {
return &ANNSearchRequest{
fieldName: fieldName,
vectors: vectors,
metricType: metricsType,
expr: expr,
searchParam: searchParam,
limit: limit,
options: options,
Expand Down
7 changes: 3 additions & 4 deletions test/testcases/groupby_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func TestSearchGroupByBinaryDefault(t *testing.T) {
for _, groupByField := range supportedGroupByFields {
_, err := mc.Search(ctx, collName, []string{}, "", []string{common.DefaultVarcharFieldName, groupByField}, queryVec,
common.DefaultBinaryVecFieldName, metricType, common.DefaultTopK, sp, client.WithGroupByField(groupByField))
common.CheckErr(t, err, false, "Unsupported dataType for chunk brute force iterator:VECTOR_BINARY")
common.CheckErr(t, err, false, "not support search_group_by operation based on binary vector column")
}
}
}
Expand Down Expand Up @@ -237,7 +237,7 @@ func TestSearchGroupByBinaryGrowing(t *testing.T) {
_, err := mc.Search(ctx, collName, []string{}, "", []string{common.DefaultVarcharFieldName,
groupByField}, queryVec, common.DefaultBinaryVecFieldName, metricType, common.DefaultTopK, sp,
client.WithGroupByField(groupByField), client.WithSearchQueryConsistencyLevel(entity.ClStrong))
common.CheckErr(t, err, false, "Unsupported dataType for chunk brute force iterator:VECTOR_BINARY")
common.CheckErr(t, err, false, "not support search_group_by operation based on binary vector column")
}
}
}
Expand Down Expand Up @@ -335,8 +335,7 @@ func TestSearchGroupByUnsupportedIndex(t *testing.T) {
_, err := mc.Search(ctx, collName, []string{}, "", []string{common.DefaultIntFieldName, common.DefaultVarcharFieldName},
queryVec, common.DefaultFloatVecFieldName, entity.MetricType(idx.Params()["metrics_type"]),
common.DefaultTopK, sp, client.WithGroupByField(common.DefaultVarcharFieldName))
common.CheckErr(t, err, false, "trying to groupBy on unsupported index type will fail, "+
"currently only support ivf-flat, ivf_cc and HNSW")
common.CheckErr(t, err, false, "doesn't support search_group_by")
}
}

Expand Down
10 changes: 5 additions & 5 deletions test/testcases/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestCreateIndexJsonField(t *testing.T) {
// create vector index on json field
idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96)
err := mc.CreateIndex(ctx, collName, common.DefaultJSONFieldName, idx, false, client.WithIndexName("json_index"))
common.CheckErr(t, err, false, "create index on JSON field is not supported")
common.CheckErr(t, err, false, "only support float vector or binary vector")

// create scalar index on json field
//err = mc.CreateIndex(ctx, collName, common.DefaultJSONFieldName, entity.NewScalarIndex(), false, client.WithIndexName("json_index"))
Expand Down Expand Up @@ -194,10 +194,10 @@ func TestCreateIndexArrayField(t *testing.T) {
if field.DataType == entity.FieldTypeArray {
// create scalar index
err := mc.CreateIndex(ctx, collName, field.Name, scalarIdx, false, client.WithIndexName("scalar_index"))
common.CheckErr(t, err, false, "create index on Array field is not supported: invalid parameter")
common.CheckErr(t, err, false, "create auto index on Array field is not supported")
// create vector index
err1 := mc.CreateIndex(ctx, collName, field.Name, vectorIdx, false, client.WithIndexName("vector_index"))
common.CheckErr(t, err1, false, "create index on Array field is not supported: invalid parameter")
common.CheckErr(t, err1, false, "float or float16 or bfloat16 vector are only supported")
}
}
}
Expand Down Expand Up @@ -390,12 +390,12 @@ func TestCreateIndexNotSupportedField(t *testing.T) {
// create index
idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96)
err := mc.CreateIndex(ctx, collName, common.DefaultFloatFieldName, idx, false)
common.CheckErr(t, err, false, "index type not match")
common.CheckErr(t, err, false, "only support float vector or binary vector")

// create scann index
indexScann, _ := entity.NewIndexSCANN(entity.L2, 8, true)
err = mc.CreateIndex(ctx, collName, common.DefaultFloatFieldName, indexScann, false)
common.CheckErr(t, err, false, "index type not match")
common.CheckErr(t, err, false, "float or float16 or bfloat16 vector are only supported")
}

// test create index with invalid params
Expand Down
4 changes: 2 additions & 2 deletions test/testcases/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,6 @@ func TestSearchInvalidVectorField(t *testing.T) {
}

// test search with invalid vectors
// TODO Issue https://github.com/milvus-io/milvus-sdk-go/issues/377
func TestSearchInvalidVectors(t *testing.T) {
t.Parallel()
ctx := createContext(t, time.Second*common.DefaultTimeout*2)
Expand All @@ -628,7 +627,7 @@ func TestSearchInvalidVectors(t *testing.T) {
{vectors: common.GenSearchVectors(common.DefaultNq, 64, entity.FieldTypeFloatVector), errMsg: "vector dimension mismatch"},

// vector type not match
{vectors: common.GenSearchVectors(common.DefaultNq, common.DefaultDim, entity.FieldTypeBinaryVector), errMsg: "vector dimension mismatch"},
{vectors: common.GenSearchVectors(common.DefaultNq, common.DefaultDim, entity.FieldTypeBinaryVector), errMsg: "vector type must be the same"},

// empty vectors
{vectors: []entity.Vector{}, errMsg: "nq [0] is invalid"},
Expand Down Expand Up @@ -1375,6 +1374,7 @@ func TestRangeSearchScannIPCosine(t *testing.T) {

// test range search with scann index and entity.HAMMING, entity.JACCARD metric type
func TestRangeSearchScannBinary(t *testing.T) {
t.Skip("https://github.com/milvus-io/milvus-sdk-go/issues/693")
t.Parallel()
for _, metricType := range common.SupportBinIvfFlatMetricType {
ctx := createContext(t, time.Second*common.DefaultTimeout)
Expand Down

0 comments on commit 7d66951

Please sign in to comment.