Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/testflinger-contrib-dss-regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ jobs:
ENV_LAUNCHER: "launchers/checkbox-dss.conf"
ENV_KUBECTL_CHANNEL: "${{ inputs.kubectl_channel }}"
run: |
envsubst '$ENV_DSS_CHANNEL $ENV_KUBECTL_CHANNEL' \
envsubst '$ENV_DSS_CHANNEL $ENV_KUBECTL_CHANNEL $ENV_MICROK8S_CHANNEL' \
< testflinger/setup-def.conf > setup.conf
echo "::group::Built setup launcher"
cat setup.conf
echo "::endgroup::"

export ENV_SETUP_LAUNCHER=setup.conf

envsubst '$ENV_QUEUE $ENV_PROVISION_DATA $ENV_MICROK8S_CHANNEL $ENV_CB_DSS_SNAP $ENV_LAUNCHER $ENV_SETUP_LAUNCHER' \
envsubst '$ENV_QUEUE $ENV_PROVISION_DATA $ENV_CB_DSS_SNAP $ENV_LAUNCHER $ENV_SETUP_LAUNCHER' \
< testflinger/job-def.yaml > job.yaml
echo "::group::Built job file"
cat job.yaml
Expand Down
25 changes: 2 additions & 23 deletions contrib/checkbox-dss-validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,7 @@ systemctl status snap.checkbox-dss.remote-slave.service

> [!NOTE]
> We are migrating to using `setup_include` from Checkbox.
> While it is not available, installing dependencies is currently a 2 stage process.
> Most importantly, the `install-deps` **will soon be removed**.

## `microk8s`

Run the helper script `install-deps` as shown below:

```shell
checkbox-dss.install-deps
```

By default this will install `microk8s` from `1.28/stable` in classic mode,
but this can be customized as
(please note that this snap must to be `--classic` to enable GPU support):

```shell
checkbox-dss.install-deps --microk8s-snap-channel 1.31/stable
```

## `data-science-stack`, `kubectl`, and `intel-gpu-tools`

> [!NOTE]
> This step will become unnecessary once we can use `setup_include` from Checkbox.
> While it is not available, installing dependencies is currently done in a separate test plan.

Run Checkbox CLI with the setup launcher:

Expand All @@ -66,6 +44,7 @@ checkbox-dss.checkbox-cli control 127.0.0.1 launchers/setup.conf

By default it will attempt to install the following:

- `microk8s` snap from channel `1.28/stable` in `--classic` mode
- `data-science-stack` snap from channel `1.0/stable`
- `kubectl` snap from `1.29/stable`
- `intel-gpu-tools` package
Expand Down
62 changes: 0 additions & 62 deletions contrib/checkbox-dss-validation/bin/install-deps

This file was deleted.

53 changes: 0 additions & 53 deletions contrib/checkbox-dss-validation/bin/install-full-deps

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ flags: simple
imports: from com.canonical.certification import executable
requires:
executable.name == 'dss'
executable.name == 'microk8s'
_summary: Check that the DSS environment initializes
estimated_duration: 2m
command:
set -eo pipefail
KUBECONFIG="$(cat ~/.kube/config)"
run_dss.sh initialize --kubeconfig "$KUBECONFIG"
KUBE_CONFIG="$(cat ~/.kube/config)"
run_dss.sh initialize --kubeconfig "$KUBE_CONFIG"

id: dss/namespace
category_id: dss-regress
Expand Down Expand Up @@ -145,8 +144,8 @@ imports: from com.canonical.certification import executable
requires: executable.name == 'dss'
depends: dss/status_intel_gpu
_summary: Check that a Tensorflow Intel notebook can be successfully created
estimated_duration: 5m
command: timeout 5m run_dss.sh create tensorflow-intel --image=tensorflow-intel
estimated_duration: 10m
command: timeout 10m run_dss.sh create tensorflow-intel --image=tensorflow-intel

id: xpu/tensorflow_can_use_xpu
category_id: dss-regress
Expand Down Expand Up @@ -216,7 +215,7 @@ estimated_duration: 10m
command:
set -eou pipefail
OPERATOR_VERSION="24.6.2"
microk8s enable gpu --driver=operator --version="${OPERATOR_VERSION}"
sudo microk8s enable gpu --driver=operator --version="${OPERATOR_VERSION}"
check_gpu_rollout.sh nvidia

