Skip to content

Commit ed8aa3c

Browse files
committed
Merge in main
2 parents 846f7b5 + bbdeaf3 commit ed8aa3c

File tree

114 files changed

+12910
-8498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+12910
-8498
lines changed

.bumpclient.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.16.9"
2+
current_version = "0.18.1"
33
commit = true
44
tag = false
55

.bumpversion.toml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.16.9"
2+
current_version = "0.18.1"
33
commit = true
44
tag = true
55

@@ -12,3 +12,28 @@ replace = '__version__ = "{new_version}"'
1212
filename = "pyproject.toml"
1313
search = 'version = "{current_version}"'
1414
replace = 'version = "{new_version}"'
15+
16+
[[tool.bumpversion.files]]
17+
filename = "Helm/Chart.yaml"
18+
search = 'version: {current_version}'
19+
replace = 'version: {new_version}'
20+
21+
[[tool.bumpversion.files]]
22+
filename = "Helm/charts/murfey-instrument-server-clem/Chart.yaml"
23+
search = 'version: {current_version}'
24+
replace = 'version: {new_version}'
25+
26+
[[tool.bumpversion.files]]
27+
filename = "Helm/charts/murfey-instrument-server-tem/Chart.yaml"
28+
search = 'version: {current_version}'
29+
replace = 'version: {new_version}'
30+
31+
[[tool.bumpversion.files]]
32+
filename = "Helm/charts/murfey-rsync/Chart.yaml"
33+
search = 'version: {current_version}'
34+
replace = 'version: {new_version}'
35+
36+
[[tool.bumpversion.files]]
37+
filename = "Helm/charts/murfey-server/Chart.yaml"
38+
search = 'version: {current_version}'
39+
replace = 'version: {new_version}'

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
python-version: ["3.9", "3.10", "3.11"]
1818
services:
1919
mariadb:
20-
image: mariadb:11.6.2 # released 2024-05-06
20+
image: mariadb:11.7.2 # released 2024-05-06
2121
# Pulls image from DockerHub
2222
# Docker images: https://hub.docker.com/_/mariadb
2323
# Previous version(s):
@@ -41,6 +41,7 @@ jobs:
4141

4242
steps:
4343
- uses: actions/checkout@v4
44+
4445
- name: Use Python ${{ matrix.python-version }}
4546
uses: actions/setup-python@v5
4647
with:
@@ -67,13 +68,13 @@ jobs:
6768
docker run --detach --name rabbitmq -p 127.0.0.1:5672:5672 -p 127.0.0.1:15672:15672 test-rabbitmq
6869
docker container list -a
6970
70-
- name: Get ispyb database
71+
- name: Get ISPyB database
7172
uses: actions/download-artifact@v4
7273
with:
7374
name: database
7475
path: database/
7576

76-
- name: Install package
77+
- name: Install Murfey
7778
run: |
7879
set -eux
7980
pip install --disable-pip-version-check -e "."[cicd,client,server,developer]
@@ -84,7 +85,7 @@ jobs:
8485
mysql-version: "11.3"
8586
auto-start: false
8687

87-
- name: Set up test ipsyb database
88+
- name: Set up test ISPyB database
8889
run: |
8990
set -eu
9091
cp ".github/workflows/config/my.cnf" .my.cnf
@@ -101,9 +102,14 @@ jobs:
101102
schemas/ispyb/routines.sql \
102103
grants/ispyb_processing.sql \
103104
grants/ispyb_import.sql; do
104-
echo Importing ${f}...
105+
106+
echo "Patching ${f} in SQL files to fix CLI escape issues..."
107+
sed -i 's/\\-/-/g' "$f"
108+
109+
echo "Importing ${f}..."
105110
mariadb --defaults-file=.my.cnf < $f
106111
done
112+
107113
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api@'%' IDENTIFIED BY 'password_1234'; GRANT ispyb_processing to ispyb_api@'%'; GRANT ispyb_import to ispyb_api@'%'; SET DEFAULT ROLE ispyb_processing FOR ispyb_api@'%';"
108114
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api_future@'%' IDENTIFIED BY 'password_4321'; GRANT SELECT ON ispybtest.* to ispyb_api_future@'%';"
109115
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api_sqlalchemy@'%' IDENTIFIED BY 'password_5678'; GRANT SELECT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT INSERT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT UPDATE ON ispybtest.* to ispyb_api_sqlalchemy@'%';"
@@ -112,18 +118,17 @@ jobs:
112118
- name: Check RabbitMQ is alive
113119
run: wget -t 10 -w 1 http://127.0.0.1:15672 -O -
114120

