Skip to content

About

A simulation beamline that goes up to 11

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

t11 IOC Instances and Services

This repository holds the a definition of t11 IOC Instances and services. Each sub folder of the services directory contains a helm chart for a specific service or IOC. The corresponding deployments repo can be found at [https://gitlab.diamond.ac.uk/controls/containers/beamline/t11-deployment].

Standalone DAQ stack

The template comparison records differences from the Copier templates, promotion assessments and standalone test-beamline settings.

This repo is a self-contained simulation: everything it needs runs inside the namespace. Unlike a real beamline it does not use identity.diamond.ac.uk, the central authz bundler, numtracker-staging.diamond.ac.uk or tiled.diamond.ac.uk.

service what it is ported from
t11-rabbitmq message broker (stomp on 61613) daq-services rabbitmq
t11-keycloak identity provider + realm bootstrap daq-services keycloak
t11-opa Open Policy Agent, local data + published policy bundle daq-services opa
t11-numtracker scan-number service, sqlite on its own PVC daq-services numtracker
t11-tiled data access, in-memory sqlite daq-services tiled
t11-blueapi bluesky worker + oauth2-proxy daq-services blueapi-oauth2-proxy

Simulated hardware comes from the IOC instances bl11t-di-cam-01, bl11t-ea-test-01 and bl11t-mo-sim-01.

Credentials

Every secret in this stack is a plain Secret holding a dev value, not a SealedSecret: the sim must deploy without a sealed-secrets controller. Keycloak runs start-dev with its H2 database on a PVC, so users, clients and the signing keys survive a restart. A postStart hook runs the bootstrap script on every container start; it creates the realm on a new volume and skips what already exists. Demo users are alice/alice and bob/bob, admin is admin/admin. None of this is fit for production.

Known limits

  • Browser logins work only for blueapi. The blueapi web UI is at http://127.0.0.1:18080/docs, and a browser logs in there as alice/alice. The oauth2-proxy Pod serves Keycloak's login pages through an nginx sidecar, which calls Keycloak as t11-keycloak:8080 so that the token issuer is right, and rewrites Keycloak's absolute URLs into relative ones. The tiled UI has no such proxy, so its login still needs an Ingress. The Keycloak admin console works at http://127.0.0.1:8080/admin. Run scripts/connect.sh <namespace> from t11-deployment and leave it running while using these URLs or the OPI server at http://127.0.0.1:18081. These three web Services are ClusterIP; only the EPICS gateway retains a LoadBalancer, consuming one floating IP per beamline at DLS. CA/PVA and camera images continue to use that gateway directly.
  • t11-blueapi needs dodal.beamlines.t11, which is not in a dodal release yet. The worker installs dodal from its t11 branch until it is; dodal/t11.py is the reference copy of that module.
  • t11-opa pulls its policy bundle from ghcr.io/diamondlightsource/authz-policy and t11-blueapi clones dodal from GitHub. Both are public artifacts, not Diamond services, but they do mean the cluster needs egress.

Using pre-commit hooks

Pre commit hooks will validate the synoptic and additional soft support if present. To install pre-commit hooks run:

uvx pre-commit install

To force execution of the pre-commit hooks on all files run:

uvx pre-commit run --all-files

Vendoring runtime support

Runtime support (stream protocol files, EPICS DB templates and the ibek entity models that describe them) is vendored directly into each IOC instance's config/ folder from a central pattern library (e.g. ibek-runtime-streamdevice or ibek-runtime-support).

config/ is the Kubernetes ConfigMap that is mounted into the running container, so it holds runtime inputs only and must stay under 1 MiB.

Manage vendored patterns from the repo root with ibek pattern:

# vendor a pattern (writes config/ files + ../runtime-lock.yaml + ../ioc.schema.json)
ibek pattern add <library>:<pattern>@<tag> services/<instance>

# re-vendor after a version bump (e.g. raised by Renovate on runtime-lock.yaml)
ibek pattern update services/<instance>

# verify on-disk vendored files still match their recorded sha256 hashes
ibek pattern check services/<instance>

# restore a vendored file that was accidentally edited
ibek pattern restore services/<instance>

How it fits together:

  • services/<instance>/runtime-lock.yaml — records the library source, the pinned version (git tag) and the sha256 of every vendored file. Renovate watches this file and raises a PR when a new library release is available; after a bump CI / the maintainer must re-run ibek pattern update.
  • services/<instance>/ioc.schema.json — a per-instance JSON schema (referenced from the first line of config/ioc.yaml) generated by ibek pattern schema. It is regenerated by a pre-commit hook and combines the base IOC schema, every vendored pattern's entity models and any local *.ibek.support.yaml you drop into config/.
  • Local beamline support — for one-off, beamline-specific support just add a plain editable *.ibek.support.yaml (plus any DB/proto it needs) directly in config/. It is not recorded in the lock file and is merged into the schema automatically, so you can edit it freely.
  • Vendored files carry a DO NOT EDIT header and are content-addressed; never hand-edit them (CI verifies their hashes via ibek pattern check). A new formatter / EOL pre-commit hook must exclude the files listed in runtime-lock.yaml.

Note: the old top-level ibek-runtime-support/ directory, the global runtime.schema.json and the per-repo schema pre-commit hook have been retired in favour of this per-instance vendoring model.

About

A simulation beamline that goes up to 11

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages