-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Rust complication strategy. * Reorganize code and tests. * Use latest Maturin and update Rust compilation strategy. * Use latest Bowtie2.
- Loading branch information
Showing
23 changed files
with
1,152 additions
and
1,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM debian:bookworm as bowtie2 | ||
WORKDIR /build | ||
RUN apt-get update && apt-get install -y build-essential cmake wget zlib1g-dev | ||
RUN wget https://github.com/BenLangmead/bowtie2/archive/refs/tags/v2.5.4.tar.gz | ||
RUN tar -xvf v2.5.4.tar.gz | ||
WORKDIR bowtie2-2.5.4 | ||
RUN make | ||
RUN mkdir /build/bowtie2 | ||
RUN cp bowtie2* /build/bowtie2/ | ||
|
||
FROM debian:bookworm as pigz | ||
WORKDIR /build | ||
RUN apt-get update && apt-get install -y gcc make wget zlib1g-dev | ||
RUN wget https://zlib.net/pigz/pigz-2.8.tar.gz && \ | ||
tar -xzvf pigz-2.8.tar.gz && \ | ||
cd pigz-2.8 && \ | ||
make | ||
|
||
FROM python:3.12-bookworm | ||
COPY --from=bowtie2 /build/bowtie2/* /usr/local/bin/ | ||
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/fastqc /opt/fastqc | ||
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/hmmer /opt/hmmer | ||
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /usr/local/bin/pigz /usr/local/bin/ | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
RUN curl -sSL https://install.python-poetry.org | python - | ||
ENV PATH="/root/.local/bin:/root/.cargo/bin:${PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "pathoscope-test", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "." | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
[package] | ||
name = "rust_utils" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Markus Swoveland"] | ||
name = "workflowpathoscope" | ||
version = "0.0.0" | ||
edition = "2021" | ||
authors = ["Markus Swoveland"] | ||
|
||
[lib] | ||
name = "workflow_pathoscope" | ||
# "cdylib" is necessary to produce a shared library for Python to import from. | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
yaml-rust = "0.4.5" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies.pyo3] | ||
version = "0.16.3" | ||
|
||
[features] | ||
extension-module = ["pyo3/extension-module"] | ||
default = ["extension-module"] | ||
version = "^0.20.0" | ||
# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum | ||
# Python version 3.12 | ||
features = ["abi3-py312"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,66 @@ | ||
FROM debian:buster as prep | ||
FROM debian:bookworm as bowtie2 | ||
WORKDIR /build | ||
RUN apt-get update && apt-get install -y make gcc zlib1g-dev wget unzip | ||
RUN apt-get update && apt-get install -y build-essential cmake wget zlib1g-dev | ||
RUN wget https://github.com/BenLangmead/bowtie2/archive/refs/tags/v2.5.4.tar.gz | ||
RUN tar -xvf v2.5.4.tar.gz | ||
WORKDIR bowtie2-2.5.4 | ||
RUN make | ||
RUN mkdir /build/bowtie2 | ||
RUN cp bowtie2* /build/bowtie2/ | ||
|
||
FROM debian:bookworm as pigz | ||
WORKDIR /build | ||
RUN apt-get update && apt-get install -y gcc make wget zlib1g-dev | ||
RUN wget https://zlib.net/pigz/pigz-2.8.tar.gz && \ | ||
tar -xzvf pigz-2.8.tar.gz && \ | ||
cd pigz-2.8 && \ | ||
make | ||
RUN wget https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.9.zip && \ | ||
unzip fastqc_v0.11.9.zip | ||
RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip && \ | ||
unzip bowtie2-2.3.2-legacy-linux-x86_64.zip && \ | ||
mkdir bowtie2 && \ | ||
cp bowtie2-2.3.2-legacy/bowtie2* bowtie2 | ||
|
||
|
||
FROM python:3.10-buster as base | ||
FROM python:3.12-bookworm as deps | ||
WORKDIR /app | ||
COPY --from=prep /build/bowtie2/* /usr/local/bin/ | ||
COPY --from=prep /build/FastQC /opt/fastqc | ||
COPY --from=prep /build/pigz-2.8/pigz /usr/local/bin/pigz | ||
RUN chmod ugo+x /opt/fastqc/fastqc && \ | ||
ln -fs /opt/fastqc/fastqc /usr/local/bin/fastqc && \ | ||
for file in `ls /opt/hmmer/bin`; do ln -fs /opt/hmmer/bin/${file} /usr/local/bin/${file}; done | ||
COPY --from=bowtie2 /build/bowtie2/* /usr/local/bin/ | ||
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/fastqc /opt/fastqc | ||
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/hmmer /opt/hmmer | ||
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /usr/local/bin/pigz /usr/local/bin/ | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends curl build-essential default-jre && \ | ||
apt-get install -y --no-install-recommends default-jre && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt-get clean | ||
|
||
FROM python:3.12-bookworm as poetry | ||
WORKDIR /app | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
RUN curl -sSL https://install.python-poetry.org | python - | ||
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}" | ||
RUN pip install --upgrade pip | ||
RUN pip install maturin==0.14.5 | ||
COPY src src | ||
COPY Cargo.toml Cargo.lock fixtures.py utils.py poetry.lock pyproject.toml workflow.py ./ | ||
RUN maturin build --release | ||
RUN poetry export > requirements.txt | ||
RUN pip install -r requirements.txt | ||
RUN pip install /app/target/wheels/rust_utils*.whl | ||
COPY VERSION* ./ | ||
ENV PATH="/root/.local/bin:/root/.cargo/bin:${PATH}" \ | ||
POETRY_CACHE_DIR='/tmp/poetry_cache' \ | ||
POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 | ||
COPY Cargo.toml Cargo.lock poetry.lock pyproject.toml ./ | ||
COPY python/ ./python | ||
COPY src ./src | ||
RUN poetry install | ||
RUN poetry run maturin develop --release | ||
|
||
FROM base as test | ||
FROM deps as base | ||
WORKDIR /app | ||
RUN poetry export --with dev > requirements.txt | ||
RUN pip install -r requirements.txt | ||
ENV VIRTUAL_ENV=/app/.venv \ | ||
PATH="/app/.venv/bin:/opt/fastqc:/opt/hmmer/bin:${PATH}" | ||
RUN chmod ugo+x /opt/fastqc/fastqc | ||
COPY --from=poetry /app/.venv /app/.venv | ||
COPY --from=poetry /app/python /app/python | ||
COPY fixtures.py workflow.py VERSION* ./ | ||
|
||
FROM deps as test | ||
WORKDIR /app | ||
ENV PATH="/root/.local/bin:/root/.cargo/bin:${PATH}" | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
RUN curl -sSL https://install.python-poetry.org | python - | ||
COPY Cargo.lock Cargo.toml pyproject.toml poetry.lock ./ | ||
COPY src ./src | ||
COPY python ./python | ||
RUN poetry install | ||
RUN poetry run maturin develop --release | ||
COPY example ./example | ||
COPY tests ./tests | ||
COPY fixtures.py workflow.py VERSION* ./ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.