From 1d16dfd034833aa25b2114c57da18ec0c4f3bfa4 Mon Sep 17 00:00:00 2001 From: Sam Armstrong <88863522+Sam-Armstrong@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:46:26 +0100 Subject: [PATCH] CI cleanup + workflow for PR assignment (#28787) --- .github/CODEOWNERS | 2 - .github/workflows/array-api-det-coverage.yml | 4 +- .github/workflows/assign-pr.yml | 24 +++++ .github/workflows/det-test-coverage.yml | 4 +- .github/workflows/run-all-tests.yml | 78 -------------- .github/workflows/run-failing-tests.yml | 76 ------------- .github/workflows/test-ivy-cron-gpu.yml | 102 ------------------ .../workflows/test-ivy-cron-multi-version.yml | 46 -------- .github/workflows/test-ivy-cron.yml | 46 -------- .github/workflows/test-ivy-tracer-cron.yml | 46 -------- .github/workflows/welcome-message.yml | 34 ------ 11 files changed, 28 insertions(+), 434 deletions(-) create mode 100644 .github/workflows/assign-pr.yml delete mode 100644 .github/workflows/run-all-tests.yml delete mode 100644 .github/workflows/run-failing-tests.yml delete mode 100644 .github/workflows/test-ivy-cron-gpu.yml delete mode 100644 .github/workflows/test-ivy-cron-multi-version.yml delete mode 100644 .github/workflows/test-ivy-cron.yml delete mode 100644 .github/workflows/test-ivy-tracer-cron.yml delete mode 100644 .github/workflows/welcome-message.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 34a52a8d4ffce..9ff8c778e98cd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,12 +1,10 @@ # Ivy Framework -ivy/ @Sam-Armstrong ivy/func_wrapper.py @Sam-Armstrong **/gradients.py @Sam-Armstrong ivy/utils/backend @Sam-Armstrong ivy/utils/backend/ast_helpers.py @Sam-Armstrong # Ivy Testing -ivy_tests/ @Sam-Armstrong ivy_tests/test_ivy/helpers/ @Sam-Armstrong # Docs builder diff --git a/.github/workflows/array-api-det-coverage.yml b/.github/workflows/array-api-det-coverage.yml index 254fb28e548a0..0cda22fa3af37 100644 --- a/.github/workflows/array-api-det-coverage.yml +++ b/.github/workflows/array-api-det-coverage.yml @@ -1,8 +1,8 @@ name: array-api-determine-test-coverage on: workflow_dispatch: - schedule: - - cron: "30 20 * * 6" +# schedule: +# - cron: "30 20 * * 6" permissions: actions: read diff --git a/.github/workflows/assign-pr.yml b/.github/workflows/assign-pr.yml new file mode 100644 index 0000000000000..9416d25ae514b --- /dev/null +++ b/.github/workflows/assign-pr.yml @@ -0,0 +1,24 @@ +name: assign-pr + +on: + pull_request: + types: [opened] + +jobs: + assign: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Assign PR + env: + GITHUB_TOKEN: ${{ secrets.DEV_BOT_GENERAL_PAT }} + run: | + PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + curl -s -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/assignees \ + -d '{"assignees":["Sam-Armstrong"]}' diff --git a/.github/workflows/det-test-coverage.yml b/.github/workflows/det-test-coverage.yml index be26581eb0903..a0834c58c1c1d 100644 --- a/.github/workflows/det-test-coverage.yml +++ b/.github/workflows/det-test-coverage.yml @@ -1,8 +1,8 @@ name: Determine Test Coverage on: workflow_dispatch: - schedule: - - cron: "30 20 * * 6" +# schedule: +# - cron: "30 20 * * 6" permissions: actions: read diff --git a/.github/workflows/run-all-tests.yml b/.github/workflows/run-all-tests.yml deleted file mode 100644 index 7fb8304e0f52d..0000000000000 --- a/.github/workflows/run-all-tests.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: run-all-tests -on: - workflow_dispatch: - -permissions: - actions: read -jobs: - display_test_results: - if: ${{ always() }} - runs-on: ubuntu-latest - needs: - - run_tests - - steps: - - name: Download all test results - uses: actions/download-artifact@v3 - - - name: Combined Test Results - run: | - find . -name "test_results_*.txt" -exec cat {} + > combined_test_results.txt - echo "Test results summary:" - cat combined_test_results.txt - - run_tests: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - branch: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64 ] - steps: - - name: Checkout Ivy 🛎 - uses: actions/checkout@v3 - with: - path: ivy - persist-credentials: false - submodules: "recursive" - fetch-depth: 100 - - - name: Install ivy and fetch binaries - run: | - cd ivy - sudo pip3 install -e . - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - cd .. - - - name: Get Job URL - uses: Tiryoh/gha-jobid-action@v0 - id: jobs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - job_name: ${{ github.job }} - - - name: Run Tests - run: | - pip3 install pymongo - cd ivy - python scripts/setup_tests/filter_tests.py ${{ matrix.branch }} - set -o pipefail - python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' 'false' 'false' ${{ steps.jobs.outputs.html_url }} | tee test_results_${{ matrix.branch }}.txt - continue-on-error: true - - - name: Upload test results - uses: actions/upload-artifact@v3 - with: - name: test_results_${{ matrix.branch }} - path: ivy/test_results_${{ matrix.branch }}.txt - - - name: Check on failures - if: steps.tests.outcome != 'success' - run: exit 1 diff --git a/.github/workflows/run-failing-tests.yml b/.github/workflows/run-failing-tests.yml deleted file mode 100644 index cbd95ca62b532..0000000000000 --- a/.github/workflows/run-failing-tests.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Run Failing Tests -on: - workflow_dispatch: - inputs: - priority: - description: 'Priority:' - default: true - required: false - -permissions: - actions: read -jobs: - display_test_results: - if: ${{ always() }} - runs-on: ubuntu-latest - needs: - - run_tests - - steps: - - name: Download all test results - uses: actions/download-artifact@v3 - - - name: Combined Test Results - run: | - find . -name "test_results_*.txt" -exec cat {} + > combined_test_results.txt - echo "Test results summary:" - cat combined_test_results.txt - - run_tests: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - branch: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128 ] - steps: - - name: Checkout Ivy 🛎 - uses: actions/checkout@v3 - with: - path: ivy - persist-credentials: false - submodules: "recursive" - fetch-depth: 1 - - - name: Get Job URL - uses: Tiryoh/gha-jobid-action@v0 - id: jobs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - job_name: ${{ github.job }} - - - name: Setup Tests - run: | - pip3 install pymongo - cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python scripts/setup_tests/setup_failing_tests.py ${{ github.event.inputs.priority }} ${{ matrix.branch }} - - - name: Run Tests - run: | - cd ivy - python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' 'false' 'false' ${{ steps.jobs.outputs.html_url }} - continue-on-error: true diff --git a/.github/workflows/test-ivy-cron-gpu.yml b/.github/workflows/test-ivy-cron-gpu.yml deleted file mode 100644 index f4209e776b030..0000000000000 --- a/.github/workflows/test-ivy-cron-gpu.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: test-ivy-cron-gpu -on: - workflow_dispatch: - # schedule: - # - cron: '25 * * * *' -permissions: - actions: read -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: false -jobs: - start-vm: - runs-on: ubuntu-latest - if: always() # Run this job always, regardless of the status of run-test-basics - steps: - - name: Checkout Demos🛎 - uses: actions/checkout@v4 - with: - repository: unifyai/demos - path: demos - persist-credentials: false - submodules: "recursive" - fetch-depth: 1 - - - name: Install clients for GCP/Mongo - run: | - pip3 install pymongo google-api-python-client paramiko - - - name: Start GPU VM - run: | - cd demos/tests/auth - mkdir -p ~/.ssh - touch ~/.ssh/id_rsa - echo -n "${{ secrets.GPU_SSH_KEY }}" > ~/.ssh/id_rsa - chmod +x ~/.ssh/id_rsa - python3 db_auth.py ${{ secrets.GPU_DB_ENDPOINT }} ${{ secrets.GPU_DB_OBJ_ID }} - python3 vm_auth.py ${{ secrets.GPU_SSH_USERNAME }} ${{ secrets.GPU_SSH_PASSPHRASE }} "false" "ivy-repo-gpu-testing" - - run-gpu-tests: - needs: start-vm - runs-on: self-hosted - steps: - - name: Clean Repository - run: - sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE - - - name: Checkout 🛎️Ivy - uses: actions/checkout@v2 - with: - path: ivy - persist-credentials: false - submodules: "recursive" - fetch-depth: 2 - - - name: Install ivy and fetch binaries - run: | - cd ivy - export TAG="cp310-cp310-manylinux_2_17_x86_64" - sudo pip3 install -e . - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - cd .. - - - name: Get Job URL - uses: Tiryoh/gha-jobid-action@v0 - id: jobs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - job_name: ${{ github.job }} - - - name: Run Tests - id: tests - run: | - pip3 install pymongo - cd ivy - python3 scripts/setup_tests/cron_tests.py ${{ github.run_number }} true false - python3 scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'true' ${{ github.run_id }} 'false' 'false' 'false' ${{ steps.jobs.outputs.html_url }} - - stop-vm: - needs: run-gpu-tests - runs-on: ubuntu-latest - if: always() # Run this job always, regardless of the status of run-test - steps: - - name: Checkout Demos🛎 - uses: actions/checkout@v4 - with: - repository: unifyai/demos - path: demos - persist-credentials: false - submodules: "recursive" - fetch-depth: 1 - - - name: Install clients for GCP/Mongo - run: | - pip3 install pymongo google-api-python-client paramiko - - - name: Stop GPU VM - run: | - cd demos/tests/auth - python3 db_auth.py ${{ secrets.GPU_DB_ENDPOINT }} ${{ secrets.GPU_DB_OBJ_ID }} - python3 vm_auth.py ${{ secrets.GPU_SSH_USERNAME }} ${{ secrets.GPU_SSH_PASSPHRASE }} "true" "ivy-repo-gpu-testing" diff --git a/.github/workflows/test-ivy-cron-multi-version.yml b/.github/workflows/test-ivy-cron-multi-version.yml deleted file mode 100644 index 552e73f4aed06..0000000000000 --- a/.github/workflows/test-ivy-cron-multi-version.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: test-ivy-cron-multi-version -on: - workflow_dispatch: -# schedule: -# - cron: '20 * * * *' -permissions: - actions: read -jobs: - run-nightly-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️Ivy - uses: actions/checkout@v2 - with: - path: ivy - persist-credentials: false - submodules: "recursive" - - - name: Install ivy and fetch binaries - run: | - cd ivy - sudo pip3 install -e . - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - cd .. - - - name: Get Job URL - uses: Tiryoh/gha-jobid-action@v0 - id: jobs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - job_name: ${{ github.job }} - - - name: Run Tests - id: tests - run: | - cd ivy - pip3 install pymongo - python scripts/setup_tests/cron_tests_multi_version.py ${{ github.run_number }} - python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'true' 'false' ${{ github.run_id }} 'false' 'false' 'false' ${{ steps.jobs.outputs.html_url }} - continue-on-error: true - - - name: Check on failures - if: steps.tests.outcome != 'success' - run: exit 1 diff --git a/.github/workflows/test-ivy-cron.yml b/.github/workflows/test-ivy-cron.yml deleted file mode 100644 index 31224a8291cc7..0000000000000 --- a/.github/workflows/test-ivy-cron.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: test-ivy-cron -on: - workflow_dispatch: -# schedule: -# - cron: '30 * * * *' -permissions: - actions: read -jobs: - run-nightly-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️Ivy - uses: actions/checkout@v2 - with: - path: ivy - persist-credentials: false - submodules: "recursive" - - - name: Install ivy and fetch binaries - run: | - cd ivy - sudo pip3 install -e . - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - cd .. - - - name: Get Job URL - uses: Tiryoh/gha-jobid-action@v0 - id: jobs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - job_name: ${{ github.job }} - - - name: Run Tests - id: tests - run: | - cd ivy - pip3 install pymongo - python scripts/setup_tests/cron_tests.py ${{ github.run_number }} false false - python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' 'false' 'false' ${{ steps.jobs.outputs.html_url }} - continue-on-error: true - - - name: Check on failures - if: steps.tests.outcome != 'success' - run: exit 1 diff --git a/.github/workflows/test-ivy-tracer-cron.yml b/.github/workflows/test-ivy-tracer-cron.yml deleted file mode 100644 index c799eadfb5678..0000000000000 --- a/.github/workflows/test-ivy-tracer-cron.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: test-ivy-tracer-cron -on: - workflow_dispatch: -# schedule: -# - cron: '15 * * * *' -permissions: - actions: read -jobs: - run-nightly-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️Ivy - uses: actions/checkout@v2 - with: - path: ivy - persist-credentials: false - submodules: "recursive" - - - name: Install ivy and fetch binaries - run: | - cd ivy - sudo pip3 install -e . - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - cd .. - - - name: Get Job URL - uses: Tiryoh/gha-jobid-action@v0 - id: jobs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - job_name: ${{ github.job }} - - - name: Run Tests - id: tests - run: | - cd ivy - pip3 install pymongo - python scripts/setup_tests/cron_tests.py ${{ github.run_number }} false true - python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' 'true' 'false' ${{ steps.jobs.outputs.html_url }} - continue-on-error: true - - - name: Check on failures - if: steps.tests.outcome != 'success' - run: exit 1 diff --git a/.github/workflows/welcome-message.yml b/.github/workflows/welcome-message.yml deleted file mode 100644 index 77034baca336a..0000000000000 --- a/.github/workflows/welcome-message.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Check Semantic and welcome new contributors - -on: - pull_request_target: - types: - - opened - workflow_call: - -permissions: - pull-requests: write - -jobs: - welcome: - name: Welcome - runs-on: ubuntu-latest - timeout-minutes: 10 - if: github.event.action == 'opened' - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-message: |- - Congrats on making your first Pull Request and thanks for supporting Ivy! 🎉 - Join the conversation in our [Discord](https://discord.com/invite/sXyFF8tDtm). - - For every PR opened, we run unit tests and comment the results in the PR to ensure the functionality remains intact. - Please make sure they are passing. 💪 - - If you want to check them from the action runners, you can open the `display_test_results` job. 👀 - It contains the following two sections: - - **Combined Test Results:** This shows the results of all the ivy tests that ran on the PR. ✔️ - - **New Failures Introduced:** This lists the tests that fail on this PR. - - Keep in mind that we will assign an engineer for this task and they will look at it based on the workload that they have, **kindly be patient 😄**.