mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
4ef98ffdff
Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>
172 lines
5.9 KiB
YAML
172 lines
5.9 KiB
YAML
name: Deploy Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# * is a special character in YAML so you have to quote this string
|
|
# ┌───────────── minute (0 - 59)
|
|
# │ ┌───────────── hour (0 - 23)
|
|
# │ │ ┌───────────── day of the month (1 - 31)
|
|
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
|
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
|
# │ │ │ │ │
|
|
# │ │ │ │ │
|
|
# │ │ │ │ │
|
|
- cron: "30 20 * * *"
|
|
|
|
jobs:
|
|
|
|
test-docker-compose:
|
|
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
mode: [standalone,cluster]
|
|
task: [reinstall,upgrade]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Run deploy test
|
|
timeout-minutes: 15
|
|
shell: bash
|
|
working-directory: tests/python_client/deploy
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install --upgrade protobuf
|
|
mkdir -p ${{ matrix.mode }}/logs
|
|
echo "test -m ${{ matrix.mode }} -t ${{ matrix.task }}" > ./${{ matrix.mode }}/logs/test_info.log
|
|
python scripts/get_tag.py >> ./${{ matrix.mode }}/logs/test_info.log
|
|
bash test.sh -m ${{ matrix.mode }} -t ${{ matrix.task }} -p ""
|
|
|
|
- name: 'Send mail'
|
|
if: ${{ failure() }}
|
|
uses: dawidd6/action-send-mail@v3
|
|
with:
|
|
server_address: ${{ secrets.EMAIL_SERVICE_NAME }}
|
|
server_port: 465
|
|
username: ${{ secrets.TEST_EMAIL_USERNAME }}
|
|
password: ${{ secrets.TEST_EMAIL_PASSWORD }}
|
|
subject: Deploy Test
|
|
body: "test ${{ matrix.mode }} ${{ matrix.task }} failed \n You can view it at https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
|
|
to: ${{ secrets.QA_EMAIL_ADDRESS }}
|
|
from: GitHub Actions
|
|
|
|
- name: Upload logs
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: logs-${{ matrix.mode }}-${{ matrix.task }}
|
|
path: tests/python_client/deploy/${{ matrix.mode }}/logs
|
|
|
|
test-helm-install:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
task: [reinstall,upgrade]
|
|
steps:
|
|
|
|
- name: Creating kind cluster
|
|
uses: helm/kind-action@v1.2.0
|
|
|
|
- name: Print cluster information
|
|
run: |
|
|
kubectl config view
|
|
kubectl cluster-info
|
|
kubectl get nodes
|
|
kubectl get pods -n kube-system
|
|
helm version
|
|
kubectl version
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- name: Install dependency
|
|
shell: bash
|
|
working-directory: tests/python_client/deploy
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install --upgrade protobuf
|
|
|
|
- name: First Milvus Deployment
|
|
timeout-minutes: 60
|
|
shell: bash
|
|
working-directory: tests/python_client/deploy
|
|
run: |
|
|
helm repo add milvus https://milvus-io.github.io/milvus-helm
|
|
helm repo update
|
|
|
|
# if the task is reinstall, install milvus with latest image in repo milvusdb/milvus-dev
|
|
if [ ${{ matrix.task }} == "reinstall" ]; then helm install --wait --timeout 300s deploy-testing milvus/milvus -f cluster-values.yaml; fi
|
|
|
|
# if the task is upgrade, install milvus with latest rc image in repo milvusdb/milvus
|
|
if [ ${{ matrix.task }} == "upgrade" ]; then helm install --wait --timeout 300s deploy-testing milvus/milvus --set image.all.repository=milvusdb/milvus --set image.all.tag=latest -f cluster-values.yaml; fi
|
|
kubectl get pods
|
|
sleep 20s
|
|
kubectl get pods
|
|
kubectl port-forward service/deploy-testing-milvus 19530 >/dev/null 2>&1 &
|
|
sleep 20s
|
|
# check whether port-forward success
|
|
nc -vz 127.0.0.1 19530
|
|
|
|
# first test
|
|
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_reinstall.py; fi
|
|
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_before_upgrade.py; fi
|
|
|
|
|
|
# uninstall milvus
|
|
if [[ $(date +%w) -eq 0 || $(data +%w) -eq 6 ]]; then sleep 1800s; fi
|
|
helm uninstall deploy-testing
|
|
|
|
- name: Seconde Milvus Deployment
|
|
timeout-minutes: 15
|
|
shell: bash
|
|
working-directory: tests/python_client/deploy
|
|
run: |
|
|
#
|
|
helm install --wait --timeout 300s deploy-testing milvus/milvus -f cluster-values.yaml
|
|
kubectl get pods
|
|
sleep 20s
|
|
kubectl get pods
|
|
ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9
|
|
kubectl port-forward service/deploy-testing-milvus 19530 >/dev/null 2>&1 &
|
|
sleep 20s
|
|
# check whether port-forward success
|
|
nc -vz 127.0.0.1 19530
|
|
|
|
# second test
|
|
if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_reinstall.py; fi
|
|
if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_after_upgrade.py; fi
|
|
|
|
- name: Export logs
|
|
if: ${{ always() }}
|
|
shell: bash
|
|
working-directory: tests/python_client/deploy
|
|
run: |
|
|
kubectl get pod
|
|
# export k8s log for milvus
|
|
bash ../../scripts/export_log_k8s.sh default deploy-testing
|
|
|
|
- name: Upload logs
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: helm-deploy-logs-${{ matrix.task }}
|
|
path: tests/python_client/deploy/k8s_logs
|
|
|
|
|
|
|
|
|
|
|
|
|