-
Notifications
You must be signed in to change notification settings - Fork 167
Specification for reusable hardware configurations #4833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+97
−0
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| summary: | | ||
| Reference predefined hardware configurations from external preset files. | ||
|
|
||
| description: | | ||
| .. code-block:: yaml | ||
|
|
||
| provision: | ||
| hardware: | ||
| import-preset: | ||
| - https://github.com/my-team/project/presets.yaml | ||
| - file:///home/user/config/tmt/presets.yaml | ||
| - ~/.config/tmt/presets.yaml | ||
| preset: BIG_MEMORY | ||
| cpu: | ||
| model: 97 | ||
|
|
||
| In the example above, both the ``BIG_MEMORY`` preset and the | ||
| ``cpu.model: 97`` constraint must be satisfied — sibling keys under | ||
| ``hardware`` are combined with implicit ``and`` glue. | ||
|
|
||
| Rules: | ||
|
|
||
| * ``import-preset`` is allowed only at the top level of the ``hardware`` | ||
| key. | ||
|
|
||
| * ``import-preset`` accepts a single string or a list of strings. Each | ||
| string identifies a preset source and is interpreted automatically: | ||
|
|
||
| * An ``http://`` or ``https://`` URL — fetched remotely. | ||
|
therazix marked this conversation as resolved.
|
||
| * A ``file://`` URL — read from the given absolute local path. | ||
| * Any other string — treated as a local file path (absolute, relative, | ||
| or using ``~`` for the home directory). | ||
|
|
||
| * ``preset`` is a string referencing a single named preset. To apply | ||
| multiple presets, combine them with ``and`` (or ``or``). | ||
|
|
||
| Preset files use YAML format with a dictionary mapping preset names to | ||
| their hardware definitions: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| # presets.yaml | ||
| AMD__ROME: | ||
| cpu: | ||
| family: 23 | ||
| model: 49 | ||
| MEMORY_MIN_64G: | ||
| memory: ">= 64 GB" | ||
|
psss marked this conversation as resolved.
|
||
|
|
||
| example: | ||
| - | | ||
| # Use a remote preset | ||
| provision: | ||
| hardware: | ||
| import-preset: https://github.com/my-team/presets.yaml | ||
| preset: AMD__ROME | ||
| - | | ||
| # Use a local preset file | ||
|
LecrisUT marked this conversation as resolved.
|
||
| provision: | ||
| hardware: | ||
| import-preset: ~/.config/tmt/presets.yaml | ||
| preset: BIG_MEMORY | ||
| - | | ||
| # Use a local preset file via file:// URL | ||
| provision: | ||
| hardware: | ||
| import-preset: file:///home/user/config/tmt/presets.yaml | ||
| preset: BIG_MEMORY | ||
| - | | ||
| # Combine multiple presets and additional constraints | ||
| provision: | ||
| hardware: | ||
| import-preset: | ||
| - https://github.com/my-team/project/presets.yaml | ||
| - file:///home/user/config/tmt/presets.yaml | ||
| - ~/.config/tmt/presets.yaml | ||
| and: | ||
| - preset: AMD__ROME | ||
| - preset: BIG_MEMORY | ||
| - cpu: | ||
| model: 97 | ||
|
|
||
| # NOTE: not yet supported | ||
| # link: | ||
| # - implemented-by: /tmt/steps/provision/artemis.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
|
|
||
| # | ||
| # JSON Schema definition for tmt hardware preset files | ||
| # | ||
|
|
||
| $id: /schemas/hardware-preset | ||
| $schema: https://json-schema.org/draft-07/schema | ||
|
|
||
| type: object | ||
| additionalProperties: | ||
| $ref: "/schemas/provision/hardware#/definitions/hardware" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.