Files
TheRock/rocm-libraries/projects/hipblas/.jenkins/common.groovy
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

138 lines
4.5 KiB
Groovy

// This file is for internal AMD use.
// If you are interested in running your own Jenkins, please raise a github issue for assistance.
def runCompileCommand(platform, project, jobName, boolean sameOrg=false)
{
def getDependenciesCommand = ""
if (project.installLibraryDependenciesFromCI)
{
project.libraryDependencies.each
{ libraryName ->
getDependenciesCommand += auxiliary.getLibrary(libraryName, platform.jenkinsLabel, null, sameOrg)
}
}
if (env.BRANCH_NAME ==~ /PR-\d+/)
{
if (pullRequest.labels.contains("noSolver"))
{
project.paths.build_command = project.paths.build_command.replaceAll(' -c', ' -cn')
}
if (pullRequest.labels.contains("debug"))
{
project.paths.build_command = project.paths.build_command.replaceAll(' -c', ' -cg')
}
}
String centos = platform.jenkinsLabel.contains('centos7') ? 'source scl_source enable devtoolset-7' : ':'
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
${getDependenciesCommand}
${centos}
${project.paths.build_command}
"""
platform.runCommand(this, command)
}
def runTestCommand (platform, project)
{
String sudo = auxiliary.sudo(platform.jenkinsLabel)
String stagingDir = "${project.paths.project_build_prefix}/build/release/clients/staging"
if (env.BRANCH_NAME ==~ /PR-\d+/)
{
if (pullRequest.labels.contains("debug"))
{
stagingDir = "${project.paths.project_build_prefix}/build/debug/clients/staging"
}
}
String gtestCommonEnv = "HIPBLAS_CLIENT_RAM_GB_LIMIT=95 GTEST_LISTENER=NO_PASS_LINE_IN_LOG"
def command = """#!/usr/bin/env bash
set -x
pushd ${stagingDir}
${gtestCommonEnv} ./hipblas-test --gtest_output=xml --gtest_color=yes
popd
"""
platform.runCommand(this, command)
def yamlTestCommand = """#!/usr/bin/env bash
set -x
pushd ${stagingDir}
${gtestCommonEnv} ./hipblas-test --gtest_output=xml --gtest_color=yes --yaml hipblas_smoke.yaml
popd
"""
platform.runCommand(this, yamlTestCommand)
}
def runCoverageCommand (platform, project, String cmdDir = "release-debug")
{
//Temporary workaround due to bug in container
String centos7Workaround = platform.jenkinsLabel.contains('centos7') ? 'export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/rocm/lib64/' : ''
String gtestCommonEnv = "HIPBLAS_CLIENT_RAM_GB_LIMIT=95 GTEST_LISTENER=NO_PASS_LINE_IN_LOG"
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build/${cmdDir}
export LD_LIBRARY_PATH=/opt/rocm/lib/
${centos7Workaround}
${gtestCommonEnv} make coverage_cleanup coverage GTEST_FILTER=-*known_bug*
"""
platform.runCommand(this, command)
publishHTML([allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: "${project.paths.project_build_prefix}/build/${cmdDir}/coverage-report",
reportFiles: "index.html",
reportName: "Code coverage report",
reportTitles: "Code coverage report"])
}
def runPackageCommand(platform, project, jobName, label='', buildDir='')
{
def command
label = label != '' ? '-' + label.toLowerCase() : ''
String ext = platform.jenkinsLabel.contains('ubuntu') ? "deb" : "rpm"
String dir = jobName.contains('Debug') ? "debug" : "release"
if (env.BRANCH_NAME ==~ /PR-\d+/)
{
if (pullRequest.labels.contains("debug"))
{
dir = "debug"
}
}
if (buildDir != '')
{
dir = buildDir
}
command = """
set -x
cd ${project.paths.project_build_prefix}/build/${dir}
make package
mkdir -p package
if [ ! -z "$label" ]
then
for f in hipblas*.$ext
do
mv "\$f" "hipblas${label}-\${f#*-}"
done
fi
mv *.${ext} package/
"""
platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/${dir}/package/*.${ext}""")
}
return this