Skip to content

Commit

Permalink
Merge pull request #108 from Cray-HPE/feature/CASMCMS-9068
Browse files Browse the repository at this point in the history
Add global passthrough build time options
  • Loading branch information
jsl-hpe authored Oct 8, 2024
2 parents 60b0fe9 + 97d1f16 commit 5483258
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added passthrough option for affecting global build options through the associated configset (global_additional_build_options).

## [1.14.2] - 2024-09-05

Expand Down
7 changes: 7 additions & 0 deletions kubernetes/cms-ipxe/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ ipxe:
# support kpxe/undionly variants.
build_kind: ipxe

# This allows injection of new custom build options for ipxe. This is a GLOBAL SETTING, so every build will have these
# values included at build time. The format of this value is a comma delimited string. By default, this string is
# empty. Changing this value to anything that is not supported by the ipxe build makefile will likely break ALL
# builds. Only change this value if you have a solid understanding of the internals of the ipxe build chain, as the
# contents of this setting are passed in to the build process as is.
global_additional_build_options: ""

# These options are specific to x86_64 ipxe builds
build_x86: true
cray_ipxe_binary_name: ipxe.efi
Expand Down
11 changes: 11 additions & 0 deletions src/crayipxe/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ def global_settings(self):
self.recreation_necessary = True
return self._global_settings

@property
def global_additional_build_options(self):
"""
A list of strings that correspond to MAKE targets for building. These are typically user supplied values that
affect the overall build of all ipxe flavors.
:return: A list of build options to append at build time.
"""
return self.global_settings.get('global_additional_build_options', '').split(',')

@property
def build_kind(self):
"""
Expand Down Expand Up @@ -385,6 +394,8 @@ def build_command(self):
build_command.append('BEARER_TOKEN=%s' % self.bearer_token)
LOGGER.debug("Build command generated as: [%s]" % ' '.join(build_command[:-1]))
LOGGER.debug("BEARER_TOKEN=<omitted> for reasons of security.")
if self.global_additional_build_options:
build_command.extend(self.global_additional_build_options)
return build_command

@property
Expand Down

0 comments on commit 5483258

Please sign in to comment.