Skip to content

Commit

Permalink
Add and start using utils.boot_test
Browse files Browse the repository at this point in the history
Signed-off-by: Henri Rosten <[email protected]>
  • Loading branch information
henrirosten committed Jun 26, 2024
1 parent 207825b commit ad2e678
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
17 changes: 2 additions & 15 deletions ghaf-main-pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,9 @@ pipeline {
steps {
dir(WORKDIR) {
script {
imgdir = utils.find_img_relpath('.#packages.aarch64-linux.nvidia-jetson-orin-agx-debug', 'archive')
remote_path = "artifacts/${env.ARTIFACTS_REMOTE_PATH}"
jenkins_url = "https://ghaf-jenkins-controller-dev.northeurope.cloudapp.azure.com"
img_url = "${jenkins_url}/${remote_path}/${imgdir}"
// Trigger a build in 'ghaf-test-boot' pipeline.
// 'build' step is documented in https://plugins.jenkins.io/pipeline-build-step/
build(
job: "ghaf-test-boot",
propagate: true,
parameters: [
string(name: "LABEL", value: "testagent"),
string(name: "DEVICE_CONFIG_NAME", value: "orin-agx"),
string(name: "IMG_URL", value: "$img_url"),
],
wait: true,
)
utils.boot_test('.#packages.x86_64-linux.nvidia-jetson-orin-agx-debug-from-x86_64', 'orin-agx', jenkins_url)
utils.boot_test('.#packages.aarch64-linux.nvidia-jetson-orin-agx-debug', 'orin-agx', jenkins_url)
}
}
}
Expand Down
33 changes: 31 additions & 2 deletions utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def archive_artifacts(String subdir) {
currentBuild.description = "<a href=\"${href}\">📦 Artifacts</a>"
}

def purge_stash(String remote_path) {
def purge_artifacts(String remote_path) {
if (!remote_path) {
println "Warning: skipping stash purge, remote_path not set"
println "Warning: skipping artifacts purge, remote_path not set"
return
}
run_rclone("purge :webdav:/${remote_path}")
Expand Down Expand Up @@ -147,6 +147,35 @@ def find_img_relpath(String flakeref, String subdir) {
return img_relpath
}

def boot_test(String flakeref, String device_config, String jenkins_url, String subdir='archive') {
testagent_nodes = nodesByLabel(label: 'testagent', offline: false)
if (!testagent_nodes) {
println "Warning: Skipping boot test '$flakeref', no test agents online"
unstable("No test agents online")
return
}
if (!env.ARTIFACTS_REMOTE_PATH) {
println "Warning: skipping boot_test '$flakeref', ARTIFACTS_REMOTE_PATH not set"
return
}
// Compose the image URL; testagent will need this URL to download the image
imgdir = find_img_relpath(flakeref, subdir)
remote_path = "artifacts/${env.ARTIFACTS_REMOTE_PATH}"
img_url = "${jenkins_url}/${remote_path}/${imgdir}"
// Trigger a build in 'ghaf-test-boot' pipeline.
// 'build' step is documented in https://plugins.jenkins.io/pipeline-build-step/
build(
job: "ghaf-test-boot",
propagate: true,
parameters: [
string(name: "LABEL", value: "testagent"),
string(name: "DEVICE_CONFIG_NAME", value: "$device_config"),
string(name: "IMG_URL", value: "$img_url"),
],
wait: true,
)
}

return this

////////////////////////////////////////////////////////////////////////////////

0 comments on commit ad2e678

Please sign in to comment.