name: TheRock CI Linux on: workflow_call: inputs: therock_ref: type: string required: true docker_image: type: string required: true rocm_package_version: type: string required: true cmake_options: type: string projects_to_test: type: string test_type: type: string amdgpu_families: type: string test_runs_on: type: string build_runs_on: type: string permissions: contents: read jobs: therock-build-linux: name: Build (${{ inputs.amdgpu_families }}) runs-on: ${{ inputs.build_runs_on }} permissions: id-token: write container: image: ${{ inputs.docker_image }} strategy: fail-fast: true env: CACHE_DIR: ${{ github.workspace }}/.container-cache CCACHE_CONFIGPATH: ${{ github.workspace }}/.ccache/ccache.conf AMDGPU_FAMILIES: ${{ inputs.amdgpu_families }} TEATIME_FORCE_INTERACTIVE: 0 steps: - name: "Checking out repository for rocm-libraries" uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout TheRock repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: repository: "ROCm/TheRock" path: TheRock ref: ${{ inputs.therock_ref }} - name: Install python deps run: | pip install -r TheRock/requirements.txt - name: Patch rocm-libraries run: | # Remove patches here if they cannot be applied cleanly, and they have not been deleted from TheRock repo # rm ./TheRock/patches/amd-mainline/rocm-libraries/*.patch # git -c user.name="therockbot" -c "user.email=therockbot@amd.com" am --whitespace=nowarn ./TheRock/patches/amd-mainline/rocm-libraries/*.patch # 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: Setup ccache run: | ./TheRock/build_tools/setup_ccache.py \ --config-preset "github-oss-dev" \ --dir "$(dirname $CCACHE_CONFIGPATH)" \ --local-path "$CACHE_DIR/ccache" - name: Runner health status run: | ./TheRock/build_tools/health_status.py - name: Pull DVC files for rocm-libraries # LOGNAME details here https://github.com/ROCm/rocm-libraries/pull/1617 run: | if command -v dvc &> /dev/null; then echo "dvc detected" else echo "Warning, dvc not detected!" fi LOGNAME=github-runner dvc pull -v - name: Fetch sources timeout-minutes: 30 run: | ./TheRock/build_tools/fetch_sources.py --jobs 12 --no-include-rocm-libraries --no-include-ml-frameworks - name: Configure Projects env: amdgpu_families: ${{ env.AMDGPU_FAMILIES }} package_version: ${{ inputs.rocm_package_version }} extra_cmake_options: "-DTHEROCK_ROCM_LIBRARIES_SOURCE_DIR=../ ${{ inputs.cmake_options }}" BUILD_DIR: build run: | python3 TheRock/build_tools/github_actions/build_configure.py - name: Build therock-artifacts and therock-dist run: cmake --build TheRock/build --target therock-artifacts therock-dist -- -k 0 - name: Report if: ${{ !cancelled() }} run: | echo "Full SDK du:" echo "------------" du -h -d 1 TheRock/build/dist/rocm echo "Artifacts:" echo "----------" du -h -d 1 TheRock/build/artifacts echo "CCache Stats:" echo "-------------" ccache -s -v tail -v -n +1 .ccache/compiler_check_cache/* > TheRock/build/logs/ccache_compiler_check_cache.log - name: Configure AWS Credentials for non-forked repos if: ${{ always() && !github.event.pull_request.head.repo.fork }} uses: aws-actions/configure-aws-credentials@99214aa6889fcddfa57764031d71add364327e59 # v6.1.3 with: aws-region: us-east-2 role-to-assume: arn:aws:iam::692859939525:role/therock-ci-external - name: Push artifacts run: | python TheRock/build_tools/artifact_manager.py push \ --run-id ${{ github.run_id }} \ --build-dir TheRock/build \ --stage all - name: Post Build Upload if: always() run: | python3 TheRock/build_tools/github_actions/post_build_upload.py \ --run-id ${{ github.run_id }} \ --artifact-group ${{ env.AMDGPU_FAMILIES }} \ --build-dir TheRock/build \ --upload - name: Notify Teams Channel on Failure if: ${{ failure() && !github.event.pull_request.head.repo.fork }} env: PR_NUMBER: ${{ github.event.pull_request.number }} PR_TITLE: ${{ github.event.pull_request.title }} MIOPEN_WEBHOOK_URL: ${{ secrets.MIOPEN_CI_WEBHOOK_URL }} HIPDNN_WEBHOOK_URL: ${{ secrets.HIPDNN_CI_WEBHOOK_URL }} COMPONENT_NAME: ${{ inputs.projects_to_test }} run: | python3 .github/scripts/notify_teams.py \ --failure-stage build \ --log-path TheRock/build/logs \ --webhook-urls "{\"miopen\":\"${MIOPEN_WEBHOOK_URL}\",\"hipdnn\":\"${HIPDNN_WEBHOOK_URL}\"}" \ --pr-number "${PR_NUMBER}" \ --pr-title "${PR_TITLE}" \ --component-name "${COMPONENT_NAME}" therock-test-linux: name: Test (${{ inputs.amdgpu_families }}) needs: [therock-build-linux] # TODO(TheRock#3288): Re-enable gfx950-dcgpu runners once we get more capacity if: ${{ inputs.amdgpu_families != 'gfx950-dcgpu' }} uses: ./.github/workflows/therock-test-packages.yml with: therock_ref: ${{ inputs.therock_ref }} projects_to_test: ${{ inputs.projects_to_test }} amdgpu_families: ${{ inputs.amdgpu_families }} test_runs_on: ${{ inputs.test_runs_on }} platform: "linux" test_type: ${{ inputs.test_type }} secrets: inherit