115-
- name: Run tests
121+
- name: Run Murfey tests
116122
env:
117123
POSTGRES_HOST: localhost
118124
POSTGRES_PORT: 5432
119125
POSTGRES_DB: murfey_test_db
120126
POSTGRES_PASSWORD: psql_pwd
121127
POSTGRES_USER: psql_user
122128
run: |
123-
export ISPYB_CREDENTIALS=".github/workflows/config/ispyb.cfg"
124129
PYTHONDEVMODE=1 pytest -v -ra --cov=murfey --cov-report=xml --cov-branch
125130
126-
- name: Upload to Codecov
131+
- name: Upload test results to Codecov
127132
uses: codecov/codecov-action@v5
128133
with:
129134
name: ${{ matrix.python-version }}

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Build and test
33
on: [push, pull_request]
44

55
env:
6-
DATABASE_SCHEMA: 4.2.1 # released 2024-08-19
6+
ISPYB_DATABASE_SCHEMA: 4.6.0
77
# Installs from GitHub
88
# Versions: https://github.com/DiamondLightSource/ispyb-database/tags
99
# Previous version(s):
10-
# 4.1.0
10+
# 4.2.1 # released 2024-08-19
11+
# 4.1.0 # released 2024-03-26
1112

1213
permissions:
1314
contents: read
@@ -53,10 +54,10 @@ jobs:
5354
runs-on: ubuntu-latest
5455
steps:
5556
- uses: actions/checkout@v4
56-
- name: Download ISPyB DB schema v${{ env.DATABASE_SCHEMA }} for tests
57+
- name: Download ISPyB DB schema v${{ env.ISPYB_DATABASE_SCHEMA }} for tests
5758
run: |
5859
mkdir database
59-
wget -t 3 --waitretry=20 https://github.com/DiamondLightSource/ispyb-database/releases/download/v${{ env.DATABASE_SCHEMA }}/ispyb-database-${{ env.DATABASE_SCHEMA }}.tar.gz -O database/ispyb-database.tar.gz
60+
wget -t 3 --waitretry=20 https://github.com/DiamondLightSource/ispyb-database/releases/download/v${{ env.ISPYB_DATABASE_SCHEMA }}/ispyb-database-${{ env.ISPYB_DATABASE_SCHEMA }}.tar.gz -O database/ispyb-database.tar.gz
6061
- name: Store database artifact
6162
uses: actions/upload-artifact@v4
6263
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ repos:
2020
name: Verifying JSON file syntax
2121
- id: check-yaml
2222
name: Verifying YAML file syntax
23+
exclude: Helm/charts/.*?/templates/deployment\.yaml
2324
args: [--allow-multiple-documents]
2425
- id: check-toml
2526
name: Verifying TOML file syntax
@@ -103,4 +104,5 @@ repos:
103104
hooks:
104105
- id: prettier
105106
name: Formatting other file types according to Prettier
107+
exclude: Helm/charts/.*?/templates/deployment\.yaml
106108
# types_or: [css, html, json, yaml]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Build command template
2+
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-instrument-server -t murfey-instrument-server:<version> path/to/python-murfey
3+
4+
# Set up the base image to build with
5+
FROM docker.io/library/python:3.12.10-slim-bookworm AS base
6+
7+
# Install Vim in base image
8+
RUN apt-get update && \
9+
apt-get upgrade -y && \
10+
apt-get install -y --no-install-recommends \
11+
rsync \
12+
vim \
13+
&& \
14+
apt-get autoremove && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
18+
# Build Murfey in a branch image
19+
FROM base as build
20+
COPY ./ /python-murfey/
21+
RUN apt-get update && \
22+
apt-get upgrade -y && \
23+
apt-get install -y --no-install-recommends \
24+
build-essential \
25+
busybox \
26+
net-tools \
27+
libpq-dev \
28+
&& \
29+
busybox --install && \
30+
python -m venv /venv && \
31+
/venv/bin/python -m pip install --upgrade \
32+
pip \
33+
build \
34+
importlib-metadata && \
35+
/venv/bin/python -m pip install /python-murfey[client,instrument-server]
36+
37+
38+
# Transfer completed Murfey build to base image
39+
FROM base
40+
41+
# Define external build arguments
42+
ARG groupid
43+
ARG groupname
44+
ARG userid
45+
46+
# Copy completed Murfey build across and set user and group permissions
47+
COPY --from=build /venv/ /venv/
48+
RUN groupadd -r -g "${groupid}" "${groupname}" && \
49+
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
50+
chown -R "${userid}":"${groupid}" /venv && \
51+
chmod -R a+x /venv
52+
ENV PATH=/venv/bin:$PATH
53+
USER "${userid}":"${groupid}"

