Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 298 additions & 0 deletions .github/workflows/native_linux_packages_full_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
name: Full Test of Native Linux Packages

on:
workflow_call:
inputs:
repo_sub_folder:
description: "Repository sub folder (e.g., 20260204-21658678136). Format: build_date-artifact_run_id"
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
default: "deb"
os_profile:
description: OS profile (e.g., ubuntu2404, rhel8, debian12, sles16).
required: true
type: string
gfx_arch:
description: GPU architecture (e.g., gfx94x, gfx110x, gfx1151).
type: string
release_type:
description: The type of release to test ("nightly" or "prerelease").
required: true
type: string
default: "nightly"
install_prefix:
description: Installation prefix path (optional, defaults to /opt/rocm/core).
required: false
type: string
default: "/opt/rocm/core"
workflow_dispatch:
inputs:
repo_sub_folder:
description: "Repository Sub Folder (e.g., 20260204-21658678136). Format: build_date-artifact_run_id."
required: true
type: string
rocm_version:
description: ROCm version to append to the package (8.0.0, 8.0.1rc1, ...).
type: string
default: "8.0.0"
native_package_type:
description: Specify whether debian or rpm packages are needed (deb or rpm).
required: true
type: choice
options:
- deb
- rpm
default: "deb"
os_profile:
description: OS profile (e.g., ubuntu2404, rhel8, debian12, sles16).
required: true
type: choice
options:
- ubuntu2404
- ubuntu2204
- debian12
- rhel8
- rhel9
- sles16
default: "ubuntu2404"
gfx_arch:
description: GPU architecture (e.g., gfx94x, gfx110x, gfx1151).
type: string
default: "gfx94x"
release_type:
description: The type of release to test ("nightly" or "prerelease"). All developer-triggered jobs should use "nightly"!
type: choice
required: true
options:
- nightly
- prerelease
default: "nightly"
install_prefix:
description: Installation prefix path (defaults to /opt/rocm/core).
type: string
default: "/opt/rocm/core"
required: false
push:
branches:
- main
- develop
paths:
- '.github/workflows/native_linux_packages_full_test.yml'
- 'build_tools/**'
pull_request:
branches:
- main
- develop
paths:
- '.github/workflows/native_linux_packages_full_test.yml'
- 'build_tools/**'

permissions:
id-token: write
contents: read

run-name: Full Test - Native Linux packages (${{ inputs.os_profile }}, ${{ inputs.rocm_version }}, ${{ inputs.native_package_type }}, ${{ inputs.gfx_arch }})

jobs:
full_test_native_linux_packages:
name: Full Installation Test - ${{ inputs.native_package_type }}
strategy:
fail-fast: false
# Use appropriate runner based on package type
runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
container:
# Use container matching the package type
image: ${{ inputs.native_package_type == 'deb' && 'ubuntu:24.04' || 'almalinux:9' }}
options: --privileged
env:
REPO_SUB_FOLDER: ${{ inputs.repo_sub_folder }}
ROCM_VERSION: ${{ inputs.rocm_version }}
OS_PROFILE: ${{ inputs.os_profile }}
PACKAGE_TYPE: ${{ inputs.native_package_type }}
GFX_ARCH: ${{ inputs.gfx_arch || 'gfx94x' }}
RELEASE_TYPE: ${{ inputs.release_type || 'nightly' }}
INSTALL_PREFIX: ${{ inputs.install_prefix || '/opt/rocm/core' }}
steps:
- name: Install System Prerequisites
run: |
echo "Installing prerequisites for ${{ inputs.native_package_type }} on container"

if [ "${{ inputs.native_package_type }}" = "deb" ]; then
# Ubuntu/Debian prerequisites
apt update
apt install -y \
python3 \
python3-pip \
wget \
curl \
ca-certificates \
git \
lsb-release
else
# RHEL/CentOS/AlmaLinux prerequisites
# Use --allowerasing to handle curl-minimal conflict on AlmaLinux 9
dnf install -y --allowerasing \
python3 \
python3-pip \
wget \
curl \
ca-certificates \
git \
dnf-plugins-core
fi

- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Python Dependencies
run: |
if [ "${{ inputs.native_package_type }}" = "deb" ]; then
# Ubuntu/Debian: use --break-system-packages flag
pip3 install --break-system-packages pyelftools requests
else
# RHEL/CentOS/AlmaLinux: no --break-system-packages flag needed
pip3 install pyelftools requests
fi

- name: Set Repository Base URL
id: set-repo-url
run: |
if [ "${{ env.RELEASE_TYPE }}" = "prerelease" ]; then
echo "REPO_BASE_URL=https://rocm.prereleases.amd.com/packages" >> $GITHUB_ENV
echo "Using prerelease repository: https://rocm.prereleases.amd.com/packages"
else
echo "REPO_BASE_URL=https://rocm.nightlies.amd.com" >> $GITHUB_ENV
echo "Using nightly repository: https://rocm.nightlies.amd.com"
fi
echo "Release Type: ${{ env.RELEASE_TYPE }}"

