Skip to content

Commit

Permalink
Merge pull request #377 from Cray-HPE/casmcms-9146
Browse files Browse the repository at this point in the history
CASMCMS-9146: Add BOS option ims_images_must_exist
  • Loading branch information
mharding-hpe authored Oct 7, 2024
2 parents 4406dc9 + 3a5f893 commit 69ce67e
Show file tree
Hide file tree
Showing 12 changed files with 603 additions and 390 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- Added `ims_errors_fatal` BOS option. This determines whether or not an IMS failure
#### BOS options
- `ims_errors_fatal`: This determines whether or not an IMS failure
is considered fatal even when BOS could continue despite the failure. Specifically,
this comes up when validating image architecture in a boot set. By default
this is false. Note that this has no effect for boot sets that:
- Have non-IMS images
- Have IMS images but the image does not exist in IMS
- Have `Other` architecture
- `ims_images_must_exist`: This determines whether or not BOS considers it a fatal error if
a boot set has an IMS boot image which does not exist in IMS. If false (the default), then
BOS will only log warnings about these. If true, then these will cause boot set validations
to fail. Note that if `ims_images_must_exist` is true but `ims_errors_fatal` is false, then
a failure to determine whether or not an image is in IMS will NOT result in a fatal error.

### Changed
- Refactored some BOS Options code to use abstract base classes, to avoid code duplication.
- Alphabetized options in API spec
- Refactored `controllers/v2/boot_sets.py` into its own module, for clarity

## [2.29.0] - 2024-10-01
### Added
Expand Down
9 changes: 9 additions & 0 deletions api/openapi.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,15 @@ components:
In the above situation, if this option is true, then the validation will fail.
Otherwise, if the option is false, then a warning will be logged, but the validation will not
be failed because of this.
ims_images_must_exist:
type: boolean
description: |
This option modifies how BOS behaves when validating a boot set whose boot image appears to be from IMS.
Specifically, this option comes into play when the image does not actually exist in IMS.
In the above situation, if this option is true, then the validation will fail.
Otherwise, if the option is false, then a warning will be logged, but the validation will not
be failed because of this. Note that if ims_images_must_exist is true but ims_errors_fatal is false, then
a failure to determine whether or not an image is in IMS will NOT result in a fatal error.
logging_level:
type: string
description: The logging level for all BOS services
Expand Down
5 changes: 5 additions & 0 deletions src/bos/common/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'disable_components_on_completion': True,
'discovery_frequency': 300,
'ims_errors_fatal': False,
'ims_images_must_exist': False,
'logging_level': 'INFO',
'max_boot_wait_time': 1200,
'max_component_batch_size': 2800,
Expand Down Expand Up @@ -89,6 +90,10 @@ def discovery_frequency(self) -> int:
def ims_errors_fatal(self) -> bool:
return bool(self.get_option('ims_errors_fatal'))

@property
def ims_images_must_exist(self) -> bool:
return bool(self.get_option('ims_images_must_exist'))

@property
def logging_level(self) -> str:
return str(self.get_option('logging_level'))
Expand Down
Loading

0 comments on commit 69ce67e

Please sign in to comment.