Skip to content

Commit

Permalink
Updated image refs in Helm charts
Browse files Browse the repository at this point in the history
- Reworked image references in the helm charts
- Changed image repository from dtr.dev.cray.com to artifactory.algol60.net
- Added github workflows to do testing of the charts and images
- Added new pull request template

Jira: CASMHMS-5198
  • Loading branch information
shunr-hpe committed Nov 18, 2021
1 parent 864d82e commit 529983b
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 76 deletions.
70 changes: 30 additions & 40 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,48 @@
### Summary and Scope
## Summary and Scope

EXPLAIN WHY THIS PR IS NECESSARY. WHAT IS IMPACTED?
IS THIS A NEW FEATURE OR CRITICAL BUG FIX? SUMMARIZE WHAT CHANGED.
_Summarize what has changed. Explain why this PR is necessary. What is impacted? Is this a new feature, critical bug fix, etc?_

DOES THIS CHANGE INVOLVE ANY SCHEME CHANGES? Y/N
_Is this change backwards incompatible, backwards compatible, or a backwards compatible bugfix?_

REMINDER: HAVE YOU INCREMENTED VERSION NUMBERS? E.G., .spec, Chart.yaml, .version, CHANGELOG.md
## Issues and Related PRs

REMINDER 2: HAVE YOU UPDATED THE COPYRIGHT PER hpe GUIDELINES: (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP ? Y/N
_List and characterize relationship to Jira/Github issues and other pull requests. Be sure to list dependencies._

### Issues and Related PRs

LIST AND CHARACTERIZE RELATIONSHIP TO JIRA ISSUES AND OTHER PULL REQUESTS. BE SURE LIST DEPENDENCIES.

* Resolves CASM-XYZ
* Resolves [issue id](issue link)
* Change will also be needed in `<insert branch name here>`
* Future work required by CASM-ABC
* Merge with `<insert PR URL here>`
* Merge before `<insert PR URL here>`
* Merge after `<insert PR URL here>`
* Future work required by [issue id](issue link)
* Merge with/before/after `<insert PR URL here>`

### Testing
## Testing

LIST THE ENVIRONMENTS IN WHICH THESE CHANGES WERE TESTED.
_List the environments in which these changes were tested._

Tested on:

* `<drink system>`
* Craystack
* CMS base-box
* Virtual Shasta
* `<development system>`
* Local development environment
* Virtual Shasta

Test description:

_How were the changes tested and success verified? If schema changes were part of this change, how were those handled in your upgrade/downgrade testing?_

Were the install/upgrade based validation checks/tests run?(goss tests/install-validation doc)
Were continuous integration tests run? Y/N If not, Why?
Was an Upgrade tested? Y/N If not, Why?
Was a Downgrade tested? Y/N If not, Why?
If schema changes were part of this change, how were those handled in your upgrade/downgrade testing?
- Were the install/upgrade-based validation checks/tests run (goss tests/install-validation doc)?
- Were continuous integration tests run? If not, why?
- Was upgrade tested? If not, why?
- Was downgrade tested? If not, why?

WHAT WAS THE EXTENT OF TESTING PERFORMED? MANUAL VERSUS AUTOMATED TESTS (UNIT/SMOKE/OTHER)
HOW WERE CHANGES VERIFIED TO BE SUCCESSFUL?

### Risks and Mitigations
## Risks and Mitigations

HAS A SECURITY AUDIT BEEN RUN? (./runSnyk.sh)
ARE THERE KNOWN ISSUES WITH THESE CHANGES?
ANY OTHER SPECIAL CONSIDERATIONS?
_Are there known issues with these changes? Any other special considerations?_

INCLUDE THE FOLLOWING ITEMS THAT APPLY. LIST ADDITIONAL ITEMS AND PROVIDE MORE DETAILED INFORMATION AS APPROPRIATE.

Requires:
## Pull Request Checklist

* Additional testing on bare-metal
* Compute nodes
* 3rd party software
* Broader integration testing
* Fresh install
* Platform upgrade
- [ ] Version number(s) incremented, if applicable
- [ ] Copyrights updated
- [ ] License file intact
- [ ] Target branch correct
- [ ] CHANGELOG.md updated
- [ ] Testing is appropriate and complete, if applicable
22 changes: 22 additions & 0 deletions .github/workflows/charts-lint-test-scan-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Cron Lint, test, and scan Helm charts
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
lint-test-scan:
uses: Cray-HPE/.github/.github/workflows/charts-lint-test-scan.yml@main
with:
ct-config: |
chart-dirs:
- kubernetes
chart-repos:
- cray-algol60=https://artifactory.algol60.net/artifactory/csm-helm-charts
validate-maintainers: false
scan-chart-snyk-args: "--severity-threshold=high"
scan-image-snyk-args: "--severity-threshold=high"
test-charts: false
scan-images: true
secrets:
snyk-token: ${{ secrets.SNYK_TOKEN }}

25 changes: 25 additions & 0 deletions .github/workflows/charts-lint-test-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint, test, and scan Helm charts
on:
pull_request:
branches:
- master
- release/**
workflow_dispatch:
jobs:
lint-test-scan:
uses: Cray-HPE/.github/.github/workflows/charts-lint-test-scan.yml@main
with:
lint-charts: ${{ github.event_name == 'pull_request' }}
ct-config: |
chart-dirs:
- kubernetes
chart-repos:
- cray-algol60=https://artifactory.algol60.net/artifactory/csm-helm-charts
validate-maintainers: false
scan-chart-snyk-args: "--severity-threshold=high"
scan-image-snyk-args: "--severity-threshold=high"
test-charts: false
scan-images: false
secrets:
snyk-token: ${{ secrets.SNYK_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
*.tgz
*.swp
.vscode
cmd/smd-loader/node_nid_map.json
kubernetes/cray-hms-smd/helm
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.34.0
1.35.0
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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).

## [1.35.0] - 2021-11-18

### Changed

- CASMHMS-5198 - Updated image refs in the chart.

## [1.34.0] - 2021-11-16

### Changed
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ test_rpm_build_source:

test_rpm_build:
BUILD_METADATA=$(BUILD_METADATA) rpmbuild -ba $(TEST_SPEC_FILE) --define "_topdir $(TEST_BUILD_DIR)" --nodeps

clean:
# Remove files generated by helm
rm -rf kubernetes/cray-hms-smd/charts
rm -rf kubernetes/.packaged

6 changes: 6 additions & 0 deletions kubernetes/cray-hms-smd/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: cray-service
repository: https://artifactory.algol60.net/artifactory/csm-helm-charts
version: 7.0.0
digest: sha256:c04595364279402b13294b8666a8a97bfa79e4402b42ebbf0d2bcd4f52ec04ad
generated: "2021-11-15T12:49:28.96400053-07:00"
20 changes: 16 additions & 4 deletions kubernetes/cray-hms-smd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
apiVersion: v1
description: "Kubernetes resources for cray-hms-smd"
apiVersion: v2
name: "cray-hms-smd"
home: "HMS/hms-smd"
version: 1.34.0
version: 1.35.0
description: "Kubernetes resources for cray-hms-smd"
home: "https://github.com/Cray-HPE/hms-smd"
sources:
- "https://github.com/Cray-HPE/hms-smd"
dependencies:
- name: cray-service
version: "~7.0.0"
repository: https://artifactory.algol60.net/artifactory/csm-helm-charts
maintainers:
- name: Hardware Management
url: https://github.com/orgs/Cray-HPE/teams/hardware-management
appVersion: "1.35.0"
annotations:
artifacthub.io/images: ""
6 changes: 0 additions & 6 deletions kubernetes/cray-hms-smd/requirements.lock

This file was deleted.

4 changes: 0 additions & 4 deletions kubernetes/cray-hms-smd/requirements.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions kubernetes/cray-hms-smd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
{{/*
Add helper methods here for your chart
*/}}

