Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 4.0.1
_commit: 4.1.0
_src_path: https://github.com/DiamondLightSource/python-copier-template
author_email: [email protected]
author_name: Callum Forrester
Expand All @@ -10,6 +10,7 @@ description: Lightweight bluesky-as-a-service wrapper application. Also usable a
a library.
distribution_name: blueapi
docker: true
docker_debug: true
docs_type: sphinx
git_platform: github.com
github_org: DiamondLightSource
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua

This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.

For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/4.0.1/how-to.html).
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/4.1.0/how-to.html).
20 changes: 0 additions & 20 deletions .github/workflows/_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,6 @@ jobs:
tags: |
type=ref,event=tag
type=raw,value=latest

- name: Create tags for publishing debug image
id: debug-meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag,suffix=-debug
type=raw,value=latest-debug

- name: Push cached image to container registry
if: inputs.publish && github.ref_type == 'tag'
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
push: true
target: debug
tags: ${{ steps.debug-meta.outputs.tags }}

- name: Push cached image to container registry
if: github.ref_type == 'tag'
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/_debug_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
workflow_call:
inputs:
publish:
type: boolean
description: If true, pushes image to container registry

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Need this to get version number from last tag
fetch-depth: 0

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create tags for publishing debug image
id: debug-meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag,suffix=-debug
type=raw,value=latest-debug

- name: Build and publish debug image to container registry
if: github.ref_type == 'tag'
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
push: true
target: debug
tags: ${{ steps.debug-meta.outputs.tags }}
20 changes: 11 additions & 9 deletions .github/workflows/_system_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,29 @@ jobs:
with:
repository: epics-containers/example-services
path: example-services
ref: '2025.8.2'

- name: Run docker compose
- name: Compose devices
uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
with:
compose-file: "./example-services/compose.yaml"
compose-file: "example-services/compose.yaml"
services: |
bl01t-di-cam-01
bl01t-mo-sim-01
ca-gateway

- name: Start RabbitMQ
uses: namoshek/rabbitmq-github-action@d1d4455f4a8f72db66111c24cb0dc5654047a975 # v1
- name: Compose services
uses: hoverkraft-tech/compose-action@40041ff1b97dbf152cd2361138c2b03fa29139df # v2.3.0
with:
ports: "61613:61613"
plugins: rabbitmq_stomp
compose-file: "tests/system_tests/compose.yaml"
services: |
rabbitmq
numtracker

- name: Start Blueapi Server
env:
EPICS_CA_NAME_SERVERS: 127.0.0.1:5094
EPICS_PVA_NAME_SERVERS: 127.0.0.1:5095
EPICS_CA_ADDR_LIST: 127.0.0.1:5094
EPICS_CA_NAME_SERVERS: 127.0.0.1:9064
EPICS_PVA_NAME_SERVERS: 127.0.0.1:9075
run: blueapi -c ${{ github.workspace }}/tests/system_tests/config.yaml serve &

- name: Run tests
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ jobs:
contents: read
packages: write

debug_container:
needs: [container, test]
uses: ./.github/workflows/_debug_container.yml
with:
publish: ${{ needs.test.result == 'success' }}
permissions:
contents: read
packages: write

docs:
uses: ./.github/workflows/_docs.yml

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand All @@ -88,6 +88,6 @@ jobs:
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3
with:
category: "/language:${{matrix.language}}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ lockfiles/

# Editor/IDE project files
.idea/

# Example IOCs
example-services/
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ repos:
hooks:
- id: check-added-large-files
- id: check-yaml
exclude: ^helm\/.*\/templates\/.*|catalog-info.yaml
exclude: ^helm/blueapi/templates/
args: [--allow-multiple-documents]
- id: check-merge-conflict
- id: end-of-file-fixer

Expand All @@ -31,3 +32,8 @@ repos:
args:
# Make the tool search for charts only under the `helm` directory
- --chart-search-root=helm

- repo: https://github.com/gitleaks/gitleaks
rev: v8.28.0
hooks:
- id: gitleaks
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ ENV PATH=/venv/bin:$PATH
# The build stage installs the context into the venv
FROM developer AS build
RUN mkdir -p /.cache/pip; chmod o+wrX /.cache/pip
# Requires buildkit 0.17.0
COPY --chmod=o+wrX . /workspaces/blueapi
WORKDIR /workspaces/blueapi
RUN touch dev-requirements.txt && pip install --upgrade pip && pip install -c dev-requirements.txt .


FROM build AS debug


# Set origin to use ssh
RUN git remote set-url origin [email protected]:diamondlightsource/DiamondLightSource/blueapi.git
RUN git remote set-url origin [email protected]:DiamondLightSource/blueapi.git


# For this pod to understand finding user information from LDAP
RUN apt update
Expand All @@ -45,6 +49,7 @@ RUN pip install -e .
ENTRYPOINT [ "/bin/bash", "-c", "--" ]
CMD [ "while true; do sleep 30; done;" ]


# The runtime stage copies the built venv into a slim runtime container
FROM python:${PYTHON_VERSION}-slim AS runtime
# Add apt-get system dependecies for runtime here if needed
Expand Down
Loading
Loading