id: nvidia_gpu_addon/validations_succeed
Expand Down Expand Up @@ -282,8 +281,8 @@ imports: from com.canonical.certification import executable
requires: executable.name == 'dss'
depends: dss/status_nvidia_gpu
_summary: Check that an Tensorflow CUDA notebook can be successfully created
estimated_duration: 5m
command: timeout 5m run_dss.sh create tensorflow-cuda --image=tensorflow-cuda
estimated_duration: 10m
command: timeout 10m run_dss.sh create tensorflow-cuda --image=tensorflow-cuda

id: cuda/tensorflow_can_use_cuda
category_id: dss-regress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ estimated_duration: 2m
command:
sudo snap install data-science-stack --channel="${SETUP_DSS_CHANNEL}"

id: setup_dss/install_snap_microk8s
category_id: setup-dss-regress
flags: simple
_summary: Install Snap microk8s with classic confinement (classic for GPU support)
estimated_duration: 2m
command:
sudo snap install microk8s --classic --channel="${SETUP_MICROK8S_CHANNEL}"

id: setup_dss/install_package_intel-gpu-tools
category_id: setup-dss-regress
flags: simple
Expand All @@ -22,3 +30,36 @@ estimated_duration: 2m
command:
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \
apt-get install -y intel-gpu-tools

id: setup_dss/enable_microk8s_addons
category_id: setup-dss-regress
depends: setup_dss/install_snap_microk8s
flags: simple
_summary: Enable required microk8s addons
estimated_duration: 10m
command:
set -e
timeout 5m sudo microk8s status --wait-ready
timeout 2m sudo microk8s enable hostpath-storage
timeout 2m sudo microk8s enable dns
timeout 2m sudo microk8s enable rbac
sudo microk8s.kubectl wait --timeout 120s \
--for=condition=available \
-n kube-system deployment/coredns deployment/hostpath-provisioner
timeout 2m sudo microk8s.kubectl -n kube-system rollout status ds/calico-node
timeout 5m sudo microk8s status --wait-ready

id: setup_dss/write_microk8s_kube_config
category_id: setup-dss-regress
depends: setup_dss/enable_microk8s_addons
flags: simple
_summary: Write out the kubeconfig for the microk8s cluster
estimated_duration: 2s
command:
set -e
destination_dir="${HOME}/.kube"
mkdir -p "${destination_dir}"
destination="${destination_dir}/config"
# hack as redirecting stdout anywhere but /dev/null throws a permission denied error
# see: https://forum.snapcraft.io/t/eksctl-cannot-write-to-stdout/17254/4
sudo microk8s.kubectl config view --raw | tee "$destination" >/dev/null
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ _name: Setup to run DSS validations
include:
setup_dss/install_snap_.*
setup_dss/install_package_.*
setup_dss/enable_microk8s_addons
setup_dss/write_microk8s_kube_config

id: dss-validation
unit: test plan
Expand Down
1 change: 1 addition & 0 deletions contrib/checkbox-dss-validation/launchers/setup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ auto_retry = no
[environment]
SETUP_KUBECTL_CHANNEL="1.29/stable"
SETUP_DSS_CHANNEL="1.0/stable"
SETUP_MICROK8S_CHANNEL="1.28/stable"
6 changes: 0 additions & 6 deletions contrib/checkbox-dss-validation/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ base: core22
# in the remote fashion (through checkbox-cli)
# shell:
# - give shell access to the provider snap
# install-full-deps:
# - install all dependencies needed for provider jobs
# regression-testing:
# - Run the OpenCL regression test suite
apps:
checkbox-cli:
command-chain: [bin/wrapper_local]
Expand All @@ -43,8 +39,6 @@ apps:
shell:
command-chain: [bin/wrapper_local]
command: bin/shell-wrapper
install-deps:
command: bin/install-deps
remove-deps:
command: bin/remove-deps

Expand Down
7 changes: 0 additions & 7 deletions contrib/checkbox-dss-validation/testflinger/job-def.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ test_data:
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 --microk8s-snap-channel $ENV_MICROK8S_CHANNEL
_run wait_for_packages_complete
wait_for_ssh --allow-degraded

# run the setup test plan
# XXX:@motjuste: will be part of main test plan when setup_include is available
PYTHONUNBUFFERED=1 checkbox-cli control $DEVICE_IP $RESOURCES_PATH/$ENV_SETUP_LAUNCHER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ auto_retry = no
[environment]
SETUP_KUBECTL_CHANNEL="$ENV_KUBECTL_CHANNEL"
SETUP_DSS_CHANNEL="$ENV_DSS_CHANNEL"
SETUP_MICROK8S_CHANNEL="$ENV_MICROK8S_CHANNEL"
Loading