Dockerfiles/murfey-rsync

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Template build command
2+
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-rsync
3+
4+
FROM docker.io/library/alpine:3.21
5+
# FROM alpine:3.14
6+
7+
ARG groupid
8+
ARG groupname
9+
ARG userid
10+
11+
# Add any system dependencies for the developer/build environment here
12+
RUN apk add --no-cache rsync && \
13+
addgroup -S -g "${groupid}" "${groupname}" && \
14+
adduser -S "${groupname}" -G "${groupname}" -u "${userid}" -s /bin/sh

Dockerfiles/murfey-server

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Template build command
2+
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-server -t murfey-server:<version> path/to/python-murfey
3+
4+
# Set up the base image to build with
5+
FROM docker.io/library/python:3.12.10-slim-bookworm AS base
6+
7+
# Install Vim and PostgreSQL dependencies in base image
8+
RUN apt-get update && \
9+
apt-get upgrade -y && \
10+
apt-get install -y --no-install-recommends \
11+
libpq-dev \
12+
vim \
13+
&& \
14+
apt-get autoremove && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
18+
# Build Murfey and IMOD in a branch image
19+
FROM base as build
20+
COPY ./ /python-murfey/
21+
RUN apt-get update && \
22+
apt-get upgrade -y && \
23+
apt-get install -y --no-install-recommends \
24+
build-essential \
25+
busybox \
26+
curl \
27+
net-tools \
28+
&& \
29+
busybox --install && \
30+
python -m venv /venv && \
31+
/venv/bin/python -m pip install --upgrade \
32+
pip \
33+
build \
34+
importlib-metadata \
35+
psycopg2-binary \
36+
&& \
37+
/venv/bin/python -m pip install /python-murfey[server] && \
38+
curl https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_5.1.0_RHEL8-64_CUDA12.0.sh > imod_5.1.0_RHEL8-64_CUDA12.0.sh && \
39+
chmod +x imod_5.1.0_RHEL8-64_CUDA12.0.sh && \
40+
mkdir imod && \
41+
./imod_5.1.0_RHEL8-64_CUDA12.0.sh -dir imod -skip -y
42+
43+
44+
# Transfer completed builds to base image
45+
FROM base
46+
47+
# Pass external build arguments to this stage
48+
ARG groupid
49+
ARG groupname
50+
ARG userid
51+
52+
# Copy completed Murfey and IMOD builds across and set user and group permissions
53+
COPY --from=build /venv/ /venv/
54+
COPY --from=build /imod/ /imod/
55+
RUN groupadd -r -g "${groupid}" "${groupname}" && \
56+
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
57+
chown -R "${userid}":"${groupid}" /venv && \
58+
chmod -R a+x /venv
59+
ENV PATH=/venv/bin:/imod/IMOD/bin:$PATH
60+
ENV IMOD_DIR=/imod/IMOD
61+
USER "${userid}":"${groupid}"

Helm/Chart.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
name: murfey-services
3+
description: Umbrella Helm chart for deploying the servers and daemons needed to enable Murfey to transfer and process data
4+
version: 0.18.1
5+
dependencies:
6+
- name: murfey-instrument-server-clem
7+
- name: murfey-instrument-server-tem
8+
- name: murfey-server
9+
- name: murfey-rsync
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
name: murfey-instrument-server-clem
3+
description: Helm chart for deploying a Murfey instrument server, which executes orders to detect, modify, and transfer files on the instrument PC, and notifies the backend server about transferred files
4+
version: 0.18.1

0 commit comments

Comments
 (0)