From 9bbd3dab781d3dcb682f61ba05e912aabf617637 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 16:49:24 -0400 Subject: [PATCH 01/14] terraforming for image build Signed-off-by: Ryan Cook --- .github/workflows/remote-rhel-build.yaml | 48 +++++++++++++ .gitignore | 1 + main.tf | 87 ++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 .github/workflows/remote-rhel-build.yaml create mode 100644 main.tf diff --git a/.github/workflows/remote-rhel-build.yaml b/.github/workflows/remote-rhel-build.yaml new file mode 100644 index 0000000000000..a8fa3ad57c73f --- /dev/null +++ b/.github/workflows/remote-rhel-build.yaml @@ -0,0 +1,48 @@ +name: Remote RHEL Build + +on: + workflow_dispatch: + +env: + AWS_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_VAR_vpc_id: ${{ secrets.VPC_ID }} + TF_VAR_rh_access: ${{ secrets.RH_ACCESS }} + TF_VAR_rh_org: ${{ secrets.RH_ORG }} + +jobs: + podman-remote: + runs-on: ubuntu-latest + steps: + - uses: hashicorp/setup-terraform@v3 + + - name: Checkout code + uses: actions/checkout@v2 + + - name: sshkeygen for ansible + run: ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" + + - name: Terraform Init + run: terraform init + + - name: Terraform Apply + run: terraform apply -auto-approve + + - name: Install podman remote + run: | + sudo apt-get install -y podman + sudo apt-get install -y jq + + - name: jq parse the terraform state for the public ip + run: | + PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') + podman system connection add terraform --identity ~/.ssh/id_rsa ssh://$PUBLIC_IP/run/user/1000/podman/podman.sock + + - name: Build image + run: | + podman-remote build -f build/docker/builder/cpu/rhel9/Containerfile . + + - name: Terraform Destroy + if: always() + run: terraform destroy -auto-approve \ No newline at end of file diff --git a/.gitignore b/.gitignore index 17c251a7be6af..466d92999d549 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,4 @@ internal/proto/**/*.pb.go internal/core/src/pb/*.pb.h internal/core/src/pb/*.pb.cc **/legacypb/*.pb.go +terraform.tfvars diff --git a/main.tf b/main.tf new file mode 100644 index 0000000000000..96a5d8f6fd2a6 --- /dev/null +++ b/main.tf @@ -0,0 +1,87 @@ +variable "vpc_id" { + type = string +} + +variable "ssh_public_key_path" { + type = string + default = "~/.ssh/id_rsa.pub" +} + +variable "ssh_private_key_path" { + type = string + default = "~/.ssh/id_rsa" +} + + +variable "ami_id" { + type = string + default = "ami-0d77c9d87c7e619f9" +} + +variable "rh_access" { + sensitive = true + type = string +} + +variable "rh_org" { + sensitive = true + type = string +} + + +// generate a new security group to allow ssh and https traffic +resource "aws_security_group" "builder-access" { + name = "builder-access" + description = "Allow ssh and https traffic" + vpc_id = var.vpc_id + + ingress { + description = "SSH from VPC" + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "aws_key_pair" "sigkey" { + key_name = uuid() + public_key = file(var.ssh_public_key_path) +} + +resource "aws_instance" "builder" { + ami = var.ami_id + instance_type = "m5.large" + associate_public_ip_address = true + vpc_security_group_ids = [aws_security_group.builder-access.id] + key_name = aws_key_pair.sigkey.key_name + + provisioner "remote-exec" { + inline = [ + "sudo cloud-init status --wait", + "echo 'Connection Established'", + "sudo subscription-manager register --activationkey=${var.rh_access} --org=${var.rh_org} --force", + "sudo dnf -y install container-tools podman", + "sudo subscription-manager config --rhsm.manage_repos=1", + "systemctl enable --now podman.socket --user", + ] + } + connection { + type = "ssh" + user = "ec2-user" + host = self.public_ip + private_key = file(var.ssh_private_key_path) + } +} + +// Output public ip address +output "public_ip" { + value = aws_instance.builder.public_ip +} From c2908a91b7321759c1e69a22b304b9ea4c8953b1 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 18:39:29 -0400 Subject: [PATCH 02/14] Update remote-rhel-build.yaml --- .github/workflows/remote-rhel-build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/remote-rhel-build.yaml b/.github/workflows/remote-rhel-build.yaml index a8fa3ad57c73f..92c60192694ae 100644 --- a/.github/workflows/remote-rhel-build.yaml +++ b/.github/workflows/remote-rhel-build.yaml @@ -10,6 +10,7 @@ env: TF_VAR_vpc_id: ${{ secrets.VPC_ID }} TF_VAR_rh_access: ${{ secrets.RH_ACCESS }} TF_VAR_rh_org: ${{ secrets.RH_ORG }} + TF_VAR_ami_id: ${{ secrets.AMI_ID }} jobs: podman-remote: @@ -45,4 +46,4 @@ jobs: - name: Terraform Destroy if: always() - run: terraform destroy -auto-approve \ No newline at end of file + run: terraform destroy -auto-approve From 59c6738aaad65be8870982a95d86ba8967ea3eea Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 19:44:50 -0400 Subject: [PATCH 03/14] podman remote install Signed-off-by: Ryan Cook --- .github/workflows/remote-rhel-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remote-rhel-build.yaml b/.github/workflows/remote-rhel-build.yaml index 92c60192694ae..4a3d6cbf74ec7 100644 --- a/.github/workflows/remote-rhel-build.yaml +++ b/.github/workflows/remote-rhel-build.yaml @@ -32,7 +32,7 @@ jobs: - name: Install podman remote run: | - sudo apt-get install -y podman + sudo apt-get install -y podman podman-remote sudo apt-get install -y jq - name: jq parse the terraform state for the public ip From 768a5835be01c5d38bac090ab7e98038f849e419 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 19:48:59 -0400 Subject: [PATCH 04/14] bump in hope package exists Signed-off-by: Ryan Cook --- .github/workflows/remote-rhel-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remote-rhel-build.yaml b/.github/workflows/remote-rhel-build.yaml index 4a3d6cbf74ec7..58c24f2166bd3 100644 --- a/.github/workflows/remote-rhel-build.yaml +++ b/.github/workflows/remote-rhel-build.yaml @@ -14,7 +14,7 @@ env: jobs: podman-remote: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: hashicorp/setup-terraform@v3 From 1de65f818fdeb9e112198b9cb4b2c03b7eb29af8 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 20:28:26 -0400 Subject: [PATCH 05/14] clean out jobs Signed-off-by: Ryan Cook --- .github/workflows/all-contributors.yaml | 67 ---- .github/workflows/bump-version.yaml | 54 --- .github/workflows/check-issue.yaml | 48 --- .github/workflows/code-checker.yaml | 114 ------ .github/workflows/daily-release.yml | 71 ---- .github/workflows/deploy-test.yaml | 400 ------------------- .github/workflows/io-latency-chaos-test.yaml | 197 --------- .github/workflows/jenkins-checker.yaml | 60 --- .github/workflows/license-checker.yaml | 14 - .github/workflows/mac.yaml | 95 ----- .github/workflows/main.yaml | 280 ------------- .github/workflows/markdown-check.yaml | 24 -- .github/workflows/mem-stress-chaos-test.yaml | 197 --------- 13 files changed, 1621 deletions(-) delete mode 100644 .github/workflows/all-contributors.yaml delete mode 100644 .github/workflows/bump-version.yaml delete mode 100644 .github/workflows/check-issue.yaml delete mode 100644 .github/workflows/code-checker.yaml delete mode 100644 .github/workflows/daily-release.yml delete mode 100644 .github/workflows/deploy-test.yaml delete mode 100644 .github/workflows/io-latency-chaos-test.yaml delete mode 100644 .github/workflows/jenkins-checker.yaml delete mode 100644 .github/workflows/license-checker.yaml delete mode 100644 .github/workflows/mac.yaml delete mode 100644 .github/workflows/main.yaml delete mode 100644 .github/workflows/markdown-check.yaml delete mode 100644 .github/workflows/mem-stress-chaos-test.yaml diff --git a/.github/workflows/all-contributors.yaml b/.github/workflows/all-contributors.yaml deleted file mode 100644 index 71763b56d249c..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: ${{ github.workspace }} - - - 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: ${{ github.workspace }} - - - name: commit code - run: | - pwd - git config --system user.email "sre-ci-robot@zilliz.com" - git config --system 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/bump-version.yaml b/.github/workflows/bump-version.yaml deleted file mode 100644 index f7e138538a23b..0000000000000 --- a/.github/workflows/bump-version.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Bump Milvus Version - -on: - workflow_dispatch: - inputs: - imageTag: - description: "the milvus image tag" - required: true - type: string - oldImageTag: - description: "the milvus old image tag" - required: true - type: string - -jobs: - update-knowhere-commits: - name: Bump Milvus Version for release - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Update milvus image tag - # continue-on-error: true - shell: bash - run: | - # sed -i "s#( image: milvusdb/milvus:.*#( image: milvusdb/milvus:${{ inputs.imageTag }} )#g" deployments/docker/standalone/docker-compose.yml - sed -i "s/milvusdb\/milvus:${{ inputs.oldImageTag }}/milvusdb\/milvus:${{ inputs.imageTag }}/g" deployments/docker/standalone/docker-compose.yml - sed -i "s/milvusdb\/milvus:${{ inputs.oldImageTag }}/milvusdb\/milvus:${{ inputs.imageTag }}/g" deployments/binary/README.md - sed -i "s/milvusdb\/milvus:${{ inputs.oldImageTag }}/milvusdb\/milvus:${{ inputs.imageTag }}/g" deployments/docker/gpu/standalone/docker-compose.yml - sed -i "s/milvusdb\/milvus:${{ inputs.oldImageTag }}/milvusdb\/milvus:${{ inputs.imageTag }}/g" deployments/docker/cluster-distributed-deployment/inventory.ini - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add deployments - git status - git commit -m "Bump milvus version to ${{ inputs.imageTag }}" - - name: Create Pull Request - id: cpr - continue-on-error: true - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - author: sre-ci-robot - signoff: true - branch: bump_milvus_commit_${{ github.sha }} - delete-branch: true - title: '[automated] Bump milvus version to ${{ inputs.imageTag }}' - body: | - Bump milvus version to ${{ inputs.imageTag }} - Signed-off-by: sre-ci-robot sre-ci-robot@users.noreply.github.com - - name: Check outputs - 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/check-issue.yaml b/.github/workflows/check-issue.yaml deleted file mode 100644 index 952c07641b91c..0000000000000 --- a/.github/workflows/check-issue.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Add Comment for issue - -on: - issues: - types: [opened] - -jobs: - check_issue_title: - name: Check issue - runs-on: ubuntu-latest - env: - TITLE_PASSED: "T" - permissions: - issues: write - timeout-minutes: 20 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Check Issue - shell: bash - run: | - echo Issue title: ${{ github.event.issue.title }} - cat >> check_title.py << EOF - import re - import sys - check_str = sys.argv[1] - pattern = re.compile(r'[\u4e00-\u9fa5]') - match = pattern.search(check_str) - if match: - print("TITLE_PASSED=F") - else: - print("TITLE_PASSED=T") - EOF - - python3 check_title.py "${{ github.event.issue.title }}" >> "$GITHUB_ENV" - cat $GITHUB_ENV - - - name: Check env - shell: bash - run: | - echo ${{ env.TITLE_PASSED }} - - name: Add comment - if: ${{ env.TITLE_PASSED == 'F'}} - uses: peter-evans/create-or-update-comment@5f728c3dae25f329afbe34ee4d08eef25569d79f - with: - issue-number: ${{ github.event.issue.number }} - body: | - The title and description of this issue contains Chinese. Please use English to describe your issue. \ No newline at end of file diff --git a/.github/workflows/code-checker.yaml b/.github/workflows/code-checker.yaml deleted file mode 100644 index 659680126d33e..0000000000000 --- a/.github/workflows/code-checker.yaml +++ /dev/null @@ -1,114 +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/**' - - 'pkg/**' - - 'client/**' - - 'cmd/**' - - 'build/**' - - 'tests/integration/**' - - '.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 - - .golangci.yml - - rules.go - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - ubuntu: - name: Code Checker AMD64 Ubuntu 20.04 - runs-on: ubuntu-latest - timeout-minutes: 180 - strategy: - fail-fast: false - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Checkout - uses: actions/checkout@v2 - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'ubuntu20.04' - - name: Code Check - env: - OS_NAME: 'ubuntu20.04' - run: | - ./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers" - - amazonlinux: - name: Code Checker Amazonlinux 2023 - # Run in amazonlinux docker - runs-on: ubuntu-latest - timeout-minutes: 180 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Checkout - uses: actions/checkout@v2 - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'amazonlinux2023' - - name: Code Check - run: | - sed -i 's/ubuntu20.04/amazonlinux2023/g' .env - ./build/builder.sh /bin/bash -c "make install" - - rockylinux: - name: Code Checker rockylinux8 - # Run in amazonlinux docker - runs-on: ubuntu-latest - timeout-minutes: 180 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Checkout - uses: actions/checkout@v2 - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'rockylinux8' - - name: Code Check - run: | - sed -i 's/ubuntu20.04/rockylinux8/g' .env - ./build/builder.sh /bin/bash -c "make install" 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 7271b9feede6e..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://zilliztech.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 a231f0a36c8f8..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://zilliztech.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 ccb21ebaab5af..0000000000000 --- a/.github/workflows/mac.yaml +++ /dev/null @@ -1,95 +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/**' - - 'pkg/**' - - 'client/**' - - 'cmd/**' - - 'build/**' - - 'tests/integration/**' - - '.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 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - mac: - name: Code Checker MacOS 12 - runs-on: macos-12 - timeout-minutes: 300 - 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 CCache Volumes - uses: actions/cache@v3 - with: - path: /var/tmp/ccache - key: macos-ccache-${{ env.corehash }} - restore-keys: macos-ccache- - - name: Setup Python environment - uses: actions/setup-python@v4 - with: - python-version: '<3.12' - - name: Setup Go environment - uses: actions/setup-go@v2.2.0 - with: - go-version: '~1.21.10' - - 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: Mac Cache Conan Packages - uses: actions/cache@v3 - with: - path: ~/.conan - key: macos-conan-${{ hashFiles('internal/core/conanfile.*') }} - restore-keys: macos-conan- - - name: Code Check - env: - CCACHE_DIR: /var/tmp/ccache - CCACHE_COMPILERCHECK: content - CCACHE_COMPRESS: 1 - CCACHE_COMPRESSLEVEL: 5 - CCACHE_MAXSIZE: 2G - run: | - if [[ ! -d "/var/tmp/ccache" ]];then - mkdir -p /var/tmp/ccache - fi - ls -alh /var/tmp/ccache - brew install libomp ninja openblas ccache pkg-config - pip3 install conan==1.61.0 - if [[ ! -d "/usr/local/opt/llvm" ]]; then - ln -s /usr/local/opt/llvm@14 /usr/local/opt/llvm - fi - make milvus - - name: Upload Cmake log - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: cmake-log - path: cmake_build/CMakeFiles/*.log diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index b2a965cbdafe4..0000000000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,280 +0,0 @@ -name: Build and test - -# 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/**' - - 'client/**' - - 'pkg/**' - - 'cmd/**' - - 'build/**' - - 'tests/integration/**' # run integration test - - '.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/**' - - 'pkg/**' - - 'client/**' - - 'cmd/**' - - 'build/**' - - 'tests/integration/**' # run integration test - - '.github/workflows/main.yaml' - - '.env' - - docker-compose.yml - - Makefile - - go.mod - - '!**.md' - - '!build/ci/jenkins/**' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - Build: - name: Build and test AMD64 Ubuntu 20.04 - runs-on: ubuntu-latest - timeout-minutes: 180 - steps: - - name: 'Setup $HOME' - # hot fix - run: | - # Check if $HOME is not set - if [ -z "$HOME" ]; then - echo '$HOME was no set' - echo "HOME=/home/zilliz-user" >> $GITHUB_ENV - fi - echo "HOME variable is:$HOME" - echo "GITHUB_ENV variable is:$GITHUB_ENV" - - name: Setup mold - uses: rui314/setup-mold@v1 - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: 'Check Changed files' - id: changed-files-cpp - uses: tj-actions/changed-files@v41 - with: - since_last_remote_commit: 'true' - files: | - **/*.cpp - **/*.cc - **/*.c - **/*.h - **/*.hpp - **/*.CMakeLists.txt - **/conanfile.* - - name: 'Setup Use USE_ASAN' - if: steps.changed-files-cpp.outputs.any_changed == 'true' - run: | - echo "useasan=ON" >> $GITHUB_ENV - echo "Setup USE_ASAN to true since cpp file(s) changed" - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'ubuntu20.04' - kind: 'cpp' - - name: Build - run: | - ./build/builder.sh /bin/bash -c "make USE_ASAN=${{env.useasan}} build-cpp-with-coverage" - - run: | - zip -r code.zip . -x "./.docker/*" -x "./cmake_build/thirdparty/**" -x ".git/**" - - name: Archive code - uses: actions/upload-artifact@v3 - with: - name: code - path: code.zip - UT-Cpp: - name: UT for Cpp - needs: Build - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Download code - uses: actions/download-artifact@v3.0.1 - with: - name: code - - run: | - unzip code.zip - rm code.zip - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'ubuntu20.04' - kind: 'cpp' - - name: Start Service - shell: bash - run: | - docker-compose up -d azurite - - name: UT - run: | - chmod +x build/builder.sh - chmod +x scripts/* - chmod +x internal/core/output/unittest/* - ./build/builder.sh /bin/bash -c ./scripts/run_cpp_codecov.sh - - name: Archive result - uses: actions/upload-artifact@v4 - with: - name: cpp-result - path: | - ./go_coverage.txt - ./lcov_output.info - *.info - *.out - UT-Go: - name: UT for Go - needs: Build - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Download code - uses: actions/download-artifact@v3.0.1 - with: - name: code - - run: | - unzip code.zip - rm code.zip - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'ubuntu20.04' - kind: 'go' - - name: Start Service - shell: bash - run: | - docker-compose up -d pulsar etcd minio azurite - - name: UT - run: | - chmod +x build/builder.sh - chmod +x scripts/run_go_codecov.sh - ./build/builder.sh /bin/bash -c "make codecov-go-without-build" - - name: Archive result - uses: actions/upload-artifact@v4 - with: - name: go-result - path: | - ./go_coverage.txt - ./lcov_output.info - *.info - *.out - integration-test: - name: Integration Test - needs: Build - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Download code - uses: actions/download-artifact@v3.0.1 - with: - name: code - - run: | - unzip code.zip - rm code.zip - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'ubuntu20.04' - kind: 'go' - - name: Start Service - shell: bash - run: | - docker-compose up -d pulsar etcd minio - - name: IntegrationTest - run: | - chmod +x build/builder.sh - chmod +x scripts/run_intergration_test.sh - ./build/builder.sh /bin/bash -c "make integration-test" - - name: Archive result - uses: actions/upload-artifact@v4 - with: - name: it-result - path: | - ./it_coverage.txt - *.info - *.out - codecov: - name: Upload Code Coverage - needs: [UT-Cpp, UT-Go, integration-test] - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Download Cpp code coverage results - uses: actions/download-artifact@v4.1.0 - with: - name: cpp-result - - name: Download Go code coverage results - uses: actions/download-artifact@v4.1.0 - with: - name: go-result - - name: Download Integration Test coverage results - uses: actions/download-artifact@v4.1.0 - with: - name: it-result - - name: Display structure of code coverage results - run: | - ls -lah - - name: Upload coverage to Codecov - if: ${{ github.repository == 'milvus-io/milvus' }} - uses: Wandalen/wretry.action@v3.5.0 - with: - action: codecov/codecov-action@v4 - with: | - token: ${{ secrets.CODECOV_TOKEN }} - files: ./go_coverage.txt,./lcov_output.info,./it_coverage.txt - name: ubuntu-20.04-unittests - fail_ci_if_error: true - disable_safe_directory: true - attempt_limit: 10 - attempt_delay: 30000 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 ba980b6f4edd3..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://zilliztech.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 From 27c6a96518a37f0e9ed108abfa583acb5d9ddec4 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 20:29:20 -0400 Subject: [PATCH 06/14] clean out jobs Signed-off-by: Ryan Cook --- .../workflows/network-latency-chaos-test.yaml | 197 ------------------ .../network-partition-chaos-test.yaml | 95 --------- .github/workflows/pod-failure-chaos-test.yaml | 192 ----------------- .../pod-kill-chaos-test-kafka-version.yaml | 188 ----------------- .github/workflows/pod-kill-chaos-test.yaml | 188 ----------------- .github/workflows/publish-builder.yaml | 90 -------- .github/workflows/publish-gpu-builder.yaml | 84 -------- .github/workflows/publish-krte-images.yaml | 85 -------- .github/workflows/publish-test-images.yaml | 97 --------- .github/workflows/remote-rhel-build.yaml | 1 + .github/workflows/rerun-failure-checks.yaml | 47 ----- .../workflows/simd-compatibility-test.yaml | 87 -------- .github/workflows/update-knowhere-commit.yaml | 75 ------- .github/workflows/weekly-release.yml | 71 ------- 14 files changed, 1 insertion(+), 1496 deletions(-) delete mode 100644 .github/workflows/network-latency-chaos-test.yaml delete mode 100644 .github/workflows/network-partition-chaos-test.yaml delete mode 100644 .github/workflows/pod-failure-chaos-test.yaml delete mode 100644 .github/workflows/pod-kill-chaos-test-kafka-version.yaml delete mode 100644 .github/workflows/pod-kill-chaos-test.yaml delete mode 100644 .github/workflows/publish-builder.yaml delete mode 100644 .github/workflows/publish-gpu-builder.yaml delete mode 100644 .github/workflows/publish-krte-images.yaml delete mode 100644 .github/workflows/publish-test-images.yaml delete mode 100644 .github/workflows/rerun-failure-checks.yaml delete mode 100644 .github/workflows/simd-compatibility-test.yaml delete mode 100644 .github/workflows/update-knowhere-commit.yaml delete mode 100644 .github/workflows/weekly-release.yml diff --git a/.github/workflows/network-latency-chaos-test.yaml b/.github/workflows/network-latency-chaos-test.yaml deleted file mode 100644 index 813d5415d2e93..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://zilliztech.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 b9331155fd050..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://zilliztech.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 916f427e8744a..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://zilliztech.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 7cc6e965af8d3..0000000000000 --- a/.github/workflows/pod-kill-chaos-test-kafka-version.yaml +++ /dev/null @@ -1,188 +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://zilliztech.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 - - - name: Run e2e test before 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 data presistence test before chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v testcases/test_data_persistence.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - 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 data presistence test after chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v testcases/test_data_persistence.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - name: Verify all collections after chaos - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - - pytest -s -v testcases/test_get_collections.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - sleep 2s - pytest -s -v testcases/test_all_collections_after_chaos.py --host 127.0.0.1 -n 4 --log-cli-level=INFO --capture=no - - - 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: 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 cb5ab9cda4979..0000000000000 --- a/.github/workflows/pod-kill-chaos-test.yaml +++ /dev/null @@ -1,188 +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://zilliztech.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 - - - name: Run e2e test before 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 data presistence test before chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v testcases/test_data_persistence.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - 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 data presistence test after chaos - timeout-minutes: 5 - shell: bash - working-directory: tests/python_client/chaos - run: | - pytest -s -v testcases/test_data_persistence.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - - - name: Verify all collections after chaos - timeout-minutes: 15 - shell: bash - working-directory: tests/python_client/chaos - run: | - - pytest -s -v testcases/test_get_collections.py --host 127.0.0.1 --log-cli-level=INFO --capture=no - sleep 2s - pytest -s -v testcases/test_all_collections_after_chaos.py --host 127.0.0.1 -n 4 --log-cli-level=INFO --capture=no - - - 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: 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 d8d0029fd44d5..0000000000000 --- a/.github/workflows/publish-builder.yaml +++ /dev/null @@ -1,90 +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/cpu/**' - - '.github/workflows/publish-builder.yaml' - - '!**.md' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/builder/cpu/**' - - '.github/workflows/publish-builder.yaml' - - '!**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - publish-builder: - name: ${{ matrix.arch }} ${{ matrix.os }} - runs-on: ubuntu-latest - timeout-minutes: 500 - strategy: - fail-fast: false - matrix: - os: [ubuntu20.04, amazonlinux2023, rockylinux8] - env: - OS_NAME: ${{ matrix.os }} - IMAGE_ARCH: ${{ matrix.arch }} - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - # overprovision-lvm: 'true' - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - 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=7 HEAD)" - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - milvusdb/milvus-env - tags: | - type=raw,enable=true,value=${{ matrix.os }}-{{date 'YYYYMMDD'}}-{{sha}} - type=raw,enable=true,value=${{ matrix.os }}-latest - # - name: Setup upterm session - # uses: lhotari/action-upterm@v1 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - file: build/docker/builder/cpu/${{ matrix.os }}/Dockerfile - - name: Bump Builder Version - uses: ./.github/actions/bump-builder-version - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04' - with: - tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}" - type: cpu - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} diff --git a/.github/workflows/publish-gpu-builder.yaml b/.github/workflows/publish-gpu-builder.yaml deleted file mode 100644 index 73ff250c020f3..0000000000000 --- a/.github/workflows/publish-gpu-builder.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Publish Gpu 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/gpu/**' - - '.github/workflows/publish-gpu-builder.yaml' - - '!**.md' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/builder/gpu/**' - - '.github/workflows/publish-gpu-builder.yaml' - - '!**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - publish-gpu-builder: - runs-on: ubuntu-latest - timeout-minutes: 500 - env: - OS: ubuntu22.04 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - # overprovision-lvm: 'true' - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - 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=7 HEAD)" - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - milvusdb/milvus-env - tags: | - type=raw,enable=true,value=gpu-${{ env.OS }}-{{date 'YYYYMMDD'}}-{{sha}} - type=raw,enable=true,value=gpu-${{ env.OS }}-latest - # - name: Setup upterm session - # uses: lhotari/action-upterm@v1 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - file: build/docker/builder/gpu/${{ env.OS }}/Dockerfile - - name: Bump Builder Version - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && ${{ env.OS == 'ubuntu22.04' }} - uses: ./.github/actions/bump-builder-version - with: - tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}" - type: gpu - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} diff --git a/.github/workflows/publish-krte-images.yaml b/.github/workflows/publish-krte-images.yaml deleted file mode 100644 index a9579dfaec3a7..0000000000000 --- a/.github/workflows/publish-krte-images.yaml +++ /dev/null @@ -1,85 +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' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -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 5587389d63f42..0000000000000 --- a/.github/workflows/publish-test-images.yaml +++ /dev/null @@ -1,97 +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' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -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/remote-rhel-build.yaml b/.github/workflows/remote-rhel-build.yaml index 58c24f2166bd3..b1937e1bd404a 100644 --- a/.github/workflows/remote-rhel-build.yaml +++ b/.github/workflows/remote-rhel-build.yaml @@ -39,6 +39,7 @@ jobs: run: | PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') podman system connection add terraform --identity ~/.ssh/id_rsa ssh://$PUBLIC_IP/run/user/1000/podman/podman.sock + podman system connection list - name: Build image run: | 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/update-knowhere-commit.yaml b/.github/workflows/update-knowhere-commit.yaml deleted file mode 100644 index 051f3b8d49290..0000000000000 --- a/.github/workflows/update-knowhere-commit.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: Update Knowhere Commit - -on: - workflow_dispatch: - schedule: - # * is a special character in YAML so you have to quote this string - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - - cron: '0 15 * * *' - - -jobs: - update-knowhere-commits: - name: update-knowhere-commit - runs-on: ubuntu-latest - env: - OS_NAME: ubuntu20.04 - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: get knowhere latest commit - id: get-knowhere-latest-commit - run: | - cd .. - git clone https://github.com/zilliztech/Knowhere.git - cd Knowhere - export commit=$(git rev-parse --short HEAD) - echo $commit - echo "::set-output name=knowhere-commit::$commit" - cd ../milvus - - name: Update Commit Changes - continue-on-error: true - shell: bash - run: | - sed -i "0,/(\ KNOWHERE_VERSION/ s#( KNOWHERE_VERSION.*#( KNOWHERE_VERSION ${{ steps.get-knowhere-latest-commit.outputs.knowhere-commit }} )#g" internal/core/thirdparty/knowhere/CMakeLists.txt - head -n 17 internal/core/thirdparty/knowhere/CMakeLists.txt - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add internal/core/thirdparty/knowhere/CMakeLists.txt - git commit -m "Update knowhere commit" - - name: Create Pull Request - id: cpr - continue-on-error: true - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} - author: sre-ci-robot - signoff: true - branch: update_knowhere_commit_${{ github.sha }} - delete-branch: true - title: '[automated] Update Knowhere Commit' - body: | - Update Knowhere Commit - Signed-off-by: sre-ci-robot sre-ci-robot@users.noreply.github.com - - name: Check outputs - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" - - name: Send Message To Feishu - env: - ACTIONS_FEISHU_TAG: 'v1.3.1' - INPUT_WEBHOOK: "${{ secrets.FEISHU_WEBHOOK_KNOWHERE_COMMIT_BOT }}" - INPUT_MESSAGE_TYPE: text - INPUT_CONTENT: "Pr url by rebot: ${{ steps.cpr.outputs.pull-request-url }}" - run: | - wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz - tar zxf linux-amd64-actions-feishu.tar.gz feishu - ./feishu 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 }}" - - From 40eb3a29373bd50db88e5b9eb67b3a03ed503777 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 20:32:44 -0400 Subject: [PATCH 07/14] specifiy user Signed-off-by: Ryan Cook --- .github/workflows/remote-rhel-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remote-rhel-build.yaml b/.github/workflows/remote-rhel-build.yaml index b1937e1bd404a..dd3990e636f1c 100644 --- a/.github/workflows/remote-rhel-build.yaml +++ b/.github/workflows/remote-rhel-build.yaml @@ -38,7 +38,7 @@ jobs: - name: jq parse the terraform state for the public ip run: | PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') - podman system connection add terraform --identity ~/.ssh/id_rsa ssh://$PUBLIC_IP/run/user/1000/podman/podman.sock + podman system connection add terraform --identity ~/.ssh/id_rsa ssh://ec2-user@$PUBLIC_IP/run/user/1000/podman/podman.sock podman system connection list - name: Build image From 0bab489d36ab7406ff3a179873ed5fa82fff0b56 Mon Sep 17 00:00:00 2001 From: Ryan Cook Date: Mon, 10 Jun 2024 20:36:38 -0400 Subject: [PATCH 08/14] specifiy user Signed-off-by: Ryan Cook --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index 96a5d8f6fd2a6..fe9bd8499bd16 100644 --- a/main.tf +++ b/main.tf @@ -71,6 +71,7 @@ resource "aws_instance" "builder" { "sudo dnf -y install container-tools podman", "sudo subscription-manager config --rhsm.manage_repos=1", "systemctl enable --now podman.socket --user", + "sudo loginctl enable-linger ec2-user", ] } connection { From 6307d56bc31425926d91e171ae87b98342c3362a Mon Sep 17 00:00:00 2001 From: greg pereira Date: Sun, 9 Jun 2024 16:08:10 -0700 Subject: [PATCH 09/14] WIP: milvus on rhel 9 Signed-off-by: greg pereira --- build/docker/builder/cpu/rhel9/Containerfile | 40 +++++++++++++++++ .../cpu/rhel9/Milvus-ubuntu-to-rhel.md | 39 +++++++++++++++++ build/docker/milvus/rhel9/Dockerfile | 43 +++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 build/docker/builder/cpu/rhel9/Containerfile create mode 100644 build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md create mode 100644 build/docker/milvus/rhel9/Dockerfile diff --git a/build/docker/builder/cpu/rhel9/Containerfile b/build/docker/builder/cpu/rhel9/Containerfile new file mode 100644 index 0000000000000..5f012ba196c38 --- /dev/null +++ b/build/docker/builder/cpu/rhel9/Containerfile @@ -0,0 +1,40 @@ +FROM registry.redhat.io/rhel9/python-311:1-62.1717085982 + +ARG TARGETARCH + +USER 0 +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +RUN dnf install -y ninja-build libtool +# equivalents +RUN dnf install -y gdb-gdbserver openssl-devel zlib-devel pkgconf-pkg-config libuuid-devel +# Non devel alternatives +RUN dnf install -y libaio openblas + + +# apt-get remove --purge -y && \ +# rm -rf /var/lib/apt/lists/* + +RUN pip3 install conan==1.61.0 + +RUN echo "target arch $TARGETARCH" +RUN wget -qO- "https://cmake.org/files/v3.27/cmake-3.27.5-linux-`uname -m`.tar.gz" | tar --strip-components=1 -xz -C /usr/local + +RUN mkdir /opt/vcpkg && \ + wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ + rm -rf vcpkg.tar.gz + +ENV VCPKG_FORCE_SYSTEM_BINARIES 1 + +RUN /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics && ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg && vcpkg version + +RUN vcpkg install azure-identity-cpp azure-storage-blobs-cpp gtest + +# Install Go +ENV GOPATH /go +ENV GOROOT /usr/local/go +ENV GO111MODULE on +ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH +RUN mkdir -p /usr/local/go && wget -qO- "https://go.dev/dl/go1.21.10.linux-$TARGETARCH.tar.gz" | tar --strip-components=1 -xz -C /usr/local/go && \ + mkdir -p "$GOPATH/src" "$GOPATH/bin" && \ + go clean --modcache && \ + chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) diff --git a/build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md b/build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md new file mode 100644 index 0000000000000..85271ae11151b --- /dev/null +++ b/build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md @@ -0,0 +1,39 @@ +Ubuntu deps: + - g++ gcc gdb gdbserver ninja-build git make ccache libssl-dev zlib1g-dev zip unzip \ + clang-format-10 clang-tidy-10 lcov libtool m4 autoconf automake python3 python3-pip \ + pkg-config uuid-dev libaio-dev libopenblas-dev + +in progress deps: + - ccache \ + clang-format-10 clang-tidy-10 lcov \ + libaio-dev libopenblas-dev + +Dont need: + - python3 python3-pip + +Already installed: + - g++, gcc, gdb, git, make, zip, unzip, m4, autoconf automake + +Can be installed regularly: + - ninja-build, gdb-gdbserver, libtool + +RHEL equivalents of Ubuntu packages (Ubuntu --> RHEL): + - gdbserver --> gdb-gdbserver + - libssl-dev --> openssl-devel + - zlib1g-dev --> zlib-devel + - pkg-config --> pkgconf-pkg-config + - uuid-dev --> libuuid-devel + +RHEL equivalents that dont exist: + - libaio-dev --> libaio (devel option does not exist) + - libopenblas-dev --> openblas + +Needs to be installed manually: + - ccache + +Not sure what this is: + - lcov + +Issues: + - lcov has a perl dependency and resolving this is difficult + - \ No newline at end of file diff --git a/build/docker/milvus/rhel9/Dockerfile b/build/docker/milvus/rhel9/Dockerfile new file mode 100644 index 0000000000000..07347ac9a6c17 --- /dev/null +++ b/build/docker/milvus/rhel9/Dockerfile @@ -0,0 +1,43 @@ +# Copyright (C) 2024 Red Hat, Inc. All rights reserved. + +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 + +ARG TARGETARCH + +RUN dnf install -y wget libgomp libaio libatomic + +# RUN subscription-manager register --auto-attach +# install openblas-devel +RUN dnf copr enable @copr/PyPI epel-9 +RUN +RUN dnf -y install dnf-plugins-core && \ + # Could not find a version of openblas-devel on RHEL + dnf -y install openblas + +COPY ./bin/ /milvus/bin/ + +COPY ./configs/ /milvus/configs/ + +COPY ./lib/ /milvus/lib/ + +ENV PATH=/milvus/bin:$PATH +ENV LD_LIBRARY_PATH=/milvus/lib:$LD_LIBRARY_PATH:/usr/lib +ENV LD_PRELOAD=/milvus/lib/libjemalloc.so +ENV MALLOC_CONF=background_thread:true + +# Add Tini +ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-$TARGETARCH /tini +RUN chmod +x /tini +ENTRYPOINT ["/tini", "--"] + +WORKDIR /milvus \ No newline at end of file From f47b098348f022684dcdc63661577531eb40013f Mon Sep 17 00:00:00 2001 From: greg pereira Date: Mon, 10 Jun 2024 16:17:52 -0700 Subject: [PATCH 10/14] more WIP Signed-off-by: greg pereira --- .env | 8 +- .github/workflows/rhel9-milvus.yaml | 91 +++++++++++++++++++ build/docker/builder/cpu/rhel9/Containerfile | 40 -------- build/docker/builder/cpu/rhel9/Dockerfile | 70 ++++++++++++++ .../cpu/rhel9/Milvus-ubuntu-to-rhel.md | 39 -------- build/docker/builder/cpu/rhel9/install-go.sh | 41 +++++++++ .../docker/builder/cpu/rhel9/install-rpms.sh | 35 +++++++ build/docker/milvus/rhel9/Dockerfile | 16 ++-- build/docker/milvus/rhel9/install-openblas.sh | 22 +++++ docker-compose.yml | 4 + 10 files changed, 277 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/rhel9-milvus.yaml delete mode 100644 build/docker/builder/cpu/rhel9/Containerfile create mode 100644 build/docker/builder/cpu/rhel9/Dockerfile delete mode 100644 build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md create mode 100644 build/docker/builder/cpu/rhel9/install-go.sh create mode 100644 build/docker/builder/cpu/rhel9/install-rpms.sh create mode 100644 build/docker/milvus/rhel9/install-openblas.sh diff --git a/.env b/.env index 6beb24525c5e1..6cf0d55e08342 100644 --- a/.env +++ b/.env @@ -1,8 +1,12 @@ # to define environment variables available to docker-compose.yml -IMAGE_REPO=milvusdb +# subman creds for RHEL builds +SUBMAN_USER= +SUBMAN_PASS= + +IMAGE_REPO=quay.io/redhat-et IMAGE_ARCH=amd64 -OS_NAME=ubuntu20.04 +OS_NAME=rhel9 # for services.builder.image in docker-compose.yml DATE_VERSION=20240520-d27db99 diff --git a/.github/workflows/rhel9-milvus.yaml b/.github/workflows/rhel9-milvus.yaml new file mode 100644 index 0000000000000..4df4477f6a247 --- /dev/null +++ b/.github/workflows/rhel9-milvus.yaml @@ -0,0 +1,91 @@ +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/cpu/**' + - '.github/workflows/publish-builder.yaml' + - '!**.md' + pull_request: + # file paths to consider in the event. Optional; defaults to all. + paths: + - 'build/docker/builder/cpu/**' + - '.github/workflows/publish-builder.yaml' + - '!**.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + publish-builder: + name: ${{ matrix.arch }} ${{ matrix.os }} + runs-on: ubuntu-latest + timeout-minutes: 500 + strategy: + fail-fast: false + matrix: + os: [rockylinux8] + arch: [arm64] + env: + OS_NAME: ${{ matrix.os }} + IMAGE_ARCH: ${{ matrix.arch }} + steps: + - name: Maximize build space + uses: easimon/maximize-build-space@master + if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner + with: + root-reserve-mb: 20480 + # overprovision-lvm: 'true' + swap-size-mb: 1024 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + - 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=7 HEAD)" + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + milvusdb/milvus-env + tags: | + type=raw,enable=true,value=${{ matrix.os }}-{{date 'YYYYMMDD'}}-{{sha}} + type=raw,enable=true,value=${{ matrix.os }}-latest + # - name: Setup upterm session + # uses: lhotari/action-upterm@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + file: build/docker/builder/cpu/${{ matrix.os }}/Dockerfile + - name: Bump Builder Version + uses: ./.github/actions/bump-builder-version + if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04' + with: + tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}" + type: cpu + token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} diff --git a/build/docker/builder/cpu/rhel9/Containerfile b/build/docker/builder/cpu/rhel9/Containerfile deleted file mode 100644 index 5f012ba196c38..0000000000000 --- a/build/docker/builder/cpu/rhel9/Containerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM registry.redhat.io/rhel9/python-311:1-62.1717085982 - -ARG TARGETARCH - -USER 0 -RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -RUN dnf install -y ninja-build libtool -# equivalents -RUN dnf install -y gdb-gdbserver openssl-devel zlib-devel pkgconf-pkg-config libuuid-devel -# Non devel alternatives -RUN dnf install -y libaio openblas - - -# apt-get remove --purge -y && \ -# rm -rf /var/lib/apt/lists/* - -RUN pip3 install conan==1.61.0 - -RUN echo "target arch $TARGETARCH" -RUN wget -qO- "https://cmake.org/files/v3.27/cmake-3.27.5-linux-`uname -m`.tar.gz" | tar --strip-components=1 -xz -C /usr/local - -RUN mkdir /opt/vcpkg && \ - wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ - rm -rf vcpkg.tar.gz - -ENV VCPKG_FORCE_SYSTEM_BINARIES 1 - -RUN /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics && ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg && vcpkg version - -RUN vcpkg install azure-identity-cpp azure-storage-blobs-cpp gtest - -# Install Go -ENV GOPATH /go -ENV GOROOT /usr/local/go -ENV GO111MODULE on -ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH -RUN mkdir -p /usr/local/go && wget -qO- "https://go.dev/dl/go1.21.10.linux-$TARGETARCH.tar.gz" | tar --strip-components=1 -xz -C /usr/local/go && \ - mkdir -p "$GOPATH/src" "$GOPATH/bin" && \ - go clean --modcache && \ - chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile new file mode 100644 index 0000000000000..69a241bfe9f3c --- /dev/null +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -0,0 +1,70 @@ +FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 as vcpkg-installer +USER 0 +RUN dnf install -y wget zip git gcc gcc-c++ cmake \ + dnf-plugins-core ninja-build \ + perl-IPC-Cmd perl-Digest-SHA \ + perl-FindBin perl-File-Compare perl-File-Copy + +ENV VCPKG_FORCE_SYSTEM_BINARIES 1 + +RUN mkdir /opt/vcpkg && \ + wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/refs/tags/2023.11.20.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ + rm -rf vcpkg.tar.gz + +# empty the vscpkg toolchains linux.cmake file to avoid the error +RUN echo "" > /opt/vcpkg/scripts/toolchains/linux.cmake + +# install azure-identity-cpp azure-storage-blobs-cpp gtest via vcpkg +RUN /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics && \ + ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg && \ + vcpkg version && \ + vcpkg install azure-identity-cpp azure-storage-blobs-cpp gtest + +######################################################################################## +FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 + +ARG TARGETARCH +ARG SUBMAN_USER +ARG SUBMAN_PASS +USER 0 + +# basic deps +RUN dnf install -y make cmake automake gcc gcc-c++ \ + zip git libaio libuuid-devel wget libstdc++-static \ + python3.11 python3.11-pip libatomic libtool ninja-build \ + perl-IPC-Cmd perl-Digest-SHA perl-FindBin + +RUN alias python3='python3.11' + +# taken from .env file +RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS + +COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh +RUN chmod +x /root/install-rpms.sh +RUN TARGETARCH=$TARGETARCH /root/install-rpms.sh + +# Install conan and Go +RUN python3.11 -m pip install conan==1.61.0 + +COPY build/docker/builder/cpu/rhel9/install-go.sh /root/install-go.sh +RUN chmod +x /root/install-go.sh +RUN TARGETARCH=$TARGETARCH /root/install-go.sh + +RUN curl https://sh.rustup.rs -sSf | \ + sh -s -- --default-toolchain=1.73 -y + +ENV PATH=/root/.cargo/bin:/usr/local/bin:/usr/local/go/bin:$PATH + +ENV VCPKG_FORCE_SYSTEM_BINARIES 1 + +# RUN mkdir /opt/vcpkg && \ +# wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ +# rm -rf vcpkg.tar.gz +COPY --from=vcpkg-installer /opt/vcpkg /opt/vcpkg + +COPY --from=vcpkg-installer /root/.cache/vcpkg /root/.cache/vcpkg +COPY --chown=0:0 build/docker/builder/entrypoint.sh / + +USER 1001 +ENTRYPOINT [ "/entrypoint.sh" ] +CMD ["tail", "-f", "/dev/null"] diff --git a/build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md b/build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md deleted file mode 100644 index 85271ae11151b..0000000000000 --- a/build/docker/builder/cpu/rhel9/Milvus-ubuntu-to-rhel.md +++ /dev/null @@ -1,39 +0,0 @@ -Ubuntu deps: - - g++ gcc gdb gdbserver ninja-build git make ccache libssl-dev zlib1g-dev zip unzip \ - clang-format-10 clang-tidy-10 lcov libtool m4 autoconf automake python3 python3-pip \ - pkg-config uuid-dev libaio-dev libopenblas-dev - -in progress deps: - - ccache \ - clang-format-10 clang-tidy-10 lcov \ - libaio-dev libopenblas-dev - -Dont need: - - python3 python3-pip - -Already installed: - - g++, gcc, gdb, git, make, zip, unzip, m4, autoconf automake - -Can be installed regularly: - - ninja-build, gdb-gdbserver, libtool - -RHEL equivalents of Ubuntu packages (Ubuntu --> RHEL): - - gdbserver --> gdb-gdbserver - - libssl-dev --> openssl-devel - - zlib1g-dev --> zlib-devel - - pkg-config --> pkgconf-pkg-config - - uuid-dev --> libuuid-devel - -RHEL equivalents that dont exist: - - libaio-dev --> libaio (devel option does not exist) - - libopenblas-dev --> openblas - -Needs to be installed manually: - - ccache - -Not sure what this is: - - lcov - -Issues: - - lcov has a perl dependency and resolving this is difficult - - \ No newline at end of file diff --git a/build/docker/builder/cpu/rhel9/install-go.sh b/build/docker/builder/cpu/rhel9/install-go.sh new file mode 100644 index 0000000000000..641d0bc60f433 --- /dev/null +++ b/build/docker/builder/cpu/rhel9/install-go.sh @@ -0,0 +1,41 @@ +#/bin/bash +if [[ -z "$GOROOT" ]]; then + GOROOT=/usr/local/go +fi + +mkdir -p $GOROOT + +RUN_MODE="" +if [[ -z "$TARGETARCH" ]]; then + TARGETARCH=$(uname -m) + echo "\$TARGETARCH not set - defaulting to host system" +fi + +if [[ "$TARGETARCH" == "arm64" ]] || [[ "$TARGETARCH" == "aarch64" ]]; then + RUN_MODE="arm64" +elif [[ "$TARGETARCH" == "amd64" ]] || [[ "$TARGETARCH" == "x86_64" ]]; then + RUN_MODE="amd64" +else + echo "invalid \$TARGETARCH, build failure. + Supported options: ['arm64', 'aarch64', 'amd64', 'x86_64']" + exit 1 +fi + +export GO111MODULE="on" + +if [[ -z "$GOPATH" ]]; then + export GOPATH="/go" +fi + +if [[ "$RUN_MODE" == "arm64" ]] || [[ "$RUN_MODE" == "amd64" ]] ; then + wget -qO- "https://go.dev/dl/go1.21.10.linux-$RUN_MODE.tar.gz" | tar --strip-components=1 -xz -C $GOROOT +else + echo "uncaught \$RUN_MODE based on invalid \$TARGETARCH." + exit 1 +fi + +export PATH="$GOPATH/bin:$GOROOT/bin:$PATH" + +mkdir -p "$GOPATH/src" "$GOPATH/bin" +go clean --modcache +chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) \ No newline at end of file diff --git a/build/docker/builder/cpu/rhel9/install-rpms.sh b/build/docker/builder/cpu/rhel9/install-rpms.sh new file mode 100644 index 0000000000000..008d7940eafe2 --- /dev/null +++ b/build/docker/builder/cpu/rhel9/install-rpms.sh @@ -0,0 +1,35 @@ +#/bin/bash +RUN_MODE="" +if [[ -z "$TARGETARCH" ]]; then + TARGETARCH=$(uname -m) + echo "\$TARGETARCH not set - defaulting to host system" +fi + +if [[ "$TARGETARCH" == "arm64" ]] || [[ "$TARGETARCH" == "aarch64" ]]; then + RUN_MODE="aarch64" +elif [[ "$TARGETARCH" == "amd64" ]] || [[ "$TARGETARCH" == "x86_64" ]]; then + RUN_MODE="x86_64" +else + echo "invalid \$TARGETARCH, build failure. + Supported options: ['arm64', 'aarch64', 'amd64', 'x86_64']" + exit 1 +fi + +if [[ "$RUN_MODE" == "aarch64" ]]; then + dnf install -y \ + https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-Unicode-EastAsianWidth-12.0-7.el9.noarch.rpm \ + https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-Text-Unidecode-1.30-16.el9.noarch.rpm \ + https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-libintl-perl-1.32-4.el9.aarch64.rpm \ + https://www.rpmfind.net/linux/centos-stream/9-stream/CRB/aarch64/os/Packages/texinfo-6.7-15.el9.aarch64.rpm + dnf install -y --enablerepo=codeready-builder-for-rhel-9-aarch64-rpms openblas-devel +elif [[ "$RUN_MODE" == "x86_64" ]]; then + dnf install -y \ + https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/perl-Unicode-EastAsianWidth-12.0-7.el9.noarch.rpm \ + https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/perl-Text-Unidecode-1.30-16.el9.noarch.rpm \ + https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/perl-libintl-perl-1.32-4.el9.x86_64.rpm \ + https://www.rpmfind.net/linux/centos-stream/9-stream/CRB/x86_64/os/Packages/texinfo-6.7-15.el9.x86_64.rpm + dnf install -y --enablerepo=codeready-builder-for-rhel-9-x86_64-rpms openblas-devel +else + echo "uncaught runmode based on invalid \$TARGETARCH." + exit 1 +fi diff --git a/build/docker/milvus/rhel9/Dockerfile b/build/docker/milvus/rhel9/Dockerfile index 07347ac9a6c17..760088c015820 100644 --- a/build/docker/milvus/rhel9/Dockerfile +++ b/build/docker/milvus/rhel9/Dockerfile @@ -14,19 +14,19 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 ARG TARGETARCH +# assumes repo of codeready-builder-for-rhel-9- RUN dnf install -y wget libgomp libaio libatomic -# RUN subscription-manager register --auto-attach -# install openblas-devel -RUN dnf copr enable @copr/PyPI epel-9 -RUN -RUN dnf -y install dnf-plugins-core && \ - # Could not find a version of openblas-devel on RHEL - dnf -y install openblas +COPY build/docker/milvus/rhel9/install-openblas.sh /home/install-openblas.sh +RUN chmod +x /home/install-openblas.sh +RUN TARGETARCH=$TARGETARCH /home/install-openblas.sh + +# Remove cache for image sizing +RUN rm -rf /var/cache/dnf/* COPY ./bin/ /milvus/bin/ -COPY ./configs/ /milvus/configs/ +COPY ./configs/ /milvus/configs/ COPY ./lib/ /milvus/lib/ diff --git a/build/docker/milvus/rhel9/install-openblas.sh b/build/docker/milvus/rhel9/install-openblas.sh new file mode 100644 index 0000000000000..3695b274de479 --- /dev/null +++ b/build/docker/milvus/rhel9/install-openblas.sh @@ -0,0 +1,22 @@ +RUN_MODE="" +if [[ -z "$TARGETARCH" ]]; then + TARGETARCH=$(uname -m) + echo "\$TARGETARCH not set - defaulting to host system" +fi + +if [[ "$TARGETARCH" == "arm64" ]] || [[ "$TARGETARCH" == "aarch64" ]]; then + RUN_MODE="aarch64" +elif [[ "$TARGETARCH" == "amd64" ]] || [[ "$TARGETARCH" == "x86_64" ]]; then + RUN_MODE="x86_64" +else + echo "invalid \$TARGETARCH, build failure. + Supported options: ['arm64', 'aarch64', 'amd64', 'x86_64']" + exit 1 +fi + +if [[ "$RUN_MODE" == "aarch64" ]] || [[ "$RUN_MODE" == "x86_64" ]]; then + dnf install -y --enablerepo=codeready-builder-for-rhel-9-$RUN_MODE-rpms openblas-devel +else + echo "uncaught runmode based on invalid \$TARGETARCH." + exit 1 +fi \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index bb99f4c0cee65..5ad8291cb6967 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,8 @@ services: dockerfile: build/docker/builder/cpu/${OS_NAME}/Dockerfile args: TARGETARCH: ${IMAGE_ARCH} + SUBMAN_USER: ${SUBMAN_USER} + SUBMAN_PASS: ${SUBMAN_PASS} cache_from: - ${IMAGE_REPO}/milvus-env:${OS_NAME}-${LATEST_DATE_VERSION} platform: linux/${IMAGE_ARCH} @@ -31,6 +33,8 @@ services: MINIO_ADDRESS: ${MINIO_ADDRESS} CONAN_USER_HOME: /home/milvus AZURE_STORAGE_CONNECTION_STRING: ${AZURITE_CONNECTION_STRING} + SUBMAN_USER: ${SUBMAN_USER} + SUBMAN_PASS: ${SUBMAN_PASS} volumes: &builder-volumes - .:/go/src/github.com/milvus-io/milvus:delegated - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache:/ccache:delegated From e5fc5d158d1751d21cebb61f6511589877a3b86f Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 12 Jun 2024 09:38:03 -0700 Subject: [PATCH 11/14] builds pass locally Signed-off-by: greg pereira --- .env | 10 +-- .github/workflows/rhel9-milvus.yaml | 91 -------------------- .gitignore | 4 + build/docker/builder/cpu/rhel9/Dockerfile | 17 ++-- build/docker/builder/cpu/rhel9/install-go.sh | 6 +- build/docker/milvus/rhel9/Dockerfile | 7 +- docker-compose.yml | 2 - 7 files changed, 26 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/rhel9-milvus.yaml diff --git a/.env b/.env index 6cf0d55e08342..578cd5de2b326 100644 --- a/.env +++ b/.env @@ -1,11 +1,9 @@ # to define environment variables available to docker-compose.yml -# subman creds for RHEL builds -SUBMAN_USER= -SUBMAN_PASS= - -IMAGE_REPO=quay.io/redhat-et -IMAGE_ARCH=amd64 +# If this is uncommented it will pull and not rebuild +# IMAGE_REPO=quay.io/grpereir +IMAGE_REPO=quay.io/ai-lab +IMAGE_ARCH=arm64 OS_NAME=rhel9 # for services.builder.image in docker-compose.yml diff --git a/.github/workflows/rhel9-milvus.yaml b/.github/workflows/rhel9-milvus.yaml deleted file mode 100644 index 4df4477f6a247..0000000000000 --- a/.github/workflows/rhel9-milvus.yaml +++ /dev/null @@ -1,91 +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/cpu/**' - - '.github/workflows/publish-builder.yaml' - - '!**.md' - pull_request: - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'build/docker/builder/cpu/**' - - '.github/workflows/publish-builder.yaml' - - '!**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - publish-builder: - name: ${{ matrix.arch }} ${{ matrix.os }} - runs-on: ubuntu-latest - timeout-minutes: 500 - strategy: - fail-fast: false - matrix: - os: [rockylinux8] - arch: [arm64] - env: - OS_NAME: ${{ matrix.os }} - IMAGE_ARCH: ${{ matrix.arch }} - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - # overprovision-lvm: 'true' - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - 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=7 HEAD)" - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - milvusdb/milvus-env - tags: | - type=raw,enable=true,value=${{ matrix.os }}-{{date 'YYYYMMDD'}}-{{sha}} - type=raw,enable=true,value=${{ matrix.os }}-latest - # - name: Setup upterm session - # uses: lhotari/action-upterm@v1 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - file: build/docker/builder/cpu/${{ matrix.os }}/Dockerfile - - name: Bump Builder Version - uses: ./.github/actions/bump-builder-version - if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04' - with: - tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}" - type: cpu - token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} diff --git a/.gitignore b/.gitignore index 466d92999d549..d0e209716b8d3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ docker-compose-devcontainer.yml.tmp # Docker generated cache file .docker/ +# Private `subscription-manager` credentials for rhel builds +.env.rhel + **/_artifacts/** # proxy @@ -46,6 +49,7 @@ proxy-go/proxy-go # Compiled source bin/ lib/ +configs/ *.a *.so *.so.* diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile index 69a241bfe9f3c..df01b1a398f5e 100644 --- a/build/docker/builder/cpu/rhel9/Dockerfile +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -36,19 +36,20 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \ RUN alias python3='python3.11' -# taken from .env file -RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS +# Assumes you have a valid subman subscription COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh RUN chmod +x /root/install-rpms.sh -RUN TARGETARCH=$TARGETARCH /root/install-rpms.sh +RUN /root/install-rpms.sh # Install conan and Go RUN python3.11 -m pip install conan==1.61.0 COPY build/docker/builder/cpu/rhel9/install-go.sh /root/install-go.sh RUN chmod +x /root/install-go.sh -RUN TARGETARCH=$TARGETARCH /root/install-go.sh +RUN source /root/install-go.sh + +RUN mkdir -p /.cache/go-build && chmod -R 777 /.cache/go-build RUN curl https://sh.rustup.rs -sSf | \ sh -s -- --default-toolchain=1.73 -y @@ -57,14 +58,12 @@ ENV PATH=/root/.cargo/bin:/usr/local/bin:/usr/local/go/bin:$PATH ENV VCPKG_FORCE_SYSTEM_BINARIES 1 -# RUN mkdir /opt/vcpkg && \ -# wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ -# rm -rf vcpkg.tar.gz -COPY --from=vcpkg-installer /opt/vcpkg /opt/vcpkg +RUN mkdir /opt/vcpkg && \ + wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ + rm -rf vcpkg.tar.gz COPY --from=vcpkg-installer /root/.cache/vcpkg /root/.cache/vcpkg COPY --chown=0:0 build/docker/builder/entrypoint.sh / -USER 1001 ENTRYPOINT [ "/entrypoint.sh" ] CMD ["tail", "-f", "/dev/null"] diff --git a/build/docker/builder/cpu/rhel9/install-go.sh b/build/docker/builder/cpu/rhel9/install-go.sh index 641d0bc60f433..5b13c9e67e88f 100644 --- a/build/docker/builder/cpu/rhel9/install-go.sh +++ b/build/docker/builder/cpu/rhel9/install-go.sh @@ -35,7 +35,11 @@ else fi export PATH="$GOPATH/bin:$GOROOT/bin:$PATH" +export GOPROXY="https://proxy.golang.org,direct" +export GOSUMDB="sum.golang.org" +export GOMODCACHE="$GOPATH/pkg/mod" +export GOCACHE="$GOPATH/.cache" -mkdir -p "$GOPATH/src" "$GOPATH/bin" +mkdir -p "$GOPATH/src" "$GOPATH/bin" "$GOPATH/pkg" "$GOCACHE" go clean --modcache chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) \ No newline at end of file diff --git a/build/docker/milvus/rhel9/Dockerfile b/build/docker/milvus/rhel9/Dockerfile index 760088c015820..ccb6594e3c212 100644 --- a/build/docker/milvus/rhel9/Dockerfile +++ b/build/docker/milvus/rhel9/Dockerfile @@ -17,6 +17,8 @@ ARG TARGETARCH # assumes repo of codeready-builder-for-rhel-9- RUN dnf install -y wget libgomp libaio libatomic +USER 0 + COPY build/docker/milvus/rhel9/install-openblas.sh /home/install-openblas.sh RUN chmod +x /home/install-openblas.sh RUN TARGETARCH=$TARGETARCH /home/install-openblas.sh @@ -38,6 +40,7 @@ ENV MALLOC_CONF=background_thread:true # Add Tini ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-$TARGETARCH /tini RUN chmod +x /tini -ENTRYPOINT ["/tini", "--"] -WORKDIR /milvus \ No newline at end of file +USER 1001 +ENTRYPOINT ["/tini", "--"] +WORKDIR /milvus diff --git a/docker-compose.yml b/docker-compose.yml index 5ad8291cb6967..b89e9f2c4ad6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,6 @@ services: MINIO_ADDRESS: ${MINIO_ADDRESS} CONAN_USER_HOME: /home/milvus AZURE_STORAGE_CONNECTION_STRING: ${AZURITE_CONNECTION_STRING} - SUBMAN_USER: ${SUBMAN_USER} - SUBMAN_PASS: ${SUBMAN_PASS} volumes: &builder-volumes - .:/go/src/github.com/milvus-io/milvus:delegated - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache:/ccache:delegated From 9e16418cde9b420198edf9de7d2d0cd5648f8444 Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 12 Jun 2024 15:35:32 -0700 Subject: [PATCH 12/14] add workflow Signed-off-by: greg pereira --- .../workflows/ai-lab-remote-rhel-build.yaml | 58 +++++++++++++++++++ build/docker/builder/cpu/rhel9/Dockerfile | 1 + build/docker/milvus/rhel9/Dockerfile | 4 +- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ai-lab-remote-rhel-build.yaml diff --git a/.github/workflows/ai-lab-remote-rhel-build.yaml b/.github/workflows/ai-lab-remote-rhel-build.yaml new file mode 100644 index 0000000000000..8a47a34ea60b4 --- /dev/null +++ b/.github/workflows/ai-lab-remote-rhel-build.yaml @@ -0,0 +1,58 @@ +name: AI-lab remove rhel-build + +on: + workflow_dispatch: + + pull_request: + branches: + - master + paths: + - 'build/docker/builder/cpu/rhel9/**' + - '.github/workflows/ai-lab-remote-rhel-build.yaml' + +env: + AWS_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_VAR_vpc_id: ${{ secrets.VPC_ID }} + TF_VAR_rh_access: ${{ secrets.RH_ACCESS }} + TF_VAR_rh_org: ${{ secrets.RH_ORG }} + TF_VAR_ami_id: ${{ secrets.AMI_ID }} + +jobs: + ai-lab-podman-remote: + runs-on: ubuntu-24.04 + steps: + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3.1.1 + with: + terraform_version: "1.7.5" + + - name: Checkout + uses: actions/checkout@v4.1.6 + + - name: sshkeygen for ansible + run: ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" + + - name: Terraform Init + run: terraform init + + - name: Terraform Apply + run: terraform apply -auto-approve + + - name: Terraform Output + id: terraform-output + run: | + echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT + echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT + echo "ssh_public_key=$(terraform output ssh_public_key | xargs)" >> $GITHUB_OUTPUT + echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT + + - name: Install podman remote + run: | + sudo apt-get install -y podman podman-remote + sudo apt-get install -y jq + + - name: Terraform Destroy + if: always() + run: terraform destroy -auto-approve diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile index df01b1a398f5e..6913832fa3d94 100644 --- a/build/docker/builder/cpu/rhel9/Dockerfile +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -37,6 +37,7 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \ RUN alias python3='python3.11' # Assumes you have a valid subman subscription + # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh RUN chmod +x /root/install-rpms.sh diff --git a/build/docker/milvus/rhel9/Dockerfile b/build/docker/milvus/rhel9/Dockerfile index ccb6594e3c212..cd7f2defbfee8 100644 --- a/build/docker/milvus/rhel9/Dockerfile +++ b/build/docker/milvus/rhel9/Dockerfile @@ -14,11 +14,13 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 ARG TARGETARCH -# assumes repo of codeready-builder-for-rhel-9- RUN dnf install -y wget libgomp libaio libatomic USER 0 +# Assumes you have a valid subman subscription + # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel + COPY build/docker/milvus/rhel9/install-openblas.sh /home/install-openblas.sh RUN chmod +x /home/install-openblas.sh RUN TARGETARCH=$TARGETARCH /home/install-openblas.sh From 1933b157269dac2a10f86df13747efd45c87f3be Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 12 Jun 2024 17:10:09 -0700 Subject: [PATCH 13/14] adding ansible playbook pieces Signed-off-by: greg pereira --- .env | 2 +- .../workflows/ai-lab-remote-rhel-build.yaml | 61 ++++++-- build/ci/rhel-ansible/ansible.cfg | 4 + build/ci/rhel-ansible/playbook.yaml | 141 ++++++++++++++++++ build/ci/rhel-ansible/requirements.yaml | 3 + build/docker/builder/cpu/rhel9/Dockerfile | 10 +- build/docker/milvus/rhel9/Dockerfile | 4 +- build/docker/milvus/rhel9/install-openblas.sh | 2 +- docker-compose.yml | 6 +- 9 files changed, 210 insertions(+), 23 deletions(-) create mode 100644 build/ci/rhel-ansible/ansible.cfg create mode 100644 build/ci/rhel-ansible/playbook.yaml create mode 100644 build/ci/rhel-ansible/requirements.yaml diff --git a/.env b/.env index 578cd5de2b326..b7131d681c5dd 100644 --- a/.env +++ b/.env @@ -3,7 +3,7 @@ # If this is uncommented it will pull and not rebuild # IMAGE_REPO=quay.io/grpereir IMAGE_REPO=quay.io/ai-lab -IMAGE_ARCH=arm64 +IMAGE_ARCH=amd64 OS_NAME=rhel9 # for services.builder.image in docker-compose.yml diff --git a/.github/workflows/ai-lab-remote-rhel-build.yaml b/.github/workflows/ai-lab-remote-rhel-build.yaml index 8a47a34ea60b4..2a7c1180b7a99 100644 --- a/.github/workflows/ai-lab-remote-rhel-build.yaml +++ b/.github/workflows/ai-lab-remote-rhel-build.yaml @@ -20,15 +20,18 @@ env: TF_VAR_ami_id: ${{ secrets.AMI_ID }} jobs: - ai-lab-podman-remote: + rhel9-milvus: runs-on: ubuntu-24.04 + strategy: + fail-fast: false + max-parallel: 1 steps: - name: Setup Terraform uses: hashicorp/setup-terraform@v3.1.1 with: terraform_version: "1.7.5" - - name: Checkout + - name: Checkout code on runner uses: actions/checkout@v4.1.6 - name: sshkeygen for ansible @@ -39,20 +42,58 @@ jobs: - name: Terraform Apply run: terraform apply -auto-approve + + - name: Set up Python on runner + uses: actions/setup-python@v5.1.0 + with: + python-version: '3.11' - - name: Terraform Output - id: terraform-output + - name: Install Ansible on runner run: | - echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT - echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT - echo "ssh_public_key=$(terraform output ssh_public_key | xargs)" >> $GITHUB_OUTPUT - echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT + python3 -m pip install --upgrade pip + pip install ansible + + # currently no reqs + # - name: Ansible Collections + # working-directory: build/ci/rhel-ansible + # run: ansible-galaxy install -r requirements.yaml - - name: Install podman remote + - name: Install jq and build inventory on runner run: | - sudo apt-get install -y podman podman-remote sudo apt-get install -y jq + PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') + # PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value' | cut -d "\"" -f 2) + echo "public_ip=$PUBLIC_IP" >> $GITHUB_OUTPUT + echo "[test_environments]" > build/ci/rhel-ansible/inventory.ini + echo "test_environment_host ansible_host=${PUBLIC_IP}" >> build/ci/rhel-ansible/inventory.ini + # cat build/ci/rhel-ansible/inventory.ini + + - name: Setup tmate session + # if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3.18 + timeout-minutes: 17 + with: + detached: true + limit-access-to-actor: true + + - name: Provision runner to ec2 + working-directory: build/ci/rhel-ansible + run: | + ansible-playbook -vv playbook.yaml \ + -i inventory.ini \ + --private-key=/home/runner/.ssh/id_rsa \ + --extra-vars "registry_user=${{ secrets.REGISTRY_USER }}" \ + --extra-vars "registry_pass=${{ secrets.REGISTRY_PASS }}" \ + --extra-vars "subman_user=${{ secrets.SUBMAN_USER }}" \ + --extra-vars "subman_pass=${{ secrets.SUBMAN_PASS }}" + env: + ANSIBLE_CONFIG: ansible.cfg - name: Terraform Destroy if: always() run: terraform destroy -auto-approve + + # For stacked runs of CI with concurrency allow for destroy to work + - name: Wait for 30 seconds for destroy to work + if: always() + run: sleep 30 diff --git a/build/ci/rhel-ansible/ansible.cfg b/build/ci/rhel-ansible/ansible.cfg new file mode 100644 index 0000000000000..c0f038aa3984b --- /dev/null +++ b/build/ci/rhel-ansible/ansible.cfg @@ -0,0 +1,4 @@ +[ssh_connection] +ssh_common_args = -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ; +[defaults] +host_key_checking = False diff --git a/build/ci/rhel-ansible/playbook.yaml b/build/ci/rhel-ansible/playbook.yaml new file mode 100644 index 0000000000000..a443e5f9d06b2 --- /dev/null +++ b/build/ci/rhel-ansible/playbook.yaml @@ -0,0 +1,141 @@ +--- +- name: Building rhel9-milvus + hosts: test_environments + remote_user: ec2-user + become: true + gather_facts: false + +# THIS RUNS ON RHEL AMI AS BUILDER FOR SUBMAN + + tasks: + + - name: Wait until the instance is ready + ansible.builtin.wait_for_connection: + delay: 15 + timeout: 180 + + - name: Gather facts for first time + ansible.builtin.setup: + + # - name: DEBUG - sleep + # ignore_unreachable: true + # ansible.builtin.shell: | + # sleep 600 + + - name: remove podman for clean docker install + ansible.builtin.shell: | + sudo dnf -y remove \ + docker \ + docker-client \ + docker-client-latest \ + docker-common \ + docker-latest \ + docker-latest-logrotate \ + docker-logrotate \ + docker-engine \ + podman \ + runc + + - name: setup docker server and docker compose + async: 1000 + poll: 0 + register: docker_install_result + ansible.builtin.shell: | + sudo yum install -y yum-utils + sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo + sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + sudo systemctl start docker + + - name: Check on downloading docker + docker tools + async_status: + jid: "{{ docker_install_result.ansible_job_id }}" + register: job_result + until: job_result.finished + retries: 25 + delay: 10 + + - name: Ensure Docker is running + ansible.builtin.systemd: + name: docker + state: started + enabled: yes + + - name: Install the docker-compose binary + ansible.builtin.shell: | + cd /tmp + export ARCH=$(uname -m) + if [[ "$ARCH" == "arm64" ]] || [[ "$ARCH" == "aarch64" ]]; then + curl -sLO https://github.com/docker/compose/releases/download/v2.28.0/docker-compose-linux-aarch64 + sudo mv /tmp/docker-compose-linux-aarch64 /usr/bin/docker-compose + elif [[ "$ARCH" == "amd64" ]] || [[ "$ARCH" == "x86_64" ]]; then + curl -sLO https://github.com/docker/compose/releases/download/v2.28.0/docker-compose-linux-x86_64 + sudo mv /tmp/docker-compose-linux-x86_64 /usr/bin/docker-compose + fi + chmod +x /usr/bin/docker-compose + + - name: Log in to quay.io + community.docker.docker_login: + username: "{{ registry_user }}" + password: "{{ registry_pass }}" + registry: quay.io + + - name: Clone Git repository + ansible.builtin.git: + repo: https://github.com/redhat-et/milvus.git + dest: "/home/ec2-user/milvus" + version: "rhel9-milvus" + clone: yes + update: yes + + - name: DEBUG - sleep + ansible.builtin.shell: | + sleep 400 + + - name: Make the builder image + async: 1000 + poll: 0 + register: builder_result + become: true + + ansible.builtin.shell: | + set -x + cd /home/ec2-user/milvus/ + ./build/builder.sh make install + ls -al /home/ec2-user/milvus/ + set +x + + - name: Check on the builder image + async_status: + jid: "{{ builder_result.ansible_job_id }}" + register: job_result + until: job_result.finished + retries: 100 + delay: 10 + + - name: Make the milvus image + async: 1000 + poll: 0 + register: milvus_result + ansible.builtin.shell: | + cd /home/ec2-user/milvus + ls -al /home/ec2-user/milvus + mv /home/ec2-user/milvus/bin /home/ec2-user/milvus/build/docker/milvus/rhel9/ + mv /home/ec2-user/milvus/configs /home/ec2-user/milvus/build/docker/milvus/rhel9/ + mv /home/ec2-user/milvus/lib /home/ec2-user/milvus/build/docker/milvus/rhel9/ + sudo su && /home/ec2-user/milvus/build/build_image.sh make + + - name: Check on the milvus image + async_status: + jid: "{{ milvus_result.ansible_job_id }}" + register: job_result + until: job_result.finished + retries: 100 + delay: 10 + + - name: log docker images + ansible.builtin.shell: | + sudo su && docker images + + - name: DEBUG - sleep + ansible.builtin.shell: | + sleep 400 diff --git a/build/ci/rhel-ansible/requirements.yaml b/build/ci/rhel-ansible/requirements.yaml new file mode 100644 index 0000000000000..d764e6348d354 --- /dev/null +++ b/build/ci/rhel-ansible/requirements.yaml @@ -0,0 +1,3 @@ +--- +collections: + - name: community.docker \ No newline at end of file diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile index 6913832fa3d94..7779122be21ca 100644 --- a/build/docker/builder/cpu/rhel9/Dockerfile +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -24,8 +24,8 @@ RUN /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics && \ FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 ARG TARGETARCH -ARG SUBMAN_USER -ARG SUBMAN_PASS +# ARG SUBMAN_USER +# ARG SUBMAN_PASS USER 0 # basic deps @@ -36,9 +36,9 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \ RUN alias python3='python3.11' -# Assumes you have a valid subman subscription - # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel - +# Assumes you have a valid subman subscription at the host machine +# RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS --force +# This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh RUN chmod +x /root/install-rpms.sh RUN /root/install-rpms.sh diff --git a/build/docker/milvus/rhel9/Dockerfile b/build/docker/milvus/rhel9/Dockerfile index cd7f2defbfee8..e6b142afdeebe 100644 --- a/build/docker/milvus/rhel9/Dockerfile +++ b/build/docker/milvus/rhel9/Dockerfile @@ -19,8 +19,8 @@ RUN dnf install -y wget libgomp libaio libatomic USER 0 # Assumes you have a valid subman subscription - # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel - +RUN subscription-manager register --auto-attach +# This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel COPY build/docker/milvus/rhel9/install-openblas.sh /home/install-openblas.sh RUN chmod +x /home/install-openblas.sh RUN TARGETARCH=$TARGETARCH /home/install-openblas.sh diff --git a/build/docker/milvus/rhel9/install-openblas.sh b/build/docker/milvus/rhel9/install-openblas.sh index 3695b274de479..722b010f5a52f 100644 --- a/build/docker/milvus/rhel9/install-openblas.sh +++ b/build/docker/milvus/rhel9/install-openblas.sh @@ -19,4 +19,4 @@ if [[ "$RUN_MODE" == "aarch64" ]] || [[ "$RUN_MODE" == "x86_64" ]]; then else echo "uncaught runmode based on invalid \$TARGETARCH." exit 1 -fi \ No newline at end of file +fi diff --git a/docker-compose.yml b/docker-compose.yml index b89e9f2c4ad6d..536b7b6a72290 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.5' - x-ccache: &ccache CCACHE_COMPILERCHECK: content CCACHE_COMPRESS: 1 @@ -16,8 +14,8 @@ services: dockerfile: build/docker/builder/cpu/${OS_NAME}/Dockerfile args: TARGETARCH: ${IMAGE_ARCH} - SUBMAN_USER: ${SUBMAN_USER} - SUBMAN_PASS: ${SUBMAN_PASS} + # SUBMAN_USER: ${SUBMAN_USER} + # SUBMAN_PASS: ${SUBMAN_PASS} cache_from: - ${IMAGE_REPO}/milvus-env:${OS_NAME}-${LATEST_DATE_VERSION} platform: linux/${IMAGE_ARCH} From 237d87116b65daba47a70c892311f8f64a1f47fc Mon Sep 17 00:00:00 2001 From: greg pereira Date: Sun, 23 Jun 2024 17:35:28 -0700 Subject: [PATCH 14/14] swap user ec2 to root Signed-off-by: greg pereira --- .../workflows/ai-lab-remote-rhel-build.yaml | 2 +- build/ci/rhel-ansible/playbook.yaml | 37 ++++++++++++------- build/docker/builder/cpu/rhel9/Dockerfile | 3 ++ .../docker/builder/cpu/rhel9/install-rpms.sh | 2 + 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ai-lab-remote-rhel-build.yaml b/.github/workflows/ai-lab-remote-rhel-build.yaml index 2a7c1180b7a99..9d66c2817ea17 100644 --- a/.github/workflows/ai-lab-remote-rhel-build.yaml +++ b/.github/workflows/ai-lab-remote-rhel-build.yaml @@ -71,7 +71,7 @@ jobs: - name: Setup tmate session # if: ${{ failure() }} uses: mxschmitt/action-tmate@v3.18 - timeout-minutes: 17 + timeout-minutes: 25 with: detached: true limit-access-to-actor: true diff --git a/build/ci/rhel-ansible/playbook.yaml b/build/ci/rhel-ansible/playbook.yaml index a443e5f9d06b2..f796f5c078fc0 100644 --- a/build/ci/rhel-ansible/playbook.yaml +++ b/build/ci/rhel-ansible/playbook.yaml @@ -24,7 +24,7 @@ - name: remove podman for clean docker install ansible.builtin.shell: | - sudo dnf -y remove \ + dnf -y remove \ docker \ docker-client \ docker-client-latest \ @@ -65,9 +65,11 @@ cd /tmp export ARCH=$(uname -m) if [[ "$ARCH" == "arm64" ]] || [[ "$ARCH" == "aarch64" ]]; then + echo "aarch64 selected" curl -sLO https://github.com/docker/compose/releases/download/v2.28.0/docker-compose-linux-aarch64 sudo mv /tmp/docker-compose-linux-aarch64 /usr/bin/docker-compose elif [[ "$ARCH" == "amd64" ]] || [[ "$ARCH" == "x86_64" ]]; then + echo "x86_64 selected" curl -sLO https://github.com/docker/compose/releases/download/v2.28.0/docker-compose-linux-x86_64 sudo mv /tmp/docker-compose-linux-x86_64 /usr/bin/docker-compose fi @@ -79,29 +81,36 @@ password: "{{ registry_pass }}" registry: quay.io + - name: Register to subscription manager + ansible.builtin.shell: | + subscription-manager register --username "{{ subman_user }}" --password "{{ subman_pass }}" --force + - name: Clone Git repository + become: false ansible.builtin.git: repo: https://github.com/redhat-et/milvus.git - dest: "/home/ec2-user/milvus" + dest: "/tmp/milvus" version: "rhel9-milvus" clone: yes update: yes - name: DEBUG - sleep ansible.builtin.shell: | - sleep 400 + sleep 900 - name: Make the builder image async: 1000 poll: 0 register: builder_result - become: true - ansible.builtin.shell: | set -x - cd /home/ec2-user/milvus/ + cd /tmp/milvus/ + sudo su + echo $TARGETARCH + export TARGETARCH=$(uname -m) + echo $TARGETARCH ./build/builder.sh make install - ls -al /home/ec2-user/milvus/ + ls -al /tmp/milvus/ set +x - name: Check on the builder image @@ -117,12 +126,12 @@ poll: 0 register: milvus_result ansible.builtin.shell: | - cd /home/ec2-user/milvus - ls -al /home/ec2-user/milvus - mv /home/ec2-user/milvus/bin /home/ec2-user/milvus/build/docker/milvus/rhel9/ - mv /home/ec2-user/milvus/configs /home/ec2-user/milvus/build/docker/milvus/rhel9/ - mv /home/ec2-user/milvus/lib /home/ec2-user/milvus/build/docker/milvus/rhel9/ - sudo su && /home/ec2-user/milvus/build/build_image.sh make + cd /tmp/milvus + ls -al /tmp/milvus + mv /tmp/milvus/bin /tmp/milvus/build/docker/milvus/rhel9/ + mv /tmp/milvus/configs /tmp/milvus/build/docker/milvus/rhel9/ + mv /tmp/milvus/lib /tmp/milvus/build/docker/milvus/rhel9/ + /tmp/milvus/build/build_image.sh make - name: Check on the milvus image async_status: @@ -134,7 +143,7 @@ - name: log docker images ansible.builtin.shell: | - sudo su && docker images + docker images - name: DEBUG - sleep ansible.builtin.shell: | diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile index 7779122be21ca..cd77935160e21 100644 --- a/build/docker/builder/cpu/rhel9/Dockerfile +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -37,7 +37,10 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \ RUN alias python3='python3.11' # Assumes you have a valid subman subscription at the host machine + # RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS --force +RUN subscription-manager attach + # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh RUN chmod +x /root/install-rpms.sh diff --git a/build/docker/builder/cpu/rhel9/install-rpms.sh b/build/docker/builder/cpu/rhel9/install-rpms.sh index 008d7940eafe2..9e72e3ad6372a 100644 --- a/build/docker/builder/cpu/rhel9/install-rpms.sh +++ b/build/docker/builder/cpu/rhel9/install-rpms.sh @@ -15,6 +15,8 @@ else exit 1 fi +subscription-manager attach + if [[ "$RUN_MODE" == "aarch64" ]]; then dnf install -y \ https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-Unicode-EastAsianWidth-12.0-7.el9.noarch.rpm \