From a43e7ffcd19bf5c8358cce1f1e36085a9e51bb29 Mon Sep 17 00:00:00 2001 From: Relm-Arrowny Date: Fri, 18 Sep 2026 14:29:47 +0000 Subject: [PATCH 1/3] add uv lock --- helm/blueapi/config_schema.json | 1216 +++++++++++++------------- helm/blueapi/values.schema.json | 6 + src/blueapi/cli/scratch.py | 23 +- src/blueapi/config.py | 4 + tests/unit_tests/cli/test_scratch.py | 17 + 5 files changed, 657 insertions(+), 609 deletions(-) diff --git a/helm/blueapi/config_schema.json b/helm/blueapi/config_schema.json index 0755a2c6e..c04e855f1 100644 --- a/helm/blueapi/config_schema.json +++ b/helm/blueapi/config_schema.json @@ -1,620 +1,626 @@ { - "$defs": { - "BasicAuthentication": { - "additionalProperties": false, - "description": "User credentials for basic authentication", - "properties": { - "username": { - "description": "Unique identifier for user", - "title": "Username", - "type": "string" - }, - "password": { - "description": "Password to verify user's identity", - "title": "Password", - "type": "string" - } - }, - "required": [ - "username", - "password" - ], - "title": "BasicAuthentication", - "type": "object", - "$id": "BasicAuthentication" - }, - "CORSConfig": { - "additionalProperties": false, - "properties": { - "origins": { - "items": { - "type": "string" - }, - "title": "Origins", - "type": "array" - }, - "allow_credentials": { - "default": false, - "title": "Allow Credentials", - "type": "boolean" - }, - "allow_methods": { - "default": [ - "*" - ], - "items": { - "type": "string" - }, - "title": "Allow Methods", - "type": "array" - }, - "allow_headers": { - "default": [ - "*" - ], - "items": { - "type": "string" - }, - "title": "Allow Headers", - "type": "array" - } - }, - "required": [ - "origins" - ], - "title": "CORSConfig", - "type": "object", - "$id": "CORSConfig" - }, - "DeviceManagerSource": { - "additionalProperties": false, - "properties": { - "module": { - "description": "Module to be imported", - "title": "Module", - "type": "string" - }, - "kind": { - "const": "deviceManager", - "default": "deviceManager", - "title": "Kind", - "type": "string" - }, - "mock": { - "default": false, - "description": "If true, ophyd_async device connections are mocked", - "title": "Mock", - "type": "boolean" - }, - "name": { - "default": "devices", - "description": "Name of the device manager in the module", - "title": "Name", - "type": "string" - } - }, - "required": [ - "module" - ], - "title": "DeviceManagerSource", - "type": "object", - "$id": "DeviceManagerSource" - }, - "EnvironmentConfig": { - "additionalProperties": false, - "description": "Config for the RunEngine environment", - "properties": { - "sources": { - "default": [], - "items": { - "discriminator": { - "mapping": { - "deviceManager": "DeviceManagerSource", - "planFunctions": "PlanSource" - }, - "propertyName": "kind" - }, - "oneOf": [ - { - "$ref": "PlanSource" - }, - { - "$ref": "DeviceManagerSource" - } - ] - }, - "title": "Sources", - "type": "array" - }, - "events": { - "$ref": "WorkerEventConfig" - }, - "metadata": { - "anyOf": [ - { - "$ref": "MetadataConfig" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "EnvironmentConfig", - "type": "object", - "$id": "EnvironmentConfig" - }, - "GraylogConfig": { - "additionalProperties": false, - "properties": { - "enabled": { - "default": false, - "title": "Enabled", - "type": "boolean" - }, - "url": { - "default": "tcp://localhost:5555", - "format": "uri", - "minLength": 1, - "title": "Url", - "type": "string" - } - }, - "title": "GraylogConfig", - "type": "object", - "$id": "GraylogConfig" - }, - "LoggingConfig": { - "additionalProperties": false, - "properties": { - "level": { - "default": "INFO", - "enum": [ - "NOTSET", - "DEBUG", - "INFO", - "WARNING", - "ERROR", - "CRITICAL" - ], - "title": "Level", - "type": "string" - }, - "graylog": { - "$ref": "GraylogConfig", - "default": { - "enabled": false, - "url": "tcp://localhost:5555" - } - } - }, - "title": "LoggingConfig", - "type": "object", - "$id": "LoggingConfig" - }, - "MetadataConfig": { - "additionalProperties": false, - "properties": { - "instrument": { - "title": "Instrument", - "type": "string" - } - }, - "required": [ - "instrument" - ], - "title": "MetadataConfig", - "type": "object", - "$id": "MetadataConfig" - }, - "NumtrackerConfig": { - "additionalProperties": false, - "properties": { - "url": { - "default": "http://localhost:8406/graphql", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Url", - "type": "string" - }, - "detector_file_template": { - "default": "{instrument}-{scan_id}-{device_name}", - "title": "Detector File Template", - "type": "string" - } - }, - "title": "NumtrackerConfig", - "type": "object", - "$id": "NumtrackerConfig" - }, - "OIDCConfig": { - "additionalProperties": false, - "properties": { - "well_known_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "deprecated": true, - "description": "URL to fetch OIDC config from the provider", - "title": "Well Known Url" - }, - "issuer": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "URL of OIDC provider", - "title": "Issuer" - }, - "client_id": { - "description": "Client ID", - "title": "Client Id", - "type": "string" - }, - "client_audience": { - "default": "blueapi", - "description": "Client Audience(s)", - "title": "Client Audience", - "type": "string" - }, - "logout_redirect_endpoint": { - "default": "", - "description": "The oidc endpoint required to logout", - "title": "Logout Redirect Endpoint", - "type": "string" - } - }, - "required": [ - "client_id" - ], - "title": "OIDCConfig", - "type": "object", - "$id": "OIDCConfig" - }, - "OpaConfig": { - "additionalProperties": false, - "properties": { - "root": { - "default": "http://localhost:8181/", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Root", - "type": "string" - }, - "audience": { - "default": "account", - "title": "Audience", - "type": "string" - }, - "tiled_service_account_check": { - "default": "blueapi/tiled_service_account_for_beamline", - "title": "Tiled Service Account Check", - "type": "string" - }, - "submit_task_check": { - "default": "blueapi/write_to_beamline_visit", - "title": "Submit Task Check", - "type": "string" - }, - "admin_check": { - "default": "admin/admin", - "title": "Admin Check", - "type": "string" - } + "$defs": { + "BasicAuthentication": { + "additionalProperties": false, + "description": "User credentials for basic authentication", + "properties": { + "username": { + "description": "Unique identifier for user", + "title": "Username", + "type": "string" + }, + "password": { + "description": "Password to verify user's identity", + "title": "Password", + "type": "string" + } + }, + "required": [ + "username", + "password" + ], + "title": "BasicAuthentication", + "type": "object", + "$id": "BasicAuthentication" + }, + "CORSConfig": { + "additionalProperties": false, + "properties": { + "origins": { + "items": { + "type": "string" + }, + "title": "Origins", + "type": "array" + }, + "allow_credentials": { + "default": false, + "title": "Allow Credentials", + "type": "boolean" + }, + "allow_methods": { + "default": [ + "*" + ], + "items": { + "type": "string" + }, + "title": "Allow Methods", + "type": "array" + }, + "allow_headers": { + "default": [ + "*" + ], + "items": { + "type": "string" + }, + "title": "Allow Headers", + "type": "array" + } + }, + "required": [ + "origins" + ], + "title": "CORSConfig", + "type": "object", + "$id": "CORSConfig" + }, + "DeviceManagerSource": { + "additionalProperties": false, + "properties": { + "module": { + "description": "Module to be imported", + "title": "Module", + "type": "string" + }, + "kind": { + "const": "deviceManager", + "default": "deviceManager", + "title": "Kind", + "type": "string" + }, + "mock": { + "default": false, + "description": "If true, ophyd_async device connections are mocked", + "title": "Mock", + "type": "boolean" + }, + "name": { + "default": "devices", + "description": "Name of the device manager in the module", + "title": "Name", + "type": "string" + } + }, + "required": [ + "module" + ], + "title": "DeviceManagerSource", + "type": "object", + "$id": "DeviceManagerSource" + }, + "EnvironmentConfig": { + "additionalProperties": false, + "description": "Config for the RunEngine environment", + "properties": { + "sources": { + "default": [], + "items": { + "discriminator": { + "mapping": { + "deviceManager": "DeviceManagerSource", + "planFunctions": "PlanSource" + }, + "propertyName": "kind" }, - "title": "OpaConfig", - "type": "object", - "$id": "OpaConfig" - }, - "PlanSource": { - "additionalProperties": false, - "properties": { - "module": { - "description": "Module to be imported", - "title": "Module", - "type": "string" - }, - "kind": { - "const": "planFunctions", - "default": "planFunctions", - "title": "Kind", - "type": "string" - } + "oneOf": [ + { + "$ref": "PlanSource" + }, + { + "$ref": "DeviceManagerSource" + } + ] + }, + "title": "Sources", + "type": "array" + }, + "events": { + "$ref": "WorkerEventConfig" + }, + "metadata": { + "anyOf": [ + { + "$ref": "MetadataConfig" }, - "required": [ - "module" - ], - "title": "PlanSource", - "type": "object", - "$id": "PlanSource" - }, - "RestConfig": { - "additionalProperties": false, - "properties": { - "url": { - "default": "http://localhost:8000/", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Url", - "type": "string" - }, - "cors": { - "anyOf": [ - { - "$ref": "CORSConfig" - }, - { - "type": "null" - } - ], - "default": null - } + { + "type": "null" + } + ], + "default": null + } + }, + "title": "EnvironmentConfig", + "type": "object", + "$id": "EnvironmentConfig" + }, + "GraylogConfig": { + "additionalProperties": false, + "properties": { + "enabled": { + "default": false, + "title": "Enabled", + "type": "boolean" + }, + "url": { + "default": "tcp://localhost:5555", + "format": "uri", + "minLength": 1, + "title": "Url", + "type": "string" + } + }, + "title": "GraylogConfig", + "type": "object", + "$id": "GraylogConfig" + }, + "LoggingConfig": { + "additionalProperties": false, + "properties": { + "level": { + "default": "INFO", + "enum": [ + "NOTSET", + "DEBUG", + "INFO", + "WARNING", + "ERROR", + "CRITICAL" + ], + "title": "Level", + "type": "string" + }, + "graylog": { + "$ref": "GraylogConfig", + "default": { + "enabled": false, + "url": "tcp://localhost:5555" + } + } + }, + "title": "LoggingConfig", + "type": "object", + "$id": "LoggingConfig" + }, + "MetadataConfig": { + "additionalProperties": false, + "properties": { + "instrument": { + "title": "Instrument", + "type": "string" + } + }, + "required": [ + "instrument" + ], + "title": "MetadataConfig", + "type": "object", + "$id": "MetadataConfig" + }, + "NumtrackerConfig": { + "additionalProperties": false, + "properties": { + "url": { + "default": "http://localhost:8406/graphql", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Url", + "type": "string" + }, + "detector_file_template": { + "default": "{instrument}-{scan_id}-{device_name}", + "title": "Detector File Template", + "type": "string" + } + }, + "title": "NumtrackerConfig", + "type": "object", + "$id": "NumtrackerConfig" + }, + "OIDCConfig": { + "additionalProperties": false, + "properties": { + "well_known_url": { + "anyOf": [ + { + "type": "string" }, - "title": "RestConfig", - "type": "object", - "$id": "RestConfig" - }, - "ScratchConfig": { - "additionalProperties": false, - "properties": { - "root": { - "default": "/tmp/scratch/blueapi", - "description": "The root directory of the scratch area, all repositories will be cloned under this directory.", - "format": "path", - "title": "Root", - "type": "string" - }, - "required_gid": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "description": "\nRequired owner GID for the scratch directory. If supplied, the setup-scratch\ncommand will check the scratch area ownership and raise an error if it is\nnot owned by , or if it does not have SGID permission bit set.\n", - "title": "Required Gid" - }, - "repositories": { - "description": "Details of repositories to be cloned and imported into blueapi", - "items": { - "$ref": "ScratchRepository" - }, - "title": "Repositories", - "type": "array" - } + { + "type": "null" + } + ], + "default": null, + "deprecated": true, + "description": "URL to fetch OIDC config from the provider", + "title": "Well Known Url" + }, + "issuer": { + "anyOf": [ + { + "type": "string" }, - "title": "ScratchConfig", - "type": "object", - "$id": "ScratchConfig" - }, - "ScratchRepository": { - "additionalProperties": false, - "properties": { - "name": { - "default": "example", - "description": "Unique name for this repository in the scratch directory", - "title": "Name", - "type": "string" - }, - "remote_url": { - "default": "https://github.com/example/example.git", - "description": "URL to clone from", - "title": "Remote Url", - "type": "string" - }, - "target_revision": { - "description": "Revision (branch or tag) to check out when cloning - defaults to remote's HEAD. If a tag is used, the repo will be left in a 'detached head' state.", - "title": "Target Revision", - "type": "string" - } + { + "type": "null" + } + ], + "default": null, + "description": "URL of OIDC provider", + "title": "Issuer" + }, + "client_id": { + "description": "Client ID", + "title": "Client Id", + "type": "string" + }, + "client_audience": { + "default": "blueapi", + "description": "Client Audience(s)", + "title": "Client Audience", + "type": "string" + }, + "logout_redirect_endpoint": { + "default": "", + "description": "The oidc endpoint required to logout", + "title": "Logout Redirect Endpoint", + "type": "string" + } + }, + "required": [ + "client_id" + ], + "title": "OIDCConfig", + "type": "object", + "$id": "OIDCConfig" + }, + "OpaConfig": { + "additionalProperties": false, + "properties": { + "root": { + "default": "http://localhost:8181/", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Root", + "type": "string" + }, + "audience": { + "default": "account", + "title": "Audience", + "type": "string" + }, + "tiled_service_account_check": { + "default": "blueapi/tiled_service_account_for_beamline", + "title": "Tiled Service Account Check", + "type": "string" + }, + "submit_task_check": { + "default": "blueapi/write_to_beamline_visit", + "title": "Submit Task Check", + "type": "string" + }, + "admin_check": { + "default": "admin/admin", + "title": "Admin Check", + "type": "string" + } + }, + "title": "OpaConfig", + "type": "object", + "$id": "OpaConfig" + }, + "PlanSource": { + "additionalProperties": false, + "properties": { + "module": { + "description": "Module to be imported", + "title": "Module", + "type": "string" + }, + "kind": { + "const": "planFunctions", + "default": "planFunctions", + "title": "Kind", + "type": "string" + } + }, + "required": [ + "module" + ], + "title": "PlanSource", + "type": "object", + "$id": "PlanSource" + }, + "RestConfig": { + "additionalProperties": false, + "properties": { + "url": { + "default": "http://localhost:8000/", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Url", + "type": "string" + }, + "cors": { + "anyOf": [ + { + "$ref": "CORSConfig" }, - "title": "ScratchRepository", - "type": "object", - "$id": "ScratchRepository" - }, - "ServiceAccount": { - "additionalProperties": false, - "properties": { - "client_id": { - "default": "", - "description": "Service account client ID", - "title": "Client Id", - "type": "string" - }, - "client_secret": { - "default": "", - "description": "Service account client secret", - "format": "password", - "title": "Client Secret", - "type": "string", - "writeOnly": true - } + { + "type": "null" + } + ], + "default": null + } + }, + "title": "RestConfig", + "type": "object", + "$id": "RestConfig" + }, + "ScratchConfig": { + "additionalProperties": false, + "properties": { + "root": { + "default": "/tmp/scratch/blueapi", + "description": "The root directory of the scratch area, all repositories will be cloned under this directory.", + "format": "path", + "title": "Root", + "type": "string" + }, + "required_gid": { + "anyOf": [ + { + "type": "integer" }, - "title": "ServiceAccount", - "type": "object", - "$id": "ServiceAccount" - }, - "StompConfig": { - "additionalProperties": false, - "description": "Config for connecting to stomp broker", - "properties": { - "enabled": { - "default": false, - "description": "True if blueapi should connect to stomp for asynchronous event publishing", - "title": "Enabled", - "type": "boolean" - }, - "url": { - "default": "tcp://localhost:61613", - "format": "uri", - "minLength": 1, - "title": "Url", - "type": "string" - }, - "auth": { - "anyOf": [ - { - "$ref": "BasicAuthentication" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Auth information for communicating with STOMP broker, if required" - } + { + "type": "null" + } + ], + "default": null, + "description": "\nRequired owner GID for the scratch directory. If supplied, the setup-scratch\ncommand will check the scratch area ownership and raise an error if it is\nnot owned by , or if it does not have SGID permission bit set.\n", + "title": "Required Gid" + }, + "repositories": { + "description": "Details of repositories to be cloned and imported into blueapi", + "items": { + "$ref": "ScratchRepository" + }, + "title": "Repositories", + "type": "array" + } + }, + "title": "ScratchConfig", + "type": "object", + "$id": "ScratchConfig" + }, + "ScratchRepository": { + "additionalProperties": false, + "properties": { + "name": { + "default": "example", + "description": "Unique name for this repository in the scratch directory", + "title": "Name", + "type": "string" + }, + "remote_url": { + "default": "https://github.com/example/example.git", + "description": "URL to clone from", + "title": "Remote Url", + "type": "string" + }, + "target_revision": { + "description": "Revision (branch or tag) to check out when cloning - defaults to remote's HEAD. If a tag is used, the repo will be left in a 'detached head' state.", + "title": "Target Revision", + "type": "string" + }, + "use_uv_lock": { + "default": false, + "description": "Whether to install the repository using uv.lock", + "title": "Use Uv Lock", + "type": "boolean" + } + }, + "title": "ScratchRepository", + "type": "object", + "$id": "ScratchRepository" + }, + "ServiceAccount": { + "additionalProperties": false, + "properties": { + "client_id": { + "default": "", + "description": "Service account client ID", + "title": "Client Id", + "type": "string" + }, + "client_secret": { + "default": "", + "description": "Service account client secret", + "format": "password", + "title": "Client Secret", + "type": "string", + "writeOnly": true + } + }, + "title": "ServiceAccount", + "type": "object", + "$id": "ServiceAccount" + }, + "StompConfig": { + "additionalProperties": false, + "description": "Config for connecting to stomp broker", + "properties": { + "enabled": { + "default": false, + "description": "True if blueapi should connect to stomp for asynchronous event publishing", + "title": "Enabled", + "type": "boolean" + }, + "url": { + "default": "tcp://localhost:61613", + "format": "uri", + "minLength": 1, + "title": "Url", + "type": "string" + }, + "auth": { + "anyOf": [ + { + "$ref": "BasicAuthentication" }, - "title": "StompConfig", - "type": "object", - "$id": "StompConfig" - }, - "TiledConfig": { - "additionalProperties": false, - "properties": { - "enabled": { - "default": false, - "description": "True if blueapi should forward data to a Tiled instance", - "title": "Enabled", - "type": "boolean" - }, - "url": { - "default": "http://localhost:8407/", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Url", - "type": "string" - }, - "authentication": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "ServiceAccount" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Tiled Authentication can be API_KEY or OIDC Service account", - "title": "Authentication" - } + { + "type": "null" + } + ], + "default": null, + "description": "Auth information for communicating with STOMP broker, if required" + } + }, + "title": "StompConfig", + "type": "object", + "$id": "StompConfig" + }, + "TiledConfig": { + "additionalProperties": false, + "properties": { + "enabled": { + "default": false, + "description": "True if blueapi should forward data to a Tiled instance", + "title": "Enabled", + "type": "boolean" + }, + "url": { + "default": "http://localhost:8407/", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Url", + "type": "string" + }, + "authentication": { + "anyOf": [ + { + "type": "string" }, - "title": "TiledConfig", - "type": "object", - "$id": "TiledConfig" - }, - "WorkerEventConfig": { - "additionalProperties": false, - "description": "Config for event broadcasting via the message bus", - "properties": { - "broadcast_status_events": { - "default": true, - "title": "Broadcast Status Events", - "type": "boolean" - } + { + "$ref": "ServiceAccount" }, - "title": "WorkerEventConfig", - "type": "object", - "$id": "WorkerEventConfig" + { + "type": "null" + } + ], + "default": null, + "description": "Tiled Authentication can be API_KEY or OIDC Service account", + "title": "Authentication" + } + }, + "title": "TiledConfig", + "type": "object", + "$id": "TiledConfig" + }, + "WorkerEventConfig": { + "additionalProperties": false, + "description": "Config for event broadcasting via the message bus", + "properties": { + "broadcast_status_events": { + "default": true, + "title": "Broadcast Status Events", + "type": "boolean" + } + }, + "title": "WorkerEventConfig", + "type": "object", + "$id": "WorkerEventConfig" + } + }, + "additionalProperties": false, + "description": "Config for the worker application as a whole. Root of\nconfig tree.", + "properties": { + "stomp": { + "$ref": "StompConfig" + }, + "tiled": { + "$ref": "TiledConfig" + }, + "env": { + "$ref": "EnvironmentConfig" + }, + "logging": { + "$ref": "LoggingConfig" + }, + "api": { + "$ref": "RestConfig" + }, + "scratch": { + "anyOf": [ + { + "$ref": "ScratchConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "oidc": { + "anyOf": [ + { + "$ref": "OIDCConfig" + }, + { + "type": "null" } + ], + "default": null }, - "additionalProperties": false, - "description": "Config for the worker application as a whole. Root of\nconfig tree.", - "properties": { - "stomp": { - "$ref": "StompConfig" - }, - "tiled": { - "$ref": "TiledConfig" - }, - "env": { - "$ref": "EnvironmentConfig" - }, - "logging": { - "$ref": "LoggingConfig" - }, - "api": { - "$ref": "RestConfig" - }, - "scratch": { - "anyOf": [ - { - "$ref": "ScratchConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "oidc": { - "anyOf": [ - { - "$ref": "OIDCConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "auth_token_path": { - "anyOf": [ - { - "format": "path", - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Auth Token Path" - }, - "numtracker": { - "anyOf": [ - { - "$ref": "NumtrackerConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "opa": { - "anyOf": [ - { - "$ref": "OpaConfig" - }, - { - "type": "null" - } - ], - "default": null + "auth_token_path": { + "anyOf": [ + { + "format": "path", + "type": "string" + }, + { + "type": "null" } + ], + "default": null, + "title": "Auth Token Path" }, - "title": "ApplicationConfig", - "type": "object" + "numtracker": { + "anyOf": [ + { + "$ref": "NumtrackerConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "opa": { + "anyOf": [ + { + "$ref": "OpaConfig" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "ApplicationConfig", + "type": "object" } diff --git a/helm/blueapi/values.schema.json b/helm/blueapi/values.schema.json index 3020e5502..7db42697e 100644 --- a/helm/blueapi/values.schema.json +++ b/helm/blueapi/values.schema.json @@ -849,6 +849,12 @@ "title": "Target Revision", "description": "Revision (branch or tag) to check out when cloning - defaults to remote's HEAD. If a tag is used, the repo will be left in a 'detached head' state.", "type": "string" + }, + "use_uv_lock": { + "title": "Use Uv Lock", + "description": "Whether to install the repository using uv.lock", + "default": false, + "type": "boolean" } }, "additionalProperties": false diff --git a/src/blueapi/cli/scratch.py b/src/blueapi/cli/scratch.py index 6fa01d83e..d06d6325e 100644 --- a/src/blueapi/cli/scratch.py +++ b/src/blueapi/cli/scratch.py @@ -66,6 +66,7 @@ def setup_scratch( scratch_install( *(config.root / repo.name for repo in config.repositories), + use_uv_lock=[repo.use_uv_lock for repo in config.repositories], timeout=install_timeout, ) @@ -116,7 +117,11 @@ def ensure_repo( ) -def scratch_install(*paths: Path, timeout: float = _DEFAULT_INSTALL_TIMEOUT) -> None: +def scratch_install( + *paths: Path, + use_uv_lock: list[bool] | None = None, + timeout: float = _DEFAULT_INSTALL_TIMEOUT, +) -> None: """ Install scratch packages. Make blueapi aware of repositories checked out in the scratch area. Make it automatically follow code changes to those repositories @@ -125,15 +130,25 @@ def scratch_install(*paths: Path, timeout: float = _DEFAULT_INSTALL_TIMEOUT) -> Args: paths: List of Paths to the checked out repositories + use_uv_lock: Optional list of booleans indicating whether to install + using uv.lock timeout: Time to wait for installation subprocess """ if not paths: return + + use_uv_lock_list = use_uv_lock or [False] * len(paths) + LOGGER.info("Installing packages") - for path in paths: + for path, uv_lock in zip(paths, use_uv_lock_list, strict=True): _validate_directory(path) - args = ["uv", "pip", "install", "-e", str(path)] - process = Popen(args) + if uv_lock: + args = ["uv", "sync", "--inexact"] + process = Popen(args, cwd=path) + else: + args = ["uv", "pip", "install", "-e", str(path)] + process = Popen(args) + process.wait(timeout=timeout) if process.returncode != 0: raise RuntimeError( diff --git a/src/blueapi/config.py b/src/blueapi/config.py index 9c339c71f..6e25667b8 100644 --- a/src/blueapi/config.py +++ b/src/blueapi/config.py @@ -209,6 +209,10 @@ class ScratchRepository(BlueapiBaseModel): # include an invalid value default_factory=lambda: None, ) + use_uv_lock: bool = Field( + description="Whether to install the repository using uv.lock", + default=False, + ) @field_validator("remote_url") @classmethod diff --git a/tests/unit_tests/cli/test_scratch.py b/tests/unit_tests/cli/test_scratch.py index 22f3ad3d8..60fc5dff0 100644 --- a/tests/unit_tests/cli/test_scratch.py +++ b/tests/unit_tests/cli/test_scratch.py @@ -62,6 +62,22 @@ def test_scratch_install_installs_path( ) +@patch("blueapi.cli.scratch.Popen") +def test_scratch_install_with_uv_lock( + mock_popen: Mock, + directory_path_with_sgid: Path, +): + mock_process = Mock() + mock_process.returncode = 0 + mock_popen.return_value = mock_process + + scratch_install(directory_path_with_sgid, use_uv_lock=[True], timeout=1.0) + + mock_popen.assert_called_once_with( + ["uv", "sync", "--inexact"], cwd=directory_path_with_sgid + ) + + def test_scratch_install_fails_on_file(file_path: Path): with pytest.raises(KeyError): scratch_install(file_path, timeout=1.0) @@ -348,6 +364,7 @@ def test_setup_scratch_iterates_repos( call( directory_path_with_sgid / "foo", directory_path_with_sgid / "bar", + use_uv_lock=[False, False], timeout=120.0, ), ] From 09b8ed7f898622d0f4ff274a2ee02f1322e3a754 Mon Sep 17 00:00:00 2001 From: Relm-Arrowny Date: Fri, 18 Sep 2026 14:38:18 +0000 Subject: [PATCH 2/3] fix test --- tests/unit_tests/test_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit_tests/test_config.py b/tests/unit_tests/test_config.py index a335434df..6a05c9a3b 100644 --- a/tests/unit_tests/test_config.py +++ b/tests/unit_tests/test_config.py @@ -333,6 +333,7 @@ def test_config_yaml_parsed(temp_yaml_config_file): { "name": "dodal", "remote_url": "https://github.com/DiamondLightSource/dodal.git", + "use_uv_lock": False, } ], }, @@ -396,6 +397,7 @@ def test_config_yaml_parsed(temp_yaml_config_file): { "name": "dodal", "remote_url": "https://github.com/DiamondLightSource/dodal.git", + "use_uv_lock": False, } ], }, From 971d74de60712b18516d4cf9ed918e46f64a0819 Mon Sep 17 00:00:00 2001 From: Relm-Arrowny Date: Fri, 18 Sep 2026 14:47:43 +0000 Subject: [PATCH 3/3] undo space changes --- helm/blueapi/config_schema.json | 1222 +++++++++++++++---------------- 1 file changed, 611 insertions(+), 611 deletions(-) diff --git a/helm/blueapi/config_schema.json b/helm/blueapi/config_schema.json index c04e855f1..8f7861c38 100644 --- a/helm/blueapi/config_schema.json +++ b/helm/blueapi/config_schema.json @@ -1,626 +1,626 @@ { - "$defs": { - "BasicAuthentication": { - "additionalProperties": false, - "description": "User credentials for basic authentication", - "properties": { - "username": { - "description": "Unique identifier for user", - "title": "Username", - "type": "string" - }, - "password": { - "description": "Password to verify user's identity", - "title": "Password", - "type": "string" - } - }, - "required": [ - "username", - "password" - ], - "title": "BasicAuthentication", - "type": "object", - "$id": "BasicAuthentication" - }, - "CORSConfig": { - "additionalProperties": false, - "properties": { - "origins": { - "items": { - "type": "string" - }, - "title": "Origins", - "type": "array" - }, - "allow_credentials": { - "default": false, - "title": "Allow Credentials", - "type": "boolean" - }, - "allow_methods": { - "default": [ - "*" - ], - "items": { - "type": "string" - }, - "title": "Allow Methods", - "type": "array" - }, - "allow_headers": { - "default": [ - "*" - ], - "items": { - "type": "string" - }, - "title": "Allow Headers", - "type": "array" - } - }, - "required": [ - "origins" - ], - "title": "CORSConfig", - "type": "object", - "$id": "CORSConfig" - }, - "DeviceManagerSource": { - "additionalProperties": false, - "properties": { - "module": { - "description": "Module to be imported", - "title": "Module", - "type": "string" - }, - "kind": { - "const": "deviceManager", - "default": "deviceManager", - "title": "Kind", - "type": "string" - }, - "mock": { - "default": false, - "description": "If true, ophyd_async device connections are mocked", - "title": "Mock", - "type": "boolean" - }, - "name": { - "default": "devices", - "description": "Name of the device manager in the module", - "title": "Name", - "type": "string" - } - }, - "required": [ - "module" - ], - "title": "DeviceManagerSource", - "type": "object", - "$id": "DeviceManagerSource" - }, - "EnvironmentConfig": { - "additionalProperties": false, - "description": "Config for the RunEngine environment", - "properties": { - "sources": { - "default": [], - "items": { - "discriminator": { - "mapping": { - "deviceManager": "DeviceManagerSource", - "planFunctions": "PlanSource" - }, - "propertyName": "kind" + "$defs": { + "BasicAuthentication": { + "additionalProperties": false, + "description": "User credentials for basic authentication", + "properties": { + "username": { + "description": "Unique identifier for user", + "title": "Username", + "type": "string" + }, + "password": { + "description": "Password to verify user's identity", + "title": "Password", + "type": "string" + } }, - "oneOf": [ - { - "$ref": "PlanSource" - }, - { - "$ref": "DeviceManagerSource" - } - ] - }, - "title": "Sources", - "type": "array" - }, - "events": { - "$ref": "WorkerEventConfig" - }, - "metadata": { - "anyOf": [ - { - "$ref": "MetadataConfig" + "required": [ + "username", + "password" + ], + "title": "BasicAuthentication", + "type": "object", + "$id": "BasicAuthentication" + }, + "CORSConfig": { + "additionalProperties": false, + "properties": { + "origins": { + "items": { + "type": "string" + }, + "title": "Origins", + "type": "array" + }, + "allow_credentials": { + "default": false, + "title": "Allow Credentials", + "type": "boolean" + }, + "allow_methods": { + "default": [ + "*" + ], + "items": { + "type": "string" + }, + "title": "Allow Methods", + "type": "array" + }, + "allow_headers": { + "default": [ + "*" + ], + "items": { + "type": "string" + }, + "title": "Allow Headers", + "type": "array" + } }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "EnvironmentConfig", - "type": "object", - "$id": "EnvironmentConfig" - }, - "GraylogConfig": { - "additionalProperties": false, - "properties": { - "enabled": { - "default": false, - "title": "Enabled", - "type": "boolean" - }, - "url": { - "default": "tcp://localhost:5555", - "format": "uri", - "minLength": 1, - "title": "Url", - "type": "string" - } - }, - "title": "GraylogConfig", - "type": "object", - "$id": "GraylogConfig" - }, - "LoggingConfig": { - "additionalProperties": false, - "properties": { - "level": { - "default": "INFO", - "enum": [ - "NOTSET", - "DEBUG", - "INFO", - "WARNING", - "ERROR", - "CRITICAL" - ], - "title": "Level", - "type": "string" - }, - "graylog": { - "$ref": "GraylogConfig", - "default": { - "enabled": false, - "url": "tcp://localhost:5555" - } - } - }, - "title": "LoggingConfig", - "type": "object", - "$id": "LoggingConfig" - }, - "MetadataConfig": { - "additionalProperties": false, - "properties": { - "instrument": { - "title": "Instrument", - "type": "string" - } - }, - "required": [ - "instrument" - ], - "title": "MetadataConfig", - "type": "object", - "$id": "MetadataConfig" - }, - "NumtrackerConfig": { - "additionalProperties": false, - "properties": { - "url": { - "default": "http://localhost:8406/graphql", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Url", - "type": "string" - }, - "detector_file_template": { - "default": "{instrument}-{scan_id}-{device_name}", - "title": "Detector File Template", - "type": "string" - } - }, - "title": "NumtrackerConfig", - "type": "object", - "$id": "NumtrackerConfig" - }, - "OIDCConfig": { - "additionalProperties": false, - "properties": { - "well_known_url": { - "anyOf": [ - { - "type": "string" + "required": [ + "origins" + ], + "title": "CORSConfig", + "type": "object", + "$id": "CORSConfig" + }, + "DeviceManagerSource": { + "additionalProperties": false, + "properties": { + "module": { + "description": "Module to be imported", + "title": "Module", + "type": "string" + }, + "kind": { + "const": "deviceManager", + "default": "deviceManager", + "title": "Kind", + "type": "string" + }, + "mock": { + "default": false, + "description": "If true, ophyd_async device connections are mocked", + "title": "Mock", + "type": "boolean" + }, + "name": { + "default": "devices", + "description": "Name of the device manager in the module", + "title": "Name", + "type": "string" + } }, - { - "type": "null" - } - ], - "default": null, - "deprecated": true, - "description": "URL to fetch OIDC config from the provider", - "title": "Well Known Url" - }, - "issuer": { - "anyOf": [ - { - "type": "string" + "required": [ + "module" + ], + "title": "DeviceManagerSource", + "type": "object", + "$id": "DeviceManagerSource" + }, + "EnvironmentConfig": { + "additionalProperties": false, + "description": "Config for the RunEngine environment", + "properties": { + "sources": { + "default": [], + "items": { + "discriminator": { + "mapping": { + "deviceManager": "DeviceManagerSource", + "planFunctions": "PlanSource" + }, + "propertyName": "kind" + }, + "oneOf": [ + { + "$ref": "PlanSource" + }, + { + "$ref": "DeviceManagerSource" + } + ] + }, + "title": "Sources", + "type": "array" + }, + "events": { + "$ref": "WorkerEventConfig" + }, + "metadata": { + "anyOf": [ + { + "$ref": "MetadataConfig" + }, + { + "type": "null" + } + ], + "default": null + } }, - { - "type": "null" - } - ], - "default": null, - "description": "URL of OIDC provider", - "title": "Issuer" - }, - "client_id": { - "description": "Client ID", - "title": "Client Id", - "type": "string" - }, - "client_audience": { - "default": "blueapi", - "description": "Client Audience(s)", - "title": "Client Audience", - "type": "string" - }, - "logout_redirect_endpoint": { - "default": "", - "description": "The oidc endpoint required to logout", - "title": "Logout Redirect Endpoint", - "type": "string" - } - }, - "required": [ - "client_id" - ], - "title": "OIDCConfig", - "type": "object", - "$id": "OIDCConfig" - }, - "OpaConfig": { - "additionalProperties": false, - "properties": { - "root": { - "default": "http://localhost:8181/", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Root", - "type": "string" - }, - "audience": { - "default": "account", - "title": "Audience", - "type": "string" - }, - "tiled_service_account_check": { - "default": "blueapi/tiled_service_account_for_beamline", - "title": "Tiled Service Account Check", - "type": "string" - }, - "submit_task_check": { - "default": "blueapi/write_to_beamline_visit", - "title": "Submit Task Check", - "type": "string" - }, - "admin_check": { - "default": "admin/admin", - "title": "Admin Check", - "type": "string" - } - }, - "title": "OpaConfig", - "type": "object", - "$id": "OpaConfig" - }, - "PlanSource": { - "additionalProperties": false, - "properties": { - "module": { - "description": "Module to be imported", - "title": "Module", - "type": "string" - }, - "kind": { - "const": "planFunctions", - "default": "planFunctions", - "title": "Kind", - "type": "string" - } - }, - "required": [ - "module" - ], - "title": "PlanSource", - "type": "object", - "$id": "PlanSource" - }, - "RestConfig": { - "additionalProperties": false, - "properties": { - "url": { - "default": "http://localhost:8000/", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Url", - "type": "string" - }, - "cors": { - "anyOf": [ - { - "$ref": "CORSConfig" + "title": "EnvironmentConfig", + "type": "object", + "$id": "EnvironmentConfig" + }, + "GraylogConfig": { + "additionalProperties": false, + "properties": { + "enabled": { + "default": false, + "title": "Enabled", + "type": "boolean" + }, + "url": { + "default": "tcp://localhost:5555", + "format": "uri", + "minLength": 1, + "title": "Url", + "type": "string" + } }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "RestConfig", - "type": "object", - "$id": "RestConfig" - }, - "ScratchConfig": { - "additionalProperties": false, - "properties": { - "root": { - "default": "/tmp/scratch/blueapi", - "description": "The root directory of the scratch area, all repositories will be cloned under this directory.", - "format": "path", - "title": "Root", - "type": "string" - }, - "required_gid": { - "anyOf": [ - { - "type": "integer" + "title": "GraylogConfig", + "type": "object", + "$id": "GraylogConfig" + }, + "LoggingConfig": { + "additionalProperties": false, + "properties": { + "level": { + "default": "INFO", + "enum": [ + "NOTSET", + "DEBUG", + "INFO", + "WARNING", + "ERROR", + "CRITICAL" + ], + "title": "Level", + "type": "string" + }, + "graylog": { + "$ref": "GraylogConfig", + "default": { + "enabled": false, + "url": "tcp://localhost:5555" + } + } }, - { - "type": "null" - } - ], - "default": null, - "description": "\nRequired owner GID for the scratch directory. If supplied, the setup-scratch\ncommand will check the scratch area ownership and raise an error if it is\nnot owned by , or if it does not have SGID permission bit set.\n", - "title": "Required Gid" - }, - "repositories": { - "description": "Details of repositories to be cloned and imported into blueapi", - "items": { - "$ref": "ScratchRepository" - }, - "title": "Repositories", - "type": "array" - } - }, - "title": "ScratchConfig", - "type": "object", - "$id": "ScratchConfig" - }, - "ScratchRepository": { - "additionalProperties": false, - "properties": { - "name": { - "default": "example", - "description": "Unique name for this repository in the scratch directory", - "title": "Name", - "type": "string" - }, - "remote_url": { - "default": "https://github.com/example/example.git", - "description": "URL to clone from", - "title": "Remote Url", - "type": "string" - }, - "target_revision": { - "description": "Revision (branch or tag) to check out when cloning - defaults to remote's HEAD. If a tag is used, the repo will be left in a 'detached head' state.", - "title": "Target Revision", - "type": "string" - }, - "use_uv_lock": { - "default": false, - "description": "Whether to install the repository using uv.lock", - "title": "Use Uv Lock", - "type": "boolean" - } - }, - "title": "ScratchRepository", - "type": "object", - "$id": "ScratchRepository" - }, - "ServiceAccount": { - "additionalProperties": false, - "properties": { - "client_id": { - "default": "", - "description": "Service account client ID", - "title": "Client Id", - "type": "string" - }, - "client_secret": { - "default": "", - "description": "Service account client secret", - "format": "password", - "title": "Client Secret", - "type": "string", - "writeOnly": true - } - }, - "title": "ServiceAccount", - "type": "object", - "$id": "ServiceAccount" - }, - "StompConfig": { - "additionalProperties": false, - "description": "Config for connecting to stomp broker", - "properties": { - "enabled": { - "default": false, - "description": "True if blueapi should connect to stomp for asynchronous event publishing", - "title": "Enabled", - "type": "boolean" - }, - "url": { - "default": "tcp://localhost:61613", - "format": "uri", - "minLength": 1, - "title": "Url", - "type": "string" - }, - "auth": { - "anyOf": [ - { - "$ref": "BasicAuthentication" + "title": "LoggingConfig", + "type": "object", + "$id": "LoggingConfig" + }, + "MetadataConfig": { + "additionalProperties": false, + "properties": { + "instrument": { + "title": "Instrument", + "type": "string" + } }, - { - "type": "null" - } - ], - "default": null, - "description": "Auth information for communicating with STOMP broker, if required" - } - }, - "title": "StompConfig", - "type": "object", - "$id": "StompConfig" - }, - "TiledConfig": { - "additionalProperties": false, - "properties": { - "enabled": { - "default": false, - "description": "True if blueapi should forward data to a Tiled instance", - "title": "Enabled", - "type": "boolean" - }, - "url": { - "default": "http://localhost:8407/", - "format": "uri", - "maxLength": 2083, - "minLength": 1, - "title": "Url", - "type": "string" - }, - "authentication": { - "anyOf": [ - { - "type": "string" + "required": [ + "instrument" + ], + "title": "MetadataConfig", + "type": "object", + "$id": "MetadataConfig" + }, + "NumtrackerConfig": { + "additionalProperties": false, + "properties": { + "url": { + "default": "http://localhost:8406/graphql", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Url", + "type": "string" + }, + "detector_file_template": { + "default": "{instrument}-{scan_id}-{device_name}", + "title": "Detector File Template", + "type": "string" + } }, - { - "$ref": "ServiceAccount" + "title": "NumtrackerConfig", + "type": "object", + "$id": "NumtrackerConfig" + }, + "OIDCConfig": { + "additionalProperties": false, + "properties": { + "well_known_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "deprecated": true, + "description": "URL to fetch OIDC config from the provider", + "title": "Well Known Url" + }, + "issuer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "URL of OIDC provider", + "title": "Issuer" + }, + "client_id": { + "description": "Client ID", + "title": "Client Id", + "type": "string" + }, + "client_audience": { + "default": "blueapi", + "description": "Client Audience(s)", + "title": "Client Audience", + "type": "string" + }, + "logout_redirect_endpoint": { + "default": "", + "description": "The oidc endpoint required to logout", + "title": "Logout Redirect Endpoint", + "type": "string" + } }, - { - "type": "null" - } - ], - "default": null, - "description": "Tiled Authentication can be API_KEY or OIDC Service account", - "title": "Authentication" - } - }, - "title": "TiledConfig", - "type": "object", - "$id": "TiledConfig" - }, - "WorkerEventConfig": { - "additionalProperties": false, - "description": "Config for event broadcasting via the message bus", - "properties": { - "broadcast_status_events": { - "default": true, - "title": "Broadcast Status Events", - "type": "boolean" - } - }, - "title": "WorkerEventConfig", - "type": "object", - "$id": "WorkerEventConfig" - } - }, - "additionalProperties": false, - "description": "Config for the worker application as a whole. Root of\nconfig tree.", - "properties": { - "stomp": { - "$ref": "StompConfig" - }, - "tiled": { - "$ref": "TiledConfig" - }, - "env": { - "$ref": "EnvironmentConfig" - }, - "logging": { - "$ref": "LoggingConfig" - }, - "api": { - "$ref": "RestConfig" - }, - "scratch": { - "anyOf": [ - { - "$ref": "ScratchConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "oidc": { - "anyOf": [ - { - "$ref": "OIDCConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "auth_token_path": { - "anyOf": [ - { - "format": "path", - "type": "string" - }, - { - "type": "null" + "required": [ + "client_id" + ], + "title": "OIDCConfig", + "type": "object", + "$id": "OIDCConfig" + }, + "OpaConfig": { + "additionalProperties": false, + "properties": { + "root": { + "default": "http://localhost:8181/", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Root", + "type": "string" + }, + "audience": { + "default": "account", + "title": "Audience", + "type": "string" + }, + "tiled_service_account_check": { + "default": "blueapi/tiled_service_account_for_beamline", + "title": "Tiled Service Account Check", + "type": "string" + }, + "submit_task_check": { + "default": "blueapi/write_to_beamline_visit", + "title": "Submit Task Check", + "type": "string" + }, + "admin_check": { + "default": "admin/admin", + "title": "Admin Check", + "type": "string" + } + }, + "title": "OpaConfig", + "type": "object", + "$id": "OpaConfig" + }, + "PlanSource": { + "additionalProperties": false, + "properties": { + "module": { + "description": "Module to be imported", + "title": "Module", + "type": "string" + }, + "kind": { + "const": "planFunctions", + "default": "planFunctions", + "title": "Kind", + "type": "string" + } + }, + "required": [ + "module" + ], + "title": "PlanSource", + "type": "object", + "$id": "PlanSource" + }, + "RestConfig": { + "additionalProperties": false, + "properties": { + "url": { + "default": "http://localhost:8000/", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Url", + "type": "string" + }, + "cors": { + "anyOf": [ + { + "$ref": "CORSConfig" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "RestConfig", + "type": "object", + "$id": "RestConfig" + }, + "ScratchConfig": { + "additionalProperties": false, + "properties": { + "root": { + "default": "/tmp/scratch/blueapi", + "description": "The root directory of the scratch area, all repositories will be cloned under this directory.", + "format": "path", + "title": "Root", + "type": "string" + }, + "required_gid": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "\nRequired owner GID for the scratch directory. If supplied, the setup-scratch\ncommand will check the scratch area ownership and raise an error if it is\nnot owned by , or if it does not have SGID permission bit set.\n", + "title": "Required Gid" + }, + "repositories": { + "description": "Details of repositories to be cloned and imported into blueapi", + "items": { + "$ref": "ScratchRepository" + }, + "title": "Repositories", + "type": "array" + } + }, + "title": "ScratchConfig", + "type": "object", + "$id": "ScratchConfig" + }, + "ScratchRepository": { + "additionalProperties": false, + "properties": { + "name": { + "default": "example", + "description": "Unique name for this repository in the scratch directory", + "title": "Name", + "type": "string" + }, + "remote_url": { + "default": "https://github.com/example/example.git", + "description": "URL to clone from", + "title": "Remote Url", + "type": "string" + }, + "target_revision": { + "description": "Revision (branch or tag) to check out when cloning - defaults to remote's HEAD. If a tag is used, the repo will be left in a 'detached head' state.", + "title": "Target Revision", + "type": "string" + }, + "use_uv_lock": { + "default": false, + "description": "Whether to install the repository using uv.lock", + "title": "Use Uv Lock", + "type": "boolean" + } + }, + "title": "ScratchRepository", + "type": "object", + "$id": "ScratchRepository" + }, + "ServiceAccount": { + "additionalProperties": false, + "properties": { + "client_id": { + "default": "", + "description": "Service account client ID", + "title": "Client Id", + "type": "string" + }, + "client_secret": { + "default": "", + "description": "Service account client secret", + "format": "password", + "title": "Client Secret", + "type": "string", + "writeOnly": true + } + }, + "title": "ServiceAccount", + "type": "object", + "$id": "ServiceAccount" + }, + "StompConfig": { + "additionalProperties": false, + "description": "Config for connecting to stomp broker", + "properties": { + "enabled": { + "default": false, + "description": "True if blueapi should connect to stomp for asynchronous event publishing", + "title": "Enabled", + "type": "boolean" + }, + "url": { + "default": "tcp://localhost:61613", + "format": "uri", + "minLength": 1, + "title": "Url", + "type": "string" + }, + "auth": { + "anyOf": [ + { + "$ref": "BasicAuthentication" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Auth information for communicating with STOMP broker, if required" + } + }, + "title": "StompConfig", + "type": "object", + "$id": "StompConfig" + }, + "TiledConfig": { + "additionalProperties": false, + "properties": { + "enabled": { + "default": false, + "description": "True if blueapi should forward data to a Tiled instance", + "title": "Enabled", + "type": "boolean" + }, + "url": { + "default": "http://localhost:8407/", + "format": "uri", + "maxLength": 2083, + "minLength": 1, + "title": "Url", + "type": "string" + }, + "authentication": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "ServiceAccount" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Tiled Authentication can be API_KEY or OIDC Service account", + "title": "Authentication" + } + }, + "title": "TiledConfig", + "type": "object", + "$id": "TiledConfig" + }, + "WorkerEventConfig": { + "additionalProperties": false, + "description": "Config for event broadcasting via the message bus", + "properties": { + "broadcast_status_events": { + "default": true, + "title": "Broadcast Status Events", + "type": "boolean" + } + }, + "title": "WorkerEventConfig", + "type": "object", + "$id": "WorkerEventConfig" } - ], - "default": null, - "title": "Auth Token Path" }, - "numtracker": { - "anyOf": [ - { - "$ref": "NumtrackerConfig" - }, - { - "type": "null" + "additionalProperties": false, + "description": "Config for the worker application as a whole. Root of\nconfig tree.", + "properties": { + "stomp": { + "$ref": "StompConfig" + }, + "tiled": { + "$ref": "TiledConfig" + }, + "env": { + "$ref": "EnvironmentConfig" + }, + "logging": { + "$ref": "LoggingConfig" + }, + "api": { + "$ref": "RestConfig" + }, + "scratch": { + "anyOf": [ + { + "$ref": "ScratchConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "oidc": { + "anyOf": [ + { + "$ref": "OIDCConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "auth_token_path": { + "anyOf": [ + { + "format": "path", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Auth Token Path" + }, + "numtracker": { + "anyOf": [ + { + "$ref": "NumtrackerConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "opa": { + "anyOf": [ + { + "$ref": "OpaConfig" + }, + { + "type": "null" + } + ], + "default": null } - ], - "default": null }, - "opa": { - "anyOf": [ - { - "$ref": "OpaConfig" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "ApplicationConfig", - "type": "object" + "title": "ApplicationConfig", + "type": "object" }