1
1
FROM debian:buster as prep
2
2
WORKDIR /build
3
3
RUN apt-get update && apt-get install -y cmake gcc g++ make unzip wget zlib1g-dev
4
- RUN wget https://zlib.net/pigz/pigz-2.8.tar.gz
5
- RUN tar -xvf pigz-2.8.tar.gz
6
- WORKDIR /build/pigz-2.8
7
- RUN make
8
- WORKDIR /build
9
- RUN wget https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.9.zip
10
- RUN unzip fastqc_v0.11.9.zip
11
4
RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip
12
5
RUN unzip bowtie2-2.3.2-legacy-linux-x86_64.zip
13
6
RUN mkdir bowtie2
@@ -17,52 +10,48 @@ RUN tar -xvf SPAdes-3.11.0-Linux.tar.gz
17
10
RUN mv SPAdes-3.11.0-Linux spades
18
11
RUN sed -i 's/import collections/import collections\n import collections.abc/g' spades/share/spades/pyyaml3/constructor.py
19
12
RUN sed -i 's/key, collections.Hashable/key, collections.abc.Hashable/g' spades/share/spades/pyyaml3/constructor.py
20
- RUN wget http://eddylab.org/software/hmmer/hmmer-3.2.1.tar.gz
21
- RUN tar -xf hmmer-3.2.1.tar.gz
22
- WORKDIR /build/hmmer-3.2.1
23
- RUN ./configure --prefix /build/hmmer
24
- RUN make
25
- RUN make install
26
- WORKDIR /build
27
- RUN wget https://github.com/relipmoc/skewer/archive/0.2.2.tar.gz
28
- RUN tar -xf 0.2.2.tar.gz
29
- WORKDIR /build/skewer-0.2.2
30
- RUN make
31
- RUN mv skewer /build
32
13
33
- FROM python:3.10-buster as base
14
+ FROM python:3.10-bullseye as build
34
15
WORKDIR /app
35
16
COPY --from=prep /build/bowtie2/* /usr/local/bin/
36
- COPY --from=prep /build/FastQC /opt/fastqc
37
- COPY --from=prep /build/hmmer /opt/hmmer
38
- COPY --from=prep /build/pigz-2.8/pigz /usr/local/bin/pigz
39
- COPY --from=prep /build/skewer /usr/local/bin/
40
17
COPY --from=prep /build/spades /opt/spades
41
- RUN chmod ugo+x /opt/fastqc/fastqc && \
42
- ln -fs /opt/fastqc/fastqc /usr/local/bin/fastqc && \
43
- for file in `ls /opt/hmmer/bin`; do ln -fs /opt/hmmer/bin/${file} /usr/local/bin/${file}; done
44
- RUN apt-get update && \
45
- apt-get install -y --no-install-recommends curl build-essential default-jre && \
46
- rm -rf /var/lib/apt/lists/* && \
47
- apt-get clean
48
- RUN apt-get update && apt-get install -y curl build-essential
18
+ COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/hmmer /opt/hmmer
19
+ COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /usr/local/bin/skewer /usr/local/bin/
20
+ COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /usr/local/bin/pigz /usr/local/bin/
21
+ RUN apt-get update && apt-get install -y --no-install-recommends curl build-essential default-jre
49
22
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
50
23
RUN curl -sSL https://install.python-poetry.org | python -
51
- ENV PATH="/root/.cargo/bin:/root/.local/bin:/opt/spades/bin:${PATH}"
52
- RUN pip install --upgrade pip
53
- RUN pip install maturin==0.14.12
24
+ ENV PATH="/root/.cargo/bin:/root/.local/bin:/opt/spades/bin:/opt/hmmer/bin/:${PATH}" \
25
+ POETRY_CACHE_DIR='/tmp/poetry_cache' \
26
+ POETRY_NO_INTERACTION=1 \
27
+ POETRY_VIRTUALENVS_IN_PROJECT=1 \
28
+ POETRY_VIRTUALENVS_CREATE=1
54
29
COPY src src
55
- COPY Cargo.toml Cargo.lock poetry.lock pyproject.toml workflow.py ./
56
- RUN maturin build --release
57
- RUN poetry export > requirements.txt
58
- RUN pip install -r requirements.txt
59
- RUN pip install /app/target/wheels/nuvs_rust*.whl
30
+ COPY Cargo.toml Cargo.lock poetry.lock pyproject.toml ./
31
+ RUN poetry install --only rust
32
+ RUN poetry run maturin build --release
33
+ RUN poetry remove nuvs-rust && poetry add target/wheels/*.whl && poetry install
34
+ RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
35
+
36
+ FROM build as test
37
+ ENV PATH="/root/.cargo/bin:/root/.local/bin:/opt/spades/bin:${PATH}" \
38
+ POETRY_NO_INTERACTION=1 \
39
+ POETRY_VIRTUALENVS_IN_PROJECT=1 \
40
+ POETRY_VIRTUALENVS_CREATE=1
41
+ RUN poetry install --with dev
42
+ COPY example ./example
43
+ COPY tests ./tests
44
+ COPY workflow.py ./
45
+ ENTRYPOINT ["poetry" , "run" ]
60
46
61
- FROM base as test
47
+ FROM python:3.10-bullseye as base
62
48
WORKDIR /app
63
- ENV PATH="/opt/spades/bin:${PATH}"
64
- RUN poetry export --with dev > requirements.txt
65
- RUN pip install -r requirements.txt
49
+ COPY --from=prep /build/bowtie2/* /usr/local/bin/
50
+ COPY --from=prep /build/spades /opt/spades
51
+ COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/hmmer /opt/hmmer
52
+ COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /usr/local/bin/skewer /usr/local/bin/
53
+ COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /usr/local/bin/pigz /usr/local/bin/
54
+ ENV VIRTUAL_ENV=/app/.venv \
55
+ PATH="/app/.venv/bin:/opt/spades/bin:/opt/hmmer/bin:${PATH}"
56
+ COPY --from=build /app/.venv /app/.venv
66
57
COPY workflow.py ./
67
- COPY tests ./tests
68
- RUN pytest
0 commit comments