Skip to content

Commit

Permalink
Add hardware schema for GPU
Browse files Browse the repository at this point in the history
To be able to select machines according to the graphics card introduce
the `gpu` key under `hardware`.

According to discussion, use for now only `product` and `vendor` names
to be available for filtering, those can be easily detected using the
command:

```
lshw -C display
```

Resolves #2154

Signed-off-by: Miroslav Vadkerti <[email protected]>
  • Loading branch information
thrix authored and psss committed Oct 31, 2023
1 parent 7552550 commit 83018c1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/hardware/gpu.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary:
Choose system according to the available graphics processing unit (gpu)
example:
- |
# GPU-related stuff grouped together.
gpu:
# GPU device name name.
device-name: G86 [Quadro NVS 290]
# GPU vendor name.
vendor-name: NVIDIA Corporation

# NOTE: not yet supported
# link:
# - implemented-by: /tmt/steps/provision/artemis.py
2 changes: 2 additions & 0 deletions tests/unit/test_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def test_parse_maximal_constraint() -> None:
disk:
- size: 40 GiB
- size: 120 GiB
gpu:
device-name: G86 [Quadro NVS 290]
hostname: "~ .*.foo.redhat.com"
memory: 8 GiB
network:
Expand Down
20 changes: 20 additions & 0 deletions tmt/schemas/provision/hardware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,23 @@ definitions:
items:
"$ref": "#/definitions/disk"

# HW requirements: single `gpu` item
gpu:
type: object

properties:
device-name:
type: string

vendor-name:
type: string

additionalProperties: false

# enforce at least one property - we don't care which one, but we don't want
# empty `gpu`.
minProperties: 1

hostname:
type: string

Expand Down Expand Up @@ -273,6 +290,9 @@ definitions:
disk:
"$ref": "#/definitions/disks"

gpu:
"$ref": "#/definitions/gpu"

hostname:
"$ref": "#/definitions/hostname"

Expand Down

0 comments on commit 83018c1

Please sign in to comment.