Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
205 changes: 181 additions & 24 deletions .github/workflows/test-ais-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ env:
AIS_INPUT_PLATFORM: ${{ inputs.platform }}
AIS_INPUT_ROCM_VERSION: ${{ inputs.rocm_version }}
AIS_MOUNT_PATH: /mnt/ais/ext4
AIS_PKG_INSTALL_CMD: >-
${{
case(
inputs.platform == 'rocky', 'dnf install -y',
inputs.platform == 'suse', 'zypper install -y --allow-unsigned-rpm',
inputs.platform == 'ubuntu', 'apt update; apt install -y',
''
)
}}
AIS_PKG_MGR: >-
${{
inputs.platform == 'rocky' && 'dnf' ||
Expand Down Expand Up @@ -49,12 +58,6 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
path: hipFile
- name: Fetching fio repository...
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
repository: ROCm/fio
ref: hipFile
path: fio
- name: Download hipFile runtime package
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
Expand Down Expand Up @@ -101,7 +104,6 @@ jobs:
/bin/bash -c '
cp -R /mnt/ais /ais
mkdir /ais/hipFile/build
mkdir /ais/fio/build
'
- name: Copy the hipFile packages into the container
run: |
Expand Down Expand Up @@ -182,29 +184,184 @@ jobs:
/ais/hipFile/util/ci-aiscp-test.sh \
/ais/hipFile/build/examples/aiscp/aiscp
'
- name: Configure fio
- name: Destroy hipfile IO test directory
if: ${{ always() }}
run: |
docker exec -t "${AIS_CONTAINER_NAME}" /bin/bash -c "rm -fr /mnt/ais-fs/${AIS_CONTAINER_NAME}"
- name: Cleanup & Stop the Docker container
if: ${{ always() }}
run: |
docker stop "${AIS_CONTAINER_NAME}"
- name: Cleanup self-hosted runner workspace
if: ${{ always() }}
run: rm -rf ${GITHUB_WORKSPACE}/* ${GITHUB_WORKSPACE}/.[!.]* ${GITHUB_WORKSPACE}/..?*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be simpler to set dotglob here?

              dotglob If set, bash includes filenames beginning with a `.' in the
                      results of pathname expansion.  The  filenames  ``.''   and
                      ``..''   must always be matched explicitly, even if dotglob
                      is set.

Then I think rm -rf ${GITHUB_WORKSPACE}/* should work.

build_FIO:
uses: ROCm/fio/.github/workflows/build-fio.yml@rildixon/ci-hook-for-hipfile
with:
ais_hipfile_pkg_filename: ${{ inputs.ais_hipfile_pkg_filename }}
ais_hipfile_pkg_dev_filename: ${{ inputs.ais_hipfile_pkg_dev_filename }}
platform: ${{ inputs.platform }}
run_FIO_tests:
runs-on: [linux, AIS]
needs: [build_FIO]
steps:
- name: Set early AIS CI environment variables
run: echo "AIS_PR_NUMBER=$(echo ${{ github.ref }} | sed 's|[^0-9]||g')" >> "${GITHUB_ENV}"
- name: Set AIS CI container name
run: |
echo "AIS_CONTAINER_NAME=${AIS_PR_NUMBER}_${{ github.job }}_${AIS_INPUT_PLATFORM}_${AIS_INPUT_ROCM_VERSION}" >> "${GITHUB_ENV}"
# hipFile repo needed for //util directory
- name: Fetching hipFile repository...
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
path: hipFile
- name: Download hipFile runtime package
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
name: ${{ inputs.ais_hipfile_pkg_filename }}
- name: Download hipFile development package
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
name: ${{ inputs.ais_hipfile_pkg_dev_filename }}
- name: Download FIO runtime package
# Fedora-based distro's need to download multiple packages as the FIO IO engines
# are dynamically linked instead of built into the FIO executable.
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
artifact-ids: >-
${{
case(
inputs.platform == 'rocky',
format(
'{0},{1}',
needs.build_FIO.outputs.fio_pkg_fedora_artifact_id,
needs.build_FIO.outputs.fio_pkg_fedora_hipfile_engine_artifact_id
),
inputs.platform == 'suse', needs.build_FIO.outputs.fio_pkg_suse_artifact_id,
inputs.platform == 'ubuntu', needs.build_FIO.outputs.fio_pkg_debian_artifact_id,
format('Platform "{0}" is not supported by build_FIO.', inputs.platform)
)
}}
merge-multiple: true
- name: Authenticating to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 #v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Starting Docker Container
run: |
docker run \
-dt \
--rm \
--device=/dev/kfd \
--device=/dev/dri \
--security-opt seccomp=unconfined \
--pull always \
-v ${GITHUB_WORKSPACE}:/mnt/ais:ro \
-v "${AIS_MOUNT_PATH}:/mnt/ais-fs" \
--name "${AIS_CONTAINER_NAME}" \
"${AIS_INPUT_CI_IMAGE}"
- name: Create hipfile IO test directory
run: |
docker exec -t "${AIS_CONTAINER_NAME}" /bin/bash -c "mkdir -p /mnt/ais-fs/${AIS_CONTAINER_NAME}"
- name: Copy the hipFile packages into the container
run: |
docker cp \
"${GITHUB_WORKSPACE}/${AIS_INPUT_HIPFILE_PKG_FILENAME}" \
"${AIS_CONTAINER_NAME}:/root"
docker cp \
"${GITHUB_WORKSPACE}/${AIS_INPUT_HIPFILE_PKG_DEV_FILENAME}" \
"${AIS_CONTAINER_NAME}:/root"
- name: Install the hipFile packages
# Note: We need to re-run the `ldconfig` post-install step.
# This really should just be done automatically by the ROCm package.
run: |
docker exec \
-t \
-w /ais/fio/build \
-w /root \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
ROCM=/opt/rocm-${ROCM_VERSION} \
HIPFILE=/ais/hipFile \
HIPFILELIB=${HIPFILE}/build/src/amd_detail/ \
HIP_PLATFORM=amd \
CFLAGS="-I${ROCM}/include" \
LDFLAGS="-L${ROCM}/lib -Wl,-rpath,${ROCM}/lib" \
../configure --enable-libhipfile
${{
format(
env.AIS_PKG_MGR == 'apt' && 'apt update; apt install -y "./{0}" "./{1}"' ||
env.AIS_PKG_MGR == 'dnf' && 'dnf install -y --cacheonly "./{0}" "./{1}"' ||
env.AIS_PKG_MGR == 'zypper' && 'zypper --no-refresh install -y --allow-unsigned-rpm "./{0}" "./{1}"' ||
'echo "Unknown platform."; exit 1',
inputs.ais_hipfile_pkg_filename,
inputs.ais_hipfile_pkg_dev_filename
)
}}
ldconfig
'
- name: Build fio
- name: Copy the FIO packages into the container
env:
FIO_RUNTIME_PKG_FILENAME: >-
${{
case(
inputs.platform == 'rocky', needs.build_FIO.outputs.fio_pkg_fedora_filename,
inputs.platform == 'suse', needs.build_FIO.outputs.fio_pkg_suse_filename,
inputs.platform == 'ubuntu', needs.build_FIO.outputs.fio_pkg_debian_filename,
''
)
}}
FIO_HIPFILE_ENGINE_PKG_FILENAME: >-
${{
case(
inputs.platform == 'rocky', needs.build_FIO.outputs.fio_pkg_fedora_hipfile_engine_filename,
''
)
}}
run: |
docker cp \
"${GITHUB_WORKSPACE}/${FIO_RUNTIME_PKG_FILENAME}" \
"${AIS_CONTAINER_NAME}:/root"
${{
case(
inputs.platform == 'rocky',
'docker cp \
"${GITHUB_WORKSPACE}/${FIO_HIPFILE_ENGINE_PKG_FILENAME}" \
"${AIS_CONTAINER_NAME}:/root"
',
''
)
}}
Comment on lines +319 to +328
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Using ${{ ... }} to inject a multi-line shell fragment (the conditional docker cp for Rocky) makes the run script hard to reason about and depends on the (likely unsupported) case(...) expression. Prefer a separate step with if: inputs.platform == 'rocky' for the second package copy, or do the conditional inside bash.

Suggested change
${{
case(
inputs.platform == 'rocky',
'docker cp \
"${GITHUB_WORKSPACE}/${FIO_HIPFILE_ENGINE_PKG_FILENAME}" \
"${AIS_CONTAINER_NAME}:/root"
',
''
)
}}
- name: Copy the FIO hipFile engine package into the container (rocky only)
if: inputs.platform == 'rocky'
run: |
docker cp \
"${GITHUB_WORKSPACE}/${{ needs.build_FIO.outputs.fio_pkg_fedora_hipfile_engine_filename }}" \
"${AIS_CONTAINER_NAME}:/root"

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll change this if any humans agree with this take. I think running this copy in a single step looks better from a CI summary perspective.

- name: Install the FIO packages
env:
FIO_RUNTIME_PKG_FILENAME: >-
${{
case(
inputs.platform == 'rocky', needs.build_FIO.outputs.fio_pkg_fedora_filename,
inputs.platform == 'suse', needs.build_FIO.outputs.fio_pkg_suse_filename,
inputs.platform == 'ubuntu', needs.build_FIO.outputs.fio_pkg_debian_filename,
''
)
}}
FIO_HIPFILE_ENGINE_PKG_FILENAME: >-
${{
case(
inputs.platform == 'rocky', needs.build_FIO.outputs.fio_pkg_fedora_hipfile_engine_filename,
''
)
}}
run: |
docker exec \
-t \
-w /ais/fio/build \
-w /root \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
make -j
ls -al
${{
format(
'{0} {1}',
env.AIS_PKG_INSTALL_CMD,
case(
inputs.platform == 'rocky',
format('./{0} ./{1}', env.FIO_RUNTIME_PKG_FILENAME, env.FIO_HIPFILE_ENGINE_PKG_FILENAME),
format('./{0}', env.FIO_RUNTIME_PKG_FILENAME)
)
)
}}
'
- name: hipFile fallback/POSIX IO test using fio
run: |
Expand All @@ -214,8 +371,8 @@ jobs:
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
HIPFILE_FORCE_COMPAT_MODE=true \
/ais/fio/build/fio \
/ais/hipFile/util/fio/write-read-verify.fio
fio \
/mnt/ais/hipFile/util/fio/write-read-verify.fio
'
- name: hipFile AIS IO test using fio
run: |
Expand All @@ -225,8 +382,8 @@ jobs:
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
HIPFILE_ALLOW_COMPAT_MODE=false \
/ais/fio/build/fio \
/ais/hipFile/util/fio/write-read-verify.fio
fio \
/mnt/ais/hipFile/util/fio/write-read-verify.fio
'
- name: Destroy hipfile IO test directory
if: ${{ always() }}
Expand All @@ -238,4 +395,4 @@ jobs:
docker stop "${AIS_CONTAINER_NAME}"
- name: Cleanup self-hosted runner workspace
if: ${{ always() }}
run: rm -rf ${GITHUB_WORKSPACE}/* ${GITHUB_WORKSPACE}/.*
run: rm -rf ${GITHUB_WORKSPACE}/* ${GITHUB_WORKSPACE}/.[!.]* ${GITHUB_WORKSPACE}/..?*
14 changes: 14 additions & 0 deletions cmake/AISInstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ set(CPACK_PACKAGE_RELOCATABLE OFF)
set(CPACK_RPM_PACKAGE_RELOCATABLE OFF)
set(CPACK_DEB_PACKAGE_RELOCATABLE OFF)

# Some RPMs set dependencies on a library automatically instead
# of a manually defined package name via the AutoRequires &
# AutoProvides RPM features.
# ROCmCreatePackage however disables AUTOREQPROV by default.
# The RPM spec does not clearly state how setting AUTOREPROV &
# AUTOREQ / AUTOPROV to different values behaves. On observation,
# AUTOREQPROV supersedes the others and continues the build.
# Ref: https://ftp.rpm.org/max-rpm/s1-rpm-specref-preamble.html#S3-RPM-SPECREF-AUTOREQPROV
set(CPACK_RPM_PACKAGE_AUTOREQPROV "") # Intentionally set to an empty value so ROCmCreatePackage treats it as defined and does not override it.
set(CPACK_RPM_PACKAGE_AUTOPROV ON)
set(CPACK_RPM_PACKAGE_AUTOREQ OFF)
# Alternatively, we could set CPACK_RPM_PACKAGE_PROVIDES,
# but then we would have to maintain it...

# Set DEB/RPM Release Information
# rocm_create_package checks if following variables are defined in the environment:
# - CPACK_DEBIAN_PACKAGE_RELEASE
Expand Down
Loading