-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
70 lines (54 loc) · 2.01 KB
/
Dockerfile
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
64
65
66
67
68
69
70
# Use an official micromamba image as the base image
ARG PYTHON_VERSION=3.10
FROM mambaorg/micromamba:1.5.10
# Set environment variables for micromamba
ENV MAMBA_DOCKERFILE_ACTIVATE=1
ENV MAMBA_ROOT_PREFIX=/opt/conda
# Switch to root to install all dependencies (using non-root user causes permission issues)
USER root
# Make arg accessible to the rest of the Dockerfile
ARG PYTHON_VERSION
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
bash \
bc \
unzip \
wget \
gfortran \
liblapack-dev \
libblas-dev \
cmake \
make \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python
RUN micromamba install -y -n base -c conda-forge \ python=${PYTHON_VERSION} && \
micromamba clean --all --yes
# Install testing dependencies
RUN python -m pip install --upgrade pip \
&& pip install uv \
&& uv pip install pre-commit pytest pytest-mock pytest-split pytest-cov types-setuptools
# Install Julia
RUN curl -fsSL https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.2-linux-x86_64.tar.gz | tar -xz -C /opt \
&& ln -s /opt/julia-1.9.2/bin/julia /usr/local/bin/julia
# Set up Julia environment (ACEpotentials.jl interface)
RUN julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.Registry.RegistrySpec(url="https://github.com/ACEsuit/ACEregistry")); Pkg.add(Pkg.PackageSpec(;name="ACEpotentials", version="0.6.7")); Pkg.add("DataFrames"); Pkg.add("CSV")'
# Install Buildcell (airss)
RUN curl -fsSL https://www.mtg.msm.cam.ac.uk/files/airss-0.9.3.tgz -o /opt/airss-0.9.3.tgz \
&& tar -xf /opt/airss-0.9.3.tgz -C /opt \
&& rm /opt/airss-0.9.3.tgz \
&& cd /opt/airss \
&& make \
&& make install \
&& make neat
# Add Buildcell to PATH
ENV PATH="${PATH}:/opt/airss/bin"
# Set the working directory
WORKDIR /workspace
# Copy the current directory contents into the container at /workspace
COPY . /workspace
# Install autoplex and clear cache
RUN uv pip install .[strict,docs]
RUN uv cache clean