Skip to content

Commit

Permalink
Add e2e job for index managemt job (#2239)
Browse files Browse the repository at this point in the history
* feat: add stream crud e2e for index creation job

Signed-off-by: hlts2 <[email protected]>

* style: format code with Gofumpt and Prettier

This commit fixes the style issues introduced in c20df9a according to the output
from Gofumpt and Prettier.

Details: #2239

* fix: change values file name

Signed-off-by: hlts2 <[email protected]>

* fix: change target name

Signed-off-by: hlts2 <[email protected]>

* fix: add deploy command for creation job and save job

Signed-off-by: hlts2 <[email protected]>

* fix: bugfix target image specification

Signed-off-by: hlts2 <[email protected]>

* feat: add e2e chaos test under index management jobs

Signed-off-by: hlts2 <[email protected]>

* fix: make format

Signed-off-by: hlts2 <[email protected]>

* fix: verify save job

Signed-off-by: hlts2 <[email protected]>

* fix: deleted e2e chaos under index management job

Signed-off-by: hlts2 <[email protected]>

* fix: deleted unnecessary id

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
hlts2 and deepsource-autofix[bot] authored Dec 7, 2023
1 parent cc00b98 commit f725e71
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/actions/deploy-chaos-mesh/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ runs:
echo "version=${CHAOS_MESH_VERSION}" >> $GITHUB_OUTPUT
env:
CHAOS_MESH_VERSION: ${{ inputs.chaos_mesh_version }}

- name: Check k3d
shell: bash
id: check_k3d
run: |
kubectl cluster-info dump
- name: Check Helm
shell: bash
run: |
helm version
- name: Deploy Chaos Mesh
shell: bash
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/detect-docker-image-tags/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ runs:
["vdaas/vald-discoverer-k8s"]="discoverer.image.tag"
["vdaas/vald-lb-gateway"]="gateway.lb.image.tag"
["vdaas/vald-manager-index"]="manager.index.image.tag"
["vdaas/vald-index-creation"]="manager.index.creator.image.tag"
["vdaas/vald-index-save"]="manager.index.saver.image.tag"
["vdaas/vald-helm-operator"]="image.tag"
)
Expand Down
7 changes: 7 additions & 0 deletions .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,38 @@ runs:
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev
- name: Setup Go environment
if: ${{ inputs.require_go == 'true' }}
uses: ./.github/actions/setup-go

- name: Setup Helm environment
if: ${{ inputs.require_helm == 'true' }}
uses: ./.github/actions/setup-helm

- name: Wait for target Docker images
if: startsWith( github.ref, 'refs/tags/')
uses: ./.github/actions/wait-for-docker-image
with:
images: ${{ inputs.target_images }}

- name: Determine Docker image tag
id: determine_tag_name
uses: ./.github/actions/determine-docker-image-tag

- name: Specify container versions
id: specify_container_versions
uses: ./.github/actions/detect-docker-image-tags
with:
tag_name: ${{ steps.determine_tag_name.outputs.PRIMARY_TAG }}
images: ${{ inputs.target_images }}

- uses: ./.github/actions/setup-k3d
if: ${{ inputs.require_k3d == 'true' }}
with:
agents: 3
ingress_port: ${{ inputs.ingress_port }}

- name: Check Kubernetes cluster
shell: bash
run: |
Expand Down
31 changes: 31 additions & 0 deletions .github/helm/values/values-index-management-jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# 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.
#

agent:
ngt:
auto_index_duration_limit: 1000h
auto_index_check_duration: 1000h
auto_save_index_duration: 1000h

manager:
index:
enabled: false
creator:
enabled: true
schedule: "* * * * *"
saver:
enabled: false
schedule: "2 * * * *"
2 changes: 1 addition & 1 deletion .github/workflows/e2e-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ jobs:
runs-on: ubuntu-latest
needs:
- agent-failure
- random-pod-failure
- agent-network-partition
- clusterwide-network-bandwidth
- random-pod-failure
steps:
- uses: actions/checkout@v3

Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,57 @@ jobs:
env:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}

e2e-stream-crud-under-index-management-jobs:
name: "E2E test (Stream CRUD) under index management jobs"
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-index-creation \
vdaas/vald-index-save"

- name: Deploy Vald
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
env:
HELM_EXTRA_OPTIONS: "--values .github/helm/values/values-index-management-jobs.yaml"
with:
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }} ${{ env.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-lb.yaml
wait_for_selector: app=vald-lb-gateway

- 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=default \
e2e
env:
POD_NAME: ${{ steps.deploy_vald.outputs.POD_NAME }}

e2e-stream-crud-skip-exist-check:
name: "E2E test (Stream CRUD: skip strict exist check)"
needs: [dump-contexts-to-log]
Expand Down Expand Up @@ -310,11 +361,12 @@ jobs:
if: startsWith( github.ref, 'refs/tags/')
needs:
- e2e-agent-and-sidecar
- e2e-jobs
- e2e-multiapis-crud
- e2e-stream-crud
- e2e-stream-crud-for-operator
- e2e-stream-crud-skip-exist-check
- e2e-jobs
- e2e-stream-crud-under-index-management-jobs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions Makefile.d/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ k8s/vald/deploy:
--set gateway.filter.image.repository=$(CRORG)/$(FILTER_GATEWAY_IMAGE) \
--set gateway.lb.image.repository=$(CRORG)/$(LB_GATEWAY_IMAGE) \
--set manager.index.image.repository=$(CRORG)/$(MANAGER_INDEX_IMAGE) \
--set manager.index.creator.image.repository=$(CRORG)/$(INDEX_CREATION_IMAGE) \
--set manager.index.saver.image.repository=$(CRORG)/$(INDEX_SAVE_IMAGE) \
$(HELM_EXTRA_OPTIONS) \
--output-dir $(TEMP_DIR) \
charts/vald
Expand Down Expand Up @@ -114,6 +116,8 @@ k8s/vald/delete:
kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/save
kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/creation
kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/correction
kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/creation
kubectl delete -f $(TEMP_DIR)/vald/templates/index/job/save
kubectl delete -f $(TEMP_DIR)/vald/templates/gateway/lb
kubectl delete -f $(TEMP_DIR)/vald/templates/manager/index
kubectl delete -f $(TEMP_DIR)/vald/templates/discoverer
Expand Down

0 comments on commit f725e71

Please sign in to comment.