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
7 changes: 7 additions & 0 deletions .github/workflows/portable_linux_package_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,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: '{ "today_date": "${{ needs.setup_metadata.outputs.version }}" }'

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

on:
workflow_dispatch:
inputs:
today_date:
type: string

jobs:
generate_release_matrix:
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure the job need to generate the release matrix to test for itself. This could be an input form the prior job. With this it's also more easy to trigger exactly one run on a specific system and for a specific GPU.

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

- name: Retrieve asset metadata
uses: shadowmoose/Github-Release-Data-Action@7cab39a3e1aab55342775ec65908ba28262a3b39
id: release_json
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: ROCm
repo: TheRock
releaseTag: 'nightly-release'

- name: Generating release matrix
id: configure
env:
ASSET_FILES: ${{ steps.release_json.outputs.data_json }}
TODAY_DATE: ${{ inputs.today_date }}
run: python ./build_tools/configure_release_matrix.py


test_release_packages:
runs-on: ${{ matrix.target.test-runs-on }}
needs: generate_release_matrix
permissions:
contents: write
strategy:
matrix:
target: ${{ fromJSON(needs.generate_release_matrix.outputs.release_matrix) }}
env:
FILE_NAME: ${{ matrix.target.file_name }}
VENV_DIR: ${{ github.workspace }}/.venv
THEROCK_BIN_DIR: ${{ github.workspace }}/artifacts/output_dir/bin
TAG_NAME: 'nightly-release'
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
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.today_date }}] 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
with:
tag_name: ${{ env.TAG_NAME }}
append_body: true
body_path: ${{ github.workspace }}/test_notes.md
28 changes: 28 additions & 0 deletions build_tools/configure_release_matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
import json
from configure_ci import set_github_output, amdgpu_family_info_matrix

# This file helps generate a release test matrix for test_release_packages.yml


def main(args):
assets = json.loads(args.get("asset_files")).get("assets", [])
today_date = args.get("today_date")
release_matrix = []
for asset in assets:
asset_name = asset.get("name", "")
# Test only today's nightly release packages
# for now, we can only run tests on gfx94X since we only have a linux gfx94X test machine
if today_date in asset_name and "gfx94X" in asset_name:
target_info = amdgpu_family_info_matrix.get("gfx94X").get("linux")
target_info["file_name"] = asset_name
release_matrix.append(target_info)

set_github_output({"release_matrix": json.dumps(release_matrix)})


if __name__ == "__main__":
args = {}
args["asset_files"] = os.environ.get("ASSET_FILES", "[]")
args["today_date"] = os.environ.get("TODAY_DATE", "")
main(args)
Loading