Skip to content

Commit 2f14e66

Browse files
authored
fix: use virtool-workflow^6.0.0-alpha11
* Overhaul workflow to use `virtool-workflow^6.0.0`. * Cleanup tests and example data. * Source some tools from `workflow-tools`. * Improve SPAdes logging.
1 parent e551612 commit 2f14e66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1456770
-3864
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
- name: commitlint
@@ -22,22 +22,33 @@ jobs:
2222
runs-on: ubuntu-22.04
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
26+
- name: Setup Docker
27+
uses: docker/setup-buildx-action@v3
28+
- name: Build
29+
id: build
30+
uses: docker/build-push-action@v5
31+
with:
32+
cache-from: type=gha
33+
cache-to: type=gha,mode=max
34+
context: .
35+
load: true
36+
target: test
2637
- name: Test
27-
run: docker build -t nuvs-test --target test . && docker run nuvs-test
38+
run: docker run --rm -t ${{ steps.build.outputs.imageid }} pytest
2839
release:
2940
runs-on: ubuntu-22.04
3041
needs: [test, commitlint]
3142
if: github.event_name == 'push'
3243
steps:
3344
- name: Checkout
34-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
3546
- name: Setup Node.js
36-
uses: actions/setup-node@v3
47+
uses: actions/setup-node@v4
3748
with:
38-
node-version: 18
49+
node-version: 20
3950
- name: Install semantic-release
40-
run: npm i semantic-release@v18.0.0 conventional-changelog-conventionalcommits@4.6.1
51+
run: npm i semantic-release@v23.0.0 conventional-changelog-conventionalcommits@7.0.2
4152
- name: Release
4253
env:
4354
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}

.github/workflows/publish.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ jobs:
1616
if: github.repository_owner == 'Virtool'
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
- name: Write VERSION file
2121
run: echo ${{ github.event.release.tag_name }} > VERSION
22-
- name: Update pyproject.toml version
23-
run: sed -i 's/0\.0\.0/${{ github.event.release.tag_name }}/' pyproject.toml
2422
- name: Login to Registry
25-
uses: docker/login-action@v2
23+
uses: docker/login-action@v3
2624
with:
2725
registry: ${{ env.REGISTRY }}
2826
username: ${{ secrets.GH_USERNAME }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__pycache__
22
.idea
33
.pytest_cache
4-
/target/
5-
.vscode
4+
.vscode
5+
target

.pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 23.1.0
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.1.13
44
hooks:
5-
- id: black
5+
- id: ruff
6+
args: [ --fix ]
7+
- id: ruff-format

.releaserc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
{
22
"branches": [
3-
"+([0-9])?(.{+([0-9]),x}).x",
43
"main",
5-
{
6-
"name": "beta",
7-
"prerelease": true
8-
},
9-
{
10-
"name": "alpha",
11-
"prerelease": true
12-
}
134
],
145
"plugins": [
156
["@semantic-release/commit-analyzer", {

.vscode/settings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

Dockerfile

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
FROM debian:buster as prep
22
WORKDIR /build
33
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
114
RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip
125
RUN unzip bowtie2-2.3.2-legacy-linux-x86_64.zip
136
RUN mkdir bowtie2
@@ -17,52 +10,48 @@ RUN tar -xvf SPAdes-3.11.0-Linux.tar.gz
1710
RUN mv SPAdes-3.11.0-Linux spades
1811
RUN sed -i 's/import collections/import collections\nimport collections.abc/g' spades/share/spades/pyyaml3/constructor.py
1912
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
3213

33-
FROM python:3.10-buster as base
14+
FROM python:3.10-bullseye as build
3415
WORKDIR /app
3516
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/
4017
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
4922
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
5023
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
5429
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"]
6046

61-
FROM base as test
47+
FROM python:3.10-bullseye as base
6248
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
6657
COPY workflow.py ./
67-
COPY tests ./tests
68-
RUN pytest

docker-compose.yml

Lines changed: 0 additions & 125 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)