diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c602447..6e54af5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # the repo. Unless a later match takes precedence, the # owners listed in this stanza will be requested for review # when someone opens a pull request. -* @Cray-HPE/CMS-core-boot-services +* @Cray-HPE/Cray-Management-Systems \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c8df92..51ef474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,28 @@ All notable changes to this project will be documented in this file. 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] + +## [1.11.2] - 2023-04-14 + +### Fixed + +- Make the build architecture and kind configurable to allow use on platforms that require KPXE binaries. + +### Changed + +- Spelling corrections. +- Enabled building of unstable artifacts +- Updated header of update_versions.conf to reflect new tool options + +### Fixed + +- Update Chart with correct image and chart version strings during builds. + ## [1.11.1] - 2022-12-20 + ### Added + - Add Artifactory authentication to Jenkinsfile ## [1.11.0] - 20222-08-10 @@ -17,12 +37,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update internal domain addresses - ## [1.10.0] - 2022-06-22 ### Changed - Convert to gitflow/gitversion. - CASMCMS-7992 - Allow for changing ipxe binary names. +- Update internal domain addresses ## [1.9.4] - (no date) diff --git a/kubernetes/cms-ipxe/Chart.yaml b/kubernetes/cms-ipxe/Chart.yaml index 61576e2..37eb517 100644 --- a/kubernetes/cms-ipxe/Chart.yaml +++ b/kubernetes/cms-ipxe/Chart.yaml @@ -23,7 +23,7 @@ # apiVersion: v2 name: cms-ipxe -version: 0.0.0 +version: 0.0.0-chart description: Kubernetes resources for cms-ipxe home: https://github.com/Cray-HPE/cms-ipxe sources: @@ -35,5 +35,5 @@ dependencies: annotations: artifacthub.io/images: | - name: cray-bss-ipxe - image: artifactory.algol60.net/csm-docker/stable/cray-bss-ipxe:0.0.0 + image: artifactory.algol60.net/csm-docker/S-T-A-B-L-E/cray-bss-ipxe:0.0.0-image artifacthub.io/license: MIT diff --git a/kubernetes/cms-ipxe/templates/configmap-settings.yaml b/kubernetes/cms-ipxe/templates/configmap-settings.yaml index 40f56a9..c3447d9 100644 --- a/kubernetes/cms-ipxe/templates/configmap-settings.yaml +++ b/kubernetes/cms-ipxe/templates/configmap-settings.yaml @@ -1,7 +1,7 @@ {{/* MIT License -(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP +(C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -36,3 +36,5 @@ data: cray_ipxe_token_host: {{ .Values.ipxe.api_gw }} cray_ipxe_binary_name: {{ .Values.ipxe.cray_ipxe_binary_name }} cray_ipxe_debug_binary_name: {{ .Values.ipxe.cray_ipxe_debug_binary_name }} + cray_ipxe_build_arch: {{ .Values.ipxe.cray_ipxe_build_arch }} + cray_ipxe_build_kind: {{ .Values.ipxe.cray_ipxe_build_kind }} diff --git a/kubernetes/cms-ipxe/templates/post-upgrade.yaml b/kubernetes/cms-ipxe/templates/post-upgrade.yaml index 4908b67..384821e 100644 --- a/kubernetes/cms-ipxe/templates/post-upgrade.yaml +++ b/kubernetes/cms-ipxe/templates/post-upgrade.yaml @@ -48,7 +48,7 @@ spec: restartPolicy: Never containers: - name: cms-ipxe-migration - image: "artifactory.algol60.net/csm-docker/stable/cray-bss-ipxe:{{ .Chart.AppVersion }}" + image: "{{ .Values.post_upgrade.image.repository }}:{{ .Chart.AppVersion }}" command: - '/bin/sh' - '-c' diff --git a/kubernetes/cms-ipxe/values.yaml b/kubernetes/cms-ipxe/values.yaml index 6fad725..6b4ab46 100644 --- a/kubernetes/cms-ipxe/values.yaml +++ b/kubernetes/cms-ipxe/values.yaml @@ -1,7 +1,7 @@ # # MIT License # -# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP +# (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -43,7 +43,7 @@ cray-service: cray-ipxe: name: cray-ipxe image: - repository: artifactory.algol60.net/csm-docker/stable/cray-bss-ipxe + repository: artifactory.algol60.net/csm-docker/S-T-A-B-L-E/cray-bss-ipxe volumeMounts: - name: cray-tftp-data mountPath: /shared_tftp @@ -127,7 +127,7 @@ ipxe: bss_max_attempts: 1024 # The longest period of time to wait between attempts for contacting BSS over NICs - # interated in cray_nic-boot_order. This number is effectively influenced by the + # iterated in cray_nic-boot_order. This number is effectively influenced by the # number of nodes expected to be booted simultaneously, and the effective number # of requests per second that BSS can serve out, assuming an average number of # requests per second. The exact number of requests per second is probably not @@ -147,3 +147,16 @@ ipxe: cray_ipxe_binary_name: ipxe.efi cray_ipxe_debug_binary_name: debug-ipxe.efi + + # Allow specification of an architecture other than x86_64 and a kind other than + # EFI. Currently, the only supported architecture is 'x86_64' and the supported + # kinds are 'efi' and 'kpxe'. + # + # If you set the kind to 'kpxe' here, you also want to set the binary name (above) + # to 'undionly.kpxe' and the debug binary name to 'debug-undionly.kpxe'. + cray_ipxe_build_arch: x86_64 + cray_ipxe_build_kind: efi + +post_upgrade: + image: + repository: artifactory.algol60.net/csm-docker/S-T-A-B-L-E/cray-bss-ipxe diff --git a/src/crayipxe/liveness/ipxe_timestamp.py b/src/crayipxe/liveness/ipxe_timestamp.py index 5c52374..9de749f 100644 --- a/src/crayipxe/liveness/ipxe_timestamp.py +++ b/src/crayipxe/liveness/ipxe_timestamp.py @@ -138,7 +138,7 @@ def value(self): data = json.load(timestamp_file) return datetime.datetime.fromtimestamp(float(data['timestamp'])) except FileNotFoundError: - LOGGER.warning("Timestamp never intialized to '%s'" % (self.path)) + LOGGER.warning("Timestamp never initialized to '%s'" % (self.path)) return datetime.datetime.fromtimestamp(0) def delete(self): diff --git a/src/crayipxe/service.py b/src/crayipxe/service.py index d940e9e..23fd416 100644 --- a/src/crayipxe/service.py +++ b/src/crayipxe/service.py @@ -2,7 +2,7 @@ # # MIT License # -# (C) Copyright 2019-2022 Hewlett Packard Enterprise Development LP +# (C) Copyright 2019-2023 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -284,7 +284,7 @@ def token_expiring_soon(bearer_token, min_remaining_valid_time): return True # Just decode the token to extract the value. THe token has already been - # obtianed from Keycloak here and verification gets handled + # obtained from Keycloak here and verification gets handled # by the API GW when the token is checked. tokenMap = None try: @@ -458,12 +458,17 @@ def main(): bearer_token_changed = True bearer_token = bearer_token_new - # Touch the relevent source to force a recompile. + # Touch the relevant source to force a recompile. os.utime('/ipxe/net/tcp/httpcore.c', None) # ipxe script setting bss_script_raw = api_instance.read_namespaced_config_map('cray-ipxe-bss-ipxe', 'services') bss_script_new = bss_script_raw.data['bss.ipxe'] + + # ipxe binary type and architecture settings... + build_arch = settings.get('cray_ipxe_build_arch', 'x86_64') + build_kind = settings.get('cray_ipxe_build_kind', 'efi') + if bss_script_new != bss_script: bss_script_changed = True bss_script = bss_script_new @@ -472,7 +477,7 @@ def main(): if any([settings_changed, ca_public_key_changed, bss_script_changed, bearer_token_changed]): - # Create a file to indicate the build is in progress. A Kuberenetes + # Create a file to indicate the build is in progress. A Kubernetes # livenessProbe can check on this file to see if it has stayed around # longer than expected, which would indicate a build failure. ipxe_timestamp = ipxeTimestamp(IPXE_PATH, os.getenv('IPXE_BUILD_TIME_LIMIT', 40)) @@ -480,7 +485,8 @@ def main(): new_ipxe_binary = create_binaries(api_instance, ipxe_binary_name, bss_script, cert=public_cert, bearer_token=bearer_token, ipxe_build_debug=ipxe_build_debug, - ipxe_build_debug_level=cray_ipxe_debug_level) + ipxe_build_debug_level=cray_ipxe_debug_level, + arch=build_arch, kind=build_kind) if not ipxe_binary == new_ipxe_binary: if ipxe_binary and os.path.exists(ipxe_binary): @@ -504,7 +510,7 @@ def main(): shell_script = shell_script_new if any([settings_changed, ca_public_key_changed, shell_script_changed, bearer_token_changed]): - # Create a file to indicate the build is in progress. A Kuberenetes + # Create a file to indicate the build is in progress. A Kubernetes # livenessProbe can check on this file to see if it has stayed around # longer than expected, which would indicate a build failure. debug_ipxe_timestamp = ipxeTimestamp(DEBUG_IPXE_PATH, @@ -514,7 +520,8 @@ def main(): cert=public_cert, bearer_token=bearer_token, ipxe_build_debug=ipxe_build_debug, - ipxe_build_debug_level=cray_ipxe_debug_level) + ipxe_build_debug_level=cray_ipxe_debug_level, + arch=build_arch, kind=build_kind) # The upgrade to cms-ipxe 1.10.0 changed the default name, potentially leaving an old file # This file still contains a valid token and should be cleaned up if not in use diff --git a/update_versions.conf b/update_versions.conf index bdf0061..6d8cce0 100644 --- a/update_versions.conf +++ b/update_versions.conf @@ -1,21 +1,33 @@ -#tag: version tag string to be replaced (optional -- if unspecified @VERSION@ is assumed) -#sourcefile: file to read actual version from (optional -- if unspecified, .version is assumed) -#targetfile: file in which to have version tags replaced +#tag: Version tag string to be replaced (optional -- if unspecified @VERSION@ is assumed) # -#Multiples of these lines are allowed. A given line is in effect until another line overrides it. -#Example: -#tag: @TAG1@ -#sourcefile: path/to/version1.txt -#targetfile: my/file.py -#targetfile: other/file.yaml +#sourcefile: File to obtain the actual version from (optional -- if unspecified, .version is assumed) +# If this file is executable, it will be executed and the output will be used as the version string. +# Otherwise it will be read and its contents will be used as the version string, with any leading and +# trailing whitespace stripped. The version string is validated by the update_version.sh string to +# verify that they match the expected version formatting (essentially semver, with a minor exception +# -- see the script header for details). +#sourcefile-novalidate: This is identical to the previous tag, except that the only validation that is +# done is to verify that the version string is not blank and does not contain strings which will +# disrupt the sed command used for the version tag replacement. Essentially, it cannot contain +# double quotes, forward slashes, or hash symbols. The file does still have leading and trailing +# whitespace stripped, however. +#targetfile: file in which to have version tags replaced. When this line is reached, the replacement +# action is performed on this file. # -#tag: @TAG2@ -#targetfile: a/b/c.txt -# -#sourcefile: v2.txt -#targetfile: 1/2/3.txt +#Multiples of any of these lines are allowed. A given line is in effect until another line overrides it. +#For this purpose, the sourcefile and sourcefile-novalidate lines are considered the same (that is, they +#override each other). + +sourcefile: .chart_version +tag: 0.0.0-chart +targetfile: kubernetes/cms-ipxe/Chart.yaml + +sourcefile: .docker_version +tag: 0.0.0-image +targetfile: kubernetes/cms-ipxe/Chart.yaml -tag: 0.0.0 +sourcefile-novalidate: .stable +tag: S-T-A-B-L-E targetfile: kubernetes/cms-ipxe/Chart.yaml targetfile: kubernetes/cms-ipxe/values.yaml