From 6a899b5f6dd4ff7c80f52564c3c074e1ee91f4b0 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 8 Dec 2025 14:39:42 -0600 Subject: [PATCH] Run pre-commit's whitespace related hooks on .github and .azuredevops (#2129) In order for pre-commit to be useful, everything needs to meet a common baseline. Signed-off-by: Mario Limonciello (AMD) --- .azuredevops/rocm_ci_caller.yml | 26 ++++++++-------- .github/labeler.yml | 2 +- .../tests/therock_configure_ci_test.py | 26 ++++++++-------- .github/scripts/therock_configure_ci.py | 4 +-- .github/scripts/therock_matrix.py | 30 +++++++++---------- .../aqlprofile-continuous_integration.yml | 6 ++-- .github/workflows/import_pr_list.yml | 6 ++-- .../rocprofiler-compute-code-coverage.yml | 10 +++---- ...rofiler-sdk-rocm_release_compatibility.yml | 2 +- .../workflows/rocprofiler-systems-ghcr.yml | 4 +-- .github/workflows/therock-ci.yml | 2 +- 11 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.azuredevops/rocm_ci_caller.yml b/.azuredevops/rocm_ci_caller.yml index 295d213b9c..6ca9c563f4 100644 --- a/.azuredevops/rocm_ci_caller.yml +++ b/.azuredevops/rocm_ci_caller.yml @@ -1,5 +1,5 @@ -trigger: none -pr: +trigger: none +pr: branches: include: - develop @@ -10,11 +10,11 @@ pr: variables: - group: internal - name: REPOSITORY_NAME - value: '$(Build.Repository.Name)' + value: '$(Build.Repository.Name)' - name: HEAD_SHA value: '$(system.pullRequest.sourceCommitId)' - name: PR_NUM - value: '$(system.pullRequest.pullRequestNumber)' + value: '$(system.pullRequest.pullRequestNumber)' - name: PR_URL value: '$(system.pullRequest.sourceRepositoryUri)/pull/$(PR_NUM)' - name: BASE_REF @@ -22,9 +22,9 @@ variables: - name: EVENT_TYPE value: 'pull_request' - name: GH_PAT - value: '$(svc_acc_org_secret)' + value: '$(svc_acc_org_secret)' -jobs: +jobs: - job: Determine_Changes displayName: 'Sparse Checkout & Check Changed Files' pool: rocm-ci-caller @@ -45,7 +45,7 @@ jobs: git fetch --depth=250 origin $(HEAD_SHA) git checkout FETCH_HEAD - + git diff --name-only origin/$(BASE_REF)...HEAD > ../changed_files.txt echo "Changed files:" @@ -81,7 +81,7 @@ jobs: name: detectChanges displayName: Detect path changes -- job: Trigger_Pipeline +- job: Trigger_Pipeline displayName: 'Trigger Pipeline or Skip' dependsOn: Determine_Changes condition: succeeded() @@ -91,7 +91,7 @@ jobs: windows_skip: $[ dependencies.Determine_Changes.outputs['detectChanges.windows_skip'] ] steps: - checkout: none - + - script: | echo "DEBUG: match_found = '$(match_found)'" displayName: 'Debug match_found variable' @@ -110,7 +110,7 @@ jobs: -f description="Windows PSDB skipped" displayName: 'Skip WindowsCI - Internal' condition: eq(variables.windows_skip, 'true') - + - script: | rm -rf $(repo_name) git clone $(gh_repo) @@ -118,7 +118,7 @@ jobs: condition: eq(variables.match_found, 'true') - script: | - set -e + set -e echo "Calling jenkins_api.py for PR #$(PR_NUM)" cd $(repo_name) docker run \ @@ -139,8 +139,8 @@ jobs: -ghpat '$(GH_PAT)' \ -br '$(BASE_REF)' \ -et '$(EVENT_TYPE)'" > /dev/null 2>&1 - displayName: Invoke jenkins_api.py in Docker - env: + displayName: Invoke jenkins_api.py in Docker + env: svc_acc_org_secret: $(svc_acc_org_secret) condition: eq(variables.match_found, 'true') diff --git a/.github/labeler.yml b/.github/labeler.yml index 556effd377..1baf69f834 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,7 +1,7 @@ "project: amdsmi": - changed-files: - any-glob-to-any-file: 'projects/amdsmi/**/*' - + "project: aqlprofile": - changed-files: - any-glob-to-any-file: 'projects/aqlprofile/**/*' diff --git a/.github/scripts/tests/therock_configure_ci_test.py b/.github/scripts/tests/therock_configure_ci_test.py index 7933a10579..71d4c08689 100644 --- a/.github/scripts/tests/therock_configure_ci_test.py +++ b/.github/scripts/tests/therock_configure_ci_test.py @@ -12,60 +12,60 @@ class ConfigureCITest(unittest.TestCase): "is_pull_request": True, "input_subtrees": "projects/rocprim\nprojects/hipcub" } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertEqual(len(project_to_run), 1) - + def test_pull_request_empty(self): args = { "is_pull_request": True, "input_subtrees": "" } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertEqual(len(project_to_run), 0) - + def test_workflow_dispatch(self): args = { "is_workflow_dispatch": True, "input_projects": "projects/rocprim projects/hipcub" } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertEqual(len(project_to_run), 1) - + def test_workflow_dispatch_bad_input(self): args = { "is_workflow_dispatch": True, "input_projects": "projects/rocprim$$projects/hipcub" } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertEqual(len(project_to_run), 0) - + def test_workflow_dispatch_all(self): args = { "is_workflow_dispatch": True, "input_projects": "all" } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertGreaterEqual(len(project_to_run), 1) - + def test_workflow_dispatch_empty(self): args = { "is_workflow_dispatch": True, "input_projects": "" } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertEqual(len(project_to_run), 0) - + def test_is_push(self): args = { "is_push": True, } - + project_to_run = therock_configure_ci.retrieve_projects(args) self.assertGreaterEqual(len(project_to_run), 1) diff --git a/.github/scripts/therock_configure_ci.py b/.github/scripts/therock_configure_ci.py index 4e3a8efabe..013507b976 100644 --- a/.github/scripts/therock_configure_ci.py +++ b/.github/scripts/therock_configure_ci.py @@ -30,7 +30,7 @@ def set_github_output(d: Mapping[str, str]): return with open(step_output_file, "a") as f: f.writelines(f"{k}={v}" + "\n" for k, v in d.items()) - + def retry(max_attempts, delay_seconds, exceptions): def decorator(func): def newfn(*args, **kwargs): @@ -111,7 +111,7 @@ def retrieve_projects(args): # retrieve the subtrees to checkout, cmake options to build, and projects to test project_to_run = [] - # Currently as we have no tests, we just build all packages available if an applicable change is made. + # Currently as we have no tests, we just build all packages available if an applicable change is made. # As we start to get an idea of test times, we can divide test jobs. if projects: for project in ["all"]: diff --git a/.github/scripts/therock_matrix.py b/.github/scripts/therock_matrix.py index 731ded3647..e02bc4d6ed 100644 --- a/.github/scripts/therock_matrix.py +++ b/.github/scripts/therock_matrix.py @@ -2,21 +2,21 @@ This dictionary is used to map specific file directory changes to the corresponding build flag and tests """ subtree_to_project_map = { - 'projects/aqlprofile': 'profiler', - 'projects/clr': 'core', - 'projects/hip': 'core', - 'projects/hip-tests': 'core', - 'projects/hipother': 'core', - 'projects/rdc': 'rdc', - 'projects/rocm-core': 'core', - 'projects/rocm-smi-lib': 'core', - 'projects/rocminfo': 'core', - 'projects/rocprofiler-compute': 'profiler', - 'projects/rocprofiler-register': 'profiler', - 'projects/rocprofiler-sdk': 'profiler', - 'projects/rocprofiler-systems': 'profiler', - 'projects/rocprofiler': 'profiler', - 'projects/rocr-runtime': 'core', + 'projects/aqlprofile': 'profiler', + 'projects/clr': 'core', + 'projects/hip': 'core', + 'projects/hip-tests': 'core', + 'projects/hipother': 'core', + 'projects/rdc': 'rdc', + 'projects/rocm-core': 'core', + 'projects/rocm-smi-lib': 'core', + 'projects/rocminfo': 'core', + 'projects/rocprofiler-compute': 'profiler', + 'projects/rocprofiler-register': 'profiler', + 'projects/rocprofiler-sdk': 'profiler', + 'projects/rocprofiler-systems': 'profiler', + 'projects/rocprofiler': 'profiler', + 'projects/rocr-runtime': 'core', 'projects/roctracer': 'profiler' } diff --git a/.github/workflows/aqlprofile-continuous_integration.yml b/.github/workflows/aqlprofile-continuous_integration.yml index 324c5c8e9b..4689deb783 100644 --- a/.github/workflows/aqlprofile-continuous_integration.yml +++ b/.github/workflows/aqlprofile-continuous_integration.yml @@ -52,7 +52,7 @@ jobs: strategy: fail-fast: false matrix: - system: + system: | - { gpu: 'navi4', runner: 'rocprofiler-navi4-dind', os: 'ubuntu-22.04', build-type: 'RelWithDebInfo', gpu-target: 'gfx120X' } - { gpu: 'navi3', runner: 'rocprofiler-navi3-dind', os: 'ubuntu-22.04', build-type: 'RelWithDebInfo', gpu-target: 'gfx110X' } - { gpu: 'mi325', runner: 'linux-mi325-1gpu-ossci-rocm', os: 'ubuntu-22.04', build-type: 'RelWithDebInfo', gpu-target: 'gfx94X' } @@ -132,7 +132,7 @@ jobs: strategy: fail-fast: false matrix: - system: + system: - { gpu: 'mi325', runner: 'linux-mi325-1gpu-ossci-rocm', os: 'rhel-8.8', build-type: 'RelWithDebInfo', gpu-target: 'gfx94X' } - { gpu: 'mi325', runner: 'linux-mi325-1gpu-ossci-rocm', os: 'rhel-9.5', build-type: 'RelWithDebInfo', gpu-target: 'gfx94X' } - { gpu: 'mi325', runner: 'linux-mi325-1gpu-ossci-rocm', os: 'sles-15.6', build-type: 'RelWithDebInfo', gpu-target: 'gfx94X' } @@ -200,7 +200,7 @@ jobs: PATH=~/.local/bin:${{ env.ROCM_PATH }}/bin:${PATH} LD_LIBRARY_PATH=$(pwd)/build:${{ env.ROCM_PATH }}/lib:$LD_LIBRARY_PATH ctest --output-on-failure -DCTEST_SOURCE_DIRECTORY="$(pwd)" - -DCTEST_BINARY_DIRECTORY="$(pwd)/build" -DAQLPROFILE_BUILD_NUM_JOBS="16" + -DCTEST_BINARY_DIRECTORY="$(pwd)/build" -DAQLPROFILE_BUILD_NUM_JOBS="16" -DCTEST_SITE=${{ matrix.system.runner }} -DCTEST_BUILD_NAME=PR_${{ github.ref_name }}_${{ github.repository }}-${{ matrix.system.os }}-${{ matrix.system.gpu }}-core -DCMAKE_CTEST_ARGUMENTS="" diff --git a/.github/workflows/import_pr_list.yml b/.github/workflows/import_pr_list.yml index 5e82672305..a7ebe5118a 100644 --- a/.github/workflows/import_pr_list.yml +++ b/.github/workflows/import_pr_list.yml @@ -45,17 +45,17 @@ jobs: .github/scripts/import_subrepo_prs.py ${{ github.event.inputs.subrepo-prefix }} sparse-checkout-cone-mode: true - + - name: Set up Python 3.x uses: actions/setup-python@v4 with: python-version: "3.x" - + - name: Install Python dependencies run: | python -m pip install --upgrade pip pip install PyGithub GitPython - + - name: Import Subrepo PRs env: GITHUB_TOKEN: ${{ steps.gen_token.outputs.token }} diff --git a/.github/workflows/rocprofiler-compute-code-coverage.yml b/.github/workflows/rocprofiler-compute-code-coverage.yml index f44e26843e..cb3b32aed2 100644 --- a/.github/workflows/rocprofiler-compute-code-coverage.yml +++ b/.github/workflows/rocprofiler-compute-code-coverage.yml @@ -26,11 +26,11 @@ jobs: id: generate_matrix run: | MATRIX='[{"os-release":"22.04","gpu":"mi355","arch":"gfx950","runner":"linux-mi355-1gpu-ossci-rocm","code-name":"jammy"},{"os-release":"24.04","gpu":"mi355","arch":"gfx950","runner":"linux-mi355-1gpu-ossci-rocm","code-name":"noble"},{"os-release":"22.04","gpu":"mi325","arch":"gfx94X","runner":"linux-mi325-1gpu-ossci-rocm","code-name":"jammy"},{"os-release":"24.04","gpu":"mi325","arch":"gfx94X","runner":"linux-mi325-1gpu-ossci-rocm","code-name":"noble"}]' - + if [ -n "${{ github.event.inputs.runner_matrix }}" ]; then MATRIX='${{ github.event.inputs.runner_matrix }}' fi - + echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT coverage: @@ -49,14 +49,14 @@ jobs: packages: read container: image: ghcr.io/rocm/rocprofiler-ubuntu:${{ matrix.system.os-release }}-systems-ci-${{ matrix.system.arch }} - options: - --privileged + options: + --privileged --ipc host --group-add video --device /dev/kfd --device /dev/dri --cap-add CAP_SYS_ADMIN - + steps: - uses: actions/checkout@v5 with: diff --git a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml index 71199df133..87be91e73a 100644 --- a/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml +++ b/.github/workflows/rocprofiler-sdk-rocm_release_compatibility.yml @@ -71,7 +71,7 @@ jobs: # Older ROCm versions don't provide these packages. apt install -y rccl-dev rccl-unittests || true apt install -y rocjpeg-dev rocjpeg-test rocdecode-dev rocdecode-test || true - + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12 python3 -m pip install -U --user -r requirements.txt diff --git a/.github/workflows/rocprofiler-systems-ghcr.yml b/.github/workflows/rocprofiler-systems-ghcr.yml index cecbc64325..d1328e466a 100644 --- a/.github/workflows/rocprofiler-systems-ghcr.yml +++ b/.github/workflows/rocprofiler-systems-ghcr.yml @@ -79,7 +79,7 @@ jobs: DOCKER_FILE=Dockerfile.${{ matrix.system.distro }}.ci fi echo "docker_file=${DOCKER_FILE}" >> $GITHUB_OUTPUT - + - name: Get the latest build of The Rock tarball id: therock run: | @@ -95,7 +95,7 @@ jobs: KEY=${KEY//\"/} test -n "$KEY" || { echo "No ${{ matrix.gpu }} tarball found"; exit 1; } echo "tarball=${KEY}" >> $GITHUB_OUTPUT - + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.7.9 diff --git a/.github/workflows/therock-ci.yml b/.github/workflows/therock-ci.yml index 8c56bc6cd7..71d2348e03 100644 --- a/.github/workflows/therock-ci.yml +++ b/.github/workflows/therock-ci.yml @@ -54,7 +54,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pydantic requests - + - name: Detect changed subtrees id: detect if: github.event_name == 'pull_request'