From e353bde084beabe0e694a278ecb6e2a730ef8fac Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Mon, 12 Feb 2024 15:59:03 +0100 Subject: [PATCH] Add k8s cluster test using kind --- .github/workflows/tests.yaml | 1481 ++++++++++++++++++---------------- ann_benchmark.sh | 26 +- apps/weaviate/local-k8s.sh | 210 +++++ 3 files changed, 1005 insertions(+), 712 deletions(-) create mode 100755 apps/weaviate/local-k8s.sh diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5e0ebfad..e426eab6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,724 +28,789 @@ jobs: steps: - uses: actions/checkout@v2 - uses: psf/black@stable - ann-benchmarks-sift-aws: - name: "[bench AWS] SIFT1M pq=false" - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} - AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} - DATASET: sift-128-euclidean - DISTANCE: l2-squared - REQUIRED_RECALL: 0.999 - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - id: 'gcs_auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - name: Run chaos test - if: always() - run: ./ann_benchmark_aws.sh - - id: 'upload-files' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: 'results' - destination: 'ann-pipelines/github-action-runs' - glob: '*.json' - ann-benchmarks-glove-aws: - name: "[bench AWS] Glove100 pq=false" - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} - AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} - DATASET: glove-100-angular - DISTANCE: cosine - REQUIRED_RECALL: 0.965 - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - id: 'gcs_auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - name: Run chaos test - if: always() - run: ./ann_benchmark_aws.sh - - id: 'upload-files' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: 'results' - destination: 'ann-pipelines/github-action-runs' - glob: '*.json' - ann-benchmarks-pq-sift-aws: - name: "[bench AWS] SIFT1M pq=true" - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} - AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} - DATASET: sift-128-euclidean - DISTANCE: l2-squared - REQUIRED_RECALL: 0.992 - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - id: 'gcs_auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - name: Run chaos test - if: always() - run: ./ann_benchmark_compression_aws.sh - - id: 'upload-files' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: 'results' - destination: 'ann-pipelines/github-action-runs' - glob: '*.json' - ann-benchmarks-pq-glove-aws: - name: "[bench AWS] Glove100 pq=true" - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} - AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} - DATASET: glove-100-angular - DISTANCE: cosine - REQUIRED_RECALL: 0.89 - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - id: 'gcs_auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - name: Run chaos test - if: always() - run: ./ann_benchmark_compression_aws.sh - - id: 'upload-files' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: 'results' - destination: 'ann-pipelines/github-action-runs' - glob: '*.json' - ann-benchmarks-sift-gcp: - name: "[bench GCP] SIFT1M pq=false" - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - DATASET: sift-128-euclidean - DISTANCE: l2-squared - REQUIRED_RECALL: 0.999 - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - id: 'gcs_auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - name: Run chaos test - if: always() - run: ./ann_benchmark_gcp.sh - - id: 'upload-files' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: 'results' - destination: 'ann-pipelines/github-action-runs' - glob: '*.json' - ann-benchmarks-pq-sift-gcp: - name: "[bench GCP] SIFT1M pq=true" - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - DATASET: sift-128-euclidean - DISTANCE: l2-squared - REQUIRED_RECALL: 0.992 - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - id: 'gcs_auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v1' - with: - credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - name: Run chaos test - if: always() - run: ./ann_benchmark_compression_gcp.sh - - id: 'upload-files' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: 'results' - destination: 'ann-pipelines/github-action-runs' - glob: '*.json' - batch-import-many-classes: - name: One class reveices long and expensive batches, user tries to create and delete 100s of classes in parallel - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./batch_import_many_classes.sh - upgrade-journey: - name: Rolling updates in multi-node setup from min to target version - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./upgrade_journey.sh - replicated-imports-with-choas-killing: - name: Replicated imports with chaos killing - runs-on: ubuntu-latest-8-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./replication_importing_while_crashing.sh - replicated-imports-with-backup: - name: Replicated imports with backup loop - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./replication_importing_with_backup.sh - replication-tunable-consistency: - name: Replication tunable consistency - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./replication_tunable_consistency.sh - counting-while-compacting: - name: Counting while compacting - runs-on: ubuntu-latest-8-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./counting_while_compacting.sh - segfault-on-batch-ref: - name: Segfault on batch ref - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./segfault_batch_ref.sh - import-with-kills: - name: Import during constant kills/crashes - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./import_while_crashing.sh - heave-imports-crashing: - name: Heavy object store imports while crashing - runs-on: ubuntu-latest-8-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./import_while_crashing_no_vector.sh - segfault-filtered-search: - name: Segfault on filtered vector search (race with hash bucket compaction) - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./segfault_filtered_vector_search.sh - backup-restore-crud: - name: Backup & Restore CRUD - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./backup_and_restore_crud.sh - backup-restore-crud-multi-node: - name: Backup & Restore multi node CRUD - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./backup_and_restore_multi_node_crud.sh - backup-restore-version-compat: - name: Backup & Restore version compatibility - runs-on: ubuntu-latest-8-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./backup_and_restore_version_compatibility.sh - compare-recall: - name: Compare Recall after import to after restart - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./compare_recall_after_restart.sh - concurrent-read-write: - name: Concurrent inverted index read/write - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./concurrent_inverted_index_read_write.sh - consecutive-create-update: - name: Consecutive create and update operations + # ann-benchmarks-sift-aws: + # name: "[bench AWS] SIFT1M pq=false" + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} + # AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + # DATASET: sift-128-euclidean + # DISTANCE: l2-squared + # REQUIRED_RECALL: 0.999 + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - id: 'gcs_auth' + # name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} + # - name: 'Set up Cloud SDK' + # uses: 'google-github-actions/setup-gcloud@v1' + # - name: Run chaos test + # if: always() + # run: ./ann_benchmark_aws.sh + # - id: 'upload-files' + # uses: 'google-github-actions/upload-cloud-storage@v1' + # with: + # path: 'results' + # destination: 'ann-pipelines/github-action-runs' + # glob: '*.json' + # ann-benchmarks-glove-aws: + # name: "[bench AWS] Glove100 pq=false" + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} + # AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + # DATASET: glove-100-angular + # DISTANCE: cosine + # REQUIRED_RECALL: 0.965 + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - id: 'gcs_auth' + # name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} + # - name: 'Set up Cloud SDK' + # uses: 'google-github-actions/setup-gcloud@v1' + # - name: Run chaos test + # if: always() + # run: ./ann_benchmark_aws.sh + # - id: 'upload-files' + # uses: 'google-github-actions/upload-cloud-storage@v1' + # with: + # path: 'results' + # destination: 'ann-pipelines/github-action-runs' + # glob: '*.json' + # ann-benchmarks-pq-sift-aws: + # name: "[bench AWS] SIFT1M pq=true" + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} + # AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + # DATASET: sift-128-euclidean + # DISTANCE: l2-squared + # REQUIRED_RECALL: 0.992 + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - id: 'gcs_auth' + # name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} + # - name: 'Set up Cloud SDK' + # uses: 'google-github-actions/setup-gcloud@v1' + # - name: Run chaos test + # if: always() + # run: ./ann_benchmark_compression_aws.sh + # - id: 'upload-files' + # uses: 'google-github-actions/upload-cloud-storage@v1' + # with: + # path: 'results' + # destination: 'ann-pipelines/github-action-runs' + # glob: '*.json' + # ann-benchmarks-pq-glove-aws: + # name: "[bench AWS] Glove100 pq=true" + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY}} + # AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + # DATASET: glove-100-angular + # DISTANCE: cosine + # REQUIRED_RECALL: 0.89 + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - id: 'gcs_auth' + # name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} + # - name: 'Set up Cloud SDK' + # uses: 'google-github-actions/setup-gcloud@v1' + # - name: Run chaos test + # if: always() + # run: ./ann_benchmark_compression_aws.sh + # - id: 'upload-files' + # uses: 'google-github-actions/upload-cloud-storage@v1' + # with: + # path: 'results' + # destination: 'ann-pipelines/github-action-runs' + # glob: '*.json' + # ann-benchmarks-sift-gcp: + # name: "[bench GCP] SIFT1M pq=false" + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # DATASET: sift-128-euclidean + # DISTANCE: l2-squared + # REQUIRED_RECALL: 0.999 + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - id: 'gcs_auth' + # name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} + # - name: 'Set up Cloud SDK' + # uses: 'google-github-actions/setup-gcloud@v1' + # - name: Run chaos test + # if: always() + # run: ./ann_benchmark_gcp.sh + # - id: 'upload-files' + # uses: 'google-github-actions/upload-cloud-storage@v1' + # with: + # path: 'results' + # destination: 'ann-pipelines/github-action-runs' + # glob: '*.json' + # ann-benchmarks-pq-sift-gcp: + # name: "[bench GCP] SIFT1M pq=true" + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # DATASET: sift-128-euclidean + # DISTANCE: l2-squared + # REQUIRED_RECALL: 0.992 + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - id: 'gcs_auth' + # name: 'Authenticate to Google Cloud' + # uses: 'google-github-actions/auth@v1' + # with: + # credentials_json: ${{secrets.GCP_SERVICE_ACCOUNT_BENCHMARKS}} + # - name: 'Set up Cloud SDK' + # uses: 'google-github-actions/setup-gcloud@v1' + # - name: Run chaos test + # if: always() + # run: ./ann_benchmark_compression_gcp.sh + # - id: 'upload-files' + # uses: 'google-github-actions/upload-cloud-storage@v1' + # with: + # path: 'results' + # destination: 'ann-pipelines/github-action-runs' + # glob: '*.json' + # batch-import-many-classes: + # name: One class reveices long and expensive batches, user tries to create and delete 100s of classes in parallel + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./batch_import_many_classes.sh + # upgrade-journey: + # name: Rolling updates in multi-node setup from min to target version + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Set up Go + # uses: actions/setup-go@v3 + # with: + # go-version: '1.20' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./upgrade_journey.sh + # replicated-imports-with-choas-killing: + # name: Replicated imports with chaos killing + # runs-on: ubuntu-latest-8-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./replication_importing_while_crashing.sh + # replicated-imports-with-backup: + # name: Replicated imports with backup loop + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./replication_importing_with_backup.sh + # replication-tunable-consistency: + # name: Replication tunable consistency + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./replication_tunable_consistency.sh + # counting-while-compacting: + # name: Counting while compacting + # runs-on: ubuntu-latest-8-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./counting_while_compacting.sh + # segfault-on-batch-ref: + # name: Segfault on batch ref + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./segfault_batch_ref.sh + # import-with-kills: + # name: Import during constant kills/crashes + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./import_while_crashing.sh + # heave-imports-crashing: + # name: Heavy object store imports while crashing + # runs-on: ubuntu-latest-8-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./import_while_crashing_no_vector.sh + # segfault-filtered-search: + # name: Segfault on filtered vector search (race with hash bucket compaction) + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./segfault_filtered_vector_search.sh + # backup-restore-crud: + # name: Backup & Restore CRUD + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./backup_and_restore_crud.sh + # backup-restore-crud-multi-node: + # name: Backup & Restore multi node CRUD + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./backup_and_restore_multi_node_crud.sh + # backup-restore-version-compat: + # name: Backup & Restore version compatibility + # runs-on: ubuntu-latest-8-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./backup_and_restore_version_compatibility.sh + # compare-recall: + # name: Compare Recall after import to after restart + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./compare_recall_after_restart.sh + # concurrent-read-write: + # name: Concurrent inverted index read/write + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./concurrent_inverted_index_read_write.sh + # consecutive-create-update: + # name: Consecutive create and update operations + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./consecutive_create_and_update_operations.sh + # batch-insert-mismatch: + # name: Batch insert mismatch + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./consecutive_create_and_update_operations.sh + # rest-patch-restart: + # name: REST PATCH requests stop working after restart + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./rest_patch_stops_working_after_restart.sh + # delete-recreate-updates: + # name: Delete and recreate class with frequent updates + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./delete_and_recreate_class.sh + # geo-crash: + # name: Preventing crashing of geo properties during HNSW maintenance cycles + # runs-on: ubuntu-latest-8-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./geo_crash.sh + # compaction-roaringset: + # name: Preventing panic on compaction of roaringsets + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./compaction_roaringset.sh + # multi-node-references: + # name: Large batches with many cross-refs on a multi-node cluster + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./multi_node_ref_imports.sh + # multi-tenancy-concurrent-imports: + # name: Concurrent clients importing into multi-node cluster + # runs-on: ubuntu-latest-8-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./multi_tenancy_concurrent_importing.sh + # multi_tenancy_activate_deactivate: + # name: Activate and deactivate tenants' shards + # runs-on: ubuntu-latest-4-cores + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./multi_tenancy_activate_deactivate.sh + # goroutine_leak_class_delete: + # name: Check for degraded performance from goroutine leak on class delete + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + # steps: + # - uses: actions/checkout@v3 + # # - name: Polar Signals Continuous Profiling + # # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # # with: + # # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} + # # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' + # - name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} + # - name: Run chaos test + # run: ./goroutine_leak_on_class_delete.sh + # # Commented only because this chaos pipeline was able to interrupt save operation + # # just in the middle of it being performed and since Weaviate doesn't have a transaction + # # mechanism implemented then this was causing an error which is a different error then + # # the discrepancy one, but this pipeline is really good in crashing Weaviate so we want to + # # save it for future tests + # # compare-while-crashing: + # # name: Compare REST and GraphQL while crashing + # # runs-on: ubuntu-latest-4-cores + # # steps: + # # - uses: actions/checkout@v3 + # # - name: Login to Docker Hub + # # uses: docker/login-action@v2 + # # with: + # # username: ${{secrets.DOCKER_USERNAME}} + # # password: ${{secrets.DOCKER_PASSWORD}} + # # - name: Run chaos test + # # run: ./compare_rest_graphql_while_crashing.sh + ann-benchmarks-sift-local-k8s: + name: Ann-benchmark in a k8s cluster using helm runs-on: ubuntu-latest timeout-minutes: 60 env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./consecutive_create_and_update_operations.sh - batch-insert-mismatch: - name: Batch insert mismatch - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./consecutive_create_and_update_operations.sh - rest-patch-restart: - name: REST PATCH requests stop working after restart - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./rest_patch_stops_working_after_restart.sh - delete-recreate-updates: - name: Delete and recreate class with frequent updates - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./delete_and_recreate_class.sh - geo-crash: - name: Preventing crashing of geo properties during HNSW maintenance cycles - runs-on: ubuntu-latest-8-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./geo_crash.sh - compaction-roaringset: - name: Preventing panic on compaction of roaringsets - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./compaction_roaringset.sh - multi-node-references: - name: Large batches with many cross-refs on a multi-node cluster - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} + HELM_BRANCH: 'raft-configuration' + REPLICAS: 3 + SETUP: 'k8s' steps: - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 - # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{secrets.DOCKER_USERNAME}} password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./multi_node_ref_imports.sh - multi-tenancy-concurrent-imports: - name: Concurrent clients importing into multi-node cluster - runs-on: ubuntu-latest-8-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + - name: Run ann-benchmark in k8s cluster + run: ./ann_benchmark.sh + # - name: Create k8s Kind Cluster + # uses: helm/kind-action@v1 # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./multi_tenancy_concurrent_importing.sh - multi_tenancy_activate_deactivate: - name: Activate and deactivate tenants' shards - runs-on: ubuntu-latest-4-cores - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # wait: 120s + # cluster_name: weaviate-k8s + # config: kind-config.yaml + # - name: Install Helm + # uses: azure/setup-helm@v1 # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./multi_tenancy_activate_deactivate.sh - goroutine_leak_class_delete: - name: Check for degraded performance from goroutine leak on class delete - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PERSISTENCE_LSM_ACCESS_STRATEGY: ${{inputs.lsm_access_strategy}} - steps: - - uses: actions/checkout@v3 - # - name: Polar Signals Continuous Profiling - # uses: polarsignals/gh-actions-ps-profiling@v0.0.1 + # version: 'v3.6.3' # replace with your desired Helm version + # # - name: Add Helm repo + # # run: helm repo add weaviate https://weaviate.github.io/weaviate-helm + # - name: Download weaviate-helm repository branch ${{ env.HELM_BRANCH}} + # uses: actions/checkout@v3 # with: - # polarsignals_cloud_token: ${{ secrets.POLARSIGNALS_TOKEN }} - # labels: 'job=${{ github.job }};gh_run_id=${{ github.run_id }}' - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - - name: Run chaos test - run: ./goroutine_leak_on_class_delete.sh - # Commented only because this chaos pipeline was able to interrupt save operation - # just in the middle of it being performed and since Weaviate doesn't have a transaction - # mechanism implemented then this was causing an error which is a different error then - # the discrepancy one, but this pipeline is really good in crashing Weaviate so we want to - # save it for future tests - # compare-while-crashing: - # name: Compare REST and GraphQL while crashing - # runs-on: ubuntu-latest-4-cores - # steps: - # - uses: actions/checkout@v3 - # - name: Login to Docker Hub - # uses: docker/login-action@v2 - # with: - # username: ${{secrets.DOCKER_USERNAME}} - # password: ${{secrets.DOCKER_PASSWORD}} - # - name: Run chaos test - # run: ./compare_rest_graphql_while_crashing.sh + # repository: weaviate/weaviate-helm + # ref: ${{ env.HELM_BRANCH }} + # path: weaviate-helm + # - name: Package Weaviate Helm chart + # run: helm package weaviate-helm/weaviate + # - name: Create namespace + # run: kubectl create namespace weaviate + # - name: Install Weaviate using Helm + # run: | + # helm upgrade --install weaviate ./weaviate-*tgz \ + # --namespace weaviate \ + # --set image.tag=${{ env.WEAVIATE_VERSION }} \ + # --set replicas=${{ env.REPLICAS }} \ + # --set grpcService.enabled=true \ + # --set debug=true + # - name: Wait for weaviate to be up + # run: | + # kubectl wait sts/weaviate -n weaviate --for jsonpath='{.status.readyReplicas}'=${{ env.REPLICAS }} --timeout=60s + # - name: Expose weaviate port locally into 8080 + # run: | + # nohup kubectl port-forward svc/weaviate 8080:80 -n weaviate & + # - name: Expose gRPC port locally into 50051 + # run: | + # nohup kubectl port-forward svc/weaviate-grpc 50051:50051 -n weaviate & + # - name: Check if weaviate is up + # run: | + # curl http://127.0.0.1:8080/v1/nodes + - name: Retreive weaviate logs + if: failure() + run: | + kubectl logs -n weaviate -l app.kubernetes.io/name=weaviate + + diff --git a/ann_benchmark.sh b/ann_benchmark.sh index 5907ad96..f9c8b8ac 100755 --- a/ann_benchmark.sh +++ b/ann_benchmark.sh @@ -5,6 +5,7 @@ set -e dataset=${DATASET:-"sift-128-euclidean"} distance=${DISTANCE:-"l2-squared"} +setup=${SETUP:-"docker"} function wait_weaviate() { echo "Wait for Weaviate to be ready" @@ -23,7 +24,18 @@ echo "Building all required containers" ( cd apps/ann-benchmarks/ && docker build -t ann_benchmarks . ) echo "Starting Weaviate..." -docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml up -d +if [ "$setup" == "docker" ] +then + echo "Using docker setup" + docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml up -d +elif [ "$setup" == "k8s" ] +then + echo "Using k8s setup" + apps/weaviate/local-k8s.sh setup +else + echo "Unknown setup" + exit 1 +fi wait_weaviate @@ -43,9 +55,15 @@ mkdir -p datasets docker run --network host -t -v "$PWD/results:/workdir/results" -v "$PWD/datasets:/datasets" ann_benchmarks python3 run.py -v /datasets/${dataset}.hdf5 -d $distance -m 32 --labels "pq=false,after_restart=false,weaviate_version=$WEAVIATE_VERSION,cloud_provider=$CLOUD_PROVIDER,machine_type=$MACHINE_TYPE,os=$OS" echo "Initial run complete, now restart Weaviate" - -docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml stop weaviate -docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml start weaviate +if [ "$setup" == "docker" ] +then + docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml stop weaviate + docker compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml start weaviate +elif [ "$setup" == "k8s" ] +then + kubectl scale --replicas=0 statefulset/weaviate -n weaviate + kubectl scale --replicas=${REPLICAS} statefulset/weaviate -n weaviate +fi wait_weaviate echo "Weaviate ready, wait 30s for caches to be hot" diff --git a/apps/weaviate/local-k8s.sh b/apps/weaviate/local-k8s.sh new file mode 100755 index 00000000..cefaf10c --- /dev/null +++ b/apps/weaviate/local-k8s.sh @@ -0,0 +1,210 @@ +#!/bin/bash +set -eou pipefail + +REQUIREMENTS=( + "kind" + "helm" + "kubectl" + "curl" + "nohup" +) + +# NOTE: If triggering some of the scripts locally on Mac, you might find an error from the test complaining +# that the injection Docker container can't connect to localhost:8080. This is because the Docker container +# is running in a separate network and can't access the host network. To fix this, you can use the IP address +# of the host machine instead of localhost, using "host.docker.internal". For example: +# client = weaviate.connect_to_local(host="host.docker.internal") +WEAVIATE_PORT=8080 +WEAVIATE_GRPC_PORT=50051 +PROMETHEUS_PORT=9091 +GRAFANA_PORT=3000 + +function wait_weaviate() { + echo "Wait for Weaviate to be ready" + for _ in {1..120}; do + if curl -sf -o /dev/null localhost:${WEAVIATE_PORT}; then + echo "Weaviate is ready" + break + fi + + echo "Weaviate is not ready, trying again in 1s" + sleep 1 + done +} + +# This auxiliary function returns the number of voters based on the number of nodes, passing the number of nodes as an argument. +function get_voters() { + if [[ $1 -ge 10 ]]; then + echo 7 + elif [[ $1 -ge 7 && $1 -lt 10 ]]; then + echo 5 + elif [[ $1 -ge 4 && $1 -lt 7 ]]; then + echo 3 + elif [[ $1 -ge 3 && $1 -lt 4 ]]; then + echo 2 + else + echo 1 + fi +} + +function setup() { + + echo "setup # Setting up Weaviate on local k8s" + + # Create Kind config file + cat < /tmp/kind-config.yaml +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +name: weaviate-k8s +nodes: +- role: control-plane +$(for i in $(seq 1 $REPLICAS); do echo "- role: worker"; done) +EOF + + echo "setup # Create local k8s cluster" + # Create k8s Kind Cluster + kind create cluster --wait 120s --name weaviate-k8s --config /tmp/kind-config.yaml + + # Create namespace + kubectl create namespace weaviate + + if [ -n "${HELM_BRANCH:-}" ]; then + WEAVIATE_HELM_DIR="/tmp/weaviate-helm" + # Delete $WEAVIATE_HELM_DIR if it already exists + if [ -d "$WEAVIATE_HELM_DIR" ]; then + rm -rf "$WEAVIATE_HELM_DIR" + fi + # Download weaviate-helm repository master branch + git clone -b $HELM_BRANCH https://github.com/weaviate/weaviate-helm.git $WEAVIATE_HELM_DIR + # Package Weaviate Helm chart + helm package -d ${WEAVIATE_HELM_DIR} ${WEAVIATE_HELM_DIR}/weaviate + TARGET=${WEAVIATE_HELM_DIR}/weaviate-*.tgz + else + helm repo add weaviate https://weaviate.github.io/weaviate-helm + TARGET="weaviate/weaviate" + fi + + # Install Weaviate using Helm + helm upgrade --install weaviate $TARGET \ + --namespace weaviate \ + --set image.tag=$WEAVIATE_VERSION \ + --set replicas=$REPLICAS \ + --set grpcService.enabled=true \ + --set env.RAFT_BOOTSTRAP_EXPECT=$(get_voters $REPLICAS) \ + --set env.LOG_LEVEL="debug" + + # Wait for Weaviate to be up + kubectl wait sts/weaviate -n weaviate --for jsonpath='{.status.readyReplicas}'=${REPLICAS} --timeout=120s + + # Install kube-relay tool to perform port-forwarding + # Check if kubectl-relay binary is available + if ! command -v kubectl-relay &> /dev/null; then + # Retrieve the operating system + OS=$(uname -s) + + # Retrieve the processor architecture + ARCH=$(uname -m) + + VERSION="v0.0.6" + + # Determine the download URL based on the OS and ARCH + if [[ $OS == "Darwin" && $ARCH == "x86_64" ]]; then + OS_ID="darwin" + ARCH_ID="amd64" + elif [[ $OS == "Darwin" && $ARCH == "arm64" ]]; then + OS_ID="darwin" + ARCH_ID="arm64" + elif [[ $OS == "Linux" && $ARCH == "x86_64" ]]; then + OS_ID="linux" + ARCH_ID="amd64" + elif [[ $OS == "Linux" && $ARCH == "aarch64" ]]; then + OS_ID="linux" + ARCH_ID="arm64" + else + echo "Unsupported operating system or architecture" + exit 1 + fi + + KUBE_RELAY_FILENAME="kubectl-relay_${VERSION}_${OS_ID}-${ARCH_ID}.tar.gz" + # Download the appropriate version + curl -L "https://github.com/knight42/krelay/releases/download/${VERSION}/${KUBE_RELAY_FILENAME}" -o /tmp/${KUBE_RELAY_FILENAME} + + # Extract the downloaded file + tar -xzf "/tmp/${KUBE_RELAY_FILENAME}" -C /tmp + + fi + + /tmp/kubectl-relay svc/weaviate -n weaviate ${WEAVIATE_PORT}:80 -n weaviate &> /tmp/weaviate_frwd.log & + + /tmp/kubectl-relay svc/weaviate-grpc -n weaviate ${WEAVIATE_GRPC_PORT}:50051 -n weaviate &> /tmp/weaviate_grpc_frwd.log & + + wait_weaviate + + # Check if Weaviate is up + curl http://localhost:${WEAVIATE_PORT}/v1/nodes +} + +function clean() { + echo "clean # Cleaning up local k8s cluster..." + + # Kill kubectl port-forward processes running in the background + pkill -f "kubectl-relay" || true + + # Check if Weaviate release exists + if helm status weaviate -n weaviate &> /dev/null; then + # Uninstall Weaviate using Helm + helm uninstall weaviate -n weaviate + fi + + # Check if Weaviate namespace exists + if kubectl get namespace weaviate &> /dev/null; then + # Delete Weaviate namespace + kubectl delete namespace weaviate + fi + + # Check if Kind cluster exists + if kind get clusters | grep -q "weaviate-k8s"; then + # Delete Kind cluster + kind delete cluster --name weaviate-k8s + fi +} + + +# Main script + +# Check if any options are passed +if [ $# -eq 0 ]; then + echo "Usage: $0 " + echo "options:" + echo " setup" + echo " clean" + exit 1 +fi + +# Check if all requirements are installed +for requirement in "${REQUIREMENTS[@]}"; do + if ! command -v $requirement &> /dev/null; then + echo "Please install '$requirement' before running this script" + echo " brew install $requirement" + exit 1 + fi +done + +# Process command line options +case $1 in + "setup") + setup + ;; + "clean") + clean + ;; + *) + echo "Invalid option: $1. Use 'setup' or 'clean'" + exit 1 + ;; +esac + +# Retrieve Weaviate logs +if [ $? -ne 0 ]; then + kubectl logs -n weaviate -l app.kubernetes.io/name=weaviate +fi