Skip to content

Test Linux Packages #40

Test Linux Packages

Test Linux Packages #40

# Copyright 2025 Advanced Micro Devices, Inc.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Test Linux Packages
on:
workflow_dispatch:
inputs:
artifact_run_id:
type: string
default: ""
push:
branches:
- ADHOCBUILD
workflow_call:
jobs:
test_rocm_info:
name: "Sanity ROCM Test"
runs-on: linux-mi300-1gpu-ossci-rocm
strategy:
fail-fast: true
defaults:
run:
shell: bash
env:
VENV_DIR: ${{ github.workspace }}/.venv
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
# MOSTLY BOILER PLATE ABOVE.
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install the AWS tool
run: ./dockerfiles/install_awscli.sh
- name: "Setting up Python"
id: setup_python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Create Python venv
run: |
python -m venv ${VENV_DIR}
source ${VENV_DIR}/bin/activate
pip install -r requirements.txt
- name: Download and Unpack Artifacts
run: |
source ${VENV_DIR}/bin/activate
BUILD_ARTIFACTS_DIR="build/artifacts"
# TODO(sosa): We should infer this from the runner. For Libs and Above it should be based on the
# runner, everything else is generic. Use just generic since this is all core/below.
VARIANT="_generic"
echo "Making ${BUILD_ARTIFACTS_DIR} directory"
mkdir -p "${BUILD_ARTIFACTS_DIR}"
echo "Downloading artifacts"
aws s3 cp s3://therock-artifacts/${ARTIFACT_RUN_ID}/core-runtime_run"${VARIANT}".tar.xz "${BUILD_ARTIFACTS_DIR}" --no-sign-request
aws s3 cp s3://therock-artifacts/${ARTIFACT_RUN_ID}/core-runtime_lib"${VARIANT}".tar.xz "${BUILD_ARTIFACTS_DIR}" --no-sign-request
aws s3 cp s3://therock-artifacts/${ARTIFACT_RUN_ID}/sysdeps_lib"${VARIANT}".tar.xz "${BUILD_ARTIFACTS_DIR}" --no-sign-request
aws s3 cp s3://therock-artifacts/${ARTIFACT_RUN_ID}/base_lib"${VARIANT}".tar.xz "${BUILD_ARTIFACTS_DIR}" --no-sign-request
echo "Unpacking artifacts"
pushd "${BUILD_ARTIFACTS_DIR}"
mkdir output_dir
python ${{ github.workspace }}/build_tools/fileset_tool.py artifact-flatten *.tar.xz -o output_dir --verbose
sudo rsync --archive --keep-dirlinks --verbose output_dir/* /
popd
- name: Run rocminfo
run: |
echo "Running rocminfo"
/bin/rocminfo
- name: Run ROCm Sanity Tests
run: |
source ${VENV_DIR}/bin/activate
pytest tests/ \
--log-cli-level=info