canonical-hw-cert team mailing list archive
-
canonical-hw-cert team
-
Mailing list archive
-
Message #46614
[Merge] ~pieq/hwcert-jenkins-jobs:add-kivu-project into hwcert-jenkins-jobs:master
Pierre Equoy has proposed merging ~pieq/hwcert-jenkins-jobs:add-kivu-project into hwcert-jenkins-jobs:master.
Requested reviews:
hwcert-jenkins (hwcert-jenkins)
For more details, see:
https://code.launchpad.net/~pieq/hwcert-jenkins-jobs/+git/hwcert-jenkins-jobs/+merge/434041
Add the Kivu project.
This job should be run on a 12th generation CPU in order to test Chromium Hardware acceleration using the checkbox-kivu-classic snap.
--
Your team hwcert-jenkins is requested to review the proposed merge of ~pieq/hwcert-jenkins-jobs:add-kivu-project into hwcert-jenkins-jobs:master.
diff --git a/jobs/kivu/checkbox.conf b/jobs/kivu/checkbox.conf
new file mode 100644
index 0000000..6fae175
--- /dev/null
+++ b/jobs/kivu/checkbox.conf
@@ -0,0 +1,18 @@
+# Please keep the indents below, for yaml formatting/templating
+ [launcher]
+ launcher_version = 1
+ app_id = com.canonical.certification:kivu-test
+ stock_reports = text, submission_files
+
+ [test plan]
+ unit = com.canonical.certification::kivu-full
+ forced = yes
+
+ [test selection]
+ forced = yes
+
+ [ui]
+ type = silent
+
+ [transport:c3]
+ secure_id = \$HEXR_DEVICE_SECURE_ID
diff --git a/jobs/kivu/kivu-template.yaml b/jobs/kivu/kivu-template.yaml
new file mode 100644
index 0000000..0fb5285
--- /dev/null
+++ b/jobs/kivu/kivu-template.yaml
@@ -0,0 +1,32 @@
+- job-template:
+ name: '{prefix}-kivu-{name}'
+ email: 'pierre.equoy@xxxxxxxxxxxxx'
+ project-type: freestyle
+ description: |
+ Run Kivu tests
+ triggers:
+ - timed: '@daily'
+ wrappers:
+ - timeout:
+ timeout: 400
+ fail: true
+ - ssh-agent-credentials:
+ users:
+ - 'ssh-ce-certification-qa'
+ checkbox_conf:
+ !include-raw-escape: checkbox.conf
+ builders:
+ - shell:
+ !include-raw: run-kivu.sh
+ publishers:
+ - post-tasks:
+ - matches:
+ - log-text: "Build timed out"
+ operator: OR
+ - log-text: "Build was aborted"
+ operator: OR
+ script: |
+ testflinger cancel $(cat JOB_ID)
+ - archive:
+ artifacts: 'artifacts/*'
+ allow-empty: true
diff --git a/jobs/kivu/projects/kivu-xps-12gen.yaml b/jobs/kivu/projects/kivu-xps-12gen.yaml
new file mode 100644
index 0000000..fb80357
--- /dev/null
+++ b/jobs/kivu/projects/kivu-xps-12gen.yaml
@@ -0,0 +1,5 @@
+- project:
+ name: dell-xps-9315-c30061
+ queue: 202203-30061
+ jobs:
+ - '{prefix}-kivu-{name}':
diff --git a/jobs/kivu/run-kivu.sh b/jobs/kivu/run-kivu.sh
new file mode 100644
index 0000000..aeb3727
--- /dev/null
+++ b/jobs/kivu/run-kivu.sh
@@ -0,0 +1,107 @@
+#!/bin/bash
+set +e
+set -x
+
+[ "{no_run}" = "True" ] && exit
+
+cat > job.yaml <<EOF
+ job_queue: {queue}
+ global_timeout: 18000
+ output_timeout: 1200
+ provision_data:
+ distro: desktop-22-04-uefi
+ test_data:
+ {test_data}
+ test_cmds: |
+ set -x
+
+ #!/bin/bash
+ SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
+ _put() {{
+ scp \$SSH_OPTS \$1 {user}@\$DEVICE_IP:\$2
+ }}
+ _get() {{
+ scp \$SSH_OPTS {user}@\$DEVICE_IP:\$1 \$2
+ }}
+ _run() {{
+ ssh -t \$SSH_OPTS {user}@\$DEVICE_IP "\$@"
+ }}
+
+ ## Launcher file
+ cat <<EOF > launcher
+ #!/usr/bin/env checkbox-cli
+ {checkbox_conf}
+ EOF
+
+ # Merge the launcher we downloaded with checkbox.conf
+ python3 -c "import configparser;c=configparser.ConfigParser(delimiters=('=',));c.optionxform=str;c.read('launcher');c.write(open('checkbox-launcher','wt'))"
+
+ mkdir -p artifacts
+ cp checkbox-launcher artifacts
+
+ echo "preparing the system..."
+ _run sudo add-apt-repository -y universe
+ _run sudo apt-get -qq update
+ _run sudo apt-get -qq install -y openssh-server pastebinit intel-gpu-tools intel-media-va-driver-non-free gstreamer1.0-vaapi gstreamer1.0-tools vainfo
+ _run sudo apt-get -qq upgrade -y
+ _run sudo snap install --channel beta/hwacc chromium
+ _run sudo snap install checkbox22
+ _run sudo snap install checkbox-kivu-classic --classic
+
+ echo Starting
+ # DISPLAY=:0 to make sure graphic test jobs were tested expectedly (not necessary in remote)
+ PYTHONUNBUFFERED=1 checkbox-cli remote \$DEVICE_IP checkbox-launcher
+ EXITCODE=\$?
+
+ # will be downloaded over testflinger-cli artifacts later
+ mkdir -p artifacts
+
+ find /home/ubuntu/ -name 'submission_*.junit.xml' -exec mv {{}} artifacts/junit.xml \;
+ find /home/ubuntu/ -name 'submission_*.html' -exec mv {{}} artifacts/submission.html \;
+ find /home/ubuntu/ -name 'submission_*.tar.xz' -exec mv {{}} artifacts/submission.tar.xz \;
+ tar -xf artifacts/submission.tar.xz submission.json
+ mv submission.json artifacts
+ echo "Files in artifacts:"
+ ls artifacts
+EOF
+
+#Remove previous venv
+rm -rf env
+cat <<EOF >build-env.sh
+{build_env}
+EOF
+. build-env.sh
+
+git -C hwcert-jenkins-tools pull -q || (rm -rf hwcert-jenkins-tools && git clone -q https://git.launchpad.net/hwcert-jenkins-tools)
+git -C hwcert-data pull -q || git clone -q git+ssh://ce-certification-qa@xxxxxxxxxxxxxxxxx/~canonical-hw-cert/hwcert-jenkins-jobs/+git/hwcert-data
+
+JOB_ID=$(testflinger submit -q job.yaml)
+echo "JOB_ID: $JOB_ID"
+echo "$JOB_ID" > JOB_ID
+testflinger poll $JOB_ID
+
+TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status)
+
+rm -rf artifacts*
+#retry getting the artifacts after a delay if it fails
+testflinger artifacts $JOB_ID || (sleep 30 && testflinger artifacts $JOB_ID)
+tar -xzf artifacts.tgz
+
+set +x
+if C3LINK=$(testflinger results $JOB_ID |jq -r .test_output|grep -a certification.canonical.com/submissions/status); then
+ echo "Found successful C3 submission link"
+else
+ C3LINK="Failed to find C3 submission link"
+fi
+export C3LINK
+echo $C3LINK > c3link
+set -x
+
+mkdir -p artifacts
+echo "Jenkins build details: $BUILD_URL" > artifacts/summary
+hwcert-jenkins-tools/revcache-job-summary -f hwcert-data/known-test-fails.yaml artifacts/submission.json $JOB_NAME > artifacts/raw_summary
+cat artifacts/raw_summary >> artifacts/summary
+echo >> artifacts/summary
+
+echo "Test exit status: $TEST_STATUS"
+exit $TEST_STATUS
Follow ups