Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
05b6373
adding time-stamp cronjob to blueapi and a corasponding test
Alexj9837 Apr 1, 2026
f49f88b
Merge branch 'DiamondLightSource:main' into last-used-stamper
Alexj9837 Apr 1, 2026
887543b
changing version so it publishes a chart
Alexj9837 Apr 1, 2026
e014ae2
updating tag.
Alexj9837 Apr 1, 2026
eef07a9
updating appversion
Alexj9837 Apr 1, 2026
3484be1
update chart
Alexj9837 Apr 1, 2026
c170359
reverting app version for tests
Alexj9837 Apr 1, 2026
c4f9f1a
updating cronjob version
Alexj9837 Apr 2, 2026
13d6101
updating chart
Alexj9837 Apr 2, 2026
d0ca3a9
Merge branch 'DiamondLightSource:main' into last-used-stamper
Alexj9837 Apr 2, 2026
6bc24f5
Merge pull request #1 from Alexj9837/last-used-stamper
Alexj9837 Apr 2, 2026
74cd4d3
setting to latest
Alexj9837 Apr 2, 2026
b4466c0
Merge pull request #2 from Alexj9837/last-used-stamper
Alexj9837 Apr 2, 2026
078caee
updating the script
Alexj9837 Apr 2, 2026
51fa294
Merge pull request #3 from Alexj9837/last-used-stamper
Alexj9837 Apr 2, 2026
f60c11b
updating the chart
Alexj9837 Apr 2, 2026
5540e23
Merge pull request #4 from Alexj9837/last-used-stamper
Alexj9837 Apr 2, 2026
fb418aa
fix: Last used stamper (#5)
Alexj9837 Apr 7, 2026
e80b4af
fix: Last used stamper (#6)
Alexj9837 Apr 7, 2026
2d41034
adding time-stamp cronjob to blueapi and a corasponding test
Alexj9837 Apr 1, 2026
aa9a062
changing version so it publishes a chart
Alexj9837 Apr 1, 2026
58fdd1e
updating tag.
Alexj9837 Apr 1, 2026
f3c30ec
updating appversion
Alexj9837 Apr 1, 2026
9c8fe93
update chart
Alexj9837 Apr 1, 2026
67497fa
reverting app version for tests
Alexj9837 Apr 1, 2026
0242e42
updating cronjob version
Alexj9837 Apr 2, 2026
3304484
updating chart
Alexj9837 Apr 2, 2026
7d506f7
setting to latest
Alexj9837 Apr 2, 2026
223eed5
updating the script
Alexj9837 Apr 2, 2026
c657106
updating the chart
Alexj9837 Apr 2, 2026
04903ef
fix: Last used stamper (#5)
Alexj9837 Apr 7, 2026
5e30291
fix: Last used stamper (#6)
Alexj9837 Apr 7, 2026
582845f
feat: add last-used-stamper cronjob
Alexj9837 Apr 7, 2026
1c22291
wrapped the job, incase it's disabled
Alexj9837 Apr 8, 2026
d9c344e
Merge branch 'main' into last-used-stamper
Alexj9837 Apr 9, 2026
a906aea
Merge remote-tracking branch 'origin/last-used-stamper' into time-sta…
Alexj9837 Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helm/blueapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ A Helm chart deploying a worker pod that runs Bluesky plans
| serviceAccount.create | bool | `false` | |
| serviceAccount.name | string | `""` | |
| startupProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/healthz","port":"http"},"periodSeconds":10}` | A more lenient livenessProbe to allow the service to start fully. This is automatically disabled when in debug mode. |
| timeStampCron.enabled | bool | `true` | |
| tolerations | list | `[]` | May be required to run on specific nodes (e.g. the control machine) |
| tracing | object | `{"fastapi":{"excludedURLs":"/healthz"},"otlp":{"enabled":false,"protocol":"http/protobuf","server":{"host":"http://opentelemetry-collector.tracing","port":4318}}}` | Exclude health probe requests from tracing by default to prevent spamming |
| volumeMounts | list | `[{"mountPath":"/config","name":"worker-config","readOnly":true}]` | Additional volumeMounts on the output StatefulSet definition. Define how volumes are mounted to the container referenced by using the same name. |
Expand Down
20 changes: 20 additions & 0 deletions helm/blueapi/files/scripts/time-stamper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
# Get PVCs belonging to this blueapi release
ALL_PVC=$(kubectl get pvc -n $RELEASE_NAMESPACE \
-o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | \
grep "^$RELEASE_NAME-scratch-")
# Get all PVCs currently mounted by running pods
MOUNTED_PVCS=$(kubectl get pods -n $RELEASE_NAMESPACE \
-o=jsonpath='{.items[*].spec.volumes[*].persistentVolumeClaim.claimName}' | tr ' ' '\n' | sort -u)
NOW=$(date +%s)
#loop through all the pvcs annotating ones thare are mounted or lack a last-used stamp
for pvc in $ALL_PVC; do
# Checks if Annotation for last-used is empty
ANNOTATION=$(kubectl get pvc "$pvc" -n $RELEASE_NAMESPACE -o=jsonpath='{.metadata.annotations.last-used}')
# -z checks if ANNOTATION is empty, if its empty or mounted to updates last-used else it ignores it
if [ -z "$ANNOTATION" ]; then
kubectl annotate --overwrite pvc "$pvc" -n $RELEASE_NAMESPACE last-used="$NOW"
elif echo "$MOUNTED_PVCS" | grep -qx "$pvc"; then
kubectl annotate --overwrite pvc "$pvc" -n $RELEASE_NAMESPACE last-used="$NOW"
fi
done
8 changes: 8 additions & 0 deletions helm/blueapi/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@
}
}
},
"timeStampCron": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
},
"tolerations": {
"description": "May be required to run on specific nodes (e.g. the control machine)",
"type": "array"
Expand Down
3 changes: 3 additions & 0 deletions helm/blueapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ initContainer:
# -- Size of persistent volume
size: "1Gi"

timeStampCron:
enabled: true

debug:
# -- If enabled, runs debugpy, allowing port-forwarding to expose port 5678 or attached vscode instance
enabled: false
Expand Down
Loading