Skip to content

Commit

Permalink
add e2e test for mirror
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Sep 26, 2023
1 parent 00b9e01 commit 6eaba03
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/e2e-deploy-vald/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ inputs:
description: "Path to the values.yaml that passed to Helm command."
required: false
default: "false"
namespace:
description: "Namespace to deploy."
required: false
wait_for_selector:
description: "Label selector used for specifying a pod waited for"
required: false
Expand Down Expand Up @@ -61,6 +64,14 @@ runs:
run: |
cat ${{ inputs.values }}
- name: Change namespace
if: ${{ inputs.namespace != '' }}
shell: bash
run: |
kubectl create ns ${NAMESPACE} || kubectl config set-context --current --namespace=${NAMESPACE}
env:
NAMESPACE: ${{ inputs.namespace }}

- name: Deploy vald from remote charts
shell: bash
id: deploy_vald_remote
Expand Down
24 changes: 24 additions & 0 deletions .github/helm/values/vald-mirror-target.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (C) 2019-2023 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.
#
apiVersion: vald.vdaas.org/v1
kind: ValdMirrorTarget
metadata:
name: mirror-target-02
spec:
colocation: dc1
target:
host: vald-mirror-gateway.vald-02.svc.cluster.local
port: 8081
81 changes: 81 additions & 0 deletions .github/helm/values/values-mirror-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#
# Copyright (C) 2019-2023 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:
logging:
level: info
networkPolicy:
enabled: false

gateway:
mirror:
enabled: true
clusterRoleBinding:
name: vald-mirror-01
serviceAccount:
name: vald-mirror-01
lb:
enabled: true
minReplicas: 1
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
gateway_config:
index_replica: 3

agent:
minReplicas: 3
maxReplicas: 10
podManagementPolicy: Parallel
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
ngt:
auto_index_duration_limit: 2m
auto_index_check_duration: 30s
auto_index_length: 1000
dimension: 784

discoverer:
minReplicas: 1
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
clusterRoleBinding:
name: vald-01
serviceAccount:
name: vald-01

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
85 changes: 85 additions & 0 deletions .github/helm/values/values-mirror-02.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#
# Copyright (C) 2019-2023 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:
logging:
level: info
networkPolicy:
enabled: false

gateway:
mirror:
enabled: true
clusterRole:
enabled: false
clusterRoleBinding:
name: vald-mirror-02
serviceAccount:
name: vald-mirror-02
lb:
enabled: true
minReplicas: 1
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
gateway_config:
index_replica: 3

agent:
minReplicas: 3
maxReplicas: 10
podManagementPolicy: Parallel
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
ngt:
auto_index_duration_limit: 2m
auto_index_check_duration: 30s
auto_index_length: 1000
dimension: 784

discoverer:
minReplicas: 1
hpa:
enabled: false
resources:
requests:
cpu: 100m
memory: 50Mi
clusterRole:
enabled: false
clusterRoleBinding:
name: vald-02
serviceAccount:
name: vald-02

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
62 changes: 62 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,67 @@ jobs:
env:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}

e2e-stream-crud-with-mirror:
name: "E2E test (Stream CRUD) with mirror"
needs: [dump-contexts-to-log]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3

- 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:
target_images: "vdaas/vald-agent-ngt vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-manager-index vdaas/vald-mirror-gateway"

- name: Deploy Vald-01
id: deploy_vald_01
uses: ./.github/actions/e2e-deploy-vald
with:
namespace: vald-01
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-mirror-01.yaml
wait_for_selector: app=vald-mirror-gateway

- name: Deploy Vald-02
id: deploy_vald_02
uses: ./.github/actions/e2e-deploy-vald
with:
namespace: vald-02
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-mirror-02.yaml
wait_for_selector: app=vald-mirror-gateway

- name: Deploy Mirror Target
run: |
kubectl apply -f .github/helm/values/vald-mirror-target.yaml -n vald-01
sleep 30s
kubectl get vmt -o wide -A
# - name: Run E2E CRUD
# run: |
# make hack/benchmark/assets/dataset/${{ env.DATASET }}
# make E2E_BIND_PORT=8081 \
# E2E_DATASET_NAME=${{ env.DATASET }} \
# E2E_INSERT_COUNT=10000\
# E2E_SEARCH_COUNT=10000 \
# E2E_SEARCH_BY_ID_COUNT=10000 \
# 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=vald-01 \
# e2e
# env:
# POD_NAME: ${{ steps.deploy_vald_01.outputs.POD_NAME }}

slack-notification:
name: "Slack notification"
if: startsWith( github.ref, 'refs/tags/')
Expand All @@ -278,6 +339,7 @@ jobs:
- e2e-stream-crud
- e2e-stream-crud-for-operator
- e2e-stream-crud-skip-exist-check
- e2e-stream-crud-with-mirror
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit 6eaba03

Please sign in to comment.