Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
68 changes: 44 additions & 24 deletions .github/workflows/build_native_linux_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,44 @@ name: Build Native Linux Packages
on:
workflow_call:
inputs:
amdgpu_family:
description: gfx arch for creating the artifact fetch url
artifact_group:
description: gfx arch group for the s3 server
required: true
type: string
default: gfx94X-dcgpu
artifact_run_id:
description: workflow run id to download the artifacts from
description: workflow run id to download the artifacts from.
required: true
type: string
rocm_version:
description: ROCm version to append to the package( Like 8.0.0 or 8.1.0).
description: ROCm version to append to the package(8.0.0, 8.0.1rc1, ... ).
required: true
type: string
package_type:
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(build_no or master or rc or combiantion).
description: The suffix to be added to package name (asan, static or rpath).
required: false
type: string
release_type:
description: The type of build version to produce (nightly, prerelease or dev).
required: false
type: string
workflow_dispatch:
inputs:
amdgpu_family:
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( Like 8.0.0 or 8.1.0)
description: ROCm version to append to the package (8.0.0, 8.0.1rc1, ...).
type: string
default: "0.0.1"
package_type:
native_package_type:
description: Specify whether debian or rpm packages are needed (deb or rpm).
required: true
type: choice
Expand All @@ -43,9 +49,13 @@ on:
- deb
default: "rpm"
package_suffix:
description: The suffix to be added to package name(build_no or master or rc or combiantion).
type: false
default: "test"
description: The suffix to be added to package name (asan, static or rpath).
type: string
required: false
release_type:
description: The type of build version to produce (nightly, prerelease or dev).
required: false
type: string

permissions:
id-token: write
Expand All @@ -60,10 +70,11 @@ jobs:
env:
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:3ac188c17f88f08ce522297b616d8308361b8e9a9b31bcc3c3bbb9429b1efa6c
ARTIFACT_RUN_ID: ${{ inputs.artifact_run_id || github.run_id }}
PACKAGE_SUFFIX: ${{ (inputs.package_suffix || github.event.inputs.package_suffix || 'test') }}.${{ inputs.artifact_run_id || github.run_id }}
PACKAGE_SUFFIX: ${{ inputs.package_suffix != '' && inputs.package_suffix || github.event.inputs.package_suffix != '' && github.event.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 || github.event.inputs.release_type || '' }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
Expand All @@ -88,20 +99,29 @@ jobs:
python ./build_tools/fetch_artifacts.py \
--run-id=${{ env.ARTIFACT_RUN_ID }} \
--run-github-repo="ROCm/TheRock" \
--target=${{ inputs.amdgpu_family }} \
--artifact-group=${{ inputs.artifact_group }} \
--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 ${{ inputs.rocm_version }} \
--target ${{ inputs.amdgpu_family }} \
--artifacts-dir ${{ env.ARTIFACTS_DIR }} \
--pkg-type ${{ inputs.package_type }} \
--version-suffix ${{ env.PACKAGE_SUFFIX }}
echo "Building ${{ inputs.native_package_type }} packages for ${{ inputs.artifact_group }} ${{ inputs.artifact_run_id }}"
if [ -z "$PACKAGE_SUFFIX" ]; then
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 }}
else
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.PACKAGE_SUFFIX }}
fi

- name: Install AWS CLI
run: bash ./dockerfiles/install_awscli.sh
Expand All @@ -117,7 +137,7 @@ jobs:
run: |
echo "Uploading to s3 bucket"
python ./build_tools/packaging/linux/upload_package_repo.py \
--pkg-type ${{ inputs.package_type }} \
--pkg-type ${{ inputs.native_package_type }} \
--s3-bucket therock-deb-rpm-test \
--amdgpu-family ${{ inputs.amdgpu_family }} \
--amdgpu-family ${{ inputs.artifact_group }} \
--artifact-id ${{ env.ARTIFACT_RUN_ID }}
5 changes: 2 additions & 3 deletions .github/workflows/release_native_linux_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ jobs:
name: Release Native Linux Package
strategy:
fail-fast: false

uses: ./.github/workflows/build_native_linux_packages.yml
with:
amdgpu_family: ${{ inputs.amdgpu_family }}
artifact_group: ${{ inputs.amdgpu_family }}
artifact_run_id: ${{ inputs.artifact_run_id }}
rocm_version: ${{ inputs.rocm_version }}
package_type: ${{ inputs.package_type }}
native_package_type: ${{ inputs.package_type }}
package_suffix: ${{ inputs.package_suffix }}
36 changes: 36 additions & 0 deletions .github/workflows/release_portable_linux_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,39 @@ jobs:
with:
path: ${{ env.OUTPUT_DIR }}/caches
key: portable-linux-package-matrix-v1-${{ matrix.target_bundle.amdgpu_family }}-${{ github.sha }}

build_native_rpm_package:
name : Build Native RPM Packages
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
target_bundle: ${{ fromJSON(needs.setup_metadata.outputs.package_targets) }}
uses: ./.github/workflows/build_native_linux_packages.yml
with:
artifact_group: ${{ matrix.target_bundle.amdgpu_family }}
rocm_version: ${{ needs.setup_metadata.outputs.version }}
artifact_run_id: ${{ github.run_id }}
native_package_type: 'rpm'
release_type: ${{ needs.setup_metadata.outputs.release_type }}
needs: [setup_metadata, portable_linux_packages]

build_native_deb_package:
name : Build Native Debian Packages
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
target_bundle: ${{ fromJSON(needs.setup_metadata.outputs.package_targets) }}
uses: ./.github/workflows/build_native_linux_packages.yml
with:
artifact_group: ${{ matrix.target_bundle.amdgpu_family }}
rocm_version: ${{ needs.setup_metadata.outputs.version }}
artifact_run_id: ${{ github.run_id }}
native_package_type: 'deb'
release_type: ${{ needs.setup_metadata.outputs.release_type }}
needs: [setup_metadata, portable_linux_packages]
13 changes: 4 additions & 9 deletions build_tools/packaging/linux/build_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,9 @@ def generate_changelog_file(pkg_info, deb_dir, config: PackageConfig):
name = name_part.strip()
email = email_part.replace(">", "").strip()
# version is used along with package name
version = (
config.rocm_version
+ "."
+ version_to_str(config.rocm_version)
+ "-"
+ config.version_suffix
)
version = str(config.rocm_version)
if config.version_suffix:
version += f"-{str(config.version_suffix)}"

env = Environment(loader=FileSystemLoader(str(SCRIPT_DIR)))
template = env.get_template("template/debian_changelog.j2")
Expand Down Expand Up @@ -457,7 +453,7 @@ def generate_spec_file(pkg_name, specfile, config: PackageConfig):

pkginfo = get_package_info(pkg_name)
# populate packge version details
version = f"{config.rocm_version}.{version_to_str(config.rocm_version)}"
version = f"{config.rocm_version}"
# TBD: Whether to use component version details?
# version = pkginfo.get("Version")

Expand Down Expand Up @@ -875,7 +871,6 @@ def main(argv: list[str]):
p.add_argument(
"--version-suffix",
type=str,
required=True,
help="Version suffix to append to package names",
)

Expand Down
Loading