Skip to content
name: Portable Linux Package Matrix
on:
push:
branches:
- linux_build_matrix
workflow_dispatch:
inputs:
package_suffix:
type: string
default: -ADHOCBUILD
workflow_call:
inputs:
package_suffix:
type: string
default: -ADHOCBUILD
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
portable_linux_packages:
strategy:
fail-fast: false
matrix:
target_bundle:
- amdgpu_family: "gfx94X-dcgpu"
- amdgpu_family: "gfx110X-dgpu"
- amdgpu_family: "gfx1151"
permissions:
contents: write
name: ${{ matrix.target_bundle.amdgpu_family }}::Build Portable Linux
runs-on: azure-cpubuilder-linux-scale
env:
TEATIME_LABEL_GH_GROUP: 1
OUTPUT_DIR: ${{ github.workspace }}/output
BUILD_IMAGE: ghcr.io/nod-ai/therock_build_manylinux_x86_64:main
DIST_ARCHIVE: "${{ github.workspace }}/output/therock-dist-${{ matrix.target_bundle.amdgpu_family }}${{ github.events.input.package_suffix }}.tar.xz"
steps:
- name: "Checking out repository"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
# TODO: We shouldn't be using a cache on actual release branches, but it
# really helps for iteration time.
- name: Enable cache
uses: actions/cache/restore@v4
with:
path: ${{ env.OUTPUT_DIR }}/caches
key: portable-linux-package-matrix-v1-${{ matrix.target_bundle.amdgpu_family }}-${{ github.sha }}
restore-keys: |
portable-linux-package-matrix-v1-${{ matrix.target_bundle.amdgpu_family }}-
- name: Fetch sources
run: |
# Prefetch docker container in background.
docker pull ${{ env.BUILD_IMAGE }} &
git config --global user.email "[email protected]"
git config --global user.name "Nobody"
./build_tools/fetch_sources.py --depth 1
wait
# The full checkout is very large: ~16GB, 9 of which is GIT stuff.
# So we delete the latter. This must be done after getting any git
# stamps or such things.
- name: Trim Disk Space
run: |
rm -Rf sources/.repo
df -h
- name: Build Projects
run: |
./packaging/linux-portable/build_portable.py \
--image=${{ env.BUILD_IMAGE }} \
--output-dir=${{ env.OUTPUT_DIR }} \
-- \
"-DTHEROCK_AMDGPU_FAMILIES=${{ matrix.target_bundle.amdgpu_family }}" \
"-DTHEROCK_ENABLE_ALL=OFF"
cd ${{ env.OUTPUT_DIR }}/build/dist/rocm
echo "Building ${{ env.DIST_ARCHIVE }}"
tar cfJ "${{ env.DIST_ARCHIVE }}" .
- name: Upload Release Asset
- name: Report
if: ${{ !cancelled() }}
run: |
echo "Full SDK du:"
echo "------------"
du -h -d 1 ${{ env.OUTPUT_DIR }}/build/dist/rocm
- name: Save cache
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.OUTPUT_DIR }}/caches
key: portable-linux-package-matrix-v1-${{ matrix.target_bundle.amdgpu_family }}-${{ github.sha }}
- uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.DIST_ARCHIVE }}"
tag: mainline-snapshot
name: mainline-snapshot
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: false