diff --git a/.devcontainer/build/devcontainer.json b/.devcontainer/build/devcontainer.json index 5debe40f27a6c..57db5e9c57acb 100644 --- a/.devcontainer/build/devcontainer.json +++ b/.devcontainer/build/devcontainer.json @@ -23,7 +23,7 @@ }, "postCreateCommand": { - "post_create": "bash .devcontainer/post_create_commands.sh", + "post_create": "bash .devcontainer/post_create_commands.sh", "bashrc": "echo \"alias python=python3\" >> ~/.bashrc" }, @@ -59,4 +59,3 @@ } } } - diff --git a/.devcontainer/build_apple_silicon/devcontainer.json b/.devcontainer/build_apple_silicon/devcontainer.json new file mode 100644 index 0000000000000..386e9b7d883e5 --- /dev/null +++ b/.devcontainer/build_apple_silicon/devcontainer.json @@ -0,0 +1,61 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/docker-existing-dockerfile +{ + "name": "Ivy Apple Silicon Development Environment (build)", + + "build": { + "dockerfile": "../../docker/DockerfileAppleSilicon", + "context": "../..", + "args": { + "pycon": ["3.10"] + } + }, + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ], + "settings": { + "python.defaultInterpreterPath": "/opt/miniconda/envs/multienv/bin/python3" + } + } + }, + + "postCreateCommand": { + "post_create": "bash .devcontainer/post_create_commands.sh", + "bashrc": "echo \"alias python=python3\" >> ~/.bashrc" + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created - for example installing curl. + + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust + // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. + // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. + // "remoteUser": "vscode", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "configureZshAsDefaultShell": true, + "installOhMyZsh": true, + "upgradePackages": false + }, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { + "moby": true, + "installDockerBuildx": true, + "version": "20.10", + "dockerDashComposeVersion": "v2" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + } + } +} diff --git a/.devcontainer/build_gpu/devcontainer.json b/.devcontainer/build_gpu/devcontainer.json index cbe6ee4d3ecfe..b74cb231c4a78 100644 --- a/.devcontainer/build_gpu/devcontainer.json +++ b/.devcontainer/build_gpu/devcontainer.json @@ -2,11 +2,11 @@ "name": "Ivy GPU Development Environment (build)", "build": { - "dockerfile": "../../docker/DockerfileGPUMultiCuda", + "dockerfile": "../../docker/DockerfileGPU", "context": "../..", "args": { - "IMAGE_NAME": "unifyai/multicuda", - "IMAGE_TAG": "base_and_requirements" + "IMAGE_NAME": "unifyai/ivy", + "IMAGE_TAG": "latest-gpu" } }, @@ -24,7 +24,7 @@ }, "postCreateCommand": { - "post_create": "bash .devcontainer/post_create_commands.sh", + "post_create": "bash .devcontainer/post_create_commands.sh", "bashrc": "echo \"alias python=python3\" >> ~/.bashrc" }, @@ -59,4 +59,4 @@ "version": "latest" } } -} \ No newline at end of file +} diff --git a/.devcontainer/build_multiversion/devcontainer.json b/.devcontainer/build_multiversion/devcontainer.json index 86e81d131b3f0..e591c0bcfae36 100644 --- a/.devcontainer/build_multiversion/devcontainer.json +++ b/.devcontainer/build_multiversion/devcontainer.json @@ -62,4 +62,3 @@ } } } - diff --git a/.devcontainer/image/devcontainer.json b/.devcontainer/devcontainer.json similarity index 99% rename from .devcontainer/image/devcontainer.json rename to .devcontainer/devcontainer.json index f5ef5400a41e9..29f16ac1112d7 100644 --- a/.devcontainer/image/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,20 +14,20 @@ }, "postCreateCommand": { - "post_create": "bash .devcontainer/post_create_commands.sh", + "post_create": "bash .devcontainer/post_create_commands.sh", "bashrc": "echo \"alias python=python3\" >> ~/.bashrc" }, "initializeCommand": "docker pull unifyai/ivy:latest", // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], - + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], - + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode", "features": { @@ -48,4 +48,4 @@ "version": "latest" } } -} \ No newline at end of file +} diff --git a/.devcontainer/image_gpu/devcontainer.json b/.devcontainer/image_gpu/devcontainer.json index a3bbfba0c34a4..ca899e132de7b 100644 --- a/.devcontainer/image_gpu/devcontainer.json +++ b/.devcontainer/image_gpu/devcontainer.json @@ -1,7 +1,7 @@ { "name": "Ivy GPU Development Environment (image)", - "image": "unifyai/multicuda:base_and_requirements", + "image": "unifyai/ivy:latest-gpu", "customizations": { "vscode": { "extensions": [ @@ -16,20 +16,20 @@ "runArgs": ["--gpus","all"], "postCreateCommand": { - "post_create": "bash .devcontainer/post_create_commands.sh", + "post_create": "bash .devcontainer/post_create_commands.sh", "bashrc": "echo \"alias python=python3\" >> ~/.bashrc" }, "initializeCommand": "docker pull unifyai/ivy:latest", - + // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], - + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], - + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode", "features": { @@ -50,4 +50,4 @@ "version": "latest" } } -} \ No newline at end of file +} diff --git a/.devcontainer/post_create_commands.sh b/.devcontainer/post_create_commands.sh index 892a423fe2385..bd3a0ddd410e3 100644 --- a/.devcontainer/post_create_commands.sh +++ b/.devcontainer/post_create_commands.sh @@ -8,4 +8,4 @@ python3 -m pip install pre-commit git config --global --add safe.directory /workspaces/ivy -( cd /workspaces/ivy/ && pre-commit install) \ No newline at end of file +( cd /workspaces/ivy/ && pre-commit install) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a2175bcbfaf5f..f24fc1e04f944 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,7 +6,6 @@ ivy/utils/backend/ast_helpers.py @CatB1t # Ivy Testing ivy_tests/test_ivy/helpers/ @CatB1t -ivy_tests/array_api_testing/ @aarsh2001 @hirwa-nshuti # Docs builder docs/index.rst @KareemMAX @@ -14,14 +13,9 @@ docs/make_docs.sh @KareemMAX docs/partial_conf.py @KareemMAX docs/prebuild.sh @KareemMAX docs/overview/contributing/building_the_docs.rst @KareemMAX -docs/overview/deep_dive/building_the_docs_pipline.rst @KareemMAX +docs/overview/deep_dive/building_the_docs_pipeline.rst @KareemMAX docs/_templates @KareemMAX - -# Docker -docker/* @ricksanchezstoic - -# Idea files -.idea/* @Aarsh2001 @zaeemansari70 +docs/demos @KareemMAX # README README.md @guillesanbri diff --git a/.github/ISSUE_TEMPLATE/sub-task.md b/.github/ISSUE_TEMPLATE/sub-task.md index 21c1855bc4283..34374422b3f2d 100644 --- a/.github/ISSUE_TEMPLATE/sub-task.md +++ b/.github/ISSUE_TEMPLATE/sub-task.md @@ -2,7 +2,7 @@ name: 🍰 Sub-Task about: Reserve a sub-task from a ToDo list issue title: "" -labels: Sub Task +labels: Sub Task, hacktoberfest assignees: '' --- diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index aeae956c725f6..f88501612a20e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,31 +1,44 @@ - -# PR Description +# PR Description - -## Related Issue +## Related Issue - -Close # +Closes # -## Checklist +## Checklist - [ ] Did you add a function? - [ ] Did you add the tests? +- [ ] Did you run your tests and are your tests passing? +- [ ] Did pre-commit not fail on any check? - [ ] Did you follow the steps we provided? -### Socials: + + +### Socials + + diff --git a/.github/workflows/array-api-det-coverage.yml b/.github/workflows/array-api-det-coverage.yml index ea913b3b17875..254fb28e548a0 100644 --- a/.github/workflows/array-api-det-coverage.yml +++ b/.github/workflows/array-api-det-coverage.yml @@ -1,11 +1,18 @@ name: array-api-determine-test-coverage on: workflow_dispatch: + schedule: + - cron: "30 20 * * 6" + permissions: actions: read jobs: determine_coverage: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + branch: [ 1, 2, 3, 4 ] steps: - name: Checkout Ivy 🛎 uses: actions/checkout@v2 @@ -19,7 +26,7 @@ jobs: run: | pip install pydriller tqdm cd ivy - python run_tests_CLI/array_api_det_coverage.py + python scripts/determine_tests/array_api_det_coverage.py ${{ matrix.branch }} cd .. mkdir tests cp ivy/tests.pbz2 tests/ @@ -32,6 +39,6 @@ jobs: source-directory: tests/ destination-github-username: 'unifyai' destination-repository-name: 'Mapping' - user-email: rashul.chutani@gmail.com + user-email: ivy.branch@lets-unify.ai commit-message: Update Array API Tests Mapping - target-branch: main + target-branch: main${{ matrix.branch }} diff --git a/.github/workflows/array-api-intelligent-tests-pr.yml b/.github/workflows/array-api-intelligent-tests-pr.yml index ceea657f3d05a..2bb007f86ba61 100644 --- a/.github/workflows/array-api-intelligent-tests-pr.yml +++ b/.github/workflows/array-api-intelligent-tests-pr.yml @@ -5,33 +5,80 @@ on: 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 + + - name: New Failures Introduced + run: | + find . -name "new_failures_*.txt" -exec cat {} + > combined_failures.txt + if [ -s combined_failures.txt ] + then + echo "This PR introduces the following new failing tests:" + cat combined_failures.txt + else + echo "This PR does not introduce any new test failures! Yippee!" + fi + run_tests: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + branch: [ 1, 2, 3, 4 ] + steps: - name: Checkout Ivy 🛎 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ivy persist-credentials: false submodules: "recursive" fetch-depth: 100 - - name: Determine Tests + - name: Get Job URL + uses: Tiryoh/gha-jobid-action@v0 + id: jobs + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + job_name: ${{ github.job }} + + - name: Determine and Run Tests run: | - git clone -b main https://github.com/unifyai/Mapping.git --depth 1 + git clone -b main${{ matrix.branch }} https://github.com/unifyai/Mapping.git --depth 1 pip install pydriller cp Mapping/tests.pbz2 ivy/ cd ivy - python run_tests_CLI/array_api_determine_tests.py + python scripts/determine_tests/array_api_determine_tests.py + python scripts/run_tests/array_api_run_tests_pr.py new_failures_${{ matrix.branch }}.txt | tee test_results_${{ matrix.branch }}.txt + cd .. continue-on-error: true - - name: Run Tests - id: tests - run: | - cd ivy - python run_tests_CLI/array_api_run_tests_pr.py - 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: Upload New Failures + uses: actions/upload-artifact@v3 + with: + name: new_failures_${{ matrix.branch }} + path: ivy/new_failures_${{ matrix.branch }}.txt - name: Check on failures if: steps.tests.outcome != 'success' diff --git a/.github/workflows/array-api-intelligent-tests.yml b/.github/workflows/array-api-intelligent-tests.yml index 604448e4750dd..576bbe9475e16 100644 --- a/.github/workflows/array-api-intelligent-tests.yml +++ b/.github/workflows/array-api-intelligent-tests.yml @@ -7,11 +7,32 @@ on: 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 ] + steps: - name: Checkout Ivy 🛎 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ivy persist-credentials: false @@ -29,26 +50,33 @@ jobs: env: SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} run: | - source ./ivy/clone_mapping.sh main - pip install pydriller pymongo + source ./ivy/scripts/shell/clone_mapping.sh main${{ matrix.branch }} + pip install pydriller pymongo cp Mapping/tests.pbz2 ivy/ cd ivy - python run_tests_CLI/array_api_determine_tests.py + python scripts/determine_tests/array_api_determine_tests.py ${{ matrix.branch }} cd .. cp ivy/tests.pbz2 Mapping/ cd Mapping git add . git commit -m "Update Mapping" - git push origin main + git push origin main${{ matrix.branch }} continue-on-error: true - name: Run Tests id: tests run: | cd ivy - python run_tests_CLI/array_api_run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} ${{ github.run_id }} ${{ steps.jobs.outputs.html_url }} + set -o pipefail + python scripts/run_tests/array_api_run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} ${{ github.run_id }} ${{ 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/auto-comment.yml b/.github/workflows/auto-comment.yml deleted file mode 100644 index c66bce4507e22..0000000000000 --- a/.github/workflows/auto-comment.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Auto Comment - -on: - pull_request_target: - types: [opened] - -jobs: - auto_comment: - runs-on: ubuntu-latest - steps: - - name: Comment - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - - body: `Thanks for contributing to Ivy! 😊👏 - Here are some of the important points from our Contributing Guidelines 📝: - 1. Feel free to ignore the \`run_tests (1)\`, \`run_tests (2)\`, … jobs, and only look at 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 are passing on main, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪 - 2. The \`lint / Check formatting / check-formatting\` tests check for the formatting of your code. 📜 If it fails, please check the exact error message in the logs and fix the same. ⚠️🔧 - 3. Finally, the \`test-docstrings / run-docstring-tests\` check for the changes made in docstrings of the functions. This may be skipped, as well. 📚 - Happy coding! 🎉👨‍💻` - }) \ No newline at end of file diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml new file mode 100644 index 0000000000000..51dd639e700d0 --- /dev/null +++ b/.github/workflows/binaries.yml @@ -0,0 +1,19 @@ +name: release-binaries +on: + workflow_call: +jobs: + release-binaries: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️Binaries + uses: actions/checkout@v2 + with: + repository: unifyai/binaries + path: binaries + persist-credentials: false + + - name: Add Tag to Binaries + run: | + cd binaries + git tag ${{ github.ref_name }} + git push origin ${{ github.ref_name }} diff --git a/.github/workflows/checklist_actions.yml b/.github/workflows/checklist_actions.yml index 6bfc557186be7..fcba0e24baa74 100644 --- a/.github/workflows/checklist_actions.yml +++ b/.github/workflows/checklist_actions.yml @@ -38,7 +38,7 @@ jobs: comment-id: ${{ github.event.comment.id }} body: ${{ steps.template.outputs.result }} edit-mode: replace - + frontend_pr_commented: name: Frontend PR comment if: ${{ github.event.issue.pull_request && github.event.comment.body == 'add_frontend_checklist' }} diff --git a/.github/workflows/det-test-coverage.yml b/.github/workflows/det-test-coverage.yml index e8a560fe870f2..be26581eb0903 100644 --- a/.github/workflows/det-test-coverage.yml +++ b/.github/workflows/det-test-coverage.yml @@ -38,7 +38,7 @@ jobs: run: | pip install pydriller tqdm cd ivy - python determine_test_coverage.py ${{ matrix.branch }} + python scripts/determine_tests/determine_test_coverage.py ${{ matrix.branch }} cd .. mkdir tests cp ivy/tests.pbz2 tests/ @@ -51,6 +51,6 @@ jobs: source-directory: tests/ destination-github-username: 'unifyai' destination-repository-name: 'Mapping' - user-email: rashul.chutani@gmail.com + user-email: ivy.branch@lets-unify.ai commit-message: Update Mapping target-branch: master${{ matrix.branch }} diff --git a/.github/workflows/dockerfile-gpu-push.yml b/.github/workflows/dockerfile-gpu-push.yml new file mode 100644 index 0000000000000..df978d2ee95a9 --- /dev/null +++ b/.github/workflows/dockerfile-gpu-push.yml @@ -0,0 +1,26 @@ +name: GPU Dockerfile Push + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + + build: + runs-on: ubuntu-latest-4-cores + + steps: + - name: Checkout 🛎 Ivy + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push GPU image + run: | + docker build --progress=plain --no-cache -t unifyai/ivy:latest-gpu -f docker/DockerfileGPU . + docker push unifyai/ivy:latest-gpu diff --git a/.github/workflows/dockerfile-image.yml b/.github/workflows/dockerfile-image.yml index 9c5be23f40475..3f82ea05ea63c 100644 --- a/.github/workflows/dockerfile-image.yml +++ b/.github/workflows/dockerfile-image.yml @@ -11,7 +11,7 @@ jobs: build: if: ${{(github.event_name == 'push') || contains(github.event.pull_request.labels.*.name, 'Exhaustive CI') || contains(github.event.pull_request.labels.*.name, 'Build Docker Files')}} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/dockerfile-multicuda-push.yml b/.github/workflows/dockerfile-multiversion-push.yml similarity index 65% rename from .github/workflows/dockerfile-multicuda-push.yml rename to .github/workflows/dockerfile-multiversion-push.yml index 79d774b11aee6..79920c208d7d8 100644 --- a/.github/workflows/dockerfile-multicuda-push.yml +++ b/.github/workflows/dockerfile-multiversion-push.yml @@ -1,4 +1,4 @@ -name: Dockerfile MultiCUDA Push +name: Dockerfile Mutiversion Push on: schedule: @@ -8,10 +8,10 @@ on: jobs: build: - runs-on: ubuntu-latest-4-cores + runs-on: ubuntu-latest steps: - - name: Checkout 🛎 Ivy + - name: Checkout Ivy 🛎 uses: actions/checkout@v3 - name: Login to Docker Hub @@ -20,8 +20,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Dockerfile run: | - docker build --progress=plain --no-cache -t unifyai/multicuda:base_and_requirements -f docker/DockerfileGPUMultiCuda . - docker push unifyai/multicuda:base_and_requirements + docker build --progress=plain --no-cache -t unifyai/multiversion:latest -f docker/DockerfileMultiversion . + docker push unifyai/multiversion:latest diff --git a/.github/workflows/dockerfile-push.yml b/.github/workflows/dockerfile-push.yml index 7b61ef63b6c3b..3a4e9959b6847 100644 --- a/.github/workflows/dockerfile-push.yml +++ b/.github/workflows/dockerfile-push.yml @@ -10,10 +10,10 @@ jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - + - name: Checkout 🛎 Ivy uses: actions/checkout@v3 diff --git a/.github/workflows/duplication.yml b/.github/workflows/duplication.yml index 3c647ec8d8968..4858881f132ef 100644 --- a/.github/workflows/duplication.yml +++ b/.github/workflows/duplication.yml @@ -21,7 +21,7 @@ jobs: id: tests run: | cd ivy - docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis unifyai/ivy:latest python3 duplicate.py + docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis unifyai/ivy:latest python3 scripts/duplicate.py continue-on-error: true - name: Check on failures diff --git a/.github/workflows/intelligent-tests-pr.yml b/.github/workflows/intelligent-tests-pr.yml index f502bb72d893a..ece59285375a0 100644 --- a/.github/workflows/intelligent-tests-pr.yml +++ b/.github/workflows/intelligent-tests-pr.yml @@ -6,6 +6,7 @@ on: permissions: actions: read + jobs: display_test_results: if: ${{ always() }} @@ -17,21 +18,36 @@ jobs: - name: Download all test results uses: actions/download-artifact@v3 + - name: Checkout Ivy 🛎 + uses: actions/checkout@v3 + with: + path: ivy + persist-credentials: false + submodules: "recursive" + fetch-depth: 1 + - 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 - - name: New Failures Introduced + - name: Label Test Failures + run: | + find . -name "test_failures_*.txt" -exec cat {} + > ivy/combined_failures.txt + pip install pymongo + cd ivy + python3 scripts/run_tests/label_failures.py combined_failures.txt labeled_combined_failures.txt + + - name: Display Test Failures run: | - find . -name "new_failures_*.txt" -exec cat {} + > combined_failures.txt - if [ -s combined_failures.txt ] + cd ivy + if [ -s labeled_combined_failures.txt ] then - echo "This PR introduces the following new failing tests:" - cat combined_failures.txt + echo "The CI captured the following failing tests based on your changes:" + cat labeled_combined_failures.txt else - echo "This PR does not introduce any new test failures! Yippee!" + echo "No test failures found based on your changes!" fi run_tests: @@ -62,20 +78,34 @@ jobs: 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: Determine and Run Tests id: tests run: | - git clone -b master${{ matrix.branch }} https://github.com/unifyai/Mapping.git --depth 200 + git clone -b master${{ matrix.branch }} https://github.com/unifyai/Mapping.git --depth 1 pip install pydriller GitPython - python ivy/run_tests_CLI/clone-mapping.py + python ivy/scripts/setup_tests/clone-mapping.py cp Mapping/tests.pbz2 ivy/ cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python determine_tests.py ${{ matrix.branch }} pr + python scripts/determine_tests/determine_tests.py ${{ matrix.branch }} pr set -o pipefail - python run_tests_pr.py new_failures_${{ matrix.branch }}.txt | tee test_results_${{ matrix.branch }}.txt + python scripts/run_tests/run_tests_pr.py test_failures_${{ matrix.branch }}.txt | tee test_results_${{ matrix.branch }}.txt + cd .. continue-on-error: true - name: Upload test results @@ -87,8 +117,8 @@ jobs: - name: Upload New Failures uses: actions/upload-artifact@v3 with: - name: new_failures_${{ matrix.branch }} - path: ivy/new_failures_${{ matrix.branch }}.txt + name: test_failures_${{ matrix.branch }} + path: ivy/test_failures_${{ matrix.branch }}.txt - name: Check on failures if: steps.tests.outcome != 'success' diff --git a/.github/workflows/intelligent-tests.yml b/.github/workflows/intelligent-tests.yml index 6c87d170816b1..d4e2ec5de132a 100644 --- a/.github/workflows/intelligent-tests.yml +++ b/.github/workflows/intelligent-tests.yml @@ -24,7 +24,7 @@ jobs: cat combined_test_results.txt run_tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -51,6 +51,15 @@ jobs: 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 @@ -62,14 +71,11 @@ jobs: env: SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} run: | - source ./ivy/clone_mapping.sh master${{ matrix.branch }} - pip install pydriller pymongo + source ./ivy/scripts/shell/clone_mapping.sh master${{ matrix.branch }} + pip install pydriller pymongo cp Mapping/tests.pbz2 ivy/ cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python determine_tests.py ${{ matrix.branch }} + python scripts/determine_tests/determine_tests.py ${{ matrix.branch }} cd .. cp ivy/tests.pbz2 Mapping/ cd Mapping @@ -83,7 +89,7 @@ jobs: run: | cd ivy set -o pipefail - python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} | tee test_results_${{ matrix.branch }}.txt + python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} | tee test_results_${{ matrix.branch }}.txt continue-on-error: true - name: Upload test results diff --git a/.github/workflows/lint-bot.yml b/.github/workflows/lint-bot.yml index 5136a5c1ad264..52ee85c1ae2d9 100644 --- a/.github/workflows/lint-bot.yml +++ b/.github/workflows/lint-bot.yml @@ -1,8 +1,9 @@ name: lint-bot on: - schedule: - - cron: '0 8 * * *' + push: + branches: + - main workflow_dispatch: permissions: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 34865c313ac3b..cfa8c518c2ead 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,8 +1,16 @@ name: lint -on: [push, pull_request] +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: [main] + +permissions: + contents: write jobs: check-formatting: name: Check formatting uses: unifyai/workflows/.github/workflows/lint.yml@main + secrets: inherit diff --git a/.github/workflows/manual-tests-pr.yml b/.github/workflows/manual-tests-pr.yml index b818bd37e614a..9f3534b2d357c 100644 --- a/.github/workflows/manual-tests-pr.yml +++ b/.github/workflows/manual-tests-pr.yml @@ -34,8 +34,8 @@ jobs: mkdir .ivy touch .ivy/key.pem echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python setup_tests.py ${{ github.event.inputs.test }} - python run_tests_pr.py new_failures.txt + python scripts/setup_tests/setup_tests.py ${{ github.event.inputs.test }} + python scripts/run_tests/run_tests_pr.py new_failures.txt continue-on-error: true - name: Check on failures diff --git a/.github/workflows/manual-tests.yml b/.github/workflows/manual-tests.yml index 24f2c92ee2f4f..819ff6cccc31e 100644 --- a/.github/workflows/manual-tests.yml +++ b/.github/workflows/manual-tests.yml @@ -30,12 +30,21 @@ jobs: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE - name: Checkout Ivy 🛎 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ivy persist-credentials: false submodules: "recursive" - set-safe-directory: false + fetch-depth: 100 + + - name: Install ivy and fetch binaries + run: | + cd ivy + 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 @@ -49,11 +58,8 @@ jobs: run: | pip3 install pymongo cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python3 setup_tests.py ${{ github.event.inputs.test }} - python3 run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' ${{ github.event.inputs.gpu }} ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} + python3 scripts/setup_tests/setup_tests.py ${{ github.event.inputs.test }} + python3 scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' ${{ github.event.inputs.gpu }} ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} continue-on-error: true - name: Check on failures @@ -65,11 +71,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Ivy 🛎 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: ivy persist-credentials: false submodules: "recursive" + fetch-depth: 100 + + - name: Install ivy and fetch binaries + run: | + cd ivy + 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 @@ -83,16 +99,11 @@ jobs: run: | pip3 install pymongo cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python setup_tests.py "${{ github.event.inputs.test }}" - python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} ${{ github.event.inputs.version}} 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} + pip3 install -e . + python scripts/setup_tests/setup_tests.py "${{ github.event.inputs.test }}" + python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} ${{ github.event.inputs.version}} 'false' ${{ github.run_id }} '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/pr-lint-bot.yml b/.github/workflows/pr-lint-bot.yml index d814f08923404..98d0ba04a17ac 100644 --- a/.github/workflows/pr-lint-bot.yml +++ b/.github/workflows/pr-lint-bot.yml @@ -1,8 +1,8 @@ name: Trigger lint format on: - issue_comment: - types: [created] + pull_request_target: + types: [opened, edited, synchronize, reopened] permissions: contents: write diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index a87489e52f31c..c7ccc919b6e61 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -7,10 +7,6 @@ permissions: jobs: run_tests: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - file: [ivy.txt, torch.txt] steps: - name: Checkout Ivy 🛎 uses: actions/checkout@v3 @@ -27,12 +23,21 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} job_name: ${{ github.job }} - - name: Run Tests + - 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 run_tests_CLI/setup_priority_tests.py priority_tests/${{ matrix.file }} - python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'true' ${{ steps.jobs.outputs.html_url }} \ No newline at end of file + python scripts/setup_tests/setup_priority_tests.py + + - name: Run CPU 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 }} 'true' ${{ steps.jobs.outputs.html_url }} + + - name: Run GPU Tests + run: | + cd ivy + python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'true' ${{ github.run_id }} 'true' ${{ steps.jobs.outputs.html_url }} diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 7032f151da031..5515864a7fed7 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -29,4 +29,4 @@ jobs: PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | cd ivy - bash deploy_pypi.sh + bash scripts/shell/deploy_pypi.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3bce4152a874..f29e7b8bbf2c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,11 @@ jobs: uses: unifyai/workflows/.github/workflows/docs.yml@main secrets: inherit + publish-binaries: + name: Publish Binaries + uses: unifyai/workflows/.github/workflows/binaries.yml@main + secrets: inherit + deploy: name: Deploy to PyPI uses: ./.github/workflows/pypi.yml diff --git a/.github/workflows/run-all-tests.yml b/.github/workflows/run-all-tests.yml index 100fc2bbddd40..64153d06ffa31 100644 --- a/.github/workflows/run-all-tests.yml +++ b/.github/workflows/run-all-tests.yml @@ -42,6 +42,15 @@ jobs: submodules: "recursive" fetch-depth: 100 + - name: Install ivy and fetch binaries + run: | + cd ivy + 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 @@ -53,12 +62,9 @@ jobs: run: | pip3 install pymongo cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python run_tests_CLI/filter_tests.py ${{ matrix.branch }} + python scripts/setup_tests/filter_tests.py ${{ matrix.branch }} set -o pipefail - python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} | tee test_results_${{ matrix.branch }}.txt + python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} | tee test_results_${{ matrix.branch }}.txt continue-on-error: true - name: Upload test results @@ -69,4 +75,4 @@ jobs: - name: Check on failures if: steps.tests.outcome != 'success' - run: exit 1 \ No newline at end of file + run: exit 1 diff --git a/.github/workflows/synchronize-db.yml b/.github/workflows/synchronize-db.yml index e9bbe65ecd61c..f5632e4f6ded0 100644 --- a/.github/workflows/synchronize-db.yml +++ b/.github/workflows/synchronize-db.yml @@ -19,4 +19,4 @@ jobs: run: | pip install pymongo cd ivy - python run_tests_CLI/synchronize_db.py ${{ secrets.MONGODB_PASSWORD }} \ No newline at end of file + python scripts/setup_tests/synchronize_db.py ${{ secrets.MONGODB_PASSWORD }} diff --git a/.github/workflows/test-array-api.yml b/.github/workflows/test-array-api.yml index a8dc106d5df50..7db65e56a0379 100644 --- a/.github/workflows/test-array-api.yml +++ b/.github/workflows/test-array-api.yml @@ -55,7 +55,7 @@ jobs: id: tests run: | cd ivy - ./run_tests_CLI/test_array_api.sh ${{matrix.backends}} test_${{matrix.submodules}} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} + ./scripts/shell/test_array_api.sh ${{matrix.backends}} test_${{matrix.submodules}} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} continue-on-error: true - name: Zip Hypothesis Examples @@ -78,4 +78,3 @@ jobs: - name: Check on failures if: steps.tests.outcome != 'success' run: exit 1 - diff --git a/.github/workflows/test-frontend-jax.yml b/.github/workflows/test-frontend-jax.yml index 38b9944b9354e..7724876d33b7e 100644 --- a/.github/workflows/test-frontend-jax.yml +++ b/.github/workflows/test-frontend-jax.yml @@ -16,6 +16,15 @@ jobs: persist-credentials: false submodules: "recursive" + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Download artifact if: github.event_name == 'pull_request' uses: dawidd6/action-download-artifact@v2 diff --git a/.github/workflows/test-frontend-numpy.yml b/.github/workflows/test-frontend-numpy.yml index 1a5a8f9bd75d6..d99000c459b95 100644 --- a/.github/workflows/test-frontend-numpy.yml +++ b/.github/workflows/test-frontend-numpy.yml @@ -16,6 +16,15 @@ jobs: persist-credentials: false submodules: "recursive" + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Download artifact if: github.event_name == 'pull_request' uses: dawidd6/action-download-artifact@v2 diff --git a/.github/workflows/test-frontend-tensorflow.yml b/.github/workflows/test-frontend-tensorflow.yml index 52ae4ca44d9ef..f5a03dcef7e1a 100644 --- a/.github/workflows/test-frontend-tensorflow.yml +++ b/.github/workflows/test-frontend-tensorflow.yml @@ -16,6 +16,15 @@ jobs: persist-credentials: false submodules: "recursive" + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Download artifact if: github.event_name == 'pull_request' uses: dawidd6/action-download-artifact@v2 diff --git a/.github/workflows/test-frontend-torch.yml b/.github/workflows/test-frontend-torch.yml index 6adeb7623a187..732958fd972a4 100644 --- a/.github/workflows/test-frontend-torch.yml +++ b/.github/workflows/test-frontend-torch.yml @@ -16,6 +16,15 @@ jobs: persist-credentials: false submodules: "recursive" + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Download artifact if: github.event_name == 'pull_request' uses: dawidd6/action-download-artifact@v2 diff --git a/.github/workflows/test-ivy-core.yml b/.github/workflows/test-ivy-core.yml index 1a9d8a0f77956..f87a42a0abb43 100644 --- a/.github/workflows/test-ivy-core.yml +++ b/.github/workflows/test-ivy-core.yml @@ -27,6 +27,15 @@ jobs: submodules: "recursive" fetch-depth: 2 + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Check Files Changed if: ${{(github.event_name == 'push') || !contains(github.event.pull_request.labels.*.name, 'Exhaustive CI') }} shell: pwsh @@ -81,10 +90,7 @@ jobs: if: steps.check_file_changed.outputs.changed == 'True' || steps.check_file_changed.conclusion == 'skipped' run: | cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - ./run_tests_CLI/test_ivy_core.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} + ./scripts/shell/test_ivy_core.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} continue-on-error: true - name: Zip Hypothesis Examples diff --git a/.github/workflows/test-ivy-cron-gpu.yml b/.github/workflows/test-ivy-cron-gpu.yml index b4cbc5e2ebab2..b4cd6719fbe58 100644 --- a/.github/workflows/test-ivy-cron-gpu.yml +++ b/.github/workflows/test-ivy-cron-gpu.yml @@ -5,21 +5,62 @@ on: - 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 🛎 + - name: Checkout 🛎️Ivy uses: actions/checkout@v2 with: path: ivy persist-credentials: false submodules: "recursive" - set-safe-directory: false + fetch-depth: 2 + + - name: Install ivy and fetch binaries + run: | + cd ivy + export TAG="cp310-cp310-manylinux_2_17_x86_64" + 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 @@ -33,13 +74,29 @@ jobs: run: | pip3 install pymongo cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - python3 run_tests_CLI/cron_tests.py ${{ github.run_number }} - python3 run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'true' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} - continue-on-error: true + python3 scripts/setup_tests/cron_tests.py ${{ github.run_number }} true + python3 scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'true' ${{ github.run_id }} '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: Check on failures - if: steps.tests.outcome != 'success' - run: exit 1 \ No newline at end of file + - 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 index 32a9560672ee5..fd36dd585d175 100644 --- a/.github/workflows/test-ivy-cron-multi-version.yml +++ b/.github/workflows/test-ivy-cron-multi-version.yml @@ -16,6 +16,15 @@ jobs: persist-credentials: false submodules: "recursive" + - name: Install ivy and fetch binaries + run: | + cd ivy + 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 @@ -28,8 +37,8 @@ jobs: run: | cd ivy pip3 install pymongo - python run_tests_CLI/cron_tests_multi_version.py ${{ github.run_number }} - python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'true' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} + 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' ${{ steps.jobs.outputs.html_url }} continue-on-error: true - name: Check on failures diff --git a/.github/workflows/test-ivy-cron.yml b/.github/workflows/test-ivy-cron.yml index 61476937d1259..8e9e62f3faf35 100644 --- a/.github/workflows/test-ivy-cron.yml +++ b/.github/workflows/test-ivy-cron.yml @@ -16,6 +16,15 @@ jobs: persist-credentials: false submodules: "recursive" + - name: Install ivy and fetch binaries + run: | + cd ivy + 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 @@ -27,12 +36,9 @@ jobs: id: tests run: | cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem pip3 install pymongo - python run_tests_CLI/cron_tests.py ${{ github.run_number }} - python run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} + python scripts/setup_tests/cron_tests.py ${{ github.run_number }} false + python scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'false' ${{ github.run_id }} 'false' ${{ steps.jobs.outputs.html_url }} continue-on-error: true - name: Check on failures diff --git a/.github/workflows/test-ivy-experimental-core.yml b/.github/workflows/test-ivy-experimental-core.yml index 906aa22955f77..8f8117978b2f5 100644 --- a/.github/workflows/test-ivy-experimental-core.yml +++ b/.github/workflows/test-ivy-experimental-core.yml @@ -26,6 +26,15 @@ jobs: submodules: "recursive" fetch-depth: 2 + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Check Files Changed shell: pwsh id: check_file_changed @@ -73,10 +82,7 @@ jobs: id: tests run: | cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - ./run_tests_CLI/test_experimental_core.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} + ./scripts/shell/test_experimental_core.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} continue-on-error: true - name: Zip Hypothesis Examples @@ -113,4 +119,4 @@ jobs: - name: Check on failures if: (steps.check_file_changed.outputs.changed == 'True' || steps.check_file_changed.conclusion == 'skipped') && steps.tests.outcome != 'success' - run: exit 1 \ No newline at end of file + run: exit 1 diff --git a/.github/workflows/test-ivy-experimental-nn.yml b/.github/workflows/test-ivy-experimental-nn.yml index ac9310c096e76..ef5ebe1c294b1 100644 --- a/.github/workflows/test-ivy-experimental-nn.yml +++ b/.github/workflows/test-ivy-experimental-nn.yml @@ -24,6 +24,15 @@ jobs: submodules: "recursive" fetch-depth: 2 + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Check Files Changed shell: pwsh id: check_file_changed @@ -71,10 +80,7 @@ jobs: id: tests run: | cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - ./run_tests_CLI/test_experimental_nn.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} + ./scripts/shell/test_experimental_nn.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} continue-on-error: true - name: Zip Hypothesis Examples @@ -111,4 +117,4 @@ jobs: - name: Check on failures if: (steps.check_file_changed.outputs.changed == 'True' || steps.check_file_changed.conclusion == 'skipped') && steps.tests.outcome != 'success' - run: exit 1 \ No newline at end of file + run: exit 1 diff --git a/.github/workflows/test-ivy-nn.yml b/.github/workflows/test-ivy-nn.yml index bc6377b74fe74..9f213e1e013bd 100644 --- a/.github/workflows/test-ivy-nn.yml +++ b/.github/workflows/test-ivy-nn.yml @@ -24,6 +24,15 @@ jobs: submodules: "recursive" fetch-depth: 2 + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Check Files Changed if: ${{ (github.event_name == 'push') || !contains(github.event.pull_request.labels.*.name, 'Exhaustive CI') }} shell: pwsh @@ -78,10 +87,7 @@ jobs: if: steps.check_file_changed.outputs.changed == 'True' || steps.check_file_changed.conclusion == 'skipped' run: | cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - ./run_tests_CLI/test_ivy_nn.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} + ./scripts/shell/test_ivy_nn.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} continue-on-error: true - name: Zip Hypothesis Examples @@ -120,4 +126,3 @@ jobs: - name: Check on failures if: (steps.check_file_changed.outputs.changed == 'True' || steps.check_file_changed.conclusion == 'skipped') && steps.tests.outcome != 'success' run: exit 1 - diff --git a/.github/workflows/test-ivy-stateful.yml b/.github/workflows/test-ivy-stateful.yml index b51dbe2a7fabd..c4aeeb690f0b4 100644 --- a/.github/workflows/test-ivy-stateful.yml +++ b/.github/workflows/test-ivy-stateful.yml @@ -25,6 +25,15 @@ jobs: submodules: "recursive" fetch-depth: 2 + - name: Install ivy and fetch binaries + run: | + cd ivy + pip3 install -e . + mkdir .ivy + touch .ivy/key.pem + echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem + cd .. + - name: Check Files Changed if: ${{ (github.event_name == 'push') || !contains(github.event.pull_request.labels.*.name, 'Exhaustive CI') }} shell: pwsh @@ -80,10 +89,7 @@ jobs: if: steps.check_file_changed.outputs.changed == 'True' || steps.check_file_changed.conclusion == 'skipped' run: | cd ivy - mkdir .ivy - touch .ivy/key.pem - echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem - ./run_tests_CLI/test_ivy_stateful.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} + ./scripts/shell/test_ivy_stateful.sh ${{ matrix.backends }} test_${{ matrix.submodules }} ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD}} continue-on-error: true - name: Zip Hypothesis Examples diff --git a/.github/workflows/welcome-message.yml b/.github/workflows/welcome-message.yml new file mode 100644 index 0000000000000..a41cb471ed830 --- /dev/null +++ b/.github/workflows/welcome-message.yml @@ -0,0 +1,56 @@ +name: Check Semantic and welcome new contributors + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + workflow_call: + +permissions: + pull-requests: write + +jobs: + pr-compliance-checks: + name: PR Compliance Checks + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: mtfoley/pr-compliance-action@v0.5.0 + with: + body-auto-close: false + protected-branch-auto-close: false + body-comment: > + ## Issue Reference + + In order to be considered for merging, the pull request description must refer to a + specific issue number. This is described in our + [contributing guide](https://unify.ai/docs/ivy/overview/contributing/the_basics.html#todo-list-issues) and our PR template. + + This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue + number that this PR is meant to address. + + 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 😄**. diff --git a/.gitignore b/.gitignore index e3e42d489a325..fef9e99694c8c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ with_time_logs/ *.csv *.csv# *.ods -*.json *.jpg *.jpeg *.png @@ -29,8 +28,11 @@ internal_automation_tools/ .vscode/* .idea/* .ivy/* +*.so .DS_Store* fn_path_cache +ivy/engines/XLA/rust_api/target/ +ivy/engines/XLA/rust_api/xla_extension/ # Environments .env @@ -42,4 +44,4 @@ env.bak/ venv.bak/ ivy_dev/ *venv/ -venv* \ No newline at end of file +venv* diff --git a/.gitmodules b/.gitmodules index 7aebe443b29c1..3f06491476bf6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ [submodule "ivy_tests/array_api_testing/test_array_api"] path = ivy_tests/array_api_testing/test_array_api url = https://github.com/data-apis/array-api-tests.git +[submodule "docs/demos"] + path = docs/demos + url = https://github.com/unifyai/demos.git diff --git a/.idea/ivy.iml b/.idea/ivy.iml index 4e727c649cb5b..aad68012bb7a3 100644 --- a/.idea/ivy.iml +++ b/.idea/ivy.iml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/.idea/misc.xml b/.idea/misc.xml index 4d1d4d4ea1dd0..5c0410dbc198c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -7,4 +7,4 @@ - \ No newline at end of file + diff --git a/.idea/modules.xml b/.idea/modules.xml index 74024e2ab5752..d82b1fd66f99c 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -5,4 +5,4 @@ - \ No newline at end of file + diff --git a/.idea/other.xml b/.idea/other.xml index a708ec7810857..49fafd73ad76b 100644 --- a/.idea/other.xml +++ b/.idea/other.xml @@ -3,4 +3,4 @@ - \ No newline at end of file + diff --git a/.idea/runConfigurations/_template__of_Python.xml b/.idea/runConfigurations/_template__of_Python.xml index 4583af271c812..b79becc28d0e5 100644 --- a/.idea/runConfigurations/_template__of_Python.xml +++ b/.idea/runConfigurations/_template__of_Python.xml @@ -51,4 +51,4 @@