|
| 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. |
0 commit comments