Skip to content

Commit dc0aff8

Browse files
committed
labs: Add pull-only labs support and demo
Depends-on: kernelci/kernelci-core#3008 This PR implement new runtime, pull-only lab Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent 66149a2 commit dc0aff8

File tree

5 files changed

+112
-1
lines changed

5 files changed

+112
-1
lines changed

config/jobs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ jobs:
132132
baseline-arm: *baseline-job
133133
baseline-arm-broonie: *baseline-job
134134
baseline-arm-testpull: *baseline-job
135+
baseline-arm-pull-labs-demo: *baseline-job
135136
baseline-arm-baylibre: *baseline-job
136137
baseline-arm-clabbe: *baseline-job
137138
baseline-arm-kontron: *baseline-job

config/pipeline.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ runtimes:
162162
callback:
163163
token: kernelci-lab-testpull
164164

165+
pull-labs-demo:
166+
lab_type: pull_labs
167+
poll_interval: 45
168+
timeout: 7200
169+
storage_name: kci-storage
170+
notify:
171+
callback:
172+
token: kernelci-pull-labs-demo
173+
165174
shell:
166175
lab_type: shell
167-

config/scheduler.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ scheduler:
8282
- beaglebone-black
8383
- imx6dl-udoo
8484

85+
- job: baseline-arm-pull-labs-demo
86+
event: *kbuild-gcc-12-arm-node-event
87+
runtime: &pull-labs-demo-runtime
88+
type: pull_labs
89+
name: pull-labs-demo
90+
platforms: &pull-labs-demo-arm
91+
- beaglebone-black
92+
- imx6dl-udoo
93+
8594
- job: baseline-arm-clabbe
8695
event: *kbuild-gcc-12-arm-node-event
8796
runtime: &lava-clabbe-runtime

doc/connecting-pull-lab.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: "Connecting Pull Labs runtime"
3+
date: 2025-02-14
4+
description: "Connecting a PULL_LABS compatible lab to the KernelCI pipeline"
5+
weight: 4
6+
---
7+
8+
KernelCI supports labs that follow the [PULL_LABS protocol](https://github.com/kernelci/kernelci-core/pull/3008) in addition to
9+
LAVA- and Kubernetes-based integrations. This guide shows the minimum
10+
configuration needed to make a lab instance visible to the pipeline.
11+
12+
The examples below mirror the demo entries committed in this repository.
13+
Replace the names and tokens with the values that match your deployment.
14+
15+
## Pipeline configuration
16+
17+
Add a new runtime entry to [`config/pipeline.yaml`](../config/pipeline.yaml)
18+
under the `runtimes` section:
19+
20+
```yaml
21+
pull-labs-demo:
22+
lab_type: pull_labs
23+
poll_interval: 45
24+
timeout: 7200
25+
storage_name: docker-host
26+
notify:
27+
callback:
28+
token: kernelci-pull-labs-demo
29+
```
30+
31+
- `poll_interval` controls how often the lab polls the API for new jobs.
32+
- `timeout` sets the default job timeout in seconds that will be written
33+
into the generated pull-labs job definition.
34+
- `storage_name` must point to a storage backend defined in the same file.
35+
- `notify.callback.token` is the name advertised to the lab so it knows
36+
which callback token value to present when sending back results.
37+
38+
## Scheduler configuration
39+
40+
Declare at least one scheduler entry in
41+
[`config/scheduler.yaml`](../config/scheduler.yaml) that targets the runtime:
42+
43+
```yaml
44+
- job: baseline-arm-pull-labs-demo
45+
event:
46+
channel: node
47+
kind: kbuild
48+
name: kbuild-gcc-12-arm
49+
state: available
50+
runtime:
51+
type: pull_labs
52+
name: pull-labs-demo
53+
platforms:
54+
- beaglebone-black
55+
- imx6dl-udoo
56+
```
57+
58+
The scheduler entry must reference a job defined in `config/jobs.yaml` and
59+
point to a set of existing platforms.
60+
61+
## Jobs
62+
63+
Add or reuse a job definition inside [`config/jobs.yaml`](../config/jobs.yaml):
64+
65+
```yaml
66+
jobs:
67+
baseline-arm-pull-labs-demo: *baseline-job
68+
```
69+
70+
Any template that depends on the runtime name (for example `baseline.jinja2`)
71+
will automatically extend `config/runtime/base/pull_labs.jinja2` from
72+
`kernelci-core` once the scheduler selects a `pull_labs` runtime.
73+
74+
## Runtime secrets
75+
76+
When the lab requires a secret token for callbacks, store the
77+
token value in [`config/kernelci.toml`](../config/kernelci.toml) by adding:
78+
79+
```toml
80+
[runtime.pull-labs-demo]
81+
runtime_token="REPLACE_WITH_CALLBACK_TOKEN_VALUE"
82+
```
83+
84+
The name inside the square brackets must match the runtime name from
85+
`config/pipeline.yaml`.
86+
87+
## Deployment
88+
89+
Ensure the `scheduler` service is started with the `--runtimes pull-labs-demo`
90+
argument in the relevant `docker-compose` file so the new runtime becomes active.
91+
The lab will see the generated events once it authenticates with the callback
92+
token value paired with the token name defined in the pipeline configuration.

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ services:
9292
- 'lava-kontron'
9393
- 'lava-foundriesio'
9494
- 'lava-testpull'
95+
- 'pull-labs-demo'
9596
extra_hosts:
9697
- "host.docker.internal:host-gateway"
9798
healthcheck:

0 commit comments

Comments
 (0)