From 6403afff4afb2c160d80f9c2432a7787b31eb238 Mon Sep 17 00:00:00 2001 From: Joseph Macaranas <145489236+amd-jmacaran@users.noreply.github.com> Date: Tue, 18 Mar 2025 17:29:44 -0400 Subject: [PATCH] Introduce framework to run Azure Pipeline jobs (#1608) - PR runs targeting develop will require approval from at least one person in a predefined list. - Nightly runs are separated and will not require approval. - Sample pytest script is provided for expanding test coverage. --- .azuredevops/multinode-ci-nightly.yml | 69 +++++++++++++++++++++++ .azuredevops/multinode-ci-pr.yml | 74 +++++++++++++++++++++++++ .azuredevops/tests/pytest/HelloWorld.py | 5 ++ 3 files changed, 148 insertions(+) create mode 100644 .azuredevops/multinode-ci-nightly.yml create mode 100644 .azuredevops/multinode-ci-pr.yml create mode 100644 .azuredevops/tests/pytest/HelloWorld.py diff --git a/.azuredevops/multinode-ci-nightly.yml b/.azuredevops/multinode-ci-nightly.yml new file mode 100644 index 0000000000..0c82aa3bfd --- /dev/null +++ b/.azuredevops/multinode-ci-nightly.yml @@ -0,0 +1,69 @@ +resources: + repositories: + - repository: pipelines_repo + type: github + endpoint: ROCm + name: ROCm/ROCm + +variables: +- group: common +- template: /.azuredevops/variables-global.yml@pipelines_repo +- name: pytestFolder + value: '.azuredevops/tests/pytest' + +parameters: +- name: pytestList + type: object + default: + - HelloWorld + +trigger: none +pr: none +schedules: + - cron: "0 5 * 11-3 *" # 11 PM CST (November - March) + displayName: "Nightly Build (CST)" + branches: + include: + - develop + always: false + + - cron: "0 4 * 4-10 *" # 11 PM CDT (April - October) + displayName: "Nightly Build (CDT)" + branches: + include: + - develop + always: false + +jobs: +- job: rccl + timeoutInMinutes: 180 + pool: rocm-ci_rccl_pool + workspace: + clean: all + steps: + - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml@pipelines_repo + parameters: + submoduleBehaviour: recursive + - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/build-cmake.yml@pipelines_repo + parameters: + installEnabled: false + printDiskSpace: false + extraBuildFlags: >- + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTS=ON + -DGPU_TARGETS=gfx942 + -GNinja + - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/test.yml@pipelines_repo + parameters: + componentName: rccl + testDir: $(Build.SourcesDirectory)/build/test + testExecutable: './rccl-UnitTests' + testParameters: '--gtest_output=xml:./test_output.xml --gtest_color=yes' + - ${{ each pytestScript in parameters.pytestList }}: + - task: Bash@3 + displayName: Test ${{ pytestScript }} + continueOnError: true + inputs: + targetType: inline + workingDirectory: $(Build.SourcesDirectory)/$(pytestFolder) + script: pytest test_${{ pytestScript }}.py diff --git a/.azuredevops/multinode-ci-pr.yml b/.azuredevops/multinode-ci-pr.yml new file mode 100644 index 0000000000..304a7b269a --- /dev/null +++ b/.azuredevops/multinode-ci-pr.yml @@ -0,0 +1,74 @@ +resources: + repositories: + - repository: pipelines_repo + type: github + endpoint: ROCm + name: ROCm/ROCm + +variables: +- group: common +- template: /.azuredevops/variables-global.yml@pipelines_repo +- name: pytestFolder + value: '.azuredevops/tests/pytest' + +parameters: +- name: pytestList + type: object + default: + - HelloWorld + +trigger: none +pr: + autoCancel: true + branches: + include: + - develop + paths: + exclude: + - .github + - .jenkins + - docs + - '*.md' + - LICENSE.txt + - NOTICES.txt + drafts: false + +stages: +- stage: rcclStage + displayName: 'RCCL develop PR' + jobs: + - deployment: rccl_pr_approval + displayName: "CI Run Requires Approval" + environment: rccl + - job: rccl + timeoutInMinutes: 180 + pool: rocm-ci_rccl_pool + workspace: + clean: all + steps: + - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml@pipelines_repo + parameters: + submoduleBehaviour: recursive + - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/build-cmake.yml@pipelines_repo + parameters: + installEnabled: false + printDiskSpace: false + extraBuildFlags: >- + -DCMAKE_BUILD_TYPE=Release + -DBUILD_TESTS=ON + -DGPU_TARGETS=gfx942 + -GNinja + - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/test.yml@pipelines_repo + parameters: + componentName: rccl + testDir: $(Build.SourcesDirectory)/build/test + testExecutable: './rccl-UnitTests' + testParameters: '--gtest_output=xml:./test_output.xml --gtest_color=yes' + - ${{ each pytestScript in parameters.pytestList }}: + - task: Bash@3 + displayName: Test ${{ pytestScript }} + continueOnError: true + inputs: + targetType: inline + workingDirectory: $(Build.SourcesDirectory)/$(pytestFolder) + script: pytest test_${{ pytestScript }}.py diff --git a/.azuredevops/tests/pytest/HelloWorld.py b/.azuredevops/tests/pytest/HelloWorld.py new file mode 100644 index 0000000000..3c2790e93c --- /dev/null +++ b/.azuredevops/tests/pytest/HelloWorld.py @@ -0,0 +1,5 @@ +import pytest + +def TestHelloWorld(): + greeting = "Hello, World!" + assert greeting == "Hello, World!"