Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4766e66
Temporarily reduce test matrix while developing
motjuste Jun 2, 2025
908ae0e
Trigger snap build and download atrifact
motjuste Jun 2, 2025
9a4a139
Add step to find the downloaded snap
motjuste Jun 3, 2025
e8c8ce5
Refactor step to build job.yaml from template
motjuste Jun 3, 2025
00d236e
Accept built snap in testflinger job-def.yaml
motjuste Jun 3, 2025
f8effaa
Use attached pre-built snap in testflinger job
motjuste Jun 3, 2025
6af8973
Temp disable submitting job to testflinger
motjuste Jun 3, 2025
e0596b4
Remove unused BRANCH env variable
motjuste Jun 3, 2025
554613f
Set path to download artifact in working directory
motjuste Jun 3, 2025
7d29b8b
Make DSS and microk8s channels inputs
motjuste Jun 3, 2025
c9af655
Add summary to each queue in matrix
motjuste Jun 3, 2025
55155b8
Update image url for dell-precision-5680 queue
motjuste Jun 3, 2025
263f209
Re-enable all queues in the matrix
motjuste Jun 3, 2025
2eba347
Add the default launcher for checkbox-dss
motjuste Jun 3, 2025
23bb977
Use launcher in testflinger job
motjuste Jun 3, 2025
536ddf0
Remove validate-with-gpu from checkbox-dss snap
motjuste Jun 3, 2025
c351ede
Fix some misspellings in snapcraft.yaml
motjuste Jun 3, 2025
49bfc3e
Migrate testflinger job to use cert tools
motjuste Jun 3, 2025
c612533
Re-enable submitting job to testflinger
motjuste Jun 3, 2025
0e8f66f
Fix path to built job.yaml
motjuste Jun 3, 2025
3114b3e
Merge branch 'CHECKBOX-1905-use-built-snap-in-dss-workflow' into CHEC…
motjuste Jun 3, 2025
c78e5ed
Remove awaiting rollout of outdated daemonset
motjuste Jun 4, 2025
876158a
Merge branch 'CHECKBOX-1905-use-built-snap-in-dss-workflow' into CHEC…
motjuste Jun 4, 2025
68d795d
Allow SSH to be degraded
motjuste Jun 4, 2025
e59d8ec
Wait for snap changes after each snap install
motjuste Jun 4, 2025
f1917e6
Add running snap refresh
motjuste Jun 4, 2025
449b0d3
Increase sleep time before checking rollout
motjuste Jun 4, 2025
e84f5a1
Switch from using sed to envsubst to fill template
motjuste Jun 6, 2025
242be91
Fix typo in calling envsubst
motjuste Jun 6, 2025
5ac2e50
Merge branch 'CHECKBOX-1905-use-built-snap-in-dss-workflow' into CHEC…
motjuste Jun 6, 2025
ef22ab4
Merge branch 'main' into CHECKBOX-1905-use-cert-tools-in-dss-tf-job
motjuste Jun 6, 2025
b701e89
Switch to ENV_ from REPLACE_ for template params
motjuste Jun 17, 2025
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
13 changes: 7 additions & 6 deletions .github/workflows/testflinger-contrib-dss-regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ jobs:
- name: Build job file from template
id: build-job-file
env:
REPLACE_QUEUE: "${{ matrix.queue.name }}"
REPLACE_PROVISION_DATA: "${{ matrix.queue.provision_data }}"
REPLACE_DSS_CHANNEL: "${{ inputs.dss_channel }}"
REPLACE_MICROK8S_CHANNEL: "${{ inputs.microk8s_channel }}"
REPLACE_CB_DSS_SNAP: "${{ steps.built-snap.outputs.local_path }}"
ENV_QUEUE: "${{ matrix.queue.name }}"
ENV_PROVISION_DATA: "${{ matrix.queue.provision_data }}"
ENV_DSS_CHANNEL: "${{ inputs.dss_channel }}"
ENV_MICROK8S_CHANNEL: "${{ inputs.microk8s_channel }}"
ENV_CB_DSS_SNAP: "${{ steps.built-snap.outputs.local_path }}"
ENV_LAUNCHER: "launchers/checkbox-dss.conf"
run: |
envsubst '$REPLACE_QUEUE $REPLACE_PROVISION_DATA $REPLACE_DSS_CHANNEL $REPLACE_MICROK8S_CHANNEL $REPLACE_CB_DSS_SNAP' \
envsubst '$ENV_QUEUE $ENV_PROVISION_DATA $ENV_DSS_CHANNEL $ENV_MICROK8S_CHANNEL $ENV_CB_DSS_SNAP $ENV_LAUNCHER' \
< testflinger/job-def.yaml > job.yaml
echo "::group::Built job file"
cat job.yaml
Expand Down
5 changes: 3 additions & 2 deletions contrib/checkbox-dss-validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ the appropriate channel name for `--kubectl-snap-channel`.

# Automated Run

To run the test plans:
Use the launcher [`launchers/checkbox-dss.conf`](./launchers/checkbox-dss.conf)
to run the test plan:

```shell
checkbox-dss.validate-with-gpu
checkbox-dss.checkbox-cli control 127.0.0.1 launchers/checkbox-dss.conf
```

# Cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -eou pipefail