- name: Full Package Installation Test
id: full-test
run: |
echo "=========================================================================="
echo "FULL INSTALLATION TEST - NATIVE LINUX PACKAGES"
echo "=========================================================================="
echo "Package Type: ${{ inputs.native_package_type }}"
echo "OS Profile: ${{ inputs.os_profile }}"
echo "Repository Sub Folder: ${{ inputs.repo_sub_folder }}"
echo "Release Type: ${{ env.RELEASE_TYPE }}"
echo "ROCm Version: ${{ inputs.rocm_version }}"
echo "GPU Architecture: ${{ env.GFX_ARCH }}"
echo "Repository Base URL: ${{ env.REPO_BASE_URL }}"
echo "Install Prefix: ${{ env.INSTALL_PREFIX }}"
echo "=========================================================================="
echo ""

# repo_sub_folder format: build_date-artifact_run_id (e.g., 20260204-21658678136)
REPO_SUB_FOLDER="${{ inputs.repo_sub_folder }}"

# For prerelease, repository sub folder not needed
if [ -z "$REPO_SUB_FOLDER" ] && [ "${{ env.RELEASE_TYPE }}" = "prerelease" ]; then
REPO_SUB_FOLDER=""
fi

# Build command for package_full_test.py
CMD="python3 build_tools/packaging/linux/package_full_test.py"
CMD="$CMD --package-type ${{ inputs.native_package_type }}"
CMD="$CMD --repo-sub-folder ${{ inputs.repo_sub_folder }}"
CMD="$CMD --repo-base-url ${{ env.REPO_BASE_URL }}"
CMD="$CMD --rocm-version ${{ inputs.rocm_version }}"
CMD="$CMD --os-profile ${{ inputs.os_profile }}"
CMD="$CMD --gfx-arch ${{ env.GFX_ARCH }}"
CMD="$CMD --install-prefix ${{ env.INSTALL_PREFIX }}"
CMD="$CMD --release-type ${{ env.RELEASE_TYPE }}"

echo "Executing: $CMD"
echo ""
eval $CMD

- name: Verify ROCm Installation
if: always() && steps.full-test.outcome == 'success'
shell: bash
run: |
echo "=========================================================================="
echo "VERIFYING ROCM INSTALLATION"
echo "=========================================================================="
echo "Install Prefix: ${{ env.INSTALL_PREFIX }}"
echo ""

# Check if ROCm directory exists
if [ -d "${{ env.INSTALL_PREFIX }}" ]; then
echo "ROCm installation directory exists: ${{ env.INSTALL_PREFIX }}"
echo ""
echo "Directory structure:"
ls -la ${{ env.INSTALL_PREFIX }}
else
echo "ROCm installation directory not found: ${{ env.INSTALL_PREFIX }}"
exit 1
fi

# Check for key ROCm components
echo ""
echo "Checking for key ROCm components:"

components=(
"bin/rocminfo"
"bin/hipcc"
"include/hip/hip_runtime.h"
"lib/libamdhip64.so"
)

all_found=true
for comp in "${components[@]}"; do
full_path="${{ env.INSTALL_PREFIX }}/${comp}"
if [ -e "$full_path" ]; then
echo " $comp"
else
echo " $comp (not found)"
all_found=false
fi
done

if [ "$all_found" = true ]; then
echo ""
echo "All key components found"
else
echo ""
echo "Some components missing (may be expected depending on package selection)"
fi

- name: Test Report
if: always()
run: |
echo ""
echo "=========================================================================="
echo "FULL TEST REPORT"
echo "=========================================================================="

if [ "${{ steps.full-test.outcome }}" = "success" ]; then
echo "FULL INSTALLATION TEST PASSED"
echo ""
echo "Summary:"
echo " - Release Type: ${{ env.RELEASE_TYPE }}"
echo " - Repository setup: SUCCESS"
echo " - Package installation from repository: SUCCESS"
echo " - ROCm verification: SUCCESS"
echo ""
echo "ROCm ${{ inputs.rocm_version }} is successfully installed at ${{ env.INSTALL_PREFIX }}"
if [ "${{ env.RELEASE_TYPE }}" = "prerelease" ]; then
echo "Installed from: ${{ env.REPO_BASE_URL }}/${{ inputs.os_profile }}/"
else
echo "Installed from: ${{ env.REPO_BASE_URL }}/${{ inputs.native_package_type }}/${{ inputs.repo_sub_folder }}/${{ inputs.os_profile }}/"
fi
else
echo "FULL INSTALLATION TEST FAILED"
echo ""
echo "The test failed during repository setup or package installation."
echo "Please check the logs above for detailed error messages."
exit 1
fi
echo "=========================================================================="
Loading
Loading