From cb394948c8707c2bc072138601573a2f5a6286ad Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 11 Oct 2024 10:31:03 +0100 Subject: [PATCH 1/3] fix namespace in environment.sh --- environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.sh b/environment.sh index cc1fdd1..365d826 100644 --- a/environment.sh +++ b/environment.sh @@ -41,7 +41,7 @@ source <(ec --show-completion ${SHELL}) module unload k8s-p99 > /dev/null module load k8s-p99 > /dev/null # set the default namespace for kubectl and helm (for convenience only) -kubectl config set-context --current --namespace=k8s-p99 +kubectl config set-context --current --namespace=p99-beamline # make sure the user has provided credentials kubectl version From 752219dc4759d6cc730c0980d7e4558f4766c31a Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 11 Oct 2024 12:20:43 +0100 Subject: [PATCH 2/3] make environment.sh point at current github org --- environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.sh b/environment.sh index 365d826..5a91f59 100644 --- a/environment.sh +++ b/environment.sh @@ -17,7 +17,7 @@ export EC_CLI_BACKEND="K8S" # the namespace to use for kubernetes deployments export EC_TARGET=p99-beamline # the git repo for this project -export EC_SERVICES_REPO=https://github.com/MaxHerbs/p99-services +export EC_SERVICES_REPO=https://github.com/epics-containers/p99-services # declare your centralised log server Web UI 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}*" From 488539c792c8df0747b4839e7993319d5e755c4d Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Fri, 11 Oct 2024 12:21:32 +0100 Subject: [PATCH 3/3] add andor3sdk pvc --- services/bl99p-ea-ioc-01/Chart.yaml | 4 +-- services/bl99p-ea-ioc-01/config/ioc.yaml | 14 ++++---- services/bl99p-ea-ioc-01/library_pvc.yaml | 44 +++++++++++++++++++++++ services/bl99p-ea-ioc-01/values.yaml | 25 +++++++++++-- 4 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 services/bl99p-ea-ioc-01/library_pvc.yaml diff --git a/services/bl99p-ea-ioc-01/Chart.yaml b/services/bl99p-ea-ioc-01/Chart.yaml index 5732737..29124d1 100644 --- a/services/bl99p-ea-ioc-01/Chart.yaml +++ b/services/bl99p-ea-ioc-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+b1 + repository: "oci://ghcr.io/epics-containers" diff --git a/services/bl99p-ea-ioc-01/config/ioc.yaml b/services/bl99p-ea-ioc-01/config/ioc.yaml index 9d53f63..89fd4fd 100644 --- a/services/bl99p-ea-ioc-01/config/ioc.yaml +++ b/services/bl99p-ea-ioc-01/config/ioc.yaml @@ -6,13 +6,12 @@ ioc_name: "{{ _global.get_env('IOC_NAME') }}" description: REPLACE WITH DESCRIPTION entities: - - type: epics.EpicsEnvSet name: EPICS_TS_MIN_WEST - value: '0' + value: "0" - type: devIocStats.iocAdminSoft - IOC: '{{ ioc_name | upper }}' + IOC: "{{ ioc_name | upper }}" - type: epics.EpicsCaMaxArrayBytes max_bytes: 9000000 @@ -22,15 +21,14 @@ entities: BUFFERS: 50000 P: BL99P-EA-DET-01 PORT: ZYLA.CAM - R: ':CAM:' + R: ":CAM:" SCANRATE: .1 second - SET_SDK_ENV: 'True' + SET_SDK_ENV: "True" TIMEOUT: 1 - ANDOR_SDK3: -| - SDK PATH HERE + ANDOR_SDK3: /data - type: ADCore.NDPosPlugin NDARRAY_PORT: ZYLA.CAM P: BL99P-EA-DET-01 PORT: POS - R: ':POS:' + R: ":POS:" diff --git a/services/bl99p-ea-ioc-01/library_pvc.yaml b/services/bl99p-ea-ioc-01/library_pvc.yaml new file mode 100644 index 0000000..984cf0d --- /dev/null +++ b/services/bl99p-ea-ioc-01/library_pvc.yaml @@ -0,0 +1,44 @@ +# this PVC is used to hold the proprietary libraries from the Andor3SDK +# that are loaded at runtime by the IOC + +# for the moment we manually deploy this with kubectl but will make it +# part of the ioc deployment workflow in the future (with an init container +# or maybe host script to load the libraries from a specified location) + +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: p99-ea-ioc-01-libraries + labels: + app: bl99p-ea-ioc-01 + ioc_group: p99 +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi +--- +kind: Pod +apiVersion: v1 +metadata: + name: p99-ea-ioc-01-libraries-loader + labels: + app: bl99p-ea-ioc-01 + ioc_group: p99 +spec: + containers: + - name: myapp + image: busybox + resources: + limits: + memory: "128Mi" + cpu: "500m" + volumeMounts: + - name: mypvc + mountPath: /data + command: ["sleep", "infinity"] + volumes: + - name: mypvc + persistentVolumeClaim: + claimName: p99-ea-ioc-01-libraries diff --git a/services/bl99p-ea-ioc-01/values.yaml b/services/bl99p-ea-ioc-01/values.yaml index 38d0952..79b6395 100644 --- a/services/bl99p-ea-ioc-01/values.yaml +++ b/services/bl99p-ea-ioc-01/values.yaml @@ -1,6 +1,27 @@ # yaml-language-server: $schema=https://github.com/epics-containers/ec-helm-charts/releases/download/3.4.4/ioc-instance.schema.json#/$defs/service ioc-instance: - image: REPLACE_WITH_IMAGE_URI + image: ghcr.io/epics-containers/ioc-adandor3-runtime:2024.10.1 + + # mount a pvc with the andor3 sdk libraries + pvClaims: + - name: sdklibs + claimName: p99-ea-ioc-01-libraries + mountPath: /data + subPath: . + + dataVolume: + pvc: false + hostPath: /dls/p99/data + + resources: + limits: + cpu: 2 + memory: 512Mi + diamond.ac.uk/andor3pci: 1 + requests: + cpu: 500m + memory: 128Mi + diamond.ac.uk/andor3pci: 1 # NOTE: the following are suggestions to help with debugging IOCs # 1. replace the runtime container with the developer version @@ -18,4 +39,4 @@ ioc-instance: # is fixed. # # startCommand: sleep - # startArgs: infinity \ No newline at end of file + # startArgs: infinity