name: rocprofiler-systems Continuous Integration run-name: rocprofiler-systems-ci on: schedule: - cron: '0 6 * * *' workflow_dispatch: inputs: mode: description: 'Build mode' required: false default: 'continuous' type: choice options: - continuous - nightly push: branches: [ develop ] paths: - '.github/workflows/rocprofiler-systems-continuous-integration.yml' - 'projects/rocprofiler-systems/**' - '!**/*.md' - '!**/*.rtf' - '!**/*.rst' - '!**/.markdownlint-ci2.yaml' - '!**/.readthedocs.yaml' - '!**/.spellcheck.local.yaml' - '!**/.wordlist.txt' - '!projects/rocprofiler-systems/docs/**' - '!projects/rocprofiler-systems/source/docs/**' - '!projects/rocprofiler-systems/source/python/gui/**' - '!projects/rocprofiler-systems/docker/**' - '!projects/rocprofiler-systems/CMakePresets.json' pull_request: paths: - '.github/workflows/rocprofiler-systems-continuous-integration.yml' - 'projects/rocprofiler-systems/**' - '!**/*.md' - '!**/*.rtf' - '!**/*.rst' - '!**/.markdownlint-ci2.yaml' - '!**/.readthedocs.yaml' - '!**/.spellcheck.local.yaml' - '!**/.wordlist.txt' - '!projects/rocprofiler-systems/docs/**' - '!projects/rocprofiler-systems/source/docs/**' - '!projects/rocprofiler-systems/source/python/gui/**' - '!projects/rocprofiler-systems/docker/**' - '!projects/rocprofiler-systems/CMakePresets.json' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: ROCPROFSYS_CI: ON ROCPROFSYS_TMPDIR: "%env{PWD}%/testing-tmp" ROCM_PATH: "/opt/rocm" EXCLUDED_TESTS: "fork.*|jacobi-usm-sys-run|jacobi-roctx.*|jpeg-decode-.*|kfd-.*|unified-memory-output-sys-run|rccl-alltoall-perf-sys-run" EXCLUDED_LABELS: "thread_limit" jobs: prepare_matrix: runs-on: ubuntu-latest outputs: matrix: ${{ steps.generate_matrix.outputs.matrix }} steps: - uses: actions/checkout@v6 with: sparse-checkout: projects/rocprofiler-systems/.github - name: Generate and output matrix id: generate_matrix working-directory: projects/rocprofiler-systems/.github run: | if [ '${{ github.event_name }}' = 'schedule' ] || [ '${{ inputs.mode }}' = 'nightly' ]; then MATRIX_CONTENT=$(cat ci-matrix.yml | yq '.matrix-nightly' -I=0 -o=json) else MATRIX_CONTENT=$(cat ci-matrix.yml | yq '.matrix-ci' -I=0 -o=json) fi echo "matrix=${MATRIX_CONTENT}" >> $GITHUB_OUTPUT ubuntu: name: Ubuntu ${{ matrix.system.os-release }} • ${{ matrix.system.arch }} needs: prepare_matrix strategy: fail-fast: false matrix: system: ${{ fromJSON(needs.prepare_matrix.outputs.matrix) }} runs-on: ${{ matrix.system.runner }} env: HIP_PLATFORM: "amd" ROCPROFSYS_CI: ON OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 ROCPROFSYS_KEEP_TEST_OUTPUT: '0' permissions: packages: read checks: write defaults: run: shell: bash container: image: ghcr.io/rocm/rocprofiler-ubuntu:${{ matrix.system.os-release }}-systems-ci-multiarch # --env-file /etc/podinfo/gha-gpu-isolation-settings - Required for GPU isolation on OSSCI MIXXX runners options: --privileged --ipc host --group-add video --device /dev/kfd --device /dev/dri --cap-add CAP_SYS_ADMIN --env-file /etc/podinfo/gha-gpu-isolation-settings steps: - uses: actions/checkout@v6 with: sparse-checkout: | projects/rocprofiler-systems .gitmodules submodules: recursive - name: Setup Environment id: setup_env run: | if [ '${{ github.event_name }}' = 'schedule' ] || [ '${{ inputs.mode }}' = 'nightly' ]; then MODE=Nightly INCLUDED_LABELS="gpu" EXCLUDED_LABELS="${{ env.EXCLUDED_LABELS }}" else MODE=Continuous INCLUDED_LABELS="gpu" EXCLUDED_LABELS="${{ env.EXCLUDED_LABELS }}|slow" fi echo "mode=${MODE}" >> $GITHUB_OUTPUT echo "included_labels=${INCLUDED_LABELS}" >> $GITHUB_OUTPUT echo "excluded_labels=${EXCLUDED_LABELS}" >> $GITHUB_OUTPUT - name: Install MPI run: | apt install -y libopenmpi-dev echo "✅ MPI Installed!" - name: Install Latest Nightly ROCm run: | set -euo pipefail tarball=$(ls /opt/rocm-*-multiarch.tar.gz | head -n 1) TARBALL_ROCM_VERSION=$(basename "${tarball}" | sed -E 's/^rocm-([0-9]+\.[0-9]+\.[0-9]+)-multiarch\.tar\.gz$/\1/') mkdir -p "${ROCM_PATH}" tar -xf "${tarball}" -C "${ROCM_PATH}" echo "ROCM_VERSION=${TARBALL_ROCM_VERSION}" >> "${GITHUB_ENV}" echo "${ROCM_PATH}/bin" >> "${GITHUB_PATH}" echo "${ROCM_PATH}/llvm/bin" >> "${GITHUB_PATH}" echo "ROCm ${TARBALL_ROCM_VERSION} installed to: ${ROCM_PATH}" echo "✅ ROCm Installation Complete!" - name: Output TheRock Manifest run: | cat ${{ env.ROCM_PATH }}/share/therock/therock_manifest.json - name: Install Python Test Dependencies timeout-minutes: 10 shell: bash working-directory: projects/rocprofiler-systems run: | python3 -m pip --version python3 -m pip install --break-system-packages -r requirements.txt - name: Generate CI scripts timeout-minutes: 5 shell: bash working-directory: projects/rocprofiler-systems env: GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} git config --global --add safe.directory ${PWD} echo "CMake: $(cmake --version | head -n 1)" INCLUDED_LABELS="${{ steps.setup_env.outputs.included_labels }}" LABEL_ARG="" if [ -n "${INCLUDED_LABELS}" ]; then LABEL_ARG="-L ${INCLUDED_LABELS}" fi PATH=${{ env.ROCM_PATH }}/bin:${{ env.ROCM_PATH }}/llvm/bin:$PATH \ LD_LIBRARY_PATH=${{ env.ROCM_PATH }}/lib:${{ env.ROCM_PATH }}/llvm/lib:$LD_LIBRARY_PATH \ python3 ./scripts/run-ci.py --stage generate \ --name "${{ github.repository }}-${{ github.ref_name }}-ubuntu-${{ matrix.system.os-release }}-${{ matrix.system.gpu }}" \ --build-jobs 16 \ --site ${{ matrix.system.runner }} \ --mode ${{ steps.setup_env.outputs.mode }} \ -B build \ -- \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_PREFIX_PATH=${{ env.ROCM_PATH }} \ -DCMAKE_INSTALL_PREFIX=/opt/rocprofiler-systems \ -DROCPROFSYS_BUILD_DYNINST=ON \ -DROCPROFSYS_BUILD_TBB=ON \ -DROCPROFSYS_BUILD_ELFUTILS=ON \ -DROCPROFSYS_BUILD_LIBIBERTY=ON \ -DROCPROFSYS_BUILD_CI=ON \ -DROCPROFSYS_BUILD_EXAMPLES=ON \ -DROCPROFSYS_BUILD_TESTING=ON \ -DROCPROFSYS_USE_PYTHON=ON \ -DROCPROFSYS_MAX_THREADS=64 \ -- \ -E "${{ env.EXCLUDED_TESTS }}" \ -LE "${{ steps.setup_env.outputs.excluded_labels }}" \ ${LABEL_ARG} - name: Configure timeout-minutes: 15 shell: bash working-directory: projects/rocprofiler-systems env: GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache run: | PATH=${{ env.ROCM_PATH }}/bin:${{ env.ROCM_PATH }}/llvm/bin:$PATH \ LD_LIBRARY_PATH=${{ env.ROCM_PATH }}/lib:${{ env.ROCM_PATH }}/llvm/lib:$LD_LIBRARY_PATH \ python3 ./scripts/run-ci.py --stage configure \ --name "${{ github.repository }}-${{ github.ref_name }}-ubuntu-${{ matrix.system.os-release }}-${{ matrix.system.gpu }}" \ -B build - name: Build timeout-minutes: 45 shell: bash working-directory: projects/rocprofiler-systems env: CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache run: | PATH=${{ env.ROCM_PATH }}/bin:${{ env.ROCM_PATH }}/llvm/bin:$PATH \ LD_LIBRARY_PATH=${{ env.ROCM_PATH }}/lib:${{ env.ROCM_PATH }}/llvm/lib:$LD_LIBRARY_PATH \ python3 ./scripts/run-ci.py --stage build \ --name "${{ github.repository }}-${{ github.ref_name }}-ubuntu-${{ matrix.system.os-release }}-${{ matrix.system.gpu }}" \ -B build - name: CDash link if: always() shell: bash run: | NAME="${{ github.repository }}-${{ github.ref_name }}-ubuntu-${{ matrix.system.os-release }}-${{ matrix.system.gpu }}" NAME=$(echo "${NAME}" | sed 's/\(.*\)-\([0-9]*\)\/merge/PR_\2_\1/') URL="https://my.cdash.org/index.php?project=rocprofiler-systems&filtercount=1&showfilters=1&field1=buildname&compare1=65&value1=${NAME}" printf '### CDash Results\n[View build on CDash](%s)\n' "${URL}" >> "${GITHUB_STEP_SUMMARY}" echo "::notice title=CDash Results::${URL}" - name: Test timeout-minutes: 60 shell: bash working-directory: projects/rocprofiler-systems run: | PATH=${{ env.ROCM_PATH }}/bin:${{ env.ROCM_PATH }}/llvm/bin:$PATH \ LD_LIBRARY_PATH=${{ env.ROCM_PATH }}/lib:${{ env.ROCM_PATH }}/llvm/lib:$LD_LIBRARY_PATH \ python3 ./scripts/run-ci.py --stage test \ --name "${{ github.repository }}-${{ github.ref_name }}-ubuntu-${{ matrix.system.os-release }}-${{ matrix.system.gpu }}" \ -B build - name: Publish test results if: always() uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 with: files: projects/rocprofiler-systems/build/test-results.xml check_name: "Tests — Ubuntu ${{ matrix.system.os-release }} • ${{ matrix.system.gpu }}" comment_mode: 'off' check_run: false job_summary: true - name: Check for Leftover Buffered Files timeout-minutes: 5 working-directory: projects/rocprofiler-systems/ run: | set -v if find /tmp -maxdepth 1 -name 'buffered*' -print -quit | grep -q .; then echo "Error: Found leftover buffered storage files in /tmp:" ls -lh /tmp/buffered* exit 1 else echo "✓ No buffered storage files found in /tmp" fi