1- FROM python:3.10-buster as rustPyo3
1+ FROM debian:buster as prep
2+ WORKDIR /build
3+ RUN apt-get update && apt-get install -y make gcc zlib1g-dev wget unzip
4+ RUN wget https://zlib.net/pigz/pigz-2.8.tar.gz && \
5+ tar -xzvf pigz-2.8.tar.gz && \
6+ cd pigz-2.8 && \
7+ make
8+ RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip && \
9+ unzip bowtie2-2.3.2-legacy-linux-x86_64.zip && \
10+ mkdir bowtie2 && \
11+ cp bowtie2-2.3.2-legacy/bowtie2* bowtie2
12+
13+ FROM python:3.10-buster as rust
214WORKDIR /build
315RUN apt-get update && apt-get install -y curl build-essential
416RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
517ENV PATH="/root/.cargo/bin:${PATH}"
6- RUN pip install maturin==0.14.5
18+ RUN pip install maturin==0.14.7
719COPY src src
820COPY Cargo.toml Cargo.lock ./
921RUN maturin build --release
1022
11- FROM virtool/workflow:5.3.0 as test
12- WORKDIR /test
13- COPY poetry.lock pyproject.toml /test/
23+ FROM python:3.10-buster as base
24+ WORKDIR /workflow
1425RUN curl -sSL https://install.python-poetry.org | python -
15- RUN poetry install
16- COPY tests / test /
17- COPY fixtures.py workflow.py pytest.ini /test/
18- COPY --from=rustPyo3 /build/target/wheels/count_nucleotides_and_seqs*.whl ./
19- RUN ls
20- RUN pip3.10 install count_nucleotides_and_seqs*.whl
21- RUN poetry install
22- RUN poetry add ./count_nucleotides_and_seqs*.whl
23- RUN poetry run pytest
26+ ENV PATH= "/root/.local/bin:${PATH}"
27+ COPY --from=prep /build/bowtie2/* /usr/local/bin /
28+ COPY --from=prep /build/pigz-2.8/pigz /usr/local/bin/pigz
29+ COPY --from=rust /build/target/wheels/count_nucleotides_and_seqs*.whl ./
30+ COPY fixtures.py workflow.py pyproject.toml poetry.lock ./
31+ RUN poetry export > requirements.txt
32+ RUN pip install --upgrade pip
33+ RUN pip install -r requirements.txt
34+ RUN pip install ./count_nucleotides_and_seqs*.whl
2435
25- FROM virtool/workflow:5.3.0 as build
36+ FROM base as test
2637WORKDIR /workflow
27- COPY fixtures.py workflow.py /workflow/
28- COPY --from=rustPyo3 /build/target/wheels/count_nucleotides_and_seqs*.whl ./
29- RUN ls
30- RUN pip3.10 install count_nucleotides_and_seqs*.whl
31- RUN poetry install
32- RUN poetry add ./count_nucleotides_and_seqs*.whl
38+ RUN poetry export --with dev > requirements.txt
39+ RUN pip install -r requirements.txt
40+ COPY pytest.ini ./
41+ COPY tests ./tests
42+ RUN pytest
0 commit comments