Skip to content

Commit

Permalink
Merge pull request #56 from Cray-HPE/release/1.11.2
Browse files Browse the repository at this point in the history
Release/1.11.2
  • Loading branch information
mharding-hpe authored Apr 14, 2023
2 parents 72f281a + 0c298c1 commit 1120819
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
4 changes: 2 additions & 2 deletions kubernetes/cms-ipxe/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
4 changes: 3 additions & 1 deletion kubernetes/cms-ipxe/templates/configmap-settings.yaml
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion kubernetes/cms-ipxe/templates/post-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
19 changes: 16 additions & 3 deletions kubernetes/cms-ipxe/values.yaml
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/crayipxe/liveness/ipxe_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
21 changes: 14 additions & 7 deletions src/crayipxe/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -472,15 +477,16 @@ 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))

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):
Expand All @@ -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,
Expand All @@ -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
Expand Down
42 changes: 27 additions & 15 deletions update_versions.conf
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 1120819

Please sign in to comment.