Skip to content

Test : Testing PR. donot merge or review #17

Test : Testing PR. donot merge or review

Test : Testing PR. donot merge or review #17

name: Build Native Linux Packages
on:
workflow_call:
inputs:
amdgpu_family:
description: gfx arch for creating the artifact fetch url
required: true
type: string
artifact_run_id:
description: workflow run id to download the artifacts from
type: string
rocm_version:
description: ROCm version to append to the package( Like 8.0.0 or 8.1.0).
required: true
type: string
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(build_no or master or rc or combiantion).
required: true
type: string
workflow_dispatch:
inputs:
amdgpu_family:
type: choice
options:
- gfx110X-dgpu
- gfx1151
- gfx120X-all
- gfx94X-dcgpu
- gfx950-dcgpu
default: gfx94X-dcgpu
artifact_run_id:
description: workflow run id to download the artifacts from
type: string
default: "17840675558"
rocm_version:
description: ROCm version to append to the package( Like 8.0.0 or 8.1.0)
type: string
default: "7.9.0"
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(build_no or master or rc or combiantion).
type: string
default: "master"
pull_request:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build_native_packages:
name: Build Linux native Packages (xfail ${{ inputs.expect_failure }})
strategy:
fail-fast: false
runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
env:
AWS_SHARED_CREDENTIALS_FILE: /home/awsconfig/credentials.ini
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:3ac188c17f88f08ce522297b616d8308361b8e9a9b31bcc3c3bbb9429b1efa6c
ARTIFACT_RUN_ID: 17840675558
OUTPUT_DIR: ${{ github.workspace }}/output
ARTIFACTS_DIR: ${{ github.workspace }}/output/artifacts
PACKAGE_DIST_DIR: ${{ github.workspace }}/output/packages
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.12'
- name: Install Python requirements
run: |
pip install pyelftools boto3 jinja2
cat /etc/os-release
#sudo yum install -y rpm-build
sudo apt update
sudo apt install -y llvm debhelper-compat build-essential
- name: Fetch Artifacts
# TODO: Currently fetch artifacts is part of build package itself. Need to seperate it out
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="ROCm/TheRock" \
--target=gfx94X-dcgpu \
--output-dir=${{ env.ARTIFACTS_DIR }}
- name: Build Packages
id: build-packages
run: |
echo "Building ${{ inputs.package_type }} packages for ${{ inputs.amdgpu_family }} ${{ inputs.artifact_run_id }}"
python ./build_tools/packaging/linux/build_package.py \
--dest-dir ${{ env.PACKAGE_DIST_DIR }} \
--rocm-version 7.9.0 \
--target gfx94X-dcgpu \
--artifacts-dir ${{ env.ARTIFACTS_DIR }} \
--pkg-type deb \
--pkg-names rocm-core hsa-rocr
- name: Install repo tools
run: |
#sudo yum install -y createrepo_c
sudo apt-get install -y dpkg-dev
#if [[ "${{ inputs.package_type }}" == "deb" ]]; then
# sudo apt-get update
# sudo apt-get install -y dpkg-dev
#else
# sudo yum install -y createrepo_c
#fi
- name: Install AWS CLI
run: bash ./dockerfiles/install_awscli.sh
- name: Configure AWS Credentials for non-forked repos
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::692859939525:role/therock-artifacts-external
- name: Upload Package repo to S3
id: upload-packages
run: |
echo "Uploading to s3 bucket"
python ./build_tools/packaging/linux/upload_package_repo.py \
--pkg-type deb \
--s3-bucket therock-deb-rpm-test \
--amdgpu-family gfx94X-dcgpu \
--artifact-id ${{ env.ARTIFACT_RUN_ID }}