Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfiles for Murfey services and build context for Murfey frontend #450

Merged
merged 39 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2e2a7c0
Duplicated '_midpoint' function from 'murfey.client.contexts.tomo' to…
tieneupin Jan 14, 2025
6988807
Moved 'midpoint' function to 'murfey.util.tomo' to function duplication
tieneupin Jan 14, 2025
a67ae92
Added new optional dependency key for client-side instrument server
tieneupin Jan 14, 2025
45590a9
Replaced remaining instances of 'procrunner' with 'subprocess'
tieneupin Jan 14, 2025
2bb132a
Updated descriptive comments on 'pyproject.toml'
tieneupin Jan 14, 2025
bb0ec71
Implemented sanitisation to satisfy CodeQL warning on uncontrolled co…
tieneupin Jan 14, 2025
b3c8e3d
Added 'jose' as an 'instrument-server' dependency
tieneupin Jan 15, 2025
b55ae5f
Added 'jose' as a 'server' dependency
tieneupin Jan 15, 2025
933cfe6
Package is 'python-jose[cryptography], not 'jose'
tieneupin Jan 15, 2025
72548e2
Updated '_parse_rsync_stdout/stderr()' functions to read stringified …
tieneupin Jan 15, 2025
e35c6fe
Increased large files threshold to 600kB in pre-commit config
tieneupin Jan 15, 2025
087934b
Added Dockerfiles for Murfey services to repo, and add build context …
tieneupin Jan 15, 2025
33820bf
Merged recent changes from 'main' branch
tieneupin Jan 15, 2025
12b77cc
Merged recent changes from 'main' branch
tieneupin Jan 16, 2025
c73adc7
Migrated 'murfey-frontend' container resources to its own repository
tieneupin Jan 16, 2025
b94d5e6
Reverted file size check back to previous amount now that 'murfey-fro…
tieneupin Jan 16, 2025
aa472a4
Optimised build instructions for 'murfey-server' to reduce image size
tieneupin Jan 17, 2025
5f0b774
Further optimised build instructions to reduce size and set necessary…
tieneupin Jan 17, 2025
bfc624a
Made similar changes to 'murfey-instrument-server' Dockerfile
tieneupin Jan 17, 2025
d0dacc3
Optimised 'murfey-rsync' file as well
tieneupin Jan 17, 2025
6c9b4de
Fixed issue with user permissions not transferring correctly between …
tieneupin Jan 20, 2025
35bfb2a
Applied same fix to 'murfey-instrument-server' and corrected section …
tieneupin Jan 20, 2025
0f62d8d
Merged recent changes from 'main' branch
tieneupin Jan 21, 2025
1362b9e
Merged recent changes from 'main' branch
tieneupin Jan 23, 2025
7d9038f
Merged recent changes from 'main' branch
tieneupin Jan 23, 2025
155f4c4
Added IMOD installation to 'murfey-server' image and added libpq-dev …
tieneupin Jan 23, 2025
0517c26
Fixed comments
tieneupin Jan 23, 2025
84d933e
Fixed incorrect environment paths
tieneupin Jan 23, 2025
2a05d27
Merged 0.16.6 changes from 'main' branch
tieneupin Jan 24, 2025
00502e4
Removed confirmed unneeded build dependencies; updated comments
tieneupin Jan 24, 2025
8c1cde1
Merged recent changes from 'main' branch
tieneupin Jan 28, 2025
54cbb81
Added 'rsync' to list of installed packages in instrument server cont…
tieneupin Jan 28, 2025
6ee0440
Formatting
tieneupin Jan 28, 2025
a836a98
Merged recent changes from 'main' branch
tieneupin Jan 30, 2025
17fe304
Merged version bump from 'main'
tieneupin Jan 31, 2025
c349e6e
Skipped checking YAML files containing template expressions
tieneupin Feb 10, 2025
74b116b
Configured Prettier hook to ignore deployment.yaml files as well
tieneupin Feb 10, 2025
dd0b153
Added Helm charts to deploy Murfey's components on a Kubernetes cluster
tieneupin Feb 10, 2025
4bf988a
Enable automated version bumps of Helm chart versions as well
tieneupin Feb 10, 2025
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
53 changes: 53 additions & 0 deletions Dockerfiles/murfey-instrument-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Build command template
# 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

# Set up the base image to build with
FROM docker.io/library/python:3.12.8-slim-bullseye AS base

# Install Vim in base image
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
rsync \
vim \
&& \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*


# Build Murfey in a branch image
FROM base as build
COPY ./ /python-murfey/
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
busybox \
net-tools \
libpq-dev \
&& \
busybox --install && \
python -m venv /venv && \
/venv/bin/python -m pip install --upgrade \
pip \
build \
importlib-metadata && \
/venv/bin/python -m pip install /python-murfey[client,instrument-server]


# Transfer completed Murfey build to base image
FROM base

# Define external build arguments
ARG groupid
ARG groupname
ARG userid

# Copy completed Murfey build across and set user and group permissions
COPY --from=build /venv/ /venv/
RUN groupadd -r -g "${groupid}" "${groupname}" && \
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
chown -R "${userid}":"${groupid}" /venv && \
chmod -R a+x /venv
ENV PATH=/venv/bin:$PATH
USER "${userid}":"${groupid}"
14 changes: 14 additions & 0 deletions Dockerfiles/murfey-rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Template build command
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-rsync

FROM docker.io/library/alpine:3.20
# FROM alpine:3.14

ARG groupid
ARG groupname
ARG userid

# Add any system dependencies for the developer/build environment here
RUN apk add --no-cache rsync && \
addgroup -S -g "${groupid}" "${groupname}" && \
adduser -S "${groupname}" -G "${groupname}" -u "${userid}" -s /bin/sh
61 changes: 61 additions & 0 deletions Dockerfiles/murfey-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Template build command
# 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

# Set up the base image to build with
FROM docker.io/library/python:3.12.8-slim-bullseye AS base

# Install Vim and PostgreSQL dependencies in base image
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
libpq-dev \
vim \
&& \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*


# Build Murfey and IMOD in a branch image
FROM base as build
COPY ./ /python-murfey/
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
busybox \
curl \
net-tools \
&& \
busybox --install && \
python -m venv /venv && \
/venv/bin/python -m pip install --upgrade \
pip \
build \
importlib-metadata \
psycopg2-binary \
&& \
/venv/bin/python -m pip install /python-murfey[server] && \
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 && \
chmod +x imod_5.1.0_RHEL8-64_CUDA12.0.sh && \
mkdir imod && \
./imod_5.1.0_RHEL8-64_CUDA12.0.sh -dir imod -skip -y


# Transfer completed builds to base image
FROM base

# Pass external build arguments to this stage
ARG groupid
ARG groupname
ARG userid

# Copy completed Murfey and IMOD builds across and set user and group permissions
COPY --from=build /venv/ /venv/
COPY --from=build /imod/ /imod/
RUN groupadd -r -g "${groupid}" "${groupname}" && \
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
chown -R "${userid}":"${groupid}" /venv && \
chmod -R a+x /venv
ENV PATH=/venv/bin:/imod/IMOD/bin:$PATH
ENV IMOD_DIR=/imod/IMOD
USER "${userid}":"${groupid}"