Skip to content

Commit

Permalink
continue adding deps for container-based build
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist committed Feb 15, 2024
1 parent fb4d48f commit 4195aa2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ccls-cache/
/target
**/*.rs.bk
8 changes: 8 additions & 0 deletions .tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[test_config]
engine = "Llvm"
follow-exec = true
skip-clean = true
target-dir = "target/tarpaulin"
exclude-files = [
"target/*"
]
41 changes: 34 additions & 7 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
ARG RUST_VERSION=1.76
FROM rust:${RUST_VERSION} as builder
FROM rust:1.76 as builder

LABEL org.opencontainers.image.source=https://github.com/berquist/rchem
LABEL org.opencontainers.image.description="quantum chemistry in Rust"
LABEL org.opencontainers.image.licenses=BSD-3-Clause

# hadolint ignore=DL3008
RUN \
--mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& apt-get install -y --no-install-recommends libgsl-dev \
&& apt-get install -y --no-install-recommends \
cmake \
gfortran \
libclang-dev \
libgsl-dev \
liblapacke-dev \
&& rm -rf /var/lib/apt/lists/*

RUN cargo install cargo-tarpaulin

ARG PYENV_ROOT=/pyenv
ENV PYENV_ROOT "${PYENV_ROOT}"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
ARG PYTHON_VERSION=3.11.8
RUN git clone https://github.com/pyenv/pyenv.git "${PYENV_ROOT}" \
&& pyenv install "${PYTHON_VERSION}" \
&& pyenv rehash \
&& pyenv global "${PYTHON_VERSION}"

WORKDIR /code/rchem
COPY requirements.txt requirements.txt
# hadolint ignore=DL3013
RUN python -m venv ${HOME}/venv \
&& . "${HOME}"/venv/bin/activate \
&& python -m pip install --no-cache-dir -U pip setuptools \
&& python -m pip install --no-cache-dir -r requirements.txt

RUN cargo install cargo-tarpaulin

COPY . .

ENV LD_LIBRARY_PATH "${PYENV_ROOT}/versions/${PYTHON_VERSION}/lib:${LD_LIBRARY_PATH}"

RUN \
--mount=type=cache,target=/code/rchem/target \
--mount=type=cache,target=/code/rchem/target,sharing=locked \
cargo tarpaulin --workspace --all-features --out Xml Html \
&& cargo build --release
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
basis-set-exchange

0 comments on commit 4195aa2

Please sign in to comment.