Skip to content

Commit

Permalink
Merge pull request #58 from alneberg/johannes_test
Browse files Browse the repository at this point in the history
Adapt Dockerfile for arm64 and some requirements changes
  • Loading branch information
remiolsen authored Jan 29, 2024
2 parents a39d9ae + 5609e0d commit b63e7d8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
41 changes: 38 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,47 @@ LABEL author="Remi-Andre Olsen" \
maintainer="[email protected]"

USER root

# Check for arm64 architecture to install minimap2
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ]; then \
# Install compliation tools for minimap2
apt-get update;\
apt-get install -y curl build-essential libz-dev;\
fi

ENV MINIMAP_VERSION=2.26

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# Download minimap2
curl -L https://github.com/lh3/minimap2/archive/refs/tags/v${MINIMAP_VERSION}.tar.gz | tar -zxvf - ;\
fi

RUN if [ "$TARGETARCH" = "arm64" ]; then \
# Compile minimap2
cd minimap2-${MINIMAP_VERSION};\
make arm_neon=1 aarch64=1; \
# Add to path
mv minimap2 /usr/local/bin/;\
fi

COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /
RUN micromamba env create -n anglerfish && micromamba install -y -n anglerfish -f /environment.yml && micromamba clean --all --yes
ENV PATH /opt/conda/envs/anglerfish/bin:$PATH
COPY --chown=$MAMBA_USER:$MAMBA_USER requirements.txt /

RUN if [ "$TARGETARCH" = "arm64" ]; then \
grep -v 'minimap2' /environment.yml > /environment.tmp.yml ;\
else \
cp /environment.yml /environment.tmp.yml ;\
fi ;\
chown $MAMBA_USER:$MAMBA_USER /environment.tmp.yml

# Add source files to the container
ADD . /usr/src/anglerfish
WORKDIR /usr/src/anglerfish
RUN eval "$(micromamba shell hook --shell bash)" && micromamba activate anglerfish && python -m pip install .[dev]

# Activate the environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN micromamba install -y -f /environment.tmp.yml && micromamba clean --all --yes

RUN eval "$(micromamba shell hook --shell bash)" && python -m pip install .[dev]
USER $MAMBA_USER
9 changes: 4 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::biopython=1.79
- conda-forge::python-levenshtein=0.23.0
- conda-forge::numpy>=1.22.0
- bioconda::minimap2=2.20
- conda-forge::pyyaml=6.0
- bioconda::minimap2=2.26
- pip
- pip:
- -r requirements.txt
- conda-forge::pre-commit
- conda-forge::prettier
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy==1.26.3
biopython==1.83
levenshtein==0.23.0
pyyaml==6.0.1
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@
python_requires=">=3.10",
packages=find_packages(),
package_data={"": ["config/adaptors.yaml"]},
install_requires=[
"python-levenshtein==0.23.0",
"biopython==1.79",
"numpy>=1.22.0",
"pyyaml==6.0",
],
# Read requirements.txt
install_requires=[x.strip() for x in open("requirements.txt").readlines()],
extras_require={"dev": ["ruff", "mypy", "editorconfig-checker"]},
entry_points={
"console_scripts": [
Expand Down

0 comments on commit b63e7d8

Please sign in to comment.