Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

207 lines
8.6 KiB
YAML

# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
name: Test component
on:
workflow_call:
inputs:
artifact_run_id:
type: string
default: ""
artifact_group:
type: string
amdgpu_families:
type: string
amdgpu_targets:
type: string
default: ""
test_retry_count:
type: number
test_runs_on:
type: string
platform:
type: string
component:
type: string
release_type:
type: string
default: ""
default_container_image:
type: string
default: "ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:4150afe4759d14822f0e3f8930e1124f26e11f68b5c7b91ec9a02b20b1ebbb98"
permissions:
contents: read
jobs:
test_component:
name: >-
Test ${{ fromJSON(inputs.component).job_name }}
(shard ${{ matrix.shard }}/${{ fromJSON(inputs.component).total_shards }})
(${{ inputs.amdgpu_families }})
${{ fromJSON(inputs.component).expect_failure == true && '(xfail)' || '' }}
runs-on: ${{ inputs.test_runs_on }}
continue-on-error: ${{ fromJSON(inputs.component).expect_failure == true }}
timeout-minutes: 210
container:
# If the component has specified an alternate image, honor that option.
# Otherwise use the default image.
image: >-
${{ inputs.platform == 'linux' &&
(fromJSON(inputs.component).container_image || inputs.default_container_image)
|| null
}}
# --ulimit memlock=-1:-1 - Prevents memory allocation issues with ROCm inside container
# --security-opt seccomp=unconfined - enables memory mapping, and is recommended for containers running in HPC environments
# --env-file /etc/podinfo/gha-gpu-isolation-settings - Required for GPU isolation on OSSCI MIXXX runners
# --user 0:0 - Running as root, by recommendation of GitHub: https://docs.github.com/en/actions/reference/workflows-and-actions/dockerfile-support#user
options: --ipc host
--group-add video
--device /dev/kfd
--device /dev/dri
--group-add 993
--group-add 992
--group-add 110
--ulimit memlock=-1:-1
--security-opt seccomp=unconfined
--env-file /etc/podinfo/gha-gpu-isolation-settings
--user 0:0
${{ fromJSON(inputs.component).container_options }}
strategy:
fail-fast: false
matrix:
# The shard array is based on "total_shards" from "fetch_test_configurations.py"
# The test executable will shard based on the array. (ex: [1, 2, 3, 4] = four test shards)
shard: ${{ fromJSON(inputs.component).shard_arr }}
defaults:
run:
shell: bash
env:
VENV_DIR: ${{ github.workspace }}/.venv
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
OUTPUT_ARTIFACTS_DIR: "./build"
THEROCK_BIN_DIR: "./build/bin"
AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }}
AMDGPU_TARGETS: ${{ inputs.amdgpu_targets }}
ARTIFACT_GROUP: ${{ inputs.artifact_group }}
# Benchmark results database API endpoints for performance metrics collection
# NOTE: These secrets are only required for benchmark results submission in nightly CI runs.
# For PR/push workflows, secret retrieval will fail gracefully and benchmarks will skip API submission.
BENCHMARK_DB_URL: ${{ secrets.BENCHMARK_DB_URL }}
BENCHMARK_DB_FALLBACK_URL: ${{ secrets.BENCHMARK_DB_FALLBACK_URL }}
steps:
- name: "Fetch 'build_tools' from repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: "ROCm/TheRock"
ref: 'compiler/amd-staging'
sparse-checkout: build_tools
path: "prejob"
- name: Pre-job cleanup processes on Windows
if: ${{ runner.os == 'Windows' }}
timeout-minutes: 5
shell: powershell
run: . '${{ github.workspace }}\prejob\build_tools\github_actions\cleanup_processes.ps1'
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: "ROCm/TheRock"
ref: 'compiler/amd-staging'
- name: Run setup test environment workflow
timeout-minutes: 15
env:
RETRY_THIS_STEP: "true"
STEP_TIMEOUT_MINUTES: "15" # should match timeout-minutes specified above at this step
uses: './.github/actions/setup_test_environment'
with:
ARTIFACT_RUN_ID: ${{ env.ARTIFACT_RUN_ID }}
# TODO(#3381): revert back to `inputs.artifact_group` once issue is resolved
ARTIFACT_GROUP: ${{ inputs.amdgpu_families }}
AMDGPU_TARGETS: ${{ inputs.amdgpu_targets }}
OUTPUT_ARTIFACTS_DIR: ${{ env.OUTPUT_ARTIFACTS_DIR }}
VENV_DIR: ${{ env.VENV_DIR }}
FETCH_ARTIFACT_ARGS: ${{ fromJSON(inputs.component).fetch_artifact_args }}
RELEASE_TYPE: ${{ inputs.release_type }}
# safe.directory must be set before Runner Health Status
- name: Adjust git config
run: |
git config --global --add safe.directory $PWD
git config fetch.parallel 10
- name: Runner health status
run: |
python ./build_tools/health_status.py
- name: Driver / GPU sanity check
timeout-minutes: 3
run: |
python ./build_tools/print_driver_gpu_info.py
- name: Setup Additional Requirements
if: ${{ fromJSON(inputs.component).additional_requirements_files != '' }}
run: |
python ./build_tools/install_additional_requirements.py \
--requirements-files ${{ join(fromJSON(inputs.component).additional_requirements_files, ',') }}
# TODO(#3755): Clean this up after final sanitizer environment variable flags are determined
- name: Enable sanitizer-specific test flags
if: ${{ contains(inputs.artifact_group, 'asan') }}
run: |
echo "ASAN_OPTIONS=detect_odr_violation=0:quarantine_size_mb=600" >> $GITHUB_ENV
echo "HSA_XNACK=1" >> $GITHUB_ENV
echo "ASAN_SYMBOLIZER_PATH=${{ env.OUTPUT_ARTIFACTS_DIR }}/llvm/bin/llvm-symbolizer" >> $GITHUB_ENV
- name: Test
id: test
timeout-minutes: ${{ fromJSON(inputs.component).timeout_minutes }}
env:
SHARD_INDEX: ${{ matrix.shard }}
TOTAL_SHARDS: ${{ fromJSON(inputs.component).total_shards }}
TEST_TYPE: ${{ fromJSON(inputs.component).test_type }}
TEST_COMPONENT: ${{ fromJSON(inputs.component).job_name }}
ROCM_KPACK_DEBUG: "1"
# Windows hip-tests (PAL=1, ROCR=0) set this via matrix; other components
# leave it empty. #3587
GPU_ENABLE_PAL: ${{ fromJSON(inputs.component).gpu_enable_pal }}
RETRY_THIS_STEP: "true"
RETRY_COUNT: "1"
RETRY_DELAY: "7"
STEP_TIMEOUT_MINUTES: ${{ fromJSON(inputs.component).timeout_minutes }}
STEP_NAME: >-
Test ${{ fromJSON(inputs.component).job_name }}
(shard ${{ matrix.shard }}/${{ fromJSON(inputs.component).total_shards }})
(${{ inputs.amdgpu_families }})
${{ fromJSON(inputs.component).expect_failure == true && '(xfail)' || '' }}
run: |
python ./build_tools/memory_monitor.py --phase "Test ${{ fromJSON(inputs.component).job_name }}" -- \
bash -c '${{ fromJSON(inputs.component).test_script }}'
- name: Print test reproduction command
if: ${{ failure() && steps.test.outcome == 'failure' }}
run: |
python ./build_tools/github_actions/reproduce_test_failure.py \
--run-id "${{ env.ARTIFACT_RUN_ID }}" \
--repository "${{ github.repository }}" \
--amdgpu-family "${{ inputs.amdgpu_families }}" \
--test-script "${{ fromJSON(inputs.component).test_script }}" \
--shard-index "${{ matrix.shard }}" \
--total-shards "${{ fromJSON(inputs.component).total_shards }}" \
--test-type "${{ fromJSON(inputs.component).test_type }}" \
--print-cmd \
${{ fromJSON(inputs.component).fetch_artifact_args && format('--fetch-artifact-args="{0}"', fromJSON(inputs.component).fetch_artifact_args) || '' }}
# GitHub's 'Complete job' step is unaware of launched executables
# and will fail to clean up orphan processes.
- name: Post-job cleanup processes on Windows
if: ${{ always() && runner.os == 'Windows' }}
timeout-minutes: 5
shell: powershell
run: . '${{ github.workspace }}\build_tools\github_actions\cleanup_processes.ps1'