Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rollout restart agent e2e test #2799

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
5 changes: 5 additions & 0 deletions .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ inputs:
description: "If k3d is not required, set this to false"
required: false
default: "true"
require_k3d_storage:
description: "If local-path-storage is not required, set this to false"
required: false
default: "false"
require_minikube:
description: "If minikube is not required, set this to true and set require_k3d to false"
required: false
Expand Down Expand Up @@ -85,6 +89,7 @@ runs:
with:
agents: 3
ingress_port: ${{ inputs.ingress_port }}
storage: ${{ inputs.require_k3d_storage }}
- name: Setup Minikube environment
if: ${{ inputs.require_minikube == 'true' }}
shell: bash
Expand Down
9 changes: 9 additions & 0 deletions .github/actions/setup-k3d/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ inputs:
description: "Number of agents"
required: false
default: "3"
storage:
description: "If true, the local-path-storage will be deployed"
required: false
default: "false"
options:
description: "Options for k3d cluster create command"
required: false
Expand Down Expand Up @@ -124,6 +128,11 @@ runs:
echo $KUBECONFIG
cat $KUBECONFIG
cat /etc/hosts
- name: Set local path storage
if: ${{ inputs.storage == 'true' }}
shell: bash
run: |
make k3d/storage
- name: Show Kubernetes Cluster Info
shell: bash
run: |
Expand Down
137 changes: 137 additions & 0 deletions .github/helm/values/values-rollout-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#
# Copyright (C) 2019-2025 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

defaults:
image:
tag: pr-2798
logging:
level: debug
server_config:
metrics:
pprof:
enabled: true # enable Pyroscope
healths:
liveness:
livenessProbe:
initialDelaySeconds: 60
readiness:
readinessProbe:
initialDelaySeconds: 60
servers:
grpc:
server:
grpc:
interceptors:
- RecoverInterceptor
- TraceInterceptor
- MetricInterceptor
grpc:
client:
dial_option:
interceptors:
- TraceInterceptor
observability:
enabled: true
otlp:
collector_endpoint: "opentelemetry-collector-collector.default.svc.cluster.local:4317"
trace:
enabled: true
networkPolicy:
enabled: true
custom:
ingress:
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: pyroscope
egress:
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: opentelemetry-collector-collector
gateway:
lb:
enabled: true
maxReplicas: 1
minReplicas: 1
hpa:
enabled: false
resources:
requests:
cpu: 200m
memory: 150Mi
gateway_config:
index_replica: 2
# ingress:
# # if enabled is true, vald-lb-gateway can be connected through Kubernetes ingress from the external network.
# enabled: true
# # TODO: Set your ingress host.
# host: localhost
# service:
# # NOTE: https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/#on-service
# annotations:
# traefik.ingress.kubernetes.io/service.serversscheme: h2c
agent:
minReplicas: 3
maxReplicas: 3
podManagementPolicy: Parallel
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
# We recommend to set this value long enough to ensure the backup speed of PV, since the Index is backed up at the end of the pod.
terminationGracePeriodSeconds: 600
# This is the persistent volume settings.
# Please change it according to your environment.
persistentVolume:
enabled: true
accessMode: ReadWriteOncePod
storageClass: local-path
size: 500Mi
ngt:
auto_index_duration_limit: 2m
auto_index_check_duration: 30s
auto_index_length: 500
dimension: 784
enable_in_memory_mode: false
index_path: "/var/ngt/index"
discoverer:
minReplicas: 1
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
manager:
index:
replicas: 1
resources:
requests:
cpu: 100m
memory: 30Mi
indexer:
auto_index_duration_limit: 2m
auto_index_check_duration: 30s
auto_index_length: 1000
corrector:
enabled: true
# suspend because you do not want corrector to start automatically in CI
# instead run it manually
suspend: true
schedule: "1 2 3 4 5"
1 change: 1 addition & 0 deletions .github/workflows/dockers-agent-faiss-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent-faiss
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-agent-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-agent-ngt-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent-ngt
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-agent-sidecar-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent-sidecar
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-benchmark-job-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: benchmark-job
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-benchmark-operator-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: benchmark-operator
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-dev-container-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: dev-container
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-discoverer-k8s-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: discoverer-k8s
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-example-client-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: example-client
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-gateway-filter-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: gateway-filter
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-gateway-lb-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: gateway-lb
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-gateway-mirror-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: gateway-mirror
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-helm-operator-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: helm-operator
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-index-correction-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-correction
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-index-creation-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-creation
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-index-deletion-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-deletion
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-index-operator-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-operator
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-index-save-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: index-save
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-manager-index-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: manager-index
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-readreplica-rotate-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: readreplica-rotate
platforms: linux/amd64,linux/arm64
secrets: inherit
44 changes: 44 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,49 @@ jobs:
e2e/readreplica
env:
POD_NAME: ${{ steps.deploy_vald_readreplica.outputs.POD_NAME }}
e2e-stream-crud-with-rollout-restart-agent:
name: "E2E test (Stream CRUD) with rollout restart agent"
needs: [detect-ci-container]
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
options: "--add-host host.docker.internal:host-gateway"
steps:
- uses: actions/checkout@v4
- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Setup E2E environment
id: setup_e2e
uses: ./.github/actions/setup-e2e
with:
require_k3d_storage: true
- name: Deploy Vald
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-rollout-agent.yaml
wait_for_selector: app=vald-lb-gateway
- name: Run E2E CRUD with rollout restart agent
run: |
make hack/benchmark/assets/dataset/${{ env.DATASET }}
make E2E_BIND_PORT=8081 \
E2E_DATASET_NAME=${{ env.DATASET }} \
E2E_INSERT_COUNT=1000 \
E2E_SEARCH_COUNT=1000 \
E2E_SEARCH_BY_ID_COUNT=1000 \
E2E_GET_OBJECT_COUNT=100 \
E2E_UPDATE_COUNT=100 \
E2E_UPSERT_COUNT=100 \
E2E_REMOVE_COUNT=100 \
E2E_WAIT_FOR_CREATE_INDEX_DURATION=3m \
E2E_TARGET_POD_NAME=${POD_NAME} \
E2E_TARGET_NAMESPACE=default \
e2e/rollout/restart/agent
env:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}
e2e-stream-crud-with-mirror:
name: "E2E test (Stream CRUD) with mirror"
needs: [detect-ci-container]
Expand Down Expand Up @@ -417,6 +460,7 @@ jobs:
- e2e-stream-crud-under-index-management-jobs
- e2e-stream-crud-with-mirror
- e2e-stream-crud-with-readreplica
- e2e-stream-crud-with-rollout-restart-agent
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ E2E_UPDATE_COUNT ?= 10
E2E_UPSERT_COUNT ?= 10
E2E_WAIT_FOR_CREATE_INDEX_DURATION ?= 8m
E2E_WAIT_FOR_START_TIMEOUT ?= 10m
E2E_WAIT_FOR_RESOURCE_READY ?= 3m
E2E_SEARCH_FROM ?= 0
E2E_SEARCH_BY_ID_FROM ?= 0
E2E_INSERT_FROM ?= 0
Expand Down
5 changes: 5 additions & 0 deletions Makefile.d/e2e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ e2e/index/job/correction:
e2e/readreplica:
$(call run-e2e-crud-test,-run TestE2EReadReplica)