{{- define "cray-hms-smd.image-prefix" -}}
{{ $base := index . "cray-service" }}
{{- if $base.imagesHost -}}
{{- printf "%s/" $base.imagesHost -}}
{{- else -}}
{{- printf "" -}}
{{- end -}}
{{- end -}}

{{/*
Helper function to get the proper image tag
*/}}
{{- define "cray-hms-smd.imageTag" -}}
{{- default "latest" .Chart.AppVersion -}}
{{- end -}}
5 changes: 3 additions & 2 deletions kubernetes/cray-hms-smd/templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ spec:
serviceAccountName: "cray-smd-job-deleter"
containers:
- name: job-deleter
image: "{{ include "cray-hms-smd.image-prefix" .Values }}loftsman/docker-kubectl:{{ .Values.dockerKubectlTag }}"
image: "{{ .Values.kubectl.image.repository }}:{{ .Values.kubectl.image.tag }}"
imagePullPolicy: "{{ .Values.kubectl.image.pullPolicy }}"
command:
- /bin/sh
- -c
Expand Down Expand Up @@ -48,7 +49,7 @@ spec:
serviceAccountName: "jobs-watcher"
containers:
- name: cray-smd-init
image: {{ include "cray-hms-smd.image-prefix" .Values }}cray/cray-smd:{{ include "cray-hms-smd.imageTag" . }}
image: {{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}
env:
# NOTE: overridden in container if POSTGRES_HOST is set
- name: SMD_DBHOST
Expand Down
17 changes: 14 additions & 3 deletions kubernetes/cray-hms-smd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@
# tag: "" (default = "latest")
# pullPolicy: "" (default = "IfNotPresent")

dockerKubectlTag: 0.2.0
global:
appVersion: 1.35.0

image:
repository: artifactory.algol60.net/csm-docker/stable/cray-smd
pullPolicy: IfNotPresent

kubectl:
image:
repository: artifactory.algol60.net/csm-docker/stable/docker-kubectl
tag: 1.19.15
pullPolicy: IfNotPresent

schemaStorageClass: ceph-cephfs-external
schemaAccessMode: ReadWriteMany
Expand Down Expand Up @@ -39,7 +50,7 @@ cray-service:
cray-smd:
name: "cray-smd"
image:
repository: "cray/cray-smd"
repository: artifactory.algol60.net/csm-docker/stable/cray-smd
resources:
limits:
cpu: "16"
Expand Down Expand Up @@ -137,7 +148,7 @@ cray-service:
enabled: true
backup:
enabled: true
schedule: "10 0 * * *" # Once per day at 12:10AM
schedule: "10 0 * * *" # Once per day at 12:10AM
users:
hmsdsuser: []
databases:
Expand Down

0 comments on commit 529983b

Please sign in to comment.