diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 70fce61..3548177 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -14,11 +14,17 @@ on: version: description: 'Version to build and deploy' required: false - + is_release: + description: 'Is this a release build?' + required: false + default: false + type: boolean + env: REPO: 'artifact.aerospike.io/ecosystem-container-dev-local' JFROG_CLI_BUILD_NAME: 'asvec' - + JFROG_CLI_LOG_LEVEL: DEBUG + JFROG_CLI_BUILD_PROJECT: 'ecosystem' jobs: build-and-push: runs-on: ubuntu-latest @@ -43,9 +49,6 @@ jobs: - name: Login to Artifact Aerospike Docker Registry run: | jf docker login artifact.aerospike.io --username ${{ secrets.JFROG_USERNAME }} --password ${{ secrets.JFROG_ACCESS_TOKEN }} - # needed these to get the docker cache working - docker pull artifact.aerospike.io/ecosystem-container-dev-local/asvec:latest || true - docker push artifact.aerospike.io/ecosystem-container-dev-local/asvec:latest || true env: JFROG_CLI_OFFER_CONFIG: 'false' @@ -63,27 +66,41 @@ jobs: - name: Set Version run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then - VERSION_ARG="${{ github.event.inputs.version }}" - elif [ "${{ github.event_name }}" == "push" ] && [[ "${{ github.ref }}" == refs/tags/* ]]; then - VERSION_ARG="${GITHUB_REF#refs/tags/}" + # Initialize variables + VERSION_ARG="" + VERSION="" + IS_RELEASE="${{ github.event.inputs.is_release }}" + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + # On tag push: Use the tag name as the version + VERSION="${GITHUB_REF#refs/tags/}" + elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + # On manual trigger + if [ -n "${{ github.event.inputs.version }}" ]; then + VERSION_ARG="${{ github.event.inputs.version }}" + else + # If no version input provided, default to RELEASE file + VERSION_ARG=$(cat RELEASE) + fi + + if [ "${IS_RELEASE}" == 'true' ]; then + # If release checkbox is checked, use version directly + VERSION="${VERSION_ARG}" + else + # If not release, append build ID + VERSION="${VERSION_ARG}-${GITHUB_RUN_NUMBER}" + fi else + # In all other cases: Use RELEASE file content appended with build ID VERSION_ARG=$(cat RELEASE) + VERSION="${VERSION_ARG}-${GITHUB_RUN_NUMBER}" fi - BUILD_ID=${GITHUB_RUN_NUMBER} - if [[ "${{ github.ref }}" == refs/tags/* ]]; then - VERSION="${VERSION_ARG}" - else - VERSION="${VERSION_ARG}-${BUILD_ID}" - fi + echo "VERSION=${VERSION}" >> $GITHUB_ENV - - name: Build Docker Image (No Push) if: github.event_name == 'pull_request' run: | jf docker buildx bake \ - --set asvec.args.VERSION_ARG=${{ env.VERSION }} \ - --set asvec.args.REPO=${{ env.REPO }} \ --set asvec.tags.0=asvec:test-${{ github.run_id }} \ --file docker/asvec.docker/bake.hcl \ @@ -91,54 +108,101 @@ jobs: DOCKER_BUILDKIT: '1' - name: Build and Push Docker Image - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) run: | jf docker buildx bake \ - --set asvec.args.VERSION_ARG=${{ env.VERSION }} \ - --set asvec.args.REPO=${{ env.REPO }} \ - --set asvec.tags.0=${{ env.REPO }}/asvec:${{ env.VERSION }} \ + --set asvec.tags=${{ env.REPO }}/asvec:${{ env.VERSION }} \ --file docker/asvec.docker/bake.hcl \ --push \ --metadata-file=build-metadata + env: DOCKER_BUILDKIT: '1' - - name: Build and Push Docker Image with 'latest' Tag (Release) - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - run: | - jf docker buildx bake \ - --set asvec.args.VERSION_ARG=${{ env.VERSION }} \ - --set asvec.args.REPO=${{ env.REPO }} \ - --set asvec.tags.0=${{ env.REPO }}/asvec:${{ env.VERSION }} \ - --set asvec.tags.1=${{ env.REPO }}/asvec:latest \ - --file docker/asvec.docker/bake.hcl \ - --push \ - --metadata-file=build-metadata - env: - DOCKER_BUILDKIT: '1' - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq - name: Extract Image Name and Digest - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))) run: | - jq -r '.[] | {digest: .["containerimage.digest"], names: .["image.name"] | split(",")} | "\(.names[0])@\(.digest)"' build-metadata > meta-info + jq -r '.[] | {digest: .["containerimage.digest"], names: .["image.name"] | split(",")} | "(.digest)"' build-metadata > sha + echo ${{ env.REPO }}/asvec:${{ env.VERSION }}@$(cat sha) > meta-info + echo ${{ env.REPO }}/asvec:${{ env.VERSION }}@$(cat sha) > meta-info-latest - name: Create Docker Build Info - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) - + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))) run: | + jf rt build-docker-create \ - --build-name "${{ env.JFROG_CLI_BUILD_NAME }}" \ + --build-name "${{ env.JFROG_CLI_BUILD_NAME }}-container" \ --build-number "${{ env.VERSION }}" \ --image-file ./meta-info \ --project ecosystem \ ecosystem-container-dev-local + - name: Publish Build Info - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))) run: | + export JFROG_CLI_LOG_LEVEL=DEBUG + jf rt build-collect-env --project ecosystem "${{ env.JFROG_CLI_BUILD_NAME }}-container" "${{ env.VERSION }}" + jf rt build-add-git --project ecosystem "${{ env.JFROG_CLI_BUILD_NAME }}-container" "${{ env.VERSION }}" + jf rt build-publish \ --detailed-summary \ --project ecosystem \ - "${{ env.JFROG_CLI_BUILD_NAME }}" "${{ env.VERSION }}" + "${{ env.JFROG_CLI_BUILD_NAME }}-container" "${{ env.VERSION }}" + + +# All of the following steps are commented out because they are just to handle "latest" tag and it is typically not desired in a release bundle + # - name: Tag a release with latest (Release) + # if: github.event_name == 'workflow_dispatch' && github.event.inputs.is_release == 'true' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + # run: | + # jf docker buildx imagetools create --tag ${{ env.REPO }}/asvec:latest ${{ env.REPO }}/asvec:${{ env.VERSION }} + # env: + # DOCKER_BUILDKIT: '1' + + # - name: Create Docker Build Info for latest + # if: github.event_name == 'workflow_dispatch' && github.event.inputs.is_release == 'true' || (github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/'))) + # run: | + + # jf rt build-docker-create \ + # --build-name "${{ env.JFROG_CLI_BUILD_NAME }}-container-latest" \ + # --build-number "${{ env.VERSION }}" \ + # --image-file ./meta-info \ + # --project ecosystem \ + # ecosystem-container-dev-local + + # - name: Publish Build Info for latest + # if: github.event_name == 'workflow_dispatch' && github.event.inputs.is_release == 'true' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + # run: | + # jfrog rt build-collect-env "${{ env.JFROG_CLI_BUILD_NAME }}-container-latest" "${{ env.VERSION }}" + # jfrog rt build-add-git "${{ env.JFROG_CLI_BUILD_NAME }}-container-latest" "${{ env.VERSION }}" + # jfrog rt build-add-dependencies "${{ env.JFROG_CLI_BUILD_NAME }}-container-latest" "${{ env.VERSION }}". + # jf rt build-publish \ + # --detailed-summary \ + # --project ecosystem \ + # "${{ env.JFROG_CLI_BUILD_NAME }}-container-latest" "${{ env.VERSION }}" + + - name: Create Release Bundle + if: github.event_name == 'workflow_dispatch' && github.event.inputs.is_release == 'true'|| (github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/'))) + run: | + echo '{ + + "name": "${{ env.JFROG_CLI_BUILD_NAME }}", + "version": "${{ env.VERSION }}", + "description": "Release bundle for ${{github.repository}} version ${{ env.VERSION }}", + "files": [ + { + "project": "ecosystem", + "build": "${{ env.JFROG_CLI_BUILD_NAME }}-container" + } + ] + }' > release-bundle-spec.json + cat release-bundle-spec.json + + jf release-bundle-create \ + "${{ env.JFROG_CLI_BUILD_NAME }}" "${{ env.VERSION }}"\ + --project ecosystem \ + --spec release-bundle-spec.json \ + --signing-key aerospike --sync \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0ed766b..4af058b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ VERSION.md build-metadata bin/asvec-linux-amd64 docker/asvec.docker/meta-info +meta-info diff --git a/RELEASE b/RELEASE index 35491ec..fd2a018 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -0.1.0-pre \ No newline at end of file +3.1.0 diff --git a/cmd/writers/nodeList.go b/cmd/writers/nodeList.go index ad9e508..205b076 100644 --- a/cmd/writers/nodeList.go +++ b/cmd/writers/nodeList.go @@ -27,7 +27,17 @@ func NewNodeTableWriter(writer io.Writer, isLB bool, logger *slog.Logger) *NodeT t := NodeTableWriter{NewDefaultWriter(writer), isLB, logger} t.table.SetTitle("Nodes") - t.table.AppendHeader(table.Row{"Node", "Endpoint", "Cluster ID", "Version", "Visible Nodes"}, rowConfigAutoMerge) + t.table.AppendHeader( + table.Row{ + "Node", + "Roles", + "Endpoint", + "Cluster ID", + "Version", + "Visible Nodes", + }, + rowConfigAutoMerge, + ) t.table.SetAutoIndex(true) t.table.SortBy([]table.SortBy{ {Name: "Node", Mode: table.Asc}, @@ -59,6 +69,13 @@ func (itw *NodeTableWriter) AppendNodeRow(node *NodeInfo) { row = append(row, id) } + // If the node is a load balancer, it does not have roles. + if !itw.isLB { + row = append(row, formatRoles(node.About.GetRoles())) + } else { + row = append(row, "N/A") + } + row = append(row, formatEndpoint(node.ConnectedEndpoint)) if node.State != nil { diff --git a/cmd/writers/utils.go b/cmd/writers/utils.go index a04c520..f422595 100644 --- a/cmd/writers/utils.go +++ b/cmd/writers/utils.go @@ -53,6 +53,20 @@ func formatEndpoints(nodeID uint64, nodeEndpoints map[uint64]*protos.ServerEndpo return strings.Join(nodeToEndpointsStr, "\n") } +func formatRoles(roles []protos.NodeRole) []string { + formattedRoles := []string{} + + for _, role := range roles { + formattedRoles = append(formattedRoles, formatRole(role)) + } + + return formattedRoles +} + +func formatRole(role protos.NodeRole) string { + return role.String() +} + func renderTable(t table.Writer, format int) string { if format == 0 { return t.Render() diff --git a/cmd/writers/utils_test.go b/cmd/writers/utils_test.go new file mode 100644 index 0000000..5f3203a --- /dev/null +++ b/cmd/writers/utils_test.go @@ -0,0 +1,87 @@ +package writers + +import ( + "reflect" + "testing" + + "github.com/aerospike/avs-client-go/protos" +) + +func Test_formatRole(t *testing.T) { + type args struct { + role protos.NodeRole + } + tests := []struct { + name string + args args + want string + }{ + { + name: "TestRolePrimary", + args: args{role: protos.NodeRole_INDEX_QUERY}, + want: "INDEX_QUERY", + }, + { + name: "TestRoleSecondary", + args: args{role: protos.NodeRole_INDEX_UPDATE}, + want: "INDEX_UPDATE", + }, + { + name: "TestRoleUnknown", + args: args{role: protos.NodeRole_KV_READ}, + want: "KV_READ", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := formatRole(tt.args.role); got != tt.want { + t.Errorf("formatRole() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_formatRoles(t *testing.T) { + type args struct { + roles []protos.NodeRole + } + tests := []struct { + name string + args args + want []string + }{ + { + name: "TestMultipleRoles", + args: args{ + roles: []protos.NodeRole{ + protos.NodeRole_INDEX_QUERY, + protos.NodeRole_INDEX_UPDATE, + protos.NodeRole_KV_READ, + }, + }, + want: []string{"INDEX_QUERY", "INDEX_UPDATE", "KV_READ"}, + }, + { + name: "TestSingleRole", + args: args{roles: []protos.NodeRole{protos.NodeRole_INDEX_QUERY}}, + want: []string{"INDEX_QUERY"}, + }, + { + name: "TestNoRoles", + args: args{roles: []protos.NodeRole{}}, + want: []string{}, + }, + { + name: "TestNilRoles", + args: args{roles: nil}, + want: []string{}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := formatRoles(tt.args.roles); !reflect.DeepEqual(got, tt.want) { + t.Errorf("formatRoles() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/docker/asvec.docker/bake.hcl b/docker/asvec.docker/bake.hcl index 2d39639..e20ac8b 100644 --- a/docker/asvec.docker/bake.hcl +++ b/docker/asvec.docker/bake.hcl @@ -1,10 +1,3 @@ -variable "VERSION_ARG" { - default = "0.0.0" -} - -variable "REPO" { - default = "artifact.aerospike.io/ecosystem-container-dev-local" -} group "default" { targets = ["asvec"] @@ -15,10 +8,5 @@ target "asvec" { dockerfile = "./Dockerfile" platforms = ["linux/amd64", "linux/arm64"] tags = [ - "${REPO}/asvec:${VERSION_ARG}", - "${REPO}/asvec:latest", ] - args = { - VERSION = "${VERSION_ARG}" - } } diff --git a/docker/auth/docker-compose.yml b/docker/auth/docker-compose.yml index c8efb33..fd58507 100644 --- a/docker/auth/docker-compose.yml +++ b/docker/auth/docker-compose.yml @@ -16,7 +16,7 @@ services: timeout: 20s retries: 20 avs: - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 depends_on: aerospike: condition: service_healthy diff --git a/docker/mtls/docker-compose.yml b/docker/mtls/docker-compose.yml index c8efb33..fd58507 100644 --- a/docker/mtls/docker-compose.yml +++ b/docker/mtls/docker-compose.yml @@ -16,7 +16,7 @@ services: timeout: 20s retries: 20 avs: - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 depends_on: aerospike: condition: service_healthy diff --git a/docker/multi-node-LB/docker-compose.yml b/docker/multi-node-LB/docker-compose.yml index c897842..5eee5dd 100644 --- a/docker/multi-node-LB/docker-compose.yml +++ b/docker/multi-node-LB/docker-compose.yml @@ -5,7 +5,9 @@ services: # - "3000:3000" volumes: - ./config/aerospike.conf:/opt/aerospike/etc/aerospike/aerospike.conf - - ./config/features.conf:/opt/aerospike/etc/aerospike/features.conf + - type: bind + source: ./config/features.conf + target: /opt/aerospike/etc/aerospike/features.conf command: - "--config-file" - "/opt/aerospike/etc/aerospike/aerospike.conf" @@ -20,10 +22,12 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 volumes: - ./config/aerospike-vector-search-1.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml - - ./config/features.conf:/etc/aerospike-vector-search/features.conf + - type: bind + source: ./config/features.conf + target: /etc/aerospike-vector-search/features.conf healthcheck: test: ["CMD", "curl", "-f", "http://avs-1:5040/manage/rest/v1"] interval: 1s @@ -35,10 +39,12 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 volumes: - ./config/aerospike-vector-search-2.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml - - ./config/features.conf:/etc/aerospike-vector-search/features.conf + - type: bind + source: ./config/features.conf + target: /etc/aerospike-vector-search/features.conf healthcheck: test: ["CMD", "curl", "-f", "http://avs-2:5040/manage/rest/v1"] interval: 1s @@ -50,10 +56,12 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 volumes: - ./config/aerospike-vector-search-3.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml - - ./config/features.conf:/etc/aerospike-vector-search/features.conf + - type: bind + source: ./config/features.conf + target: /etc/aerospike-vector-search/features.conf healthcheck: test: ["CMD", "curl", "-f", "http://avs-3:5040/manage/rest/v1"] interval: 1s diff --git a/docker/multi-node-client-visibility-err/docker-compose.yml b/docker/multi-node-client-visibility-err/docker-compose.yml index e75fc92..c7d7bef 100644 --- a/docker/multi-node-client-visibility-err/docker-compose.yml +++ b/docker/multi-node-client-visibility-err/docker-compose.yml @@ -20,7 +20,7 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 ports: - "10000:10000" volumes: @@ -37,7 +37,7 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 ports: - "10001:10001" volumes: @@ -54,7 +54,7 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 # ports: # - "10002:10002" # This causes the visibility err volumes: diff --git a/docker/multi-node/config/aerospike-vector-search-1.yml b/docker/multi-node/config/aerospike-vector-search-1.yml index b7d34be..4841a8c 100644 --- a/docker/multi-node/config/aerospike-vector-search-1.yml +++ b/docker/multi-node/config/aerospike-vector-search-1.yml @@ -6,6 +6,9 @@ cluster: # Unique identifier for this cluster. cluster-name: multi-node-avs + node-roles: + - INDEX_QUERY + # The Proximus service listening ports, TLS and network interface. service: ports: diff --git a/docker/multi-node/docker-compose.yml b/docker/multi-node/docker-compose.yml index 72c4dec..a3d3de8 100644 --- a/docker/multi-node/docker-compose.yml +++ b/docker/multi-node/docker-compose.yml @@ -5,7 +5,9 @@ services: # - "3000:3000" volumes: - ./config/aerospike.conf:/opt/aerospike/etc/aerospike/aerospike.conf - - ./config/features.conf:/opt/aerospike/etc/aerospike/features.conf + - type: bind + source: ./config/features.conf + target: /opt/aerospike/etc/aerospike/features.conf command: - "--config-file" - "/opt/aerospike/etc/aerospike/aerospike.conf" @@ -20,12 +22,14 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 ports: - "10000:10000" volumes: - ./config/aerospike-vector-search-1.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml - - ./config/features.conf:/etc/aerospike-vector-search/features.conf + - type: bind + source: ./config/features.conf + target: /etc/aerospike-vector-search/features.conf healthcheck: test: ["CMD", "curl", "-f", "http://avs-1:5040/manage/rest/v1"] interval: 5s @@ -37,12 +41,14 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 ports: - "10001:10001" volumes: - ./config/aerospike-vector-search-2.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml - - ./config/features.conf:/etc/aerospike-vector-search/features.conf + - type: bind + source: ./config/features.conf + target: /etc/aerospike-vector-search/features.conf healthcheck: test: ["CMD", "curl", "-f", "http://avs-2:5040/manage/rest/v1"] interval: 5s @@ -54,12 +60,14 @@ services: depends_on: aerospike: condition: service_healthy - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 ports: - "10002:10002" volumes: - ./config/aerospike-vector-search-3.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml - - ./config/features.conf:/etc/aerospike-vector-search/features.conf + - type: bind + source: ./config/features.conf + target: /etc/aerospike-vector-search/features.conf healthcheck: test: ["CMD", "curl", "-f", "http://avs-3:5040/manage/rest/v1"] interval: 5s diff --git a/docker/tls/docker-compose.yml b/docker/tls/docker-compose.yml index c8efb33..fd58507 100644 --- a/docker/tls/docker-compose.yml +++ b/docker/tls/docker-compose.yml @@ -16,7 +16,7 @@ services: timeout: 20s retries: 20 avs: - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 depends_on: aerospike: condition: service_healthy diff --git a/docker/vanilla/docker-compose.yml b/docker/vanilla/docker-compose.yml index c8efb33..fd58507 100644 --- a/docker/vanilla/docker-compose.yml +++ b/docker/vanilla/docker-compose.yml @@ -16,7 +16,7 @@ services: timeout: 20s retries: 20 avs: - image: aerospike/aerospike-vector-search:0.11.1 + image: aerospike/aerospike-vector-search:1.0.0 depends_on: aerospike: condition: service_healthy diff --git a/e2e_multi_node_LB_test.go b/e2e_multi_node_LB_test.go index 1eb12fb..e306dd1 100644 --- a/e2e_multi_node_LB_test.go +++ b/e2e_multi_node_LB_test.go @@ -60,8 +60,8 @@ func (suite *MultiNodeLBCmdTestSuite) TestNodeListCmd() { fmt.Sprintf("node ls --format 1 --no-color --seeds %s", suite.AvsHostPort.String()), true, `Nodes -,Node,Endpoint,Cluster ID,Version,Visible Nodes -1,Seed,localhost:10000,,,"{ +,Node,Roles,Endpoint,Cluster ID,Version,Visible Nodes +1,Seed,[INDEX_QUERY INDEX_UPDATE],localhost:10000,,,"{ 1103823447824: [1.1.1.1:10000] 2207646885648: [2.2.2.2:10000] 3311470323472: [3.3.3.3:10000] @@ -79,8 +79,8 @@ Possible scenarios: fmt.Sprintf("node ls --format 1 --no-color --host %s", suite.AvsHostPort.String()), false, `Nodes -,Node,Endpoint,Cluster ID,Version,Visible Nodes -1,LB,localhost:10000,,,"{ +,Node,Roles,Endpoint,Cluster ID,Version,Visible Nodes +1,LB,N/A,localhost:10000,,,"{ 1103823447824: [1.1.1.1:10000] 2207646885648: [2.2.2.2:10000] 3311470323472: [3.3.3.3:10000] diff --git a/e2e_multi_node_test.go b/e2e_multi_node_test.go index baa1c6a..b1ede6a 100644 --- a/e2e_multi_node_test.go +++ b/e2e_multi_node_test.go @@ -55,16 +55,16 @@ func (suite *MultiNodeCmdTestSuite) TestNodeListCmd() { "node ls with multiple nodes and seeds", fmt.Sprintf("node ls --format 1 --no-color --seeds %s", suite.AvsHostPort.String()), `Nodes -,Node,Endpoint,Cluster ID,Version,Visible Nodes -1,139637976803088,127.0.0.1:10000,,,"{ +,Node,Roles,Endpoint,Cluster ID,Version,Visible Nodes +1,139637976803088,[INDEX_QUERY],127.0.0.1:10000,,,"{ 139637976803089: [127.0.0.1:10001] 139637976803090: [127.0.0.1:10002] }" -2,139637976803089,127.0.0.1:10001,,,"{ +2,139637976803089,[INDEX_QUERY INDEX_UPDATE],127.0.0.1:10001,,,"{ 139637976803088: [127.0.0.1:10000] 139637976803090: [127.0.0.1:10002] }" -3,139637976803090,127.0.0.1:10002,,,"{ +3,139637976803090,[INDEX_QUERY INDEX_UPDATE],127.0.0.1:10002,,,"{ 139637976803088: [127.0.0.1:10000] 139637976803089: [127.0.0.1:10001] }" diff --git a/e2e_test.go b/e2e_test.go index 218db75..415c942 100644 --- a/e2e_test.go +++ b/e2e_test.go @@ -574,16 +574,15 @@ func (suite *CmdTestSuite) TestSuccessfulUpdateIndexCmd() { WithHnswMergeReIndexParallelism(11). Build(), }, - // TODO enable this if the server enables vector integrity check changes on update - // { - // name: "test with enable vector integrity check", - // indexName: "successful-update", - // indexNamespace: "test", - // cmd: "index update -y -n test -i successful-update --hnsw-vector-integrity-check false", - // expectedIndex: newBuilder(). - // WithEnableVectorIntegrityCheck(false). - // Build(), - // }, + { + name: "test with enable vector integrity check", + indexName: "successful-update", + indexNamespace: "test", + cmd: "index update -y -n test -i successful-update --hnsw-vector-integrity-check false", + expectedIndex: newBuilder(). + WithHnswVectorIntegrityCheck(false). + Build(), + }, } for _, tc := range testCases { diff --git a/go.mod b/go.mod index 4f2c6d7..a677594 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,11 @@ module asvec -go 1.22 +go 1.22.0 + +toolchain go1.22.1 require ( - github.com/aerospike/avs-client-go v0.0.0-20241025173655-4553b2b412f8 + github.com/aerospike/avs-client-go v0.0.0-20241202214048-3592b2621dbc github.com/aerospike/tools-common-go v0.0.0-20240927170813-c352c1917359 github.com/jedib0t/go-pretty/v6 v6.5.9 github.com/spf13/cobra v1.8.1 diff --git a/go.sum b/go.sum index 834e295..f28131e 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/aerospike/avs-client-go v0.0.0-20241022175841-0802ad7be5d7 h1:V9MX8Sx github.com/aerospike/avs-client-go v0.0.0-20241022175841-0802ad7be5d7/go.mod h1:gveJAyzXlND0g/lA+R6USRg9UcnGAUtyHzcngWrHSTo= github.com/aerospike/avs-client-go v0.0.0-20241025173655-4553b2b412f8 h1:5awce0R9Sn6W7ywQdoKaNG2zWoG15B0fPed615nUN/o= github.com/aerospike/avs-client-go v0.0.0-20241025173655-4553b2b412f8/go.mod h1:gveJAyzXlND0g/lA+R6USRg9UcnGAUtyHzcngWrHSTo= +github.com/aerospike/avs-client-go v0.0.0-20241202214048-3592b2621dbc h1:bWp4AnJKg96V1hDPoHL1Hacynf9vT0VeJpBr+x+gLgA= +github.com/aerospike/avs-client-go v0.0.0-20241202214048-3592b2621dbc/go.mod h1:gveJAyzXlND0g/lA+R6USRg9UcnGAUtyHzcngWrHSTo= github.com/aerospike/tools-common-go v0.0.0-20240927170813-c352c1917359 h1:NXCigFN6GWJizwJSe7xAp5kTz7ZxdNjpyRxaIp6MkuA= github.com/aerospike/tools-common-go v0.0.0-20240927170813-c352c1917359/go.mod h1:Ig1lRynXx0tXNOY3MdtanTsKz1ifG/2AyDFMXn3RMTc= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=