mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
[skip e2e]Add deploy test for kafka version milvus (#16521)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
parent
289e468a7a
commit
9aa557f8a1
97
.github/workflows/deploy-test.yaml
vendored
97
.github/workflows/deploy-test.yaml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
old_image_repo:
|
old_image_repo:
|
||||||
description: The image repository name to use for the deploy test
|
description: The image repository name to use for the deploy test
|
||||||
required: true
|
required: true
|
||||||
default: 'milvusdb/milvus'
|
default: 'milvusdb/milvus'
|
||||||
|
|
||||||
old_image_tag:
|
old_image_tag:
|
||||||
description: The old image tag to use for the deploy test
|
description: The old image tag to use for the deploy test
|
||||||
@ -65,29 +65,29 @@ jobs:
|
|||||||
echo "PREVIOUS_RELEASE_VERSION=${{ github.event.inputs.previous_release_version || env.DEFAULT_PREVIOUS_RELEASE_VERSION }}" >> $GITHUB_ENV
|
echo "PREVIOUS_RELEASE_VERSION=${{ github.event.inputs.previous_release_version || env.DEFAULT_PREVIOUS_RELEASE_VERSION }}" >> $GITHUB_ENV
|
||||||
echo "NEW_IMAGE_REPO=${{ github.event.inputs.new_image_repo || env.DEFAULT_NEW_IMAGE_REPO }}" >> $GITHUB_ENV
|
echo "NEW_IMAGE_REPO=${{ github.event.inputs.new_image_repo || env.DEFAULT_NEW_IMAGE_REPO }}" >> $GITHUB_ENV
|
||||||
echo "NEW_IMAGE_TAG=${{ github.event.inputs.new_image_tag || env.DEFAULT_NEW_IMAGE_TAG }}" >> $GITHUB_ENV
|
echo "NEW_IMAGE_TAG=${{ github.event.inputs.new_image_tag || env.DEFAULT_NEW_IMAGE_TAG }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
- name: Install dependency
|
- name: Install dependency
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client
|
working-directory: tests/python_client
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt --trusted-host https://test.pypi.org
|
pip install -r requirements.txt --trusted-host https://test.pypi.org
|
||||||
|
|
||||||
- name: First Milvus deployment
|
- name: First Milvus deployment
|
||||||
timeout-minutes: 60
|
timeout-minutes: 15
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client/deploy/${{ matrix.mode }}
|
working-directory: tests/python_client/deploy/${{ matrix.mode }}
|
||||||
run: |
|
run: |
|
||||||
if [ ${{ matrix.task }} == "reinstall" ]; then
|
if [ ${{ matrix.task }} == "reinstall" ]; then
|
||||||
wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${{ matrix.mode }}/docker-compose.yml -O docker-compose.yml;
|
wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${{ matrix.mode }}/docker-compose.yml -O docker-compose.yml;
|
||||||
MILVUS_IMAGE="${{ env.NEW_IMAGE_REPO }}:${{ env.NEW_IMAGE_TAG }}" docker-compose up -d;
|
MILVUS_IMAGE="${{ env.NEW_IMAGE_REPO }}:${{ env.NEW_IMAGE_TAG }}" docker-compose up -d;
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.task }} == "upgrade" ]; then
|
if [ ${{ matrix.task }} == "upgrade" ]; then
|
||||||
wget https://github.com/milvus-io/milvus/releases/download/${{ env.PREVIOUS_RELEASE_VERSION }}/milvus-${{ matrix.mode }}-docker-compose.yml -O docker-compose.yml;
|
wget https://github.com/milvus-io/milvus/releases/download/${{ env.PREVIOUS_RELEASE_VERSION }}/milvus-${{ matrix.mode }}-docker-compose.yml -O docker-compose.yml;
|
||||||
@ -97,31 +97,31 @@ jobs:
|
|||||||
docker-compose ps -a
|
docker-compose ps -a
|
||||||
sleep 10s
|
sleep 10s
|
||||||
- name: Run first test
|
- name: Run first test
|
||||||
timeout-minutes: 60
|
timeout-minutes: 15
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client/deploy/scripts
|
working-directory: tests/python_client/deploy/scripts
|
||||||
run: |
|
run: |
|
||||||
if [ ${{ matrix.task }} == "reinstall" ]; then
|
if [ ${{ matrix.task }} == "reinstall" ]; then
|
||||||
python3 action_before_reinstall.py
|
python3 action_before_reinstall.py
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.task }} == "upgrade" ]; then
|
if [ ${{ matrix.task }} == "upgrade" ]; then
|
||||||
python3 action_before_upgrade.py
|
python3 action_before_upgrade.py
|
||||||
fi
|
fi
|
||||||
- name: Second Milvus deployment
|
- name: Second Milvus deployment
|
||||||
timeout-minutes: 60
|
timeout-minutes: 15
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client/deploy/${{ matrix.mode }}
|
working-directory: tests/python_client/deploy/${{ matrix.mode }}
|
||||||
run: |
|
run: |
|
||||||
if [ ${{ matrix.task }} == "reinstall" ]; then
|
if [ ${{ matrix.task }} == "reinstall" ]; then
|
||||||
docker-compose restart
|
docker-compose restart
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.task }} == "upgrade" ]; then
|
if [ ${{ matrix.task }} == "upgrade" ]; then
|
||||||
wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${{ matrix.mode }}/docker-compose.yml -O docker-compose.yml;
|
wget https://raw.githubusercontent.com/milvus-io/milvus/master/deployments/docker/${{ matrix.mode }}/docker-compose.yml -O docker-compose.yml;
|
||||||
MILVUS_IMAGE="${{ env.NEW_IMAGE_REPO }}:${{ env.NEW_IMAGE_TAG }}" docker-compose up -d;
|
MILVUS_IMAGE="${{ env.NEW_IMAGE_REPO }}:${{ env.NEW_IMAGE_TAG }}" docker-compose up -d;
|
||||||
fi
|
fi
|
||||||
bash ../check_healthy.sh
|
bash ../check_healthy.sh
|
||||||
docker-compose ps -a
|
docker-compose ps -a
|
||||||
|
|
||||||
echo "sleep 120s for the second deployment to be ready"
|
echo "sleep 120s for the second deployment to be ready"
|
||||||
sleep 120s
|
sleep 120s
|
||||||
- name: Run second test
|
- name: Run second test
|
||||||
@ -129,7 +129,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client/deploy/scripts
|
working-directory: tests/python_client/deploy/scripts
|
||||||
run: |
|
run: |
|
||||||
if [ ${{ matrix.task }} == "reinstall" ]; then
|
if [ ${{ matrix.task }} == "reinstall" ]; then
|
||||||
python3 action_after_reinstall.py
|
python3 action_after_reinstall.py
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.task }} == "upgrade" ]; then
|
if [ ${{ matrix.task }} == "upgrade" ]; then
|
||||||
@ -168,13 +168,20 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
mq_type: [pulsar, kafka]
|
||||||
mode: [standalone,cluster]
|
mode: [standalone,cluster]
|
||||||
task: [reinstall,upgrade]
|
task: [reinstall,upgrade]
|
||||||
|
exclude:
|
||||||
|
- mq_type: kafka
|
||||||
|
mode: standalone
|
||||||
|
- mq_type: kafka
|
||||||
|
task: upgrade
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Creating kind cluster
|
- name: Creating kind cluster
|
||||||
uses: helm/kind-action@v1.2.0
|
uses: helm/kind-action@v1.2.0
|
||||||
|
|
||||||
- name: Print cluster information
|
- name: Print cluster information
|
||||||
run: |
|
run: |
|
||||||
kubectl config view
|
kubectl config view
|
||||||
@ -197,12 +204,21 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
# update pymilvus to latest version
|
# update pymilvus to latest version
|
||||||
pip install -i https://test.pypi.org/simple/ pymilvus==2.0.0rc10.dev2
|
pip install -i https://test.pypi.org/simple/ pymilvus==2.0.0rc10.dev2
|
||||||
|
|
||||||
- name: First Milvus Deployment
|
- name: Modify chart value config
|
||||||
timeout-minutes: 60
|
timeout-minutes: 1
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client/deploy
|
working-directory: tests/python_client/deploy
|
||||||
|
run: |
|
||||||
|
yq -i ".kafka.enabled = false" cluster-values.yaml
|
||||||
|
yq -i ".pulsar.enabled = false" cluster-values.yaml
|
||||||
|
yq -i ".${{ matrix.mq_type }}.enabled = true" cluster-values.yaml
|
||||||
|
|
||||||
|
- name: First Milvus Deployment
|
||||||
|
timeout-minutes: 15
|
||||||
|
shell: bash
|
||||||
|
working-directory: tests/python_client/deploy
|
||||||
run: |
|
run: |
|
||||||
helm repo add milvus https://milvus-io.github.io/milvus-helm
|
helm repo add milvus https://milvus-io.github.io/milvus-helm
|
||||||
helm repo update
|
helm repo update
|
||||||
@ -237,24 +253,34 @@ jobs:
|
|||||||
# check whether port-forward success
|
# check whether port-forward success
|
||||||
nc -vz 127.0.0.1 19530
|
nc -vz 127.0.0.1 19530
|
||||||
|
|
||||||
|
- name: Run first test
|
||||||
|
timeout-minutes: 15
|
||||||
|
shell: bash
|
||||||
|
working-directory: tests/python_client/deploy
|
||||||
|
run: |
|
||||||
# first test
|
# first test
|
||||||
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_before_reinstall.py; fi
|
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_before_reinstall.py; fi
|
||||||
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_before_upgrade.py; fi
|
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_before_upgrade.py; fi
|
||||||
|
|
||||||
|
- name: Restart Milvus
|
||||||
|
timeout-minutes: 15
|
||||||
|
shell: bash
|
||||||
|
working-directory: tests/python_client/deploy
|
||||||
|
run: |
|
||||||
# uninstall milvus
|
# uninstall milvus
|
||||||
if [[ $(date +%w) -eq 0 || $(data +%w) -eq 6 ]]; then sleep 1800s; fi
|
if [[ $(date +%w) -eq 0 || $(data +%w) -eq 6 ]]; then sleep 1800s; fi
|
||||||
if [ ${{ matrix.mode }} == "standalone" ];
|
if [ ${{ matrix.mode }} == "standalone" ];
|
||||||
then
|
then
|
||||||
kubectl delete pod -l app.kubernetes.io/instance=deploy-testing --grace-period=0 --force;
|
kubectl delete pod -l app.kubernetes.io/instance=deploy-testing --grace-period=0 --force;
|
||||||
kubectl delete pod -l release=deploy-testing --grace-period=0 --force;
|
kubectl delete pod -l release=deploy-testing --grace-period=0 --force;
|
||||||
else
|
else
|
||||||
helm uninstall deploy-testing
|
helm uninstall deploy-testing
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Seconde Milvus Deployment
|
- name: Seconde Milvus Deployment
|
||||||
timeout-minutes: 60
|
timeout-minutes: 15
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: tests/python_client/deploy
|
working-directory: tests/python_client/deploy
|
||||||
run: |
|
run: |
|
||||||
if [ ${{ matrix.mode }} == "cluster" ]; then helm install --wait --timeout 720s deploy-testing milvus/milvus -f cluster-values.yaml; fi
|
if [ ${{ matrix.mode }} == "cluster" ]; then helm install --wait --timeout 720s deploy-testing milvus/milvus -f cluster-values.yaml; fi
|
||||||
if [ ${{ matrix.mode }} == "standalone" ]; then helm upgrade --wait --timeout 720s deploy-testing milvus/milvus -f standalone-values.yaml; fi
|
if [ ${{ matrix.mode }} == "standalone" ]; then helm upgrade --wait --timeout 720s deploy-testing milvus/milvus -f standalone-values.yaml; fi
|
||||||
@ -266,11 +292,16 @@ jobs:
|
|||||||
sleep 120s
|
sleep 120s
|
||||||
# check whether port-forward success
|
# check whether port-forward success
|
||||||
nc -vz 127.0.0.1 19530
|
nc -vz 127.0.0.1 19530
|
||||||
|
|
||||||
|
- name: Run second test
|
||||||
|
timeout-minutes: 15
|
||||||
|
shell: bash
|
||||||
|
working-directory: tests/python_client/deploy
|
||||||
|
run: |
|
||||||
# second test
|
# second test
|
||||||
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_after_reinstall.py; fi
|
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_after_reinstall.py; fi
|
||||||
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_after_upgrade.py; fi
|
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_after_upgrade.py; fi
|
||||||
|
|
||||||
- name: Export logs
|
- name: Export logs
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -279,16 +310,10 @@ jobs:
|
|||||||
kubectl get pod
|
kubectl get pod
|
||||||
# export k8s log for milvus
|
# export k8s log for milvus
|
||||||
bash ../../scripts/export_log_k8s.sh default deploy-testing
|
bash ../../scripts/export_log_k8s.sh default deploy-testing
|
||||||
|
|
||||||
- name: Upload logs
|
- name: Upload logs
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: helm-log-${{ matrix.mode }}-${{ matrix.task }}
|
name: helm-log-${{ matrix.mode }}-${{ matrix.task }}
|
||||||
path: tests/python_client/deploy/k8s_logs
|
path: tests/python_client/deploy/k8s_logs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,11 @@ minio:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
|
|
||||||
|
kafka:
|
||||||
|
enabled: false
|
||||||
|
replicaCount: 3
|
||||||
|
|
||||||
pulsar:
|
pulsar:
|
||||||
enabled: true
|
enabled: true
|
||||||
extra:
|
extra:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user