check_nvidia_gpu_rollout() {
NAMESPACE="gpu-operator-resources"
sleep 10
sleep 30
kubectl -n "$NAMESPACE" rollout status ds/nvidia-device-plugin-daemonset
sleep 10
kubectl -n "$NAMESPACE" rollout status ds/nvidia-operator-validator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env -S checkbox-cli-wrapper control 127.0.0.1
[launcher]
app_id = com.canonical.contrib.dss-validation:checkbox
launcher_version = 1
Expand Down
9 changes: 3 additions & 6 deletions contrib/checkbox-dss-validation/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ base: core22
# checkbox-cli:
# - checkbox client, can be used to talk to the checkbox daemon
# configure:
# - inject environment variable into checkbox snap environnement
# - inject environment variable into checkbox snap environment
# the variable initial list can be found in config/config_vars
# use configure -l to get the list of the current variables
# For example, a useful use case is to inject environment variable
# to enable debugging output (LIBVA_MESSAGING_LEVEL)
# remote-slave:
# - checkbox slave daemon that will the responsible for running the test sesssion
# - checkbox slave daemon that will the responsible for running the test session
# in the remote fashion (through checkbox-cli)
# shell:
# - give shell access to the provider snap
# install-full-deps:
# - install all depedencies needed for provider jobs
# - install all dependencies needed for provider jobs
# regression-testing:
# - Run the OpenCL regression test suite
apps:
Expand All @@ -35,9 +35,6 @@ apps:
configure:
command-chain: [bin/wrapper_local]
command: bin/configure
validate-with-gpu:
command-chain: [bin/wrapper_local]
command: bin/validate-with-gpu
remote-slave:
command-chain: [bin/wrapper_local]
command: bin/checkbox-cli-wrapper slave
Expand Down
89 changes: 60 additions & 29 deletions contrib/checkbox-dss-validation/testflinger/job-def.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,69 @@
job_queue: $REPLACE_QUEUE
job_queue: $ENV_QUEUE
output_timeout: 1800
provision_data:
$REPLACE_PROVISION_DATA
$ENV_PROVISION_DATA
test_data:
attachments:
- local: $REPLACE_CB_DSS_SNAP
- local: $ENV_CB_DSS_SNAP
- local: $ENV_LAUNCHER
test_cmds: |

# Exit immediately if a test fails
set -e

scp attachments/test/$REPLACE_CB_DSS_SNAP ubuntu@$DEVICE_IP:

# Initial setup
ssh -t ubuntu@$DEVICE_IP '
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
sudo -E apt update
sudo -E apt -y upgrade
sudo -E apt -y install git
'

# Install dependencies
ssh -t ubuntu@$DEVICE_IP '
sudo snap install checkbox22
sudo snap install --dangerous --classic ./$REPLACE_CB_DSS_SNAP
'

# Install test dependencies
ssh -t ubuntu@$DEVICE_IP '
checkbox-dss.install-deps --dss-snap-channel $REPLACE_DSS_CHANNEL --microk8s-snap-channel $REPLACE_MICROK8S_CHANNEL
'

# Run tests
ssh -t ubuntu@$DEVICE_IP '
checkbox-dss.validate-with-gpu
'
# Constants
CHECKBOX_RUNTIME="checkbox22"
RESOURCES_PATH="attachments/test"
TOOLS_PATH=tools

# Retrieve cert-tools
curl -Ls -o install_tools.sh https://raw.githubusercontent.com/canonical/certification-lab-ci-tools/main/install_tools.sh
source install_tools.sh $TOOLS_PATH --branch main

wait_for_ssh --allow-degraded
_run clean_machine --im-sure

_run install_packages git
wait_for_ssh --allow-degraded

# Refresh snaps
_run sudo snap refresh --no-wait
wait_for_snap_changes

# Install runtime and provider on device
echo "Installing checkbox runtime on device (from snap)"
_run sudo snap install $CHECKBOX_RUNTIME --no-wait
wait_for_snap_changes

echo "Installing checkbox-dss snap from attachment"
_put $RESOURCES_PATH/$ENV_CB_DSS_SNAP :
_run sudo snap install --dangerous --classic ./$ENV_CB_DSS_SNAP --no-wait
wait_for_snap_changes

echo "Available snaps on device"
_run sudo snap list

# Restart the checkbox service just in case
_run sudo systemctl restart snap.checkbox-dss.remote-slave.service
check_for_checkbox_service --debug || exit 1

# Sync Checkbox version between agent and device
CHECKBOX_VERSION=$(_run checkbox-dss.checkbox-cli --version)
[ -z "$CHECKBOX_VERSION" ] && echo "Error: Unable to retrieve Checkbox version from device" && exit 1
echo "Installing checkbox $CHECKBOX_VERSION on agent container from source"
install_checkbox_agent_source $CHECKBOX_VERSION $TOOLS_PATH

# Install dependencies on device for running checkbox-dss tests
# XXX:@motjuste: to be moved to Checkbox setup phase
_run wait_for_packages_complete
_run checkbox-dss.install-deps --dss-snap-channel $ENV_DSS_CHANNEL --microk8s-snap-channel $ENV_MICROK8S_CHANNEL
_run wait_for_packages_complete
wait_for_ssh --allow-degraded

# run the test plan
PYTHONUNBUFFERED=1 checkbox-cli control $DEVICE_IP $RESOURCES_PATH/$ENV_LAUNCHER
EXITCODE=$?

# XXX:@motjuste: gather artifacts

exit $EXITCODE
Loading