-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (46 loc) · 2.22 KB
/
Dockerfile
File metadata and controls
63 lines (46 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
ARG CUDA_VERSION=13.0.2
FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-devel-ubuntu24.04 AS build
# Install dependencies
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get install -y --no-install-recommends git ca-certificates curl
# Install micromamba. Prefer install script so we don't have to determine platform here
RUN curl -sL micro.mamba.pm/install.sh | BIN_FOLDER=/opt/bin INIT_YES=no bash
# Setup paths we use
ENV PATH=/opt/ffs/bin:/opt/build_env/bin:/opt/bin:$PATH
# Copy environment files
COPY environment.yml runtime-environment.yml /opt/
# Create build environment from environment.yml
RUN micromamba create -y -f /opt/environment.yml -p /opt/build_env ninja
# Create the runtime environment from runtime-environment.yml
RUN micromamba create -y -f /opt/runtime-environment.yml -p /opt/ffs
# Copy source
COPY . /opt/ffs_src
ENV CMAKE_GENERATOR Ninja
# Build the C++/CUDA backend
WORKDIR /opt/build
RUN cmake /opt/ffs_src \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/ffs \
-DHDF5_ROOT=/opt/ffs \
-DPython3_ROOT_DIR=/opt/ffs \
-DCUDA_ARCH=80
RUN cmake --build .
RUN cmake --install .
# Install Python package
RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FFS=1.0 /opt/ffs/bin/pip3 install /opt/ffs_src
# Now copy this into an isolated runtime container
FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu24.04
LABEL org.opencontainers.image.title="fast-feedback-service" \
org.opencontainers.image.description="GPU-accelerated fast-feedback X-ray diffraction analysis service" \
org.opencontainers.image.authors="Nicholas Devenish <nicholas.devenish@diamond.ac.uk>, Dimitrios Vlachos <dimitrios.vlachos@diamond.ac.uk>, James Beilsten-Edmands <james.beilsten-edmands@diamond.ac.uk>" \
org.opencontainers.image.source="https://github.com/DiamondLightSource/fast-feedback-service" \
org.opencontainers.image.licenses="BSD-3-Clause"
COPY --from=build /opt/ffs /opt/ffs
# Set environment variables for the service
ENV PATH=/opt/ffs/bin:$PATH
ENV SPOTFINDER=/opt/ffs/bin/spotfinder
ENV LD_LIBRARY_PATH=/opt/ffs/lib:$LD_LIBRARY_PATH
# ENV ZOCALO_CONFIG=/dls_sw/apps/zocalo/live/configuration.yaml
# # Start the service
CMD ["/opt/ffs/bin/zocalo.service", "-s", "GPUPerImageAnalysis"]