diff --git a/.github/workflows/all-contributors.yaml b/.github/workflows/all-contributors.yaml deleted file mode 100644 index b1e2641ae9f48..0000000000000 --- a/.github/workflows/all-contributors.yaml +++ /dev/null @@ -1,67 +0,0 @@ -name: all-contributors - -on: - 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: '0 0,12 * * *' - -jobs: - contributor: - runs-on: ubuntu-latest - if: github.repository == 'milvus-io/milvus' - steps: - - name: checkout code - uses: actions/checkout@v2 - with: - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - - - name: log path - run: | - pwd - ls - - - name: Update README.md - uses: milvus-io/hero-bot@dco-enabled - with: - # Required - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - repos: 'milvus-io/milvus,bootcamp,community,docs,milvus-helm,milvus-sdk-go,milvus-sdk-java,milvus-sdk-node,milvus.io,pymilvus,pymilvus-orm' - targetFile: './README.md' - # Optional - isAscend: True - width: '30px' - customUserConfig: 'milvus-io/milvus/.contributors' - workingDir: '/home/runner/work/milvus/milvus' - - - name: Update README_CN.md - uses: milvus-io/hero-bot@dco-enabled - with: - # Required - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - repos: 'milvus-io/milvus,bootcamp,community,docs,milvus-helm,milvus-sdk-go,milvus-sdk-java,milvus-sdk-node,milvus.io,pymilvus,pymilvus-orm' - targetFile: './README_CN.md' - # Optional - isAscend: True - width: '30px' - customUserConfig: 'milvus-io/milvus/.contributors' - workingDir: '/home/runner/work/milvus/milvus' - - - name: commit code - run: | - pwd - git config --global user.email "sre-ci-robot@zilliz.com" - git config --global user.name "sre-ci-robot" - git add -u - git diff-index --cached --quiet HEAD || (git commit -s -m 'Update all contributors' && git push) - - - - diff --git a/.github/workflows/code-checker.yaml b/.github/workflows/code-checker.yaml deleted file mode 100644 index b8558de4c2f05..0000000000000 --- a/.github/workflows/code-checker.yaml +++ /dev/null @@ -1,159 +0,0 @@ -name: Code Checker -# TODO: do not trigger action for some document file update - -# This workflow is triggered on pushes or pull request to the repository. -on: - push: - branches: - - master - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'scripts/**' - - 'internal/**' - - 'cmd/**' - - 'build/**' - - '.github/workflows/code-checker.yaml' - - '.env' - - docker-compose.yml - - Makefile - - '!**.md' - - '!build/ci/jenkins/**' - # FIXME(wxyu): not need to run code check, update the ci-passed rules and remove these two lines - - go.mod - - go.sum - -jobs: - ubuntu: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: - - name: Code Checker AMD64 Ubuntu 20.04 - os: ubuntu-20.04 - env: - UBUNTU: 20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: "Generate CCache Hash" - env: - CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} - run: | - echo "corehash=${CORE_HASH}" >> $GITHUB_ENV - echo "Set CCache hash to ${CORE_HASH}" - - name: Cache CCache Volumes - uses: actions/cache@v3 - with: - path: .docker/amd64-ubuntu20.04-ccache - key: ubuntu20.04-ccache-${{ env.corehash }} - restore-keys: ubuntu20.04-ccache- - - name: Cache Third Party - uses: actions/cache@v3 - with: - path: .docker/thirdparty - key: ubuntu20.04-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }} - restore-keys: ubuntu20.04-thirdparty- - - name: Cache Go Mod Volumes - uses: actions/cache@v3 - with: - path: .docker/amd64-ubuntu20.04-go-mod - key: ubuntu20.04-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ubuntu20.04-go-mod- - - name: Code Check - env: -# CHECK_BUILDER: "1" - OS_NAME: "ubuntu20.04" - run: | - ./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers" - centos: - name: Code Checker CentOS 7 - # Run in centos docker - runs-on: ubuntu-20.04 - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: "Generate CCache Hash" - env: - CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} - run: | - echo "corehash=${CORE_HASH}" >> $GITHUB_ENV - echo "Set CCache hash to ${CORE_HASH}" - - name: Cache CCache Volumes - uses: actions/cache@v3 - with: - path: .docker/amd64-centos7-ccache - key: centos7-ccache-${{ env.corehash }} - restore-keys: centos7-ccache- - - name: Cache Third Party - uses: actions/cache@v3 - with: - path: .docker/thirdparty - key: centos7-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }} - restore-keys: centos7-thirdparty- - - name: Cache Go Mod Volumes - uses: actions/cache@v3 - with: - path: .docker/amd64-centos7-go-mod - key: centos7-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: centos7-go-mod- - - name: Code Check - env: - OS_NAME: "centos7" - run: | - ./build/builder.sh /bin/bash -c "make install" - mingw64: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: - - name: Code Checker MinGW - os: windows-2019 - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - name: Checkout - uses: actions/checkout@v2 - - name: Cache go - uses: actions/cache@v3 - with: - path: | - %LocalAppData%\go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - name: Cache ccache - uses: actions/cache@v3 - with: - path: | - ${{ github.workspace }}/.ccache - key: ${{ runner.os }}-ccache-${{ hashFiles('internal/core/**') }} - restore-keys: ${{ runner.os }}-ccache- - - name: Configure Toolchain - uses: msys2/setup-msys2@v2.12.0 - with: - msystem: mingw64 - - name: Install Deps - shell: msys2 {0} - run: | - sh scripts/install_deps_msys.sh - - name: Code Check - shell: msys2 {0} - env: - CCACHE_COMPILERCHECK: content - CCACHE_COMPRESS: 1 - CCACHE_COMPRESSLEVEL: 5 - CCACHE_MAXSIZE: 2G - CCACHE_DIR: ${{ github.workspace }}/.ccache - run: | - go version - mingw32-make verifiers milvus diff --git a/.github/workflows/daily-release.yml b/.github/workflows/daily-release.yml deleted file mode 100644 index 16fcc827a3ca1..0000000000000 --- a/.github/workflows/daily-release.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Daily Release -on: - 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: '0 18 * * *' - -jobs: - nightly: - name: Run Daily Release - if: github.repository == 'milvus-io/milvus' - runs-on: ubuntu-latest - env: - IMAGE_REPO: "milvusdb" - DEV: "milvus" - DAILY: "daily-build" - TAG_PREFIX: "master-" - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - - name: Get the latest of Milvus dev image tag - shell: bash - working-directory: scripts - run: echo "tag=$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/${DEV} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV - - - - name: Pull latest milvus image with tag prefix master- - run: | - docker pull "${IMAGE_REPO}/${DEV}:${{ env.tag }}" - docker tag "${IMAGE_REPO}/${DEV}:${{ env.tag }}" "${IMAGE_REPO}/${DAILY}:${{ env.tag }}" - - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push Docker image - run: | - docker push "${IMAGE_REPO}/${DAILY}:${{ env.tag }}" - - - name: Set release build - shell: bash - run: | - tag=${{ env.tag }} - IFS=- read branch date sha <<< "$tag" - echo "build=$date" >> $GITHUB_ENV - echo "sha=$(git rev-parse $sha)" >> $GITHUB_ENV - - - name: Create a daily release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - body: "Image: ${{ env.IMAGE_REPO}}/${{ env.DAILY }}:${{ env.tag }}" - prerelease: true - tag_name: "v2.0.0-testing-${{ env.build }}" - release_name: "milvus-2.0.0-testing-${{ env.build }}" - commitish: "${{ env.sha }}" - - diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml deleted file mode 100644 index 2c6e264fdf0d0..0000000000000 --- a/.github/workflows/deploy-test.yaml +++ /dev/null @@ -1,400 +0,0 @@ -name: Deploy Test - -on: - workflow_dispatch: - inputs: - old_image_repo: - description: The image repository name to use for the deploy test - required: true - default: 'milvusdb/milvus' - - old_image_tag: - description: The old image tag to use for the deploy test - required: true - default: 'v2.1.0' - - previous_release_version: - description: The previous release version to use for the deploy test - required: true - default: 'v2.1.0' - - new_image_repo: - description: The image repository name to use for the deploy test - required: true - default: 'milvusdb/milvus' - - new_image_tag: - description: The new image tag to use for the deploy test - required: true - default: 'master-latest' - - 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: - - name: Set env param - env: - DEFAULT_OLD_IMAGE_REPO: "milvusdb/milvus" - DEFAULT_OLD_IMAGE_TAG: "latest" - DEFAULT_PREVIOUS_RELEASE_VERSION: "v2.1.0" - DEFAULT_NEW_IMAGE_REPO: "milvusdb/milvus" - DEFAULT_NEW_IMAGE_TAG: "master-latest" - run: | - echo "OLD_IMAGE_REPO=${{ github.event.inputs.old_image_repo || env.DEFAULT_OLD_IMAGE_REPO }}" >> $GITHUB_ENV - echo "OLD_IMAGE_TAG=${{ github.event.inputs.old_image_tag || env.DEFAULT_OLD_IMAGE_TAG }}" >> $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_TAG=${{ github.event.inputs.new_image_tag || env.DEFAULT_NEW_IMAGE_TAG }}" >> $GITHUB_ENV - - - 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 - run: | - pip install -r requirements.txt --trusted-host https://test.pypi.org - sudo systemctl restart docker - sleep 30s - - name: Download dataset - shell: bash - working-directory: tests/python_client/assets/ann_hdf5 - run: | - echo "Downloading dataset..." - bash download.sh - - - name: First Milvus deployment - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy/${{ matrix.mode }} - run: | - source ../utils.sh - 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; - replace_image_tag ${{ env.NEW_IMAGE_REPO }} ${{ env.NEW_IMAGE_TAG }}; - - fi - 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; - replace_image_tag ${{ env.OLD_IMAGE_REPO }} ${{ env.OLD_IMAGE_TAG }}; - fi - docker-compose up -d - bash ../check_healthy.sh - docker-compose ps -a - sleep 10s - - name: Run first test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy - run: | - python scripts/first_recall_test.py - if [ ${{ matrix.task }} == "reinstall" ]; then - python3 scripts/action_before_reinstall.py - fi - if [ ${{ matrix.task }} == "upgrade" ]; then - python3 scripts/action_before_upgrade.py - fi - - - name: Milvus Idle Time - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/deploy - run: | - sleep 60s - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/deploy/${{ matrix.mode }} - run: | - docker-compose ps -a || true - mkdir -p logs/first_deploy - bash ../../../scripts/export_log_docker.sh ./logs/first_deploy || echo "export logs failed" - - name: Second Milvus deployment - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy/${{ matrix.mode }} - run: | - source ../utils.sh - if [ ${{ matrix.task }} == "reinstall" ]; then - docker-compose restart - fi - 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; - replace_image_tag ${{ env.NEW_IMAGE_REPO }} ${{ env.NEW_IMAGE_TAG }}; - docker-compose up -d; - fi - bash ../check_healthy.sh - docker-compose ps -a - - echo "sleep 120s for the second deployment to be ready" - sleep 120s - - name: Run second test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy - run: | - python scripts/second_recall_test.py - if [ ${{ matrix.task }} == "reinstall" ]; then - python3 scripts/action_after_reinstall.py - fi - if [ ${{ matrix.task }} == "upgrade" ]; then - python3 scripts/action_after_upgrade.py - fi - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/deploy/${{ matrix.mode }} - run: | - docker-compose ps -a || true - mkdir -p logs/second_deploy - bash ../../../scripts/export_log_docker.sh ./logs/second_deploy || echo "export logs failed" - - - name: Restart docker - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/deploy/${{ matrix.mode }} - run: | - echo "restart docker service" - sudo systemctl restart docker - sleep 20s - docker-compose up -d - bash ../check_healthy.sh - docker-compose ps -a - - echo "sleep 120s for the deployment to be ready after docker restart" - sleep 120s - - - - name: Run third test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy - run: | - python scripts/second_recall_test.py - if [ ${{ matrix.task }} == "reinstall" ]; then - python3 scripts/action_after_reinstall.py - fi - if [ ${{ matrix.task }} == "upgrade" ]; then - python3 scripts/action_after_upgrade.py - fi - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/deploy/${{ matrix.mode }} - run: | - docker-compose ps -a || true - mkdir -p logs/second_deploy - bash ../../../scripts/export_log_docker.sh ./logs/third_deploy || echo "export logs failed" - - - 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: ${{ ! success() }} - uses: actions/upload-artifact@v2 - with: - name: docker-compose-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: - mq_type: [pulsar, kafka] - mode: [standalone,cluster] - task: [reinstall,upgrade] - exclude: - - mq_type: kafka - task: 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 - run: | - pip install -r requirements.txt --trusted-host https://test.pypi.org - - - name: Modify chart value config - timeout-minutes: 1 - shell: bash - 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 ".kafka.enabled = false" cluster-values-second.yaml - yq -i ".pulsar.enabled = false" cluster-values-second.yaml - yq -i ".${{ matrix.mq_type }}.enabled = true" cluster-values.yaml - yq -i ".${{ matrix.mq_type }}.enabled = true" cluster-values-second.yaml - if [ ${{ matrix.mq_type }} == "kafka" ]; then - yq -i ".kafka.enabled = true" standalone-values.yaml; - fi - - - name: First Milvus Deployment - timeout-minutes: 15 - 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 - # for cluster mode - if [ ${{ matrix.task }} == "reinstall" ] && [ ${{ matrix.mode }} == "cluster" ]; then - echo "task: ${{ matrix.task }} mode: ${{ matrix.mode }}"; - helm install --wait --timeout 720s deploy-testing milvus/milvus -f cluster-values.yaml; - fi - # for standalone mode - if [ ${{ matrix.task }} == "reinstall" ] && [ ${{ matrix.mode }} == "standalone" ]; then - echo "task: ${{ matrix.task }} mode: ${{ matrix.mode }}"; - helm install --wait --timeout 720s deploy-testing milvus/milvus -f standalone-values.yaml; - fi - - # if the task is upgrade, install milvus with latest rc image in repo milvusdb/milvus - if [ ${{ matrix.task }} == "upgrade" ] && [ ${{ matrix.mode }} == "cluster" ]; then - echo "task: ${{ matrix.task }} mode: ${{ matrix.mode }}"; - helm install --wait --timeout 720s deploy-testing milvus/milvus --set image.all.repository=milvusdb/milvus --set image.all.tag=latest --set etcd.image.repository=milvusdb/etcd --set etcd.image.tag=3.5.0-r6 -f cluster-values.yaml; - fi - if [ ${{ matrix.task }} == "upgrade" ] && [ ${{ matrix.mode }} == "standalone" ]; then - echo "task: ${{ matrix.task }} mode: ${{ matrix.mode }}"; - helm install --wait --timeout 720s deploy-testing milvus/milvus --set image.all.repository=milvusdb/milvus --set image.all.tag=latest --set etcd.image.repository=milvusdb/etcd --set etcd.image.tag=3.5.0-r6 -f standalone-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 - - - name: Run first test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy - run: | - # first test - if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_before_reinstall.py; fi - if [ ${{ matrix.task }} == "upgrade" ]; then python scripts/action_before_upgrade.py; fi - - name: Milvus Idle Time - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/deploy - run: | - sleep 60s - - 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 k8s_logs/first_deploy - - name: Restart Milvus - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy - run: | - # uninstall milvus - if [ ${{ matrix.mode }} == "standalone" ]; - then - 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; - else - helm uninstall deploy-testing - fi - - - name: Seconde Milvus Deployment - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/deploy - run: | - if [ ${{ matrix.mode }} == "cluster" ]; then helm install --wait --timeout 720s deploy-testing milvus/milvus -f cluster-values-second.yaml; fi - if [ ${{ matrix.mode }} == "standalone" ]; then helm upgrade --wait --timeout 720s deploy-testing milvus/milvus -f standalone-values.yaml; fi - 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 120s - # check whether port-forward success - 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 - if [ ${{ matrix.task }} == "reinstall" ]; then python scripts/action_after_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 k8s_logs/second_deploy - - - name: Upload logs - if: ${{ ! success() }} - uses: actions/upload-artifact@v2 - with: - name: helm-log-${{ matrix.mq_type }}-${{ matrix.mode }}-${{ matrix.task }} - path: tests/python_client/deploy/k8s_logs diff --git a/.github/workflows/io-latency-chaos-test.yaml b/.github/workflows/io-latency-chaos-test.yaml deleted file mode 100644 index c11ec1e4a3cd9..0000000000000 --- a/.github/workflows/io-latency-chaos-test.yaml +++ /dev/null @@ -1,197 +0,0 @@ -name: IO Latency Chaos Test - -on: - workflow_dispatch: -jobs: - - test-io-latency-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - pod: [pulsar, etcd, minio] - - steps: - - - name: Set env param - run: | - echo "RELEASE=test-${{ matrix.pod }}-io-latency" >> $GITHUB_ENV - - - 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 - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - retry_on: error - shell: bash - command: | - pip install -r tests/python_client/requirements.txt --trusted-host https://test.pypi.org - pip install --upgrade protobuf - - - name: Deploy Chaos Mesh - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install --wait --timeout 360s chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --version v2.0.3 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - kubectl get po -n chaos-testing - - - name: Deploy Milvus - shell: bash - working-directory: tests/python_client/chaos - run: | - echo "latest tag:" - bash ../../../scripts/docker_image_find_tag.sh -n milvusdb/milvus -t master-latest -f master- -F -L -q - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - if [[ ${{ matrix.pod }} != *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f cluster-values.yaml -n=chaos-testing; fi - if [[ ${{ matrix.pod }} == *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f standalone-values.yaml -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Chaos Test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/io_latency\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_io_latency.yaml\'/g" constants.py - sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${{ env.RELEASE }}\'/g" constants.py - cat constants.py - timeout 14m pytest -s -v test_chaos.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "chaos test failed" - - - name: Result Analysis - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos/reports - run: | - echo "result analysis" - cat ${{ env.RELEASE }}.log || echo "no log file" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get iochaos -n chaos-testing - kubectl get pod -n chaos-testing - # wait all pod to be ready - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/chaos-test - - - name: Deploy Milvus Again If Previous E2E Test Failed - timeout-minutes: 15 - if: ${{ failure() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - kubectl config set-context --current --namespace=chaos-testing - bash scripts/uninstall_milvus.sh ${{ env.RELEASE }} - if [ ${{ matrix.pod }} != "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f cluster-values.yaml -n=chaos-testing; fi - if [ ${{ matrix.pod }} == "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set cluster.enabled=false --set etcd.replicaCount=1 --set minio.mode=standalone --set pulsar.enabled=false -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Data Consist Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v test_chaos_data_consist.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "data consist chaos test failed" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/data-consist-test - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon k8s_logs/chaos-mesh-daemon - - - name: Upload logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }} - path: | - tests/python_client/chaos/k8s_logs - tests/python_client/chaos/reports \ No newline at end of file diff --git a/.github/workflows/jenkins-checker.yaml b/.github/workflows/jenkins-checker.yaml deleted file mode 100644 index f9739d48bf169..0000000000000 --- a/.github/workflows/jenkins-checker.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Jenkins Checker -# Lint Jenkinsfile and related groovy files - - -on: - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/ci/jenkins/**.groovy' - - 'ci/jenkins/**.groovy' - - '.github/workflows/jenkins-checker.yaml' -jobs: - check-jenkinsfile: - name: Jenkinsfile Checker - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Validate Jenkinsfile - shell: bash - run: | - function validate(){ - local file_path=${1:-Jenkinsfile} - local jenkins_url=${2:-"https://jenkins.milvus.io:18080/"} - - JENKINS_CRUMB=`curl "${jenkins_url}/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)"` - response=$(curl --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 40 -X POST -H $JENKINS_CRUMB -F "jenkinsfile=<${file_path}" ${jenkins_url}/pipeline-model-converter/validate) - - if [[ ${response} =~ "Error" ]] - then - echo " ${response}" - echo "Validate ${file_path} failed !" - - exit 1 - fi - } - function validate_path(){ - local path=${1} - local jenkins_url=${2} - - for file in ${path} - do - if [ -f "$file" ] - then - # echo "$file" - file_name=$(basename "$file") - if echo "${file_name}" | grep -q -E '\.groovy$' - then - # echo "Validate groovy file ${file_name}" - validate $file ${jenkins_url} - elif [[ "${file_name}" == "Jenkinsfile" ]] - then - # echo "Validate Jenkinsfile" - validate $file ${jenkins_url} - fi - fi - done - } - validate_path "ci/jenkins/*" "https://jenkins.milvus.io:18080/" - \ No newline at end of file diff --git a/.github/workflows/license-checker.yaml b/.github/workflows/license-checker.yaml deleted file mode 100644 index e50190c09fcb1..0000000000000 --- a/.github/workflows/license-checker.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: License Checker - -on: - workflow_dispatch: -jobs: - check-license: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Check License Header - uses: apache/skywalking-eyes@main - with: - log: info - config: .github/.licenserc.yaml \ No newline at end of file diff --git a/.github/workflows/mac.yaml b/.github/workflows/mac.yaml deleted file mode 100644 index 820aa3a4fa702..0000000000000 --- a/.github/workflows/mac.yaml +++ /dev/null @@ -1,91 +0,0 @@ -name: Mac Code Checker - -# This workflow is triggered on pushes or pull request to the repository. -on: - push: - branches: - - master - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'scripts/**' - - 'internal/**' - - 'cmd/**' - - 'build/**' - - '.github/workflows/mac.yaml' - - '.env' - - docker-compose.yml - - Makefile - - '!**.md' - - '!build/ci/jenkins/**' - # FIXME(wxyu): not need to run code check, update the ci-passed rules and remove these two lines - - go.mod - - go.sum - -jobs: - mac: - name: Code Checker MacOS 12 - runs-on: macos-12 - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: "Generate CCache Hash" - env: - CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} - run: | - echo "corehash=${CORE_HASH}" >> $GITHUB_ENV - echo "Set CCache hash to ${CORE_HASH}" - - name: Mac Cache Third Party - uses: actions/cache@v3 - with: - path: | - /tmp/thirdparty - key: macos-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }} - restore-keys: macos-thirdparty- - - name: Mac Cache Cmake Build - uses: actions/cache@v3 - with: - path: | - cmake_build/3rdparty_download/download - key: macos-cmake-build-${{ env.corehash }} - restore-keys: macos-cmake-build- - - name: Mac Cache CCache Volumes - uses: actions/cache@v3 - with: - path: /var/tmp/ccache - key: macos-ccache-${{ env.corehash }} - restore-keys: macos-ccache- - - name: Setup Go environment - uses: actions/setup-go@v2.2.0 - with: - go-version: '~1.18.1' - - name: Mac Cache Go Mod Volumes - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: macos-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: macos-go-mod- - - name: Code Check - env: - CCACHE_DIR: /var/tmp/ccache - CCACHE_COMPILERCHECK: content - CCACHE_COMPRESS: 1 - CCACHE_COMPRESSLEVEL: 5 - CCACHE_MAXSIZE: 2G - CUSTOM_THIRDPARTY_PATH: /tmp/thirdparty - run: | - if [[ ! -d "/var/tmp/ccache" ]];then - mkdir -p /var/tmp/ccache - fi - brew install boost libomp ninja tbb openblas ccache - if [[ ! -d "/usr/local/opt/llvm" ]]; then - ln -s /usr/local/opt/llvm@14 /usr/local/opt/llvm - fi - make milvus && sh scripts/collect_arrow_dep.sh -f /tmp/thirdparty - - name: Upload Cmake log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: cmake-log - path: cmake_build/CMakeFiles/*.log \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index 2fb1d11989d2d..0000000000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,105 +0,0 @@ -name: Build and test -# TODO: do not trigger action for some document file update - -# This workflow is triggered on pushes or pull request to the repository. -on: - push: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'scripts/**' - - 'internal/**' - - 'cmd/**' - - 'build/**' - - '.github/workflows/main.yaml' - - '.env' - - docker-compose.yml - - Makefile - - go.mod - - '!**.md' - - '!build/ci/jenkins/**' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'scripts/**' - - 'internal/**' - - 'cmd/**' - - 'build/**' - - '.github/workflows/main.yaml' - - '.env' - - docker-compose.yml - - Makefile - - go.mod - - '!**.md' - - '!build/ci/jenkins/**' - -jobs: - ubuntu: - name: Build and test AMD64 Ubuntu ${{ matrix.ubuntu }} - runs-on: ubuntu-${{ matrix.ubuntu }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - ubuntu: [20.04] - env: - UBUNTU: ${{ matrix.ubuntu }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: "Generate CCache Hash" - env: - CORE_HASH: ${{ hashFiles( 'internal/core/**/*.cpp', 'internal/core/**/*.cc', 'internal/core/**/*.c', 'internal/core/**/*.h', 'internal/core/**/*.hpp', 'internal/core/**/CMakeLists.txt') }} - run: | - echo "corehash=${CORE_HASH}" >> $GITHUB_ENV - echo "Set CCache hash to ${CORE_HASH}" - - name: Cache CCache Volumes - uses: actions/cache@v3 - with: - path: .docker/amd64-ubuntu${{ matrix.ubuntu }}-ccache - key: ubuntu${{ matrix.ubuntu }}-ccache-${{ env.corehash }} - restore-keys: ubuntu${{ matrix.ubuntu }}-ccache- - - name: Cache Third Party - uses: actions/cache@v3 - with: - path: .docker/thirdparty - key: ubuntu${{ matrix.ubuntu }}-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }} - restore-keys: ubuntu${{ matrix.ubuntu }}-thirdparty- - - name: Cache Go Mod Volumes - uses: actions/cache@v3 - with: - path: .docker/amd64-ubuntu${{ matrix.ubuntu }}-go-mod - key: ubuntu${{ matrix.ubuntu }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ubuntu${{ matrix.ubuntu }}-go-mod- - - name: Start Service - shell: bash - run: | - docker-compose up -d pulsar etcd minio - - name: Build and UnitTest - run: | - ./build/builder.sh /bin/bash -c "make ci-ut" - - name: Get the status & restart count for containers when ut failed - if: ${{ failure() }} - run: | - echo "----show current status for each container---" - docker ps --format "table {{.Names}}\t\t{{.Image}}\t\t{{.Status}}" - for container in $(docker ps --format "table {{.Names}}" | grep -v "NAMES"); do - echo "restart count for ${container} is $(docker inspect ${container} --format '{{json .RestartCount}}')" - done - - name: Upload coverage to Codecov - if: "github.repository == 'milvus-io/milvus'" - uses: codecov/codecov-action@v3.1.1 - id: upload_cov - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./go_coverage.txt,./lcov_output.info - name: ubuntu-${{ matrix.ubuntu }}-unittests - fail_ci_if_error: true - - name: Retry Upload coverage to Codecov - if: "${{ failure() }} && github.repository == 'milvus-io/milvus'" - uses: codecov/codecov-action@v3.1.1 - id: retry_upload_cov - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./go_coverage.txt,./lcov_output.info - name: ubuntu-${{ matrix.ubuntu }}-unittests - fail_ci_if_error: true \ No newline at end of file diff --git a/.github/workflows/markdown-check.yaml b/.github/workflows/markdown-check.yaml deleted file mode 100644 index 7353589562c09..0000000000000 --- a/.github/workflows/markdown-check.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Markdown Links Check -on: - workflow_dispatch: - schedule: - - cron: "30 20 * * *" - -jobs: - check-links: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - # checks all markdown files from /docs including all subfolders - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - folder-path: 'docs/' - - uses: actions/checkout@master - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - # checks all markdown files from root but ignores subfolders - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - max-depth: 0 \ No newline at end of file diff --git a/.github/workflows/mem-stress-chaos-test.yaml b/.github/workflows/mem-stress-chaos-test.yaml deleted file mode 100644 index 3e34ac8abad14..0000000000000 --- a/.github/workflows/mem-stress-chaos-test.yaml +++ /dev/null @@ -1,197 +0,0 @@ -name: Memory Stress Chaos Test - -on: - workflow_dispatch: -jobs: - - test-memory-stress-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - pod: [datanode, indexnode, proxy, pulsar, querynode, etcd, minio] - - steps: - - - name: Set env param - run: | - echo "RELEASE=test-${{ matrix.pod }}-memory-stress" >> $GITHUB_ENV - - - 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 - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - retry_on: error - shell: bash - command: | - pip install -r tests/python_client/requirements.txt --trusted-host https://test.pypi.org - pip install --upgrade protobuf - - - name: Deploy Chaos Mesh - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install --wait --timeout 360s chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --version v2.0.3 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - kubectl get po -n chaos-testing - - - name: Deploy Milvus - shell: bash - working-directory: tests/python_client/chaos - run: | - echo "latest tag:" - bash ../../../scripts/docker_image_find_tag.sh -n milvusdb/milvus -t master-latest -f master- -F -L -q - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - if [[ ${{ matrix.pod }} != *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f cluster-values.yaml -n=chaos-testing; fi - if [[ ${{ matrix.pod }} == *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f standalone-values.yaml -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Chaos Test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/mem_stress\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_mem_stress.yaml\'/g" constants.py - sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${{ env.RELEASE }}\'/g" constants.py - cat constants.py - timeout 14m pytest -s -v test_chaos.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "chaos test failed" - - - name: Result Analysis - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos/reports - run: | - echo "result analysis" - cat ${{ env.RELEASE }}.log || echo "no log file" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get networkchaos -n chaos-testing - kubectl get pod -n chaos-testing - # wait all pod to be ready - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/chaos-test - - - name: Deploy Milvus Again If Previous E2E Test Failed - timeout-minutes: 15 - if: ${{ failure() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - kubectl config set-context --current --namespace=chaos-testing - bash scripts/uninstall_milvus.sh ${{ env.RELEASE }} - if [ ${{ matrix.pod }} != "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f cluster-values.yaml -n=chaos-testing; fi - if [ ${{ matrix.pod }} == "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set cluster.enabled=false --set etcd.replicaCount=1 --set minio.mode=standalone --set pulsar.enabled=false -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Data Consist Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v test_chaos_data_consist.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "data consist chaos test failed" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/data-consist-test - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon k8s_logs/chaos-mesh-daemon - - - name: Upload logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }} - path: | - tests/python_client/chaos/k8s_logs - tests/python_client/chaos/reports diff --git a/.github/workflows/network-latency-chaos-test.yaml b/.github/workflows/network-latency-chaos-test.yaml deleted file mode 100644 index 47c5f2b6e8912..0000000000000 --- a/.github/workflows/network-latency-chaos-test.yaml +++ /dev/null @@ -1,197 +0,0 @@ -name: Network Latency Chaos Test - -on: - workflow_dispatch: -jobs: - - test-network-latency-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - pod: [datacoord, datanode, indexcoord, indexnode, proxy, pulsar, querycoord, querynode, rootcoord, etcd, minio] - - steps: - - - name: Set env param - run: | - echo "RELEASE=test-${{ matrix.pod }}-network-latency" >> $GITHUB_ENV - - - 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 - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - retry_on: error - shell: bash - command: | - pip install -r tests/python_client/requirements.txt --trusted-host https://test.pypi.org - pip install --upgrade protobuf - - - name: Deploy Chaos Mesh - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install --wait --timeout 360s chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --version v2.0.3 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - kubectl get po -n chaos-testing - - - name: Deploy Milvus - shell: bash - working-directory: tests/python_client/chaos - run: | - echo "latest tag:" - bash ../../../scripts/docker_image_find_tag.sh -n milvusdb/milvus -t master-latest -f master- -F -L -q - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - if [[ ${{ matrix.pod }} != *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f cluster-values.yaml -n=chaos-testing; fi - if [[ ${{ matrix.pod }} == *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f standalone-values.yaml -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Chaos Test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/network_latency\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_network_latency.yaml\'/g" constants.py - sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${{ env.RELEASE }}\'/g" constants.py - cat constants.py - timeout 14m pytest -s -v test_chaos.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "chaos test failed" - - - name: Result Analysis - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos/reports - run: | - echo "result analysis" - cat ${{ env.RELEASE }}.log || echo "no log file" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get networkchaos -n chaos-testing - kubectl get pod -n chaos-testing - # wait all pod to be ready - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/chaos-test - - - name: Deploy Milvus Again If Previous E2E Test Failed - timeout-minutes: 15 - if: ${{ failure() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - kubectl config set-context --current --namespace=chaos-testing - bash scripts/uninstall_milvus.sh ${{ env.RELEASE }} - if [ ${{ matrix.pod }} != "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus -f cluster-values.yaml -n=chaos-testing; fi - if [ ${{ matrix.pod }} == "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set cluster.enabled=false --set etcd.replicaCount=1 --set minio.mode=standalone --set pulsar.enabled=false -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Data Consist Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v test_chaos_data_consist.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "data consist chaos test failed" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/data-consist-test - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon k8s_logs/chaos-mesh-daemon - - - name: Upload logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }} - path: | - tests/python_client/chaos/k8s_logs - tests/python_client/chaos/reports diff --git a/.github/workflows/network-partition-chaos-test.yaml b/.github/workflows/network-partition-chaos-test.yaml deleted file mode 100644 index f970af0409aa4..0000000000000 --- a/.github/workflows/network-partition-chaos-test.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: Network Partition Chaos Test - -on: - workflow_dispatch: - -jobs: - - test-network-partition-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - pod: [datacoord, datanode, indexcoord, indexnode, proxy, pulsar, querycoord, querynode, rootcoord, etcd, minio] - - 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/chaos - run: | - pip install -r ../requirements.txt - pip install --upgrade protobuf - - - name: Deploy Chaos Mesh - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install chaos-mesh chaos-mesh/chaos-mesh -n=chaos-testing --version v2.0.1 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - # wait for all pod running - sleep 60s - kubectl get po -n chaos-testing - - - name: Deploy Milvus - shell: bash - run: | - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - # install milvus with latest image - helm install --wait --timeout 360s chaos-testing milvus/milvus --set cluster.enabled=true --set image.all.repository=milvusdb/milvus --set image.all.tag=master-latest -n=chaos-testing - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/chaos-testing-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - - name: Chaos Test - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/network_partition\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_network_partition.yaml\'/g" constants.py - cat constants.py - pytest -s -v test_chaos.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-testing - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon - - - name: Upload logs - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }} - path: tests/python_client/chaos/k8s_logs \ No newline at end of file diff --git a/.github/workflows/pod-failure-chaos-test.yaml b/.github/workflows/pod-failure-chaos-test.yaml deleted file mode 100644 index 5ea55eae57a2b..0000000000000 --- a/.github/workflows/pod-failure-chaos-test.yaml +++ /dev/null @@ -1,192 +0,0 @@ -name: Cluster N node Chaos Test - -on: - workflow_dispatch: - inputs: - image_tag: - description: The image tag to use for the chaos test - required: true - default: 'master-latest' - image_repo: - description: The image repo to use for the chaos test - required: true - default: 'milvusdb/milvus' - schedule: - - cron: "30 19 * * *" -jobs: - - test-cluster-n-node-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - chaos_type: [pod_failure, pod_kill] - pod: [querynode, datanode, indexnode, proxy] - - steps: - - name: Set env param - env: - DEFAULT_IMAGE_TAG: master-latest - DEFAULT_IMAGE_REPO: milvusdb/milvus - run: | - chaos_type=${{ matrix.chaos_type }} - release="test"-${{ matrix.pod }}-${chaos_type/_/-} - echo "RELEASE=$release" >> $GITHUB_ENV - echo "IMAGE_REPO=${{ github.event.inputs.image_repo || env.DEFAULT_IMAGE_REPO}}" >> $GITHUB_ENV - echo "IMAGE_TAG=${{ github.event.inputs.image_tag || env.DEFAULT_IMAGE_TAG}}" >> $GITHUB_ENV - - 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 - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - retry_on: error - shell: bash - command: | - pip install -r tests/python_client/requirements.txt - - - name: Deploy Chaos Mesh - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --version v2.0.3 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - sleep 60s - kubectl get po -n chaos-testing - - - name: Deploy Milvus - shell: bash - working-directory: tests/python_client/chaos - run: | - echo "latest tag:" - bash ../../../scripts/docker_image_find_tag.sh -n milvusdb/milvus -t master-latest -f master- -F -L -q - declare -A pod_map=( ["querynode"]="queryNode" ["indexnode"]="indexNode" ["datanode"]="dataNode" ["proxy"]="proxy") - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} --set ${pod_map[${{ matrix.pod }}]}.replicas=2 -f cluster-values.yaml -n=chaos-testing - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - pytest -s -v ../testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python scripts/hello_milvus.py --host 127.0.0.1 - - - name: Chaos Test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/${{ matrix.chaos_type }}\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_${{ matrix.chaos_type }}.yaml\'/g" constants.py - sed -i "s/CHAOS_DURATION =.*/CHAOS_DURATION = 80/g" constants.py - sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${{ env.RELEASE }}\'/g" constants.py - cat constants.py - timeout 14m pytest -s -v test_chaos.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "chaos test failed" - - - name: Result Analysis - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos/reports - run: | - echo "result analysis" - cat ${{ env.RELEASE }}.log || echo "no log file" - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/chaos-test - - - name: Data Consist Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v test_chaos_data_consist.py --host 127.0.0.1 --log-cli-level=INFO || echo "data consist chaos test failed" - - - name: Milvus E2E Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/data-consist-test - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon - - - name: Upload logs - if: ${{ ! success() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }}-${{ matrix.chaos_type }} - path: tests/python_client/chaos/k8s_logs diff --git a/.github/workflows/pod-kill-chaos-test-kafka-version.yaml b/.github/workflows/pod-kill-chaos-test-kafka-version.yaml deleted file mode 100644 index 761b66e13ec16..0000000000000 --- a/.github/workflows/pod-kill-chaos-test-kafka-version.yaml +++ /dev/null @@ -1,231 +0,0 @@ -name: Pod Kill Chaos Test For Kafka Version - -on: - workflow_dispatch: - inputs: - image_tag: - description: The image tag to use for the chaos test - required: true - default: 'master-latest' - image_repo: - description: The image repo to use for the chaos test - required: true - default: 'milvusdb/milvus' - schedule: - - cron: "30 17 * * *" -jobs: - - test-pod-kill-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - pod: [allstandalone, allcluster, standalone, datacoord, datanode, indexcoord, indexnode, proxy, kafka, querycoord, querynode, rootcoord, etcd, minio] - - steps: - - - name: Set env param - env: - DEFAULT_IMAGE_TAG: master-latest - DEFAULT_IMAGE_REPO: milvusdb/milvus - run: | - echo "RELEASE=test-${{ matrix.pod }}-pod-kill" >> $GITHUB_ENV - echo "IMAGE_REPO=${{ github.event.inputs.image_repo || env.DEFAULT_IMAGE_REPO}}" >> $GITHUB_ENV - echo "IMAGE_TAG=${{ github.event.inputs.image_tag || env.DEFAULT_IMAGE_TAG}}" >> $GITHUB_ENV - - - 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 - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - retry_on: error - shell: bash - command: | - pip install -r tests/python_client/requirements.txt --trusted-host https://test.pypi.org - - - name: Deploy Chaos Mesh - timeout-minutes: 2 - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install --wait --timeout 360s chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --version v2.0.3 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - kubectl get po -n chaos-testing - - - name: Deploy Milvus - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - echo "latest tag:" - bash ../../../scripts/docker_image_find_tag.sh -n milvusdb/milvus -t master-latest -f master- -F -L -q - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - if [[ ${{ matrix.pod }} != *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set pulsar.enabled=false --set kafka.enabled=true --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} -f cluster-values.yaml -n=chaos-testing; fi - if [[ ${{ matrix.pod }} == *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set pulsar.enabled=false --set kafka.enabled=true --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} -f standalone-values.yaml -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Chaos Test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/pod_kill\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_pod_kill.yaml\'/g" constants.py - sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${{ env.RELEASE }}\'/g" constants.py - cat constants.py - timeout 14m pytest -s -v test_chaos.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "chaos test failed" - - - name: Result Analysis - timeout-minutes: 1 - shell: bash - working-directory: tests/python_client/chaos/reports - run: | - echo "result analysis" - cat ${{ env.RELEASE }}.log || echo "no log file" - - - name: Wait all pods ready - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - # wait all pod to be ready - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - - name: Run e2e test after chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client - run: | - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - name: Run hello_milvus after chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client - run: | - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Verify all collections after chaos - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client - run: | - python chaos/scripts/verify_all_collections.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/chaos-test - - - name: Deploy Milvus Again If Previous E2E Test Failed - timeout-minutes: 15 - if: ${{ failure() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - kubectl config set-context --current --namespace=chaos-testing - bash scripts/uninstall_milvus.sh ${{ env.RELEASE }} - if [ ${{ matrix.pod }} != "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} -f cluster-values.yaml -n=chaos-testing; fi - if [ ${{ matrix.pod }} == "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} --set cluster.enabled=false --set etcd.replicaCount=1 --set minio.mode=standalone --set pulsar.enabled=false -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Data Consist Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v test_chaos_data_consist.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/data-consist-test - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon k8s_logs/chaos-mesh-daemon - - - name: Upload logs - if: ${{ ! success() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }} - path: | - tests/python_client/chaos/k8s_logs - tests/python_client/chaos/reports diff --git a/.github/workflows/pod-kill-chaos-test.yaml b/.github/workflows/pod-kill-chaos-test.yaml deleted file mode 100644 index 0290f43e21457..0000000000000 --- a/.github/workflows/pod-kill-chaos-test.yaml +++ /dev/null @@ -1,231 +0,0 @@ -name: Pod Kill Chaos Test - -on: - workflow_dispatch: - inputs: - image_tag: - description: The image tag to use for the chaos test - required: true - default: 'master-latest' - image_repo: - description: The image repo to use for the chaos test - required: true - default: 'milvusdb/milvus' - schedule: - - cron: "30 18 * * *" -jobs: - - test-pod-kill-chaos: - - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - pod: [allstandalone, allcluster, standalone, datacoord, datanode, indexcoord, indexnode, proxy, pulsar, querycoord, querynode, rootcoord, etcd, minio] - - steps: - - - name: Set env param - env: - DEFAULT_IMAGE_TAG: master-latest - DEFAULT_IMAGE_REPO: milvusdb/milvus - run: | - echo "RELEASE=test-${{ matrix.pod }}-pod-kill" >> $GITHUB_ENV - echo "IMAGE_REPO=${{ github.event.inputs.image_repo || env.DEFAULT_IMAGE_REPO}}" >> $GITHUB_ENV - echo "IMAGE_TAG=${{ github.event.inputs.image_tag || env.DEFAULT_IMAGE_TAG}}" >> $GITHUB_ENV - - - 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 - uses: nick-invision/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 3 - retry_on: error - shell: bash - command: | - pip install -r tests/python_client/requirements.txt --trusted-host https://test.pypi.org - - - name: Deploy Chaos Mesh - timeout-minutes: 2 - shell: bash - run: | - helm repo add chaos-mesh https://charts.chaos-mesh.org - helm search repo chaos-mesh - kubectl create ns chaos-testing - helm install --wait --timeout 360s chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-testing --version v2.0.3 --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock - kubectl get po -n chaos-testing - - - name: Deploy Milvus - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - echo "latest tag:" - bash ../../../scripts/docker_image_find_tag.sh -n milvusdb/milvus -t master-latest -f master- -F -L -q - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - if [[ ${{ matrix.pod }} != *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} -f cluster-values.yaml -n=chaos-testing; fi - if [[ ${{ matrix.pod }} == *"standalone"* ]]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} -f standalone-values.yaml -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Chaos Test - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - # replace chaos object - sed -i "s/TESTS_CONFIG_LOCATION =.*/TESTS_CONFIG_LOCATION = \'chaos_objects\/pod_kill\/'/g" constants.py - sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_pod_kill.yaml\'/g" constants.py - sed -i "s/RELEASE_NAME =.*/RELEASE_NAME = \'${{ env.RELEASE }}\'/g" constants.py - cat constants.py - timeout 14m pytest -s -v test_chaos.py --host 127.0.0.1 --log-cli-level=INFO --capture=no || echo "chaos test failed" - - - name: Result Analysis - timeout-minutes: 1 - shell: bash - working-directory: tests/python_client/chaos/reports - run: | - echo "result analysis" - cat ${{ env.RELEASE }}.log || echo "no log file" - - - name: Wait all pods ready - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - # wait all pod to be ready - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - - sleep 20s - nc -vz 127.0.0.1 19530 - - - name: Run e2e test after chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client - run: | - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - name: Run hello_milvus after chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client - run: | - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Verify all collections after chaos - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client - run: | - python chaos/scripts/verify_all_collections.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/chaos-test - - - name: Deploy Milvus Again If Previous E2E Test Failed - timeout-minutes: 15 - if: ${{ failure() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - kubectl config set-context --current --namespace=chaos-testing - bash scripts/uninstall_milvus.sh ${{ env.RELEASE }} - if [ ${{ matrix.pod }} != "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} -f cluster-values.yaml -n=chaos-testing; fi - if [ ${{ matrix.pod }} == "standalone" ]; then helm install --wait --timeout 720s ${{ env.RELEASE }} milvus/milvus --set image.all.repository=${{ env.IMAGE_REPO }} --set image.all.tag=${{ env.IMAGE_TAG }} --set cluster.enabled=false --set etcd.replicaCount=1 --set minio.mode=standalone --set pulsar.enabled=false -n=chaos-testing; fi - kubectl get pods -n chaos-testing - sleep 20s - kubectl get pods -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - # check whether milvus server is healthy - python scripts/hello_milvus.py - - - name: Data Consist Test - timeout-minutes: 5 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v test_chaos_data_consist.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - name: Milvus E2E Test - timeout-minutes: 10 - if: ${{ always() }} - shell: bash - working-directory: tests/python_client - run: | - kubectl get pod -n chaos-testing - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl wait --for=condition=Ready pod -l release=${{ env.RELEASE }} -n chaos-testing --timeout=360s - kubectl get pod -n chaos-testing - ps aux|grep forward|grep -v grep|awk '{print $2}'|xargs kill -9 - kubectl port-forward service/${{ env.RELEASE }}-milvus 19530 -n chaos-testing >/dev/null 2>&1 & - sleep 20s - nc -vz 127.0.0.1 19530 - - pytest -s -v testcases/test_e2e.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - python chaos/scripts/hello_milvus.py --host 127.0.0.1 - - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: tests/python_client/chaos - run: | - #in this step, verify whether pod has been killed by pod's age - kubectl get po -n chaos-testing - # export k8s log for chaos mesh and milvus - bash ../../scripts/export_log_k8s.sh chaos-testing ${{ env.RELEASE }} k8s_logs/data-consist-test - bash ../../scripts/export_log_k8s.sh chaos-testing chaos-daemon k8s_logs/chaos-mesh-daemon - - - name: Upload logs - if: ${{ ! success() }} - uses: actions/upload-artifact@v2 - with: - name: logs-${{ matrix.pod }} - path: | - tests/python_client/chaos/k8s_logs - tests/python_client/chaos/reports diff --git a/.github/workflows/publish-builder.yaml b/.github/workflows/publish-builder.yaml deleted file mode 100644 index fe59a06779d49..0000000000000 --- a/.github/workflows/publish-builder.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: Publish Builder -# TODO: do not trigger action for some document file update - -# This workflow is triggered on pushes or pull request to the repository. -on: - push: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/builder/**' - - '.github/workflows/publish-builder.yaml' - - '!**.md' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/builder/**' - - '.github/workflows/publish-builder.yaml' - - '!**.md' - -jobs: - publish-builder: - name: AMD64 ${{ matrix.os }} - runs-on: ubuntu-latest - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - os: [ubuntu18.04, ubuntu20.04, centos7] - env: - OS_NAME: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get version from system time after release step - id: extracter - run: | - echo "::set-output name=version::$(date +%Y%m%d)" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: Docker Pull - shell: bash - run: | - docker-compose pull --ignore-pull-failures builder - - name: Docker Build - shell: bash - run: | - DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose build builder - export LATEST_DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} - DATE_VERSION=latest docker-compose build builder - - name: Docker Push - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' - continue-on-error: true - shell: bash - run: | - docker login -u ${{ secrets.DOCKERHUB_USER }} \ - -p ${{ secrets.DOCKERHUB_TOKEN }} - DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose push builder - DATE_VERSION=latest docker-compose push builder - - name: Update Builder Image Changes - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' - continue-on-error: true - shell: bash - run: | - sed -i "s#^DATE_VERSION=.*#DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" .env - sed -i "s#^LATEST_DATE_VERSION=.*#LATEST_DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" .env - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add .env - git commit -m "Update Builder image changes" - - name: Create Pull Request - id: cpr - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04' - continue-on-error: true - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - signoff: false - branch: update_builder_${{ github.sha }} - delete-branch: true - title: '[automated] Update Builder image changes' - body: | - Update Builder image changes - See changes: https://github.com/milvus-io/milvus/commit/${{ github.sha }} - Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com - - name: Check outputs - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04' - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/publish-krte-images.yaml b/.github/workflows/publish-krte-images.yaml deleted file mode 100644 index ba4881b653fef..0000000000000 --- a/.github/workflows/publish-krte-images.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: Publish KRTE Images -# TODO: do not trigger action for some document file update - -# This workflow is triggered on pushes or pull request to the repository. -on: - workflow_dispatch: - push: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/krte/**' - - '.github/workflows/publish-krte-images.yaml' - - '!**.md' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/krte/**' - - '.github/workflows/publish-krte-images.yaml' - - '!**.md' - -jobs: - publish-krte-images: - name: KRTE - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get version from system time after release step - id: extracter - run: | - echo "::set-output name=version::$(date +%Y%m%d)" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: Docker Build - shell: bash - working-directory: build/docker/krte - run: | - export TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} - docker build --build-arg IMAGE_ARG="milvusdb/krte:$TAG" --build-arg GO_VERSION=1.15.8 -t "milvusdb/krte:$TAG" . - - name: Docker Push - if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' )&& github.repository == 'milvus-io/milvus' - continue-on-error: true - shell: bash - run: | - docker login -u ${{ secrets.DOCKERHUB_USER }} \ - -p ${{ secrets.DOCKERHUB_TOKEN }} - export TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} - docker push "milvusdb/krte:$TAG" - echo "Push krte image Succeeded" - - name: Update KRTE Image Changes - if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.repository == 'milvus-io/milvus' - continue-on-error: true - shell: bash - working-directory: build/ci/jenkins/pod - run: | - export TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} - sed -i "s#krte:.*#krte:${TAG}#g" ./build/ci/jenkins/pod/rte.yaml - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add rte.yaml - git commit -m "Update KRTE image changes" - - name: Create Pull Request - id: cpr - if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.repository == 'milvus-io/milvus' - continue-on-error: true - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - signoff: false - branch: update_krte_${{ github.sha }} - delete-branch: true - title: '[automated] Update KRTE image changes' - body: | - Update KRTE image changes - - Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com - - name: Check outputs - if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.repository == 'milvus-io/milvus' - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/publish-test-images.yaml b/.github/workflows/publish-test-images.yaml deleted file mode 100644 index fd6e5ccf84768..0000000000000 --- a/.github/workflows/publish-test-images.yaml +++ /dev/null @@ -1,93 +0,0 @@ -name: Publish Test Images -# TODO: do not trigger action for some document file update - -# This workflow is triggered on pushes or pull request to the repository. -on: - push: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'tests/docker/Dockerfile' - - 'tests/python_client/requirements.txt' - - '.github/workflows/publish-test-images.yaml' - - '!**.md' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'tests/docker/Dockerfile' - - 'tests/python_client/requirements.txt' - - '.github/workflows/publish-test-images.yaml' - - '!**.md' - -jobs: - publish-pytest-images: - name: PyTest - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get version from system time after release step - id: extracter - run: | - echo "::set-output name=version::$(date +%Y%m%d)" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: Docker Pull - shell: bash - working-directory: tests/docker - run: | - docker-compose pull --ignore-pull-failures pytest - - name: Docker Build - shell: bash - working-directory: tests/docker - run: | - IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose build pytest - export LATEST_IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} - IMAGE_TAG=latest docker-compose build pytest - - name: Docker Push - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' - continue-on-error: true - shell: bash - working-directory: tests/docker - run: | - docker login -u ${{ secrets.DOCKERHUB_USER }} \ - -p ${{ secrets.DOCKERHUB_TOKEN }} - IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose push pytest - IMAGE_TAG=latest docker-compose push pytest - echo "Push pytest image Succeeded" - - name: Update Pytest Image Changes - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' - continue-on-error: true - shell: bash - working-directory: . - run: | - sed -i "s#^IMAGE_TAG=.*#IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./tests/docker/.env - sed -i "s#^LATEST_IMAGE_TAG=.*#LATEST_IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./tests/docker/.env - sed -i "s#pytest:.*#pytest:${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./ci/jenkins/pod/rte.yaml - sed -i "s#pytest:.*#pytest:${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" ./ci/jenkins/pod/e2e.yaml - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add ./tests/docker/.env - git add ./ci/jenkins/pod/rte.yaml - git add ./ci/jenkins/pod/e2e.yaml - git commit -m "Update Pytest image changes" - - name: Create Pull Request - id: cpr - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' - continue-on-error: true - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> - signoff: true - branch: update_pytest_${{ github.sha }} - delete-branch: true - title: '[automated] Update Pytest image changes' - body: | - Update Pytest image changes - See changes: https://github.com/milvus-io/milvus/commit/${{ github.sha }} - Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com - - name: Check outputs - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000000..ef0515204335c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Release windows + +# This workflow is triggered on pushes or pull request to the repository. +on: + push: + tags: + - windows-* + +jobs: + windows: + name: Release windows + runs-on: windows-2019 + timeout-minutes: 90 + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout + uses: actions/checkout@v2 + - name: Cache go + uses: actions/cache@v3 + with: + path: | + %LocalAppData%\go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- + - name: Cache ccache + uses: actions/cache@v3 + with: + path: | + ${{ github.workspace }}/.ccache + key: ${{ runner.os }}-ccache-${{ hashFiles('internal/core/**') }} + restore-keys: ${{ runner.os }}-ccache- + - name: Configure Toolchain + uses: msys2/setup-msys2@v2.12.0 + with: + msystem: mingw64 + - name: Install Deps + shell: msys2 {0} + run: | + sh scripts/install_deps_msys.sh + - name: Build Milvus and package + shell: msys2 {0} + env: + CCACHE_COMPILERCHECK: content + CCACHE_COMPRESS: 1 + CCACHE_COMPRESSLEVEL: 5 + CCACHE_MAXSIZE: 2G + CCACHE_DIR: ${{ github.workspace }}/.ccache + run: | + mingw32-make + sh scripts/package_windows.sh + - name: release + uses: ncipollo/release-action@v1 + with: + artifacts: "windows_package/milvus*.zip" + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rerun-failure-checks.yaml b/.github/workflows/rerun-failure-checks.yaml deleted file mode 100644 index fa779cfd46304..0000000000000 --- a/.github/workflows/rerun-failure-checks.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Rerun Failure Checks -on: - issue_comment: - types: [created] -jobs: - rerun-checks: - if: "github.event_name == 'issue_comment'&& startsWith(github.event.comment.body, 'rerun ut')" - runs-on: ubuntu-latest - steps: - - name: Is Organization Member - shell: bash - if: "github.event_name == 'issue_comment'" - id: is_organization_member - run: | - response_code=$(curl -sIL -w %{http_code} -H "Authorization: token ${{ secrets.RERUN_BOT_TOKEN }}" -H "Accept: application/vnd.github.v3+json" \ - -o /dev/null https://api.github.com/orgs/${GITHUB_REPOSITORY_OWNER}/members/${{ github.event.sender.login }}) - echo " response code is ${response_code} " - if [[ ${response_code} == '204' ]];then - echo "::set-output name=is-member::true" - elif [[ ${response_code} == '404' ]]; then - echo "::set-output name=is-member::false" - else - echo "Please check if the repository secret RERUN_BOT_TOKEN still exists and have the permission to read organization membership." - exit 1 - fi - - name: Create Comment for Non-Org Member - if: "github.event_name == 'issue_comment' && steps.is_organization_member.outputs.is-member == 'false'" - uses: actions-cool/issues-helper@v2.5.0 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | - Hello ${{ github.event.sender.login }}, you are not in the organization, so you do not have the permission to rerun the workflow, please contact `@milvus-io/milvus-maintainers` for help. - - uses: actions/checkout@v2 - - name: Rerun Failure Checks - if: "github.event_name == 'issue_comment' && steps.is_organization_member.outputs.is-member == 'true'" - uses: zymap/bot@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # replace here to your token - with: - repo_owner: milvus-io # replace here to your repo owner - repo_name: milvus # replace here to your repo name - rerun_cmd: rerun ut - comment: ${{ github.event.comment.body }} - - \ No newline at end of file diff --git a/.github/workflows/simd-compatibility-test.yaml b/.github/workflows/simd-compatibility-test.yaml deleted file mode 100644 index ee26169de6f4e..0000000000000 --- a/.github/workflows/simd-compatibility-test.yaml +++ /dev/null @@ -1,87 +0,0 @@ -name: SIMD Compatibility Test - -on: - workflow_dispatch: - schedule: - - cron: "30 18 * * 0" - -jobs: - test-simd-compatibility: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - simd_type: ["sse4_2", "avx", "avx2", "avx512"] - 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: install milvus operator and milvus cluster - shell: bash - working-directory: tests/python_client/customize/template - run: | - kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.3/cert-manager.yaml - sleep 30s - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=cert-manager -n cert-manager --timeout=360s - kubectl get pods -A - - #install milvus operator - kubectl apply -f https://raw.githubusercontent.com/milvus-io/milvus-operator/main/deploy/manifests/deployment.yaml - sleep 30s - kubectl wait --for=condition=Ready pod --all -n milvus-operator --timeout=360s - kubectl get pods -A - #install milvus cluster - - # change simdType - sed -i "s/simdType.*/simdType\: ${{ matrix.simd_type }}/g" minimum.yaml - kubectl apply -f minimum.yaml - sleep 60s - # wait all pod running - kubectl get pods -A - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=my-release-minio --timeout=360s - kubectl get pods -A - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=my-release-etcd --timeout=360s - kubectl get pods -A - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=my-release-pulsar --timeout=360s - kubectl get pods -A - sleep 60s - kubectl get pods -A - kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=my-release --timeout=360s - sleep 30s - kubectl get pods -A - - # port-forward - kubectl port-forward service/my-release-milvus 19530 >/dev/null 2>&1 & - sleep 20s - # check whether port-forward success - nc -vz 127.0.0.1 19530 - - - name: Run E2E test - shell: bash - working-directory: tests/python_client/chaos - run: | - python scripts/hello_milvus.py diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml deleted file mode 100644 index ee9ceb1647206..0000000000000 --- a/.github/workflows/weekly-release.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Weekly Release -on: - 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: '0 0 * * 2,5' - -jobs: - nightly: - name: Run Weekly Release - if: github.repository == 'milvus-io/milvus' - runs-on: ubuntu-latest - env: - IMAGE_REPO: "milvusdb" - DEV: "milvus" - WEEKLY: "weekly-build" - TAG_PREFIX: "master-" - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - - name: Get the latest of Milvus dev image tag - shell: bash - working-directory: scripts - run: echo "tag=$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/${DEV} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV - - - - name: Pull latest milvus image with tag prefix master- - run: | - docker pull "${IMAGE_REPO}/${DEV}:${{ env.tag }}" - docker tag "${IMAGE_REPO}/${DEV}:${{ env.tag }}" "${IMAGE_REPO}/${WEEKLY}:${{ env.tag }}" - - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push Docker image - run: | - docker push "${IMAGE_REPO}/${WEEKLY}:${{ env.tag }}" - - - name: Set release build - shell: bash - run: | - tag=${{ env.tag }} - IFS=- read branch date sha <<< "$tag" - echo "build=$date" >> $GITHUB_ENV - echo "sha=$(git rev-parse $sha)" >> $GITHUB_ENV - - - name: Create a weekly release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - body: "Image: ${{ env.IMAGE_REPO}}/${{ env.WEEKLY }}:${{ env.tag }}" - prerelease: true - tag_name: "v2.2-testing-${{ env.build }}" - release_name: "milvus-2.2-testing-${{ env.build }}" - commitish: "${{ env.sha }}" - -