Skip to content

Adding release test capability #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 17, 2025
21 changes: 11 additions & 10 deletions .github/actions/setup_test_environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
name: "Setup test environment"

inputs:
ARTIFACT_RUN_ID:
VENV_DIR:
type: string
required: true
AMDGPU_FAMILIES:
type: string
OUTPUT_ARTIFACTS_DIR:
type: string
required: true
FETCH_ARTIFACT_ARGS:
ARTIFACT_RUN_ID:
type: string
VENV_DIR:
AMDGPU_FAMILIES:
type: string
required: true
FETCH_ARTIFACT_ARGS:
type: string

runs:
using: "composite"
steps:
- name: Install the AWS tool
shell: bash
run: ./dockerfiles/cpubuilder/install_awscli.sh

- name: "Setting up Python"
id: setup_python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
Expand All @@ -36,6 +33,10 @@ runs:
pip install -r requirements-test.txt
pip freeze

- name: Install the AWS tool
shell: bash
run: ./dockerfiles/cpubuilder/install_awscli.sh

- name: Download and Unpack Artifacts
shell: bash
env:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/portable_linux_package_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
OUTPUT_DIR: ${{ github.workspace }}/output
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64:main
DIST_ARCHIVE: "${{ github.workspace }}/output/therock-dist-linux-${{ matrix.target_bundle.amdgpu_family }}${{ inputs.package_suffix }}-${{ needs.setup_metadata.outputs.version }}.tar.gz"
FILE_NAME: "therock-dist-linux-${{ matrix.target_bundle.amdgpu_family }}${{ inputs.package_suffix }}-${{ needs.setup_metadata.outputs.version }}.tar.gz"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -142,6 +143,13 @@ jobs:
replacesArtifacts: true
makeLatest: false

- name: Trigger test nightly release package workflow
if: ${{ inputs.build_type == 'rc' || inputs.build_type == '' }}
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc #1.2.4
with:
workflow: test_release_packages.yml
inputs: '{ "version": "${{ needs.setup_metadata.outputs.version }}", "tag": "nightly-release", "file_name": "${{ env.FILE_NAME }}", "target": "${{ matrix.target_bundle.amdgpu_family }}" }'

- name: Report
if: ${{ !cancelled() }}
run: |
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/test_release_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Test release packages

on:
workflow_dispatch:
inputs:
version:
type: string
tag:
type: string
file_name:
type: string
target:
type: string

jobs:
generate_target_to_run:
runs-on: ubuntu-24.04
outputs:
test_runs_on: ${{ steps.configure.outputs.test-runs-on }}
steps:
- name: Checking out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Generating target to run
id: configure
env:
TARGET: ${{ inputs.target }}
run: python ./build_tools/configure_target_run.py


test_release_packages:
runs-on: ${{ needs.generate_target_to_run.outputs.test_runs_on }}
needs: generate_target_to_run
permissions:
contents: write
env:
FILE_NAME: ${{ inputs.file_name }}
VENV_DIR: ${{ github.workspace }}/.venv
THEROCK_BIN_DIR: ${{ github.workspace }}/artifacts/output_dir/bin
TAG_NAME: ${{ inputs.tag }}
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Downloading release tag assets to artifacts directory
- name: Download release artifacts
uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
with:
tag: ${{ env.TAG_NAME }}
fileName: ${{ env.FILE_NAME }}
out-file-path: 'artifacts'

- name: Extract tar asset file
run: |
mkdir -p ${{ github.workspace }}/artifacts/output_dir
tar -xf artifacts/${FILE_NAME} -C ${{ github.workspace }}/artifacts/output_dir

- name: Setting up Python
id: setup_python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.11

- name: Create Python venv
run: |
python -m venv ${VENV_DIR}
source ${VENV_DIR}/bin/activate
pip install -r requirements-test.txt

- name: Run Sanity check
if: '!cancelled()'
id: sanity-check
run: |
source ${VENV_DIR}/bin/activate
pytest tests/ \
--log-cli-level=info

- name: Run hipBLASLt tests
if: '!cancelled()'
id: hipblaslt-tests
run: |
source ${VENV_DIR}/bin/activate
${THEROCK_BIN_DIR}/hipblaslt-test --gtest_filter=*pre_checkin*

- name: Run rocBLAS tests
if: '!cancelled()'
id: rocblas-tests
run: |
ROCBLAS_TENSILE_LIBPATH="${THEROCK_BIN_DIR}/lib/rocblas/library/"
source ${VENV_DIR}/bin/activate
${THEROCK_BIN_DIR}/rocblas-test --yaml ${THEROCK_BIN_DIR}/rocblas_smoke.yaml
Comment on lines +78 to +91
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse here what you've recently added to the CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll need to do some rework on both sides to consolidate and share tests, since it seems duplicating

and for these tests, it'll involve some upload/download assets and hopefully that won't be too costly in time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll actually scope this PR to just adding the capability to test, then in a future PR, i'll work on consolidating and combining the test efforts


# Creating a markdown file for testing notes since environment variables cannot be resolved in markdown
- name: Append results to markdown file
if: '!cancelled()'
run: |
echo "" >> ${{ github.workspace }}/test_notes.md
echo "[${{ inputs.version }}] Test results for ${{ env.FILE_NAME }}" >> ${{ github.workspace }}/test_notes.md
echo "* SANITY_CHECK=${{ steps.sanity-check.outcome }}" >> ${{ github.workspace }}/test_notes.md
echo "* HIPBLASLT_CHECK=${{ steps.hipblaslt-tests.outcome }}" >> ${{ github.workspace }}/test_notes.md
echo "* ROCBLAS_CHECK=${{ steps.rocblas-tests.outcome }}" >> ${{ github.workspace }}/test_notes.md

- name: Report test notes to the release body
if: '!cancelled()'
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
tag_name: ${{ env.TAG_NAME }}
append_body: true
body_path: ${{ github.workspace }}/test_notes.md
27 changes: 27 additions & 0 deletions build_tools/configure_target_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
import json
from configure_ci import set_github_output, amdgpu_family_info_matrix

# This file helps configure which target to run

# TODO (geomin12): this is very hard-coded to a very specific use-case.
# Once portable_linux_package_matrix.yml matures, this will mature as well


def main(args):
target = args.get("target")
for key in amdgpu_family_info_matrix.keys():
# If the amdgpu_family matrix key is inside the target (ex: gfx94X in gfx94X-dcgpu)
if key in target:
test_runs_on_machine = (
amdgpu_family_info_matrix.get(key).get("linux").get("test-runs-on")
)
# if there is a test machine available for this target
if test_runs_on_machine:
set_github_output({"test-runs-on": test_runs_on_machine})


if __name__ == "__main__":
args = {}
args["target"] = os.environ.get("TARGET", "")
main(args)
Loading