.PHONY: e2e/rollaout/restart/agent
## run rollout-restart agent e2e
e2e/rollout/restart/agent:
$(call run-e2e-crud-test,-run TestE2EAgentRolloutRestart)

.PHONY: e2e/maxdim
## run e2e/maxdim
e2e/maxdim:
Expand Down
1 change: 1 addition & 0 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ define run-e2e-crud-test
-search-by-id-from=$(E2E_SEARCH_BY_ID_FROM) \
-get-object-from=$(E2E_GET_OBJECT_FROM) \
-wait-after-insert=$(E2E_WAIT_FOR_CREATE_INDEX_DURATION) \
-wait-resource-ready=$(E2E_WAIT_FOR_RESOURCE_READY) \
-portforward=$(E2E_PORTFORWARD_ENABLED) \
-portforward-pod-name=$(E2E_TARGET_POD_NAME) \
-portforward-pod-port=$(E2E_TARGET_PORT) \
Expand Down
2 changes: 1 addition & 1 deletion dockers/agent/core/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ LABEL maintainer="vdaas.org vald team <[email protected]>"
COPY --from=builder /usr/bin/agent /usr/bin/agent
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/agent"]
ENTRYPOINT ["/usr/bin/agent"]
2 changes: 1 addition & 1 deletion dockers/agent/core/faiss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ COPY --from=builder /usr/bin/faiss /usr/bin/faiss
COPY cmd/agent/core/faiss/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/faiss"]
ENTRYPOINT ["/usr/bin/faiss"]
Loading
Loading