From 839b707b667fff98d104da844b04d0bc00610d0c Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Wed, 6 Nov 2024 09:41:40 +0000 Subject: [PATCH 1/4] update to copier template 4.0.1 --- .copier-answers.yml | 13 +++++++++++++ .github/workflows/ci_verify.sh | 35 ++++++++++++++++++++++++++++++++-- .gitignore | 11 +++++++---- README.md | 9 ++------- environment.sh | 30 ++++++++++------------------- services/values.yaml | 4 ++-- 6 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 .copier-answers.yml diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..b75dd85 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,13 @@ +# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY +_commit: 4.0.1 +_src_path: gh:epics-containers/services-template-helm +cluster_name: pollux +cluster_namespace: p45-beamline +cluster_type: dls_cluster +description: p45 IOC Instances and Services +git_platform: github.com +github_org: epics-containers +ioc_group: p45 +location: bl45p +logging_url: https://graylog2.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}* +repo_uri: https://github.com/epics-containers/p45-services diff --git a/.github/workflows/ci_verify.sh b/.github/workflows/ci_verify.sh index 2b71890..077b6c8 100755 --- a/.github/workflows/ci_verify.sh +++ b/.github/workflows/ci_verify.sh @@ -10,12 +10,33 @@ ROOT=$(realpath $(dirname ${0})/../..) set -xe +rm -rf ${ROOT}/.ci_work/ +mkdir -p ${ROOT}/.ci_work # use docker if available else use podman if ! docker version &>/dev/null; then docker=podman; else docker=docker; fi -for service in ${ROOT}/services/* +for service in ${ROOT}/services/*/ # */ to skip files do + + ### Lint each service chart and validate if schema given ### + service_name=$(basename $service) + cp -r $service ${ROOT}/.ci_work/$service_name + schema=$(cat ${service}/values.yaml | sed -rn 's/^# yaml-language-server: \$schema=(.*)/\1/p') + if [ -n "${schema}" ]; then + echo "{\"\$ref\": \"$schema\"}" > ${ROOT}/.ci_work/$service_name/values.schema.json + fi + $docker run --rm --entrypoint bash \ + -v ${ROOT}/.ci_work/$service_name:/services/$service_name \ + alpine/helm:3.14.3 \ + -c "helm dependency update /services/$service_name" + $docker run --rm --entrypoint bash \ + -v ${ROOT}/.ci_work/$service_name:/services/$service_name \ + -v ${ROOT}/services/values.yaml:/services/values.yaml \ + alpine/helm:3.14.3 \ + -c "helm lint /services/$service_name --values /services/values.yaml" + + ### Valiate each ioc config ### # Skip if subfolder has no config to validate if [ ! -f "${service}/config/ioc.yaml" ]; then continue @@ -27,10 +48,20 @@ do if [ -n "${image}" ]; then echo "Validating ${service} with ${image}" + runtime=/tmp/ioc-runtime/$(basename ${service}) + mkdir -p ${runtime} + # This will fail and exit if the ioc.yaml is invalid $docker run --rm --entrypoint bash \ - -v ${service}/config:/config ${image} \ + -v ${service}/config:/config \ + -v ${runtime}:/epics/runtime \ + ${image} \ -c 'ibek runtime generate /config/ioc.yaml /epics/ibek-defs/*' + # show the startup script we just generated (and verify it exists) + cat ${runtime}/st.cmd fi + done + +rm -r ${ROOT}/.ci_work \ No newline at end of file diff --git a/.gitignore b/.gitignore index 842d6fc..7777862 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ +**/*.tz +**/*.tgz .history -**/*.bob -edm/bobs -**/*copy -**/charts/*tgz +venv* +.venv* **/Chart.lock +**/charts +**/*copy +.ci_work \ No newline at end of file diff --git a/README.md b/README.md index e9297ce..f94e8b4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,3 @@ -# beamline bl45p IOC Instances and Services - -This repository holds the a definition of beamline bl45p IOC Instances and services. Each sub folder of the `services` directory contains a helm chart for a specific service or IOC. - -The respository is deployed into the beamline cluster using Argo CD which keeps the cluster namespace bl45p in sync with the contents of this repo. - -See apps.yaml for the root app of apps description. +# p45 IOC Instances and Services +This repository holds the a definition of p45 IOC Instances and services. Each sub folder of the `services` directory contains a helm chart for a specific service or IOC. \ No newline at end of file diff --git a/environment.sh b/environment.sh index a1f6109..09096b4 100644 --- a/environment.sh +++ b/environment.sh @@ -1,7 +1,7 @@ #!/bin/bash # a bash script to source in order to set up your command line to in order -# to work with the bl45p IOCs and Services. +# to work with the p45 IOCs and Services. # check we are sourced if [ "$0" = "$BASH_SOURCE" ]; then @@ -9,28 +9,17 @@ if [ "$0" = "$BASH_SOURCE" ]; then exit 1 fi -echo "Loading environment for beamline bl45p IOC Instances and Services ..." +echo "Loading environment for p45 IOC Instances and Services ..." #### SECTION 1. Environment variables ########################################## -# a mapping between generic IOC repo roots and the related container registry -# use spaces or line breaks to separate multiple mappings by default this -# inlcudes mappings for github and DLS gitlab, add your own here. -export EC_REGISTRY_MAPPING_REGEX=' -.*github.com:(.*)\/(.*) ghcr.io/\1/\2 -.*gitlab.diamond.ac.uk.*\/(.*) gcr.io/diamond-privreg/controls/prod/ioc/\1 -' -# the namespace to use for kubernetes deployments - use local for local docker/podman -export EC_NAMESPACE=bl45p +export EC_CLI_BACKEND="K8S" +# the namespace to use for kubernetes deployments +export EC_TARGET=p45-beamline # the git repo for this project -export EC_SERVICES_REPO=git@github.com:epics-containers/bl45p.git +export EC_SERVICES_REPO=https://github.com/epics-containers/p45-services # declare your centralised log server Web UI -export EC_LOG_URL="https://graylog.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*" -# enforce a specific container cli - defaults to whatever is available -# export EC_CONTAINER_CLI=podman -# enable debug output in all 'ec' commands -# export EC_DEBUG=1 - +export EC_LOG_URL="https://graylog2.diamond.ac.uk/search?rangetype=relative&fields=message%2Csource&width=1489&highlightMessage=&relative=172800&q=pod_name%3A{service_name}*" #### SECTION 2. Install ec ##################################################### @@ -46,12 +35,13 @@ source <(ec --show-completion ${SHELL}) #### SECTION 3. Configure Kubernetes Cluster ################################### + # the following configures kubernetes inside DLS. module unload pollux > /dev/null module load pollux > /dev/null # set the default namespace for kubectl and helm (for convenience only) -kubectl config set-context --current --namespace=bl45p +kubectl config set-context --current --namespace=p45-beamline # make sure the user has provided credentials kubectl version @@ -59,4 +49,4 @@ kubectl version # enable shell completion for k8s tools if [ -n "$ZSH_VERSION" ]; then SHELL=zsh; fi source <(helm completion $(basename ${SHELL})) -source <(kubectl completion $(basename ${SHELL})) \ No newline at end of file +source <(kubectl completion $(basename ${SHELL})) diff --git a/services/values.yaml b/services/values.yaml index dee3839..0a91840 100644 --- a/services/values.yaml +++ b/services/values.yaml @@ -1,4 +1,4 @@ -# shared beamline values for all services +# shared values for all services global: ioc_group: p45 @@ -33,4 +33,4 @@ ioc-instance: - key: nodetype operator: Equal value: test-rig - effect: NoSchedule \ No newline at end of file + effect: NoSchedule From ae2bc99aa93748dcaed68cf1ad27b267b287f4bb Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Wed, 6 Nov 2024 11:01:33 +0000 Subject: [PATCH 2/4] update to latest generic iocs and ec-helm-charts --- services/bl45p-ea-dcam-01/Chart.yaml | 2 +- services/bl45p-ea-dcam-01/values.yaml | 2 +- services/bl45p-ea-dcam-02/Chart.yaml | 2 +- services/bl45p-ea-dcam-02/values.yaml | 2 +- services/bl45p-mo-brick-01/Chart.yaml | 4 ++-- services/bl45p-mo-brick-01/values.yaml | 4 +--- services/bl45p-mo-panda-01/Chart.yaml | 4 ++-- services/bl45p-mo-panda-01/values.yaml | 2 +- services/bl45p-mo-panda-02/Chart.yaml | 4 ++-- services/bl45p-mo-panda-02/values.yaml | 2 +- services/p45-ea-test-01/Chart.yaml | 4 ++-- 11 files changed, 15 insertions(+), 17 deletions(-) diff --git a/services/bl45p-ea-dcam-01/Chart.yaml b/services/bl45p-ea-dcam-01/Chart.yaml index bd47eb5..f011ad8 100644 --- a/services/bl45p-ea-dcam-01/Chart.yaml +++ b/services/bl45p-ea-dcam-01/Chart.yaml @@ -7,7 +7,7 @@ type: application dependencies: - name: ioc-instance - version: 4.0.0 + version: 4.1.2 repository: "oci://ghcr.io/epics-containers" # dls-aravis is locally available via symlink in the charts directory - name: dls-aravis diff --git a/services/bl45p-ea-dcam-01/values.yaml b/services/bl45p-ea-dcam-01/values.yaml index 3ae5c10..0c2fe4c 100644 --- a/services/bl45p-ea-dcam-01/values.yaml +++ b/services/bl45p-ea-dcam-01/values.yaml @@ -7,4 +7,4 @@ dls-aravis: ID: bl45p-ea-detector-01 ioc-instance: - image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.7.1 + image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.11.1 diff --git a/services/bl45p-ea-dcam-02/Chart.yaml b/services/bl45p-ea-dcam-02/Chart.yaml index 17fd24d..ebc8b1c 100644 --- a/services/bl45p-ea-dcam-02/Chart.yaml +++ b/services/bl45p-ea-dcam-02/Chart.yaml @@ -7,7 +7,7 @@ type: application dependencies: - name: ioc-instance - version: 4.0.0 + version: 4.1.2 repository: "oci://ghcr.io/epics-containers" # dls-aravis is locally available via symlink in the charts directory - name: dls-aravis diff --git a/services/bl45p-ea-dcam-02/values.yaml b/services/bl45p-ea-dcam-02/values.yaml index 9dafe07..274da7f 100644 --- a/services/bl45p-ea-dcam-02/values.yaml +++ b/services/bl45p-ea-dcam-02/values.yaml @@ -7,4 +7,4 @@ dls-aravis: ID: bl45p-ea-detector-02 ioc-instance: - image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.7.1 + image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.11.1 diff --git a/services/bl45p-mo-brick-01/Chart.yaml b/services/bl45p-mo-brick-01/Chart.yaml index 5732737..2ed3edd 100644 --- a/services/bl45p-mo-brick-01/Chart.yaml +++ b/services/bl45p-mo-brick-01/Chart.yaml @@ -7,5 +7,5 @@ type: application dependencies: - name: ioc-instance - version: 4.0.0 - repository: "oci://ghcr.io/epics-containers" \ No newline at end of file + version: 4.1.2 + repository: "oci://ghcr.io/epics-containers" diff --git a/services/bl45p-mo-brick-01/values.yaml b/services/bl45p-mo-brick-01/values.yaml index eea6cd4..37c9060 100644 --- a/services/bl45p-mo-brick-01/values.yaml +++ b/services/bl45p-mo-brick-01/values.yaml @@ -2,6 +2,4 @@ # latest container image for the pmac motion controller ioc-instance: - image: ghcr.io/epics-containers/ioc-pmac-runtime:2024.5.1 - - + image: ghcr.io/epics-containers/ioc-pmac-runtime:2024.9.1 diff --git a/services/bl45p-mo-panda-01/Chart.yaml b/services/bl45p-mo-panda-01/Chart.yaml index 5732737..2ed3edd 100644 --- a/services/bl45p-mo-panda-01/Chart.yaml +++ b/services/bl45p-mo-panda-01/Chart.yaml @@ -7,5 +7,5 @@ type: application dependencies: - name: ioc-instance - version: 4.0.0 - repository: "oci://ghcr.io/epics-containers" \ No newline at end of file + version: 4.1.2 + repository: "oci://ghcr.io/epics-containers" diff --git a/services/bl45p-mo-panda-01/values.yaml b/services/bl45p-mo-panda-01/values.yaml index 0a0eb58..b9e21fe 100644 --- a/services/bl45p-mo-panda-01/values.yaml +++ b/services/bl45p-mo-panda-01/values.yaml @@ -2,7 +2,7 @@ # latest container image for GigE cameras from the GitHub Container Registry ioc-instance: - image: ghcr.io/pandablocks/pandablocks-ioc:0.9.0 + image: ghcr.io/pandablocks/pandablocks-ioc:0.11.2 # this causes our config folder's start.sh to be mounted over the default # /epics/ioc/start.sh - thus making the pandaBlocks container image have diff --git a/services/bl45p-mo-panda-02/Chart.yaml b/services/bl45p-mo-panda-02/Chart.yaml index 5732737..2ed3edd 100644 --- a/services/bl45p-mo-panda-02/Chart.yaml +++ b/services/bl45p-mo-panda-02/Chart.yaml @@ -7,5 +7,5 @@ type: application dependencies: - name: ioc-instance - version: 4.0.0 - repository: "oci://ghcr.io/epics-containers" \ No newline at end of file + version: 4.1.2 + repository: "oci://ghcr.io/epics-containers" diff --git a/services/bl45p-mo-panda-02/values.yaml b/services/bl45p-mo-panda-02/values.yaml index 0a0eb58..b9e21fe 100644 --- a/services/bl45p-mo-panda-02/values.yaml +++ b/services/bl45p-mo-panda-02/values.yaml @@ -2,7 +2,7 @@ # latest container image for GigE cameras from the GitHub Container Registry ioc-instance: - image: ghcr.io/pandablocks/pandablocks-ioc:0.9.0 + image: ghcr.io/pandablocks/pandablocks-ioc:0.11.2 # this causes our config folder's start.sh to be mounted over the default # /epics/ioc/start.sh - thus making the pandaBlocks container image have diff --git a/services/p45-ea-test-01/Chart.yaml b/services/p45-ea-test-01/Chart.yaml index 5732737..2ed3edd 100644 --- a/services/p45-ea-test-01/Chart.yaml +++ b/services/p45-ea-test-01/Chart.yaml @@ -7,5 +7,5 @@ type: application dependencies: - name: ioc-instance - version: 4.0.0 - repository: "oci://ghcr.io/epics-containers" \ No newline at end of file + version: 4.1.2 + repository: "oci://ghcr.io/epics-containers" From 069bd6f84820be98a9f2872df2c15dc474e79f5c Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Thu, 7 Nov 2024 08:50:36 +0000 Subject: [PATCH 3/4] add resources to ioc-instance schema --- .github/workflows/ci_verify.sh | 10 +++++----- services/bl45p-ea-dcam-01/values.yaml | 4 +--- services/bl45p-ea-dcam-02/values.yaml | 3 +++ services/bl45p-mo-brick-01/config/ioc.yaml | 7 +++++-- services/bl45p-mo-brick-01/values.yaml | 3 ++- services/bl45p-mo-panda-01/values.yaml | 3 ++- services/bl45p-mo-panda-02/values.yaml | 3 ++- services/dls-aravis/config/ioc.yaml | 6 +++++- services/values.yaml | 12 +++++++++++- 9 files changed, 36 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci_verify.sh b/.github/workflows/ci_verify.sh index 077b6c8..deca0bd 100755 --- a/.github/workflows/ci_verify.sh +++ b/.github/workflows/ci_verify.sh @@ -16,23 +16,23 @@ mkdir -p ${ROOT}/.ci_work # use docker if available else use podman if ! docker version &>/dev/null; then docker=podman; else docker=docker; fi +# copy the services to a temporary location to avoid dirtying the repo +cp -r ${ROOT}/services/* ${ROOT}/.ci_work/ + for service in ${ROOT}/services/*/ # */ to skip files do - ### Lint each service chart and validate if schema given ### service_name=$(basename $service) - cp -r $service ${ROOT}/.ci_work/$service_name schema=$(cat ${service}/values.yaml | sed -rn 's/^# yaml-language-server: \$schema=(.*)/\1/p') if [ -n "${schema}" ]; then echo "{\"\$ref\": \"$schema\"}" > ${ROOT}/.ci_work/$service_name/values.schema.json fi $docker run --rm --entrypoint bash \ - -v ${ROOT}/.ci_work/$service_name:/services/$service_name \ + -v ${ROOT}/.ci_work:/services \ alpine/helm:3.14.3 \ -c "helm dependency update /services/$service_name" $docker run --rm --entrypoint bash \ - -v ${ROOT}/.ci_work/$service_name:/services/$service_name \ - -v ${ROOT}/services/values.yaml:/services/values.yaml \ + -v ${ROOT}/.ci_work:/services \ alpine/helm:3.14.3 \ -c "helm lint /services/$service_name --values /services/values.yaml" diff --git a/services/bl45p-ea-dcam-01/values.yaml b/services/bl45p-ea-dcam-01/values.yaml index 0c2fe4c..b291c7f 100644 --- a/services/bl45p-ea-dcam-01/values.yaml +++ b/services/bl45p-ea-dcam-01/values.yaml @@ -1,6 +1,4 @@ -# Arguments to the shared ioc instance template dls-aravis -# This will make an IOC instance for an aravis camera with a standard set -# of Areadetector plugins. +# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/4.1.2/ioc-instance.schema.json dls-aravis: P: BL45P-EA-MAP-01 diff --git a/services/bl45p-ea-dcam-02/values.yaml b/services/bl45p-ea-dcam-02/values.yaml index 274da7f..18d7f40 100644 --- a/services/bl45p-ea-dcam-02/values.yaml +++ b/services/bl45p-ea-dcam-02/values.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/4.1.2/ioc-instance.schema.json + # Arguments to the shared ioc instance template dls-aravis # This will make an IOC instance for an aravis camera with a standard set # of Areadetector plugins. @@ -8,3 +10,4 @@ dls-aravis: ioc-instance: image: ghcr.io/epics-containers/ioc-adaravis-runtime:2024.11.1 + location: bl45p # TODO remove me when schema is fixed diff --git a/services/bl45p-mo-brick-01/config/ioc.yaml b/services/bl45p-mo-brick-01/config/ioc.yaml index 62b0723..c400edc 100644 --- a/services/bl45p-mo-brick-01/config/ioc.yaml +++ b/services/bl45p-mo-brick-01/config/ioc.yaml @@ -1,11 +1,14 @@ # yaml-language-server: $schema=https://github.com/epics-containers/ioc-pmac/releases/download/2024.3.1/ibek.ioc.schema.json -# todo update ioc-pmac to latest ibek (__utils__ is old) -ioc_name: "{{ __utils__.get_env('IOC_NAME') }}" +ioc_name: "{{ _global.get_env('IOC_NAME') }}" description: auto-generated by https://github.com/epics-containers/builder2ibek entities: + - type: epics.EpicsEnvSet + name: EPICS_TZ + value: "GMT0BST" + - type: epics.EpicsCaMaxArrayBytes max_bytes: 6000000 diff --git a/services/bl45p-mo-brick-01/values.yaml b/services/bl45p-mo-brick-01/values.yaml index 37c9060..d4d84ba 100644 --- a/services/bl45p-mo-brick-01/values.yaml +++ b/services/bl45p-mo-brick-01/values.yaml @@ -1,5 +1,6 @@ -# yaml-language-server: $schema=https://github.com/marcelldls/ec-helm-charts/releases/download/3.4.4/ioc-instance.schema.json#/$defs/service +# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/4.1.2/ioc-instance.schema.json/#/$defs/service # latest container image for the pmac motion controller ioc-instance: image: ghcr.io/epics-containers/ioc-pmac-runtime:2024.9.1 + location: bl45p # TODO remove me when schema is fixed diff --git a/services/bl45p-mo-panda-01/values.yaml b/services/bl45p-mo-panda-01/values.yaml index b9e21fe..89cd342 100644 --- a/services/bl45p-mo-panda-01/values.yaml +++ b/services/bl45p-mo-panda-01/values.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://github.com/marcelldls/ec-helm-charts/releases/download/3.4.4/ioc-instance.schema.json#/$defs/service +# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/4.1.2/ioc-instance.schema.json/#/$defs/service # latest container image for GigE cameras from the GitHub Container Registry ioc-instance: @@ -8,3 +8,4 @@ ioc-instance: # /epics/ioc/start.sh - thus making the pandaBlocks container image have # the same entrypoint as ioc-template based images iocConfig: /epics/ioc + location: bl45p # TODO remove me when schema is fixed diff --git a/services/bl45p-mo-panda-02/values.yaml b/services/bl45p-mo-panda-02/values.yaml index b9e21fe..89cd342 100644 --- a/services/bl45p-mo-panda-02/values.yaml +++ b/services/bl45p-mo-panda-02/values.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://github.com/marcelldls/ec-helm-charts/releases/download/3.4.4/ioc-instance.schema.json#/$defs/service +# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/4.1.2/ioc-instance.schema.json/#/$defs/service # latest container image for GigE cameras from the GitHub Container Registry ioc-instance: @@ -8,3 +8,4 @@ ioc-instance: # /epics/ioc/start.sh - thus making the pandaBlocks container image have # the same entrypoint as ioc-template based images iocConfig: /epics/ioc + location: bl45p # TODO remove me when schema is fixed diff --git a/services/dls-aravis/config/ioc.yaml b/services/dls-aravis/config/ioc.yaml index b5a5070..ad00c37 100644 --- a/services/dls-aravis/config/ioc.yaml +++ b/services/dls-aravis/config/ioc.yaml @@ -5,6 +5,10 @@ ioc_name: "[[ _global.get_env('IOC_NAME') ]]" description: shared template for all Aravis cameras on p45 entities: + - type: epics.EpicsEnvSet + name: EPICS_TZ + value: "GMT0BST" + - type: epics.EpicsCaMaxArrayBytes max_bytes: 6000000 @@ -16,7 +20,7 @@ entities: IOC: "[[ ioc_name | upper ]]" - type: ADAravis.aravisCamera - CLASS: {{ .Values.CLASS}} + CLASS: {{ .Values.CLASS }} ID: {{ .Values.ID }} P: {{ .Values.P }} PORT: DET.DET diff --git a/services/values.yaml b/services/values.yaml index 0a91840..488935d 100644 --- a/services/values.yaml +++ b/services/values.yaml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/4.1.2/ioc-instance.schema.json/#/$defs/service # shared values for all services global: @@ -9,6 +10,7 @@ ioc-instance: # useHostNetwork - use host network for IOC - required for Channel Access # to work outside of the cluster hostNetwork: true + location: bl45p # TODO remove me when schema is fixed # affinity and tolerations to get the right nodes on pollux securityContext: @@ -19,7 +21,15 @@ ioc-instance: pvc: false hostPath: /dls/p45/data - useAffinity: true + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: beamline + operator: In + values: + - bl45p tolerations: - key: beamline From e84bcccfe4cdd73c956a37128a677086ff927f0c Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Thu, 7 Nov 2024 15:09:35 +0000 Subject: [PATCH 4/4] skip helm chart checks for internal helm chart refs --- .github/workflows/ci_skip_checks | 1 + .github/workflows/ci_verify.sh | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci_skip_checks diff --git a/.github/workflows/ci_skip_checks b/.github/workflows/ci_skip_checks new file mode 100644 index 0000000..49dddfe --- /dev/null +++ b/.github/workflows/ci_skip_checks @@ -0,0 +1 @@ +daq-nexus diff --git a/.github/workflows/ci_verify.sh b/.github/workflows/ci_verify.sh index deca0bd..922c240 100755 --- a/.github/workflows/ci_verify.sh +++ b/.github/workflows/ci_verify.sh @@ -8,7 +8,8 @@ # other future services that don't use ibek, we will need to add a standard # entrypoint for validating the config folder mounted at /config. -ROOT=$(realpath $(dirname ${0})/../..) +HERE=$(realpath $(dirname ${0})) +ROOT=$(realpath ${HERE}/../..) set -xe rm -rf ${ROOT}/.ci_work/ mkdir -p ${ROOT}/.ci_work @@ -23,18 +24,27 @@ for service in ${ROOT}/services/*/ # */ to skip files do ### Lint each service chart and validate if schema given ### service_name=$(basename $service) + + # skip services appearing in ci_skip_checks + checks=${HERE}/ci_skip_checks + if [[ -f ${checks} ]] && grep -q ${service_name} ${checks}; then + echo "Skipping ${service_name}" + continue + fi + schema=$(cat ${service}/values.yaml | sed -rn 's/^# yaml-language-server: \$schema=(.*)/\1/p') if [ -n "${schema}" ]; then echo "{\"\$ref\": \"$schema\"}" > ${ROOT}/.ci_work/$service_name/values.schema.json fi + $docker run --rm --entrypoint bash \ -v ${ROOT}/.ci_work:/services \ alpine/helm:3.14.3 \ - -c "helm dependency update /services/$service_name" - $docker run --rm --entrypoint bash \ - -v ${ROOT}/.ci_work:/services \ - alpine/helm:3.14.3 \ - -c "helm lint /services/$service_name --values /services/values.yaml" + -c " + helm lint /services/$service_name --values /services/values.yaml && + helm dependency update /services/$service_name && + rm -rf /services/$service_name/charts + " ### Valiate each ioc config ### # Skip if subfolder has no config to validate @@ -64,4 +74,4 @@ do done -rm -r ${ROOT}/.ci_work \ No newline at end of file +rm -r ${ROOT}/.ci_work