Skip to content

Commit dd93e0b

Browse files
authored
fix: improve error visibility
* Try to improve quality of errors reported to Sentry. * Log exceptions that are pushed to the API in error status reports. * Extend tracebacks reported to API. * Fix broken image build.
1 parent 1946853 commit dd93e0b

File tree

5 files changed

+50
-40
lines changed

5 files changed

+50
-40
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v3
2626
- name: Build
27-
run: docker build .
27+
run: docker build --target=base .
2828
test:
2929
runs-on: ubuntu-22.04
3030
steps:

Dockerfile

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
1-
FROM python:3.10-buster as rust_utils
1+
FROM debian:buster as prep
22
WORKDIR /build
3-
RUN apt-get update && apt-get install -y curl build-essential
3+
RUN apt-get update && apt-get install -y make gcc zlib1g-dev wget unzip
4+
RUN wget https://zlib.net/pigz/pigz-2.7.tar.gz && \
5+
tar -xzvf pigz-2.7.tar.gz && \
6+
cd pigz-2.7 && \
7+
make
8+
RUN wget https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.9.zip && \
9+
unzip fastqc_v0.11.9.zip
10+
RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip && \
11+
unzip bowtie2-2.3.2-legacy-linux-x86_64.zip && \
12+
mkdir bowtie2 && \
13+
cp bowtie2-2.3.2-legacy/bowtie2* bowtie2
14+
15+
FROM python:3.10-buster as base
16+
WORKDIR /app
17+
COPY --from=prep /build/bowtie2/* /usr/local/bin/
18+
COPY --from=prep /build/FastQC /opt/fastqc
19+
COPY --from=prep /build/pigz-2.7/pigz /usr/local/bin/pigz
20+
RUN chmod ugo+x /opt/fastqc/fastqc && \
21+
ln -fs /opt/fastqc/fastqc /usr/local/bin/fastqc && \
22+
for file in `ls /opt/hmmer/bin`; do ln -fs /opt/hmmer/bin/${file} /usr/local/bin/${file}; done
23+
RUN apt-get update && \
24+
apt-get install -y --no-install-recommends curl build-essential default-jre && \
25+
rm -rf /var/lib/apt/lists/* && \
26+
apt-get clean
427
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
5-
ENV PATH="/root/.cargo/bin:${PATH}"
28+
RUN curl -sSL https://install.python-poetry.org | python -
29+
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
30+
RUN pip install --upgrade pip
631
RUN pip install maturin==0.14.5
732
COPY src src
8-
COPY Cargo.toml Cargo.lock ./
33+
COPY Cargo.toml Cargo.lock fixtures.py pathoscope.py poetry.lock pyproject.toml workflow.py ./
934
RUN maturin build --release
35+
RUN poetry export > requirements.txt
36+
RUN pip install -r requirements.txt
37+
RUN pip install /app/target/wheels/rust_utils*.whl
1038

11-
FROM virtool/workflow:5.3.0 as base
12-
WORKDIR /app
13-
RUN pip install --upgrade pip
14-
COPY fixtures.py workflow.py pathoscope.py ./
15-
COPY --from=rust_utils /build/target/wheels/rust_utils*.whl ./
16-
RUN ls
17-
RUN pip install rust_utils*.whl
1839

19-
FROM virtool/workflow:5.3.0 as test
20-
WORKDIR /test
21-
RUN pip install --upgrade pip
22-
COPY pyproject.toml poetry.lock ./
23-
RUN curl -sSL https://install.python-poetry.org | python -
24-
COPY tests /test/tests
25-
COPY fixtures.py workflow.py pathoscope.py ./
26-
COPY --from=rust_utils /build/target/wheels/rust_utils*.whl ./
27-
RUN pip install rust_utils*.whl
28-
RUN poetry install
29-
RUN poetry add ./rust_utils*.whl
30-
RUN ls
31-
RUN poetry run pytest
40+
FROM base as test
41+
WORKDIR /app
42+
RUN poetry export --with dev > requirements.txt
43+
RUN pip install -r requirements.txt
44+
COPY tests ./tests
45+
RUN pytest

poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT"
77

88
[tool.poetry.dependencies]
99
python = "~3.10"
10-
virtool-workflow = "^5.0.0"
10+
virtool-workflow = "^5.3.1"
1111
rust = "^0.1.1"
1212

1313
[tool.poetry.group.dev.dependencies]

tests/test_workflow.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,8 @@ class SubtractionFactory(ModelFactory):
125125
**{**_subtraction1.dict(), "ready": True},
126126
path=subtraction_path,
127127
),
128-
WFSubtraction(
129-
**{**_subtraction2.dict(), "ready": True},
130-
path=subtraction_path
131-
),
132-
WFSubtraction(
133-
**{**_subtraction3.dict(), "ready": True},
134-
path=subtraction_path
135-
)
128+
WFSubtraction(**{**_subtraction2.dict(), "ready": True}, path=subtraction_path),
129+
WFSubtraction(**{**_subtraction3.dict(), "ready": True}, path=subtraction_path),
136130
]
137131

138132

@@ -194,7 +188,9 @@ async def test_map_isolates(
194188

195189

196190
@pytest.mark.datafiles(SAM_PATH, FASTQ_PATH)
197-
async def test_eliminate_subtraction(datafiles, subtractions, work_path, run_subprocess):
191+
async def test_eliminate_subtraction(
192+
datafiles, subtractions, work_path, run_subprocess
193+
):
198194
isolate_fastq_path = work_path / "test.fq"
199195
isolate_sam_path = work_path / "test_al.sam"
200196

0 commit comments

Comments
 (0)