@@ -294,3 +294,101 @@ nodes when all jobs have daily frequency limits.
294294
295295** Note** : The ` --force ` flag on the trigger service overrides the frequency
296296check, allowing checkout creation regardless of the frequency setting.
297+
298+ ## Runtimes configuration
299+
300+ The ` runtimes ` section defines the runtime environments where jobs are executed.
301+ Each runtime is defined as a dictionary entry with configuration parameters
302+ specific to the runtime type.
303+
304+ Runtimes are defined in ` config/pipeline.yaml ` .
305+
306+ ### Common parameters
307+
308+ - ** lab_type** : string (required) - Type of runtime (` lava ` , ` kubernetes ` , ` docker ` , ` shell ` , ` pull_labs ` )
309+ - ** rules** : dictionary (optional) - Filtering rules for trees/branches
310+
311+ ### LAVA runtime parameters
312+
313+ LAVA runtimes are used to submit test jobs to LAVA labs.
314+
315+ #### Required parameters
316+
317+ - ** lab_type** : ` lava `
318+ - ** url** : string - URL of the LAVA server API (e.g., ` https://lava.example.com/ ` )
319+ - ** notify.callback.token** : string - Token name for LAVA callbacks
320+
321+ #### Optional parameters
322+
323+ - ** priority** : integer or string (` low ` , ` medium ` , ` high ` ) - Job priority (0-100)
324+ - ** priority_min** : integer - Minimum priority level for the lab (0-100)
325+ - ** priority_max** : integer - Maximum priority level for the lab (0-100)
326+ - ** queue_timeout** : dictionary - Timeout for jobs in queue
327+ - ** days** : integer
328+ - ** hours** : integer
329+ - ** max_queue_depth** : integer - Maximum number of queued jobs per device type before skipping new submissions
330+ - ** Default** : 50
331+ - When the queue depth for a device type reaches this limit, new jobs will be skipped
332+ - Jobs are also skipped if no online devices are available for the device type
333+ - ** rules** : dictionary - Tree/branch filtering rules
334+
335+ #### Example
336+
337+ ``` yaml
338+ runtimes :
339+
340+ lava-collabora :
341+ lab_type : lava
342+ url : https://lava.collabora.dev/
343+ priority_min : 40
344+ priority_max : 60
345+ max_queue_depth : 100 # Higher limit for larger lab
346+ notify :
347+ callback :
348+ token : kernelci-api-token
349+ rules :
350+ tree :
351+ - ' !android'
352+
353+ lava-small-lab :
354+ lab_type : lava
355+ url : https://small-lab.example.com/
356+ max_queue_depth : 20 # Lower limit for smaller lab
357+ notify :
358+ callback :
359+ token : small-lab-token
360+ ` ` `
361+
362+ #### Queue depth behavior
363+
364+ The ` max_queue_depth` parameter controls job submission throttling per LAVA lab:
365+
366+ 1. Before submitting a job, the scheduler queries the LAVA API to check :
367+ - If there are online devices for the target device type
368+ - The current number of queued jobs for that device type
369+
370+ 2. The job is **skipped** (not submitted) if :
371+ - No online devices are available for the device type
372+ - The queue depth is >= `max_queue_depth`
373+
374+ 3. When a job is skipped, a log message is generated :
375+ ` ` `
376+ Skipping job <job-name> for <lab-name>: device_type=<type> queue_depth=<N> >= max=<limit>
377+ ` ` `
378+
379+ 4. This helps prevent queue overload in busy labs and avoids submitting jobs
380+ to device types with no available hardware.
381+
382+ # ## LAVA token configuration
383+
384+ LAVA tokens are stored separately in the TOML settings file (`kernelci.toml`),
385+ not in the YAML config :
386+
387+ ` ` ` toml
388+ [runtime.lava-collabora]
389+ runtime_token = "YOUR_LAVA_API_TOKEN"
390+ callback_token = "YOUR_CALLBACK_TOKEN" # Optional, if different from runtime_token
391+ ` ` `
392+
393+ The token **name** (description) goes in the YAML config's `notify.callback.token` field,
394+ while the token **value** (secret) goes in the TOML file.
0 commit comments