Build native Linux packages (gfx90a, 7.13.0~20260430, deb, , nightly) #6545
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright Advanced Micro Devices, Inc. | |
| # SPDX-License-Identifier: MIT | |
| name: Build Native Linux Packages | |
| on: | |
| workflow_call: | |
| inputs: | |
| artifact_group: | |
| description: gfx arch group for the s3 server | |
| type: string | |
| default: gfx94X-dcgpu | |
| artifact_run_id: | |
| description: workflow run id to download the artifacts from. | |
| required: true | |
| type: string | |
| rocm_version: | |
| description: ROCm version to append to the package (8.0.0, 8.0.1rc1, ...). | |
| required: true | |
| type: string | |
| native_package_type: | |
| description: Specify whether debian or rpm packages are needed (deb or rpm). | |
| required: true | |
| type: string | |
| package_suffix: | |
| description: The suffix to be added to package name (asan, tsan, static or rpath). | |
| required: false | |
| type: string | |
| release_type: | |
| description: The type of release to build ("dev", "nightly", or "prerelease"). All developer-triggered jobs should use "dev"! | |
| required: false | |
| type: string | |
| skip_package_upload: | |
| description: Skip uploading packages to S3. Set to true when called from test workflows. | |
| required: false | |
| type: boolean | |
| default: false | |
| repository: | |
| description: "Repository to checkout. Otherwise, defaults to `github.repository`." | |
| type: string | |
| ref: | |
| description: "Branch, tag or SHA to checkout. Defaults to the reference or SHA that triggered the workflow." | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| artifact_group: | |
| type: string | |
| default: gfx94X-dcgpu | |
| artifact_run_id: | |
| description: workflow run id to download the artifacts from | |
| type: string | |
| rocm_version: | |
| description: ROCm version to append to the package (8.0.0, 8.0.1rc1, ...). | |
| type: string | |
| default: "0.0.1" | |
| native_package_type: | |
| description: Specify whether debian or rpm packages are needed (deb or rpm). | |
| required: true | |
| type: choice | |
| options: | |
| - rpm | |
| - deb | |
| default: "rpm" | |
| package_suffix: | |
| description: The suffix to be added to package name (asan, tsan, static or rpath). | |
| type: string | |
| required: false | |
| release_type: | |
| description: The type of release to build ("dev", "nightly", or "prerelease"). All developer-triggered jobs should use "dev"! | |
| type: string | |
| default: "dev" | |
| skip_package_upload: | |
| description: Skip uploading packages to S3. Set to true when called from test workflows. | |
| type: boolean | |
| default: false | |
| ref: | |
| description: "Branch, tag or SHA to checkout. Defaults to the reference or SHA that triggered the workflow." | |
| type: string | |
| permissions: | |
| id-token: write | |
| contents: read | |
| run-name: Build native Linux packages (${{ inputs.artifact_group }}, ${{ inputs.rocm_version }}, ${{ inputs.native_package_type }}, ${{ inputs.package_suffix }}, ${{ inputs.release_type }}) | |
| jobs: | |
| build_native_packages: | |
| name: Build Linux native Packages::${{ inputs.native_package_type }}::${{ inputs.artifact_group }} | |
| strategy: | |
| fail-fast: false | |
| runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }} | |
| outputs: | |
| package_install_url: ${{ steps.upload-packages.outputs.package_repository_url }} | |
| env: | |
| BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:702a5133851e6d1daf1207d2c9fbb01c2667914a5b6dc5a01faeb3ce66ea6421 | |
| ARTIFACT_RUN_ID: ${{ inputs.artifact_run_id || github.run_id }} | |
| PACKAGE_SUFFIX: ${{ inputs.package_suffix != '' && inputs.package_suffix || '' }} | |
| OUTPUT_DIR: ${{ github.workspace }}/output | |
| ARTIFACTS_DIR: ${{ github.workspace }}/output/artifacts | |
| PACKAGE_DIST_DIR: ${{ github.workspace }}/output/packages | |
| RELEASE_TYPE: ${{ inputs.release_type || '' }} | |
| S3_BUCKET_NATIVE: "therock-${{ inputs.release_type }}-packages" | |
| steps: | |
| - name: "Checking out repository" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: ${{ inputs.repository || github.repository }} | |
| ref: ${{ inputs.ref || '' }} | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python requirements | |
| run: | | |
| pip install pyelftools boto3 jinja2 pyzstd | |
| - name: Install System requirements | |
| run: | | |
| # Install the needed tools for creating rpm / deb packages | |
| # Also install tools for creating repo files | |
| sudo apt update | |
| sudo apt install -y llvm-20 | |
| sudo apt install -y rpm debhelper-compat build-essential | |
| sudo apt install -y dpkg-dev createrepo-c | |
| - name: Fetch Artifacts | |
| run: | | |
| echo "Fetching artifacts for build ${{ inputs.artifact_run_id }}" | |
| python ./build_tools/fetch_artifacts.py \ | |
| --run-id=${{ env.ARTIFACT_RUN_ID }} \ | |
| --run-github-repo=${{ github.repository }} \ | |
| --artifact-group=${{ inputs.artifact_group }} \ | |
| --output-dir=${{ env.ARTIFACTS_DIR }} | |
| - name: Build Packages | |
| id: build-packages | |
| run: | | |
| echo "Building ${{ inputs.native_package_type }} packages for ${{ inputs.artifact_group }} ${{ inputs.artifact_run_id }}" | |
| python ./build_tools/packaging/linux/build_package.py \ | |
| --dest-dir ${{ env.PACKAGE_DIST_DIR }} \ | |
| --rocm-version ${{ inputs.rocm_version }} \ | |
| --target ${{ inputs.artifact_group }} \ | |
| --artifacts-dir ${{ env.ARTIFACTS_DIR }} \ | |
| --pkg-type ${{ inputs.native_package_type }} \ | |
| --version-suffix ${{ env.ARTIFACT_RUN_ID }} | |
| - name: Simulated install Test | |
| id: test-packages | |
| run: | | |
| python ./build_tools/packaging/linux/native_linux_package_install_test.py \ | |
| --test-type simulate \ | |
| --packages-dir "${{ env.PACKAGE_DIST_DIR }}" \ | |
| --pkg-type ${{ inputs.native_package_type }} | |
| - name: Configure AWS Credentials | |
| if: ${{ !inputs.skip_package_upload }} | |
| uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0 | |
| with: | |
| aws-region: us-east-2 | |
| role-to-assume: arn:aws:iam::692859939525:role/therock-${{ inputs.release_type }} | |
| - name: Upload Package repo to S3 | |
| if: ${{ !inputs.skip_package_upload }} | |
| id: upload-packages | |
| run: | | |
| python ./build_tools/packaging/linux/upload_package_repo.py \ | |
| --pkg-type ${{ inputs.native_package_type }} \ | |
| --s3-bucket "${{ env.S3_BUCKET_NATIVE }}" \ | |
| --amdgpu-family ${{ inputs.artifact_group }} \ | |
| --artifact-id ${{ env.ARTIFACT_RUN_ID }} \ | |
| --job ${{ inputs.release_type }} |