From 47056c9aba9da28c04c3eab533be56072cea38e2 Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Mon, 18 Nov 2024 08:51:53 +0000 Subject: [PATCH] update andor2 debug.yaml - now working --- services/bl99p-ea-ioc-01/Chart.yaml | 2 +- services/bl99p-ea-ioc-01/debug.yaml | 21 +++++++----- services/bl99p-ea-ioc-05/debug.yaml | 49 +++++++++++++++++++++++++--- services/bl99p-ea-ioc-05/values.yaml | 10 +----- 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/services/bl99p-ea-ioc-01/Chart.yaml b/services/bl99p-ea-ioc-01/Chart.yaml index 29124d1..2ed3edd 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.1.2+b1 + version: 4.1.2 repository: "oci://ghcr.io/epics-containers" diff --git a/services/bl99p-ea-ioc-01/debug.yaml b/services/bl99p-ea-ioc-01/debug.yaml index 3f7a099..7a0d1d5 100644 --- a/services/bl99p-ea-ioc-01/debug.yaml +++ b/services/bl99p-ea-ioc-01/debug.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: Pod metadata: - name: debug-andor2 + name: debug-andor3 labels: is_ioc: "true" spec: serviceAccountName: default-full-access-mounted containers: - - name: debug-andor2 - image: gcr.io/diamond-privreg/controls/prod/iocs/ioc-adandor-linux-developer:2024.10.2 + - name: debug-andor3 + image: ghcr.io/epics-containers/ioc-adandor3-developer:2024.10.2b4 command: - bash args: @@ -20,24 +20,29 @@ spec: limits: memory: "2Gi" cpu: "1" - diamond.ac.uk/andor2usb: 1 + diamond.ac.uk/andor3pci: 1 requests: memory: "1Gi" cpu: "500m" - diamond.ac.uk/andor2usb: 1 + diamond.ac.uk/andor3pci: 1 - # securityContext: - # privileged: true - # allowPrivilegeEscalation: true + securityContext: + privileged: true + allowPrivilegeEscalation: true volumeMounts: - mountPath: /dev/bus/usb/ name: devices + - mountPath: /data + name: sdklibs volumes: - name: devices persistentVolumeClaim: claimName: dev-usb + - name: sdklibs + persistentVolumeClaim: + claimName: p99-ea-ioc-01-libraries affinity: nodeAffinity: diff --git a/services/bl99p-ea-ioc-05/debug.yaml b/services/bl99p-ea-ioc-05/debug.yaml index 3f7a099..e8e1e5a 100644 --- a/services/bl99p-ea-ioc-05/debug.yaml +++ b/services/bl99p-ea-ioc-05/debug.yaml @@ -5,6 +5,10 @@ metadata: labels: is_ioc: "true" spec: + # NOTE: for best debug experience, set hostNetwork to false + # OR: to be able to see the PVs outside the cluster set to true + hostNetwork: true + runtimeClassName: usb-compat serviceAccountName: default-full-access-mounted containers: - name: debug-andor2 @@ -12,6 +16,9 @@ spec: command: - bash args: + # use this value to automatically start the IOC + # - "/epics/ioc/start.sh" + # use this value to keep the container running indefinetely for debugging - "-c" - | echo "keep running indefinetely" @@ -31,13 +38,19 @@ spec: # allowPrivilegeEscalation: true volumeMounts: - - mountPath: /dev/bus/usb/ - name: devices + # - mountPath: /dev/bus/usb/ + # name: devices + - mountPath: /epics/ioc/config + name: config-volume volumes: - - name: devices - persistentVolumeClaim: - claimName: dev-usb + # - name: devices + # persistentVolumeClaim: + # claimName: dev-usb + - configMap: + defaultMode: 420 + name: bl99p-ea-ioc-05-config + name: config-volume affinity: nodeAffinity: @@ -48,3 +61,29 @@ spec: operator: In values: - bl99p-ea-serv-01.diamond.ac.uk +# Embed the ioc.yaml as a config map ------------------------------------------- +# NOTE: update this text by running the following command and extracting the +# ConfigMap section: +# helm template bl99p-ea-ioc-05 services/bl99p-ea-ioc-05/ --values=services/values.yaml [7:45:31] +--- +# Source: ec-service/templates/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: bl99p-ea-ioc-05-config + labels: + app: bl99p-ea-ioc-05 +data: + # contents of the ioc instance config folder + ioc.yaml: "# yaml-language-server: $schema=/epics/ibek-defs/adandor.ibek.support.yaml\n\n# + TODO replace above with the generic IOC schema this IOC is based on\nioc_name: \"{{ + _global.get_env('IOC_NAME') }}\"\n\ndescription: REPLACE WITH DESCRIPTION\n\nentities:\n + \ - type: epics.EpicsEnvSet\n name: EPICS_TZ\n value: GMT0BST\n\n - type: + devIocStats.iocAdminSoft\n IOC: \"{{ ioc_name | upper }}\"\n\n\n - type: epics.EpicsEnvSet\n + \ name: EPICS_TS_MIN_WEST\n value: '0'\n \n - type: epics.EpicsCaMaxArrayBytes\n + \ max_bytes: 9000000\n\n - type: ADAndor.andorCCD\n ADDR: 0\n BUFFERS: + 2000\n INSTALLPATH: |-\n /epics/support/andorCCDSDK/andorCCDSDKApp/src/sdk/andor/etc/\n + \ P: BL99P-EA-DET-03\n PORT: DET3.cam\n R: ':CAM:'\n TIMEOUT: 1\n\n - + type: ADCore.NDPosPlugin\n ADDR: 0\n BLOCK: 0\n ENABLED: 1\n NDARRAY_PORT: + DET3.cam\n P: BL99P-EA-DET-03\n PORT: DET3.pos\n QUEUE: 1000\n R: ':POS:'\n + \ TIMEOUT: 1" diff --git a/services/bl99p-ea-ioc-05/values.yaml b/services/bl99p-ea-ioc-05/values.yaml index 8f1bbbc..fafec8a 100644 --- a/services/bl99p-ea-ioc-05/values.yaml +++ b/services/bl99p-ea-ioc-05/values.yaml @@ -10,20 +10,12 @@ ioc-instance: limits: cpu: 2 memory: 512Mi + diamond.ac.uk/andor2usb: 1 requests: cpu: 500m memory: 128Mi diamond.ac.uk/andor2usb: 1 - volumes: - - name: usb-devices - persistentVolumeClaim: - claimName: dev-usb - - volumeMounts: - - mountPath: /dev/bus/usb/ - name: usb-devices - # NOTE: the following are suggestions to help with debugging IOCs # 1. replace the runtime container with the developer version # this adds tools and compilers to the container so you