Skip to content

Commit 1be8f11

Browse files
authored
fix: improve redis connection reliability
- Use mise and uv. - Update CI. Use mise and Docker build caching. - Overhaul Dockerfile. - Migrate `virtool-workflow` -> `virtool`.
1 parent acdb144 commit 1be8f11

File tree

8 files changed

+1245
-2639
lines changed

8 files changed

+1245
-2639
lines changed

.deepsource.toml

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

.github/workflows/ci.yml renamed to .github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
uses: actions/checkout@v4
3232
- name: Setup Docker
3333
uses: docker/setup-buildx-action@v3
34+
- name: Setup mise
35+
uses: jdx/mise-action@v2
3436
- name: Build
3537
id: build
3638
uses: docker/build-push-action@v5
@@ -41,7 +43,7 @@ jobs:
4143
load: true
4244
target: test
4345
- name: Test
44-
run: docker run --rm -t ${{ steps.build.outputs.imageid }} poetry run pytest
46+
run: docker run --rm -t ${{ steps.build.outputs.imageid }} uv run pytest
4547
release:
4648
name: Release
4749
runs-on: ubuntu-24.04
@@ -76,12 +78,10 @@ jobs:
7678
uses: actions/checkout@v4
7779
with:
7880
ref: ${{ needs.release.outputs.git-tag }}
79-
- name: Install Poetry
80-
uses: snok/install-poetry@v1
81+
- name: Setup mise
82+
uses: jdx/mise-action@v2
8183
- name: Write VERSION file
8284
run: echo ${{ needs.release.outputs.git-tag }} > VERSION
83-
- name: Update Version
84-
run: poetry version ${{ needs.release.outputs.git-tag }}
8585
- name: Login
8686
uses: docker/login-action@v3
8787
with:

Dockerfile

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,28 @@
1-
FROM debian:bookworm as pigz
2-
WORKDIR /build
3-
RUN apt-get update && apt-get install -y gcc make wget zlib1g-dev
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-
9-
FROM debian:bookworm as bowtie2
10-
WORKDIR /build
11-
RUN apt-get update && apt-get install -y unzip wget
12-
RUN wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.2/bowtie2-2.3.2-legacy-linux-x86_64.zip && \
13-
unzip bowtie2-2.3.2-legacy-linux-x86_64.zip && \
14-
mkdir bowtie2 && \
15-
cp bowtie2-2.3.2-legacy/bowtie2* bowtie2
16-
17-
FROM python:3.12.3-bookworm as build
18-
WORKDIR /workflow
19-
RUN curl -sSL https://install.python-poetry.org | python -
1+
FROM python:3.13-bookworm AS uv
2+
WORKDIR /app
3+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
4+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
205
ENV PATH="/root/.local/bin:${PATH}" \
21-
POETRY_CACHE_DIR='/tmp/poetry_cache' \
22-
POETRY_NO_INTERACTION=1 \
23-
POETRY_VIRTUALENVS_IN_PROJECT=1 \
24-
POETRY_VIRTUALENVS_CREATE=1
25-
COPY pyproject.toml poetry.lock ./
26-
RUN poetry install --without dev --no-root
6+
UV_CACHE_DIR='/tmp/uv_cache'
7+
COPY uv.lock pyproject.toml README.md ./
8+
RUN uv sync
9+
10+
FROM python:3.13-bookworm AS deps
11+
COPY --from=ghcr.io/virtool/tools:1.1.0 /tools/bowtie2/2.5.4/bowtie* /usr/local/bin/
12+
COPY --from=ghcr.io/virtool/tools:1.1.0 /tools/pigz/2.8/pigz /usr/local/bin/
2713

28-
FROM python:3.12.3-bookworm as base
29-
WORKDIR /workflow
30-
ENV VIRTUAL_ENV=/app/.venv \
31-
PATH="/workflow/.venv/bin:/opt/fastqc:${PATH}"
32-
COPY --from=bowtie2 /build/bowtie2/* /usr/local/bin/
33-
COPY --from=pigz /build/pigz-2.8/pigz /usr/local/bin/pigz
34-
COPY --from=build /workflow/.venv /workflow/.venv
14+
FROM deps AS base
15+
WORKDIR /app
16+
ENV PATH="/app/.venv/bin:${PATH}"
17+
COPY --from=uv /app/.venv /app/.venv
3518
COPY fixtures.py utils.py workflow.py VERSION* ./
3619

37-
FROM build as test
38-
COPY --from=bowtie2 /build/bowtie2/* /usr/local/bin/
39-
COPY --from=pigz /build/pigz-2.8/pigz /usr/local/bin/pigz
40-
RUN curl -sSL https://install.python-poetry.org | python -
20+
FROM deps AS test
21+
WORKDIR /app
22+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
23+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
4124
ENV PATH="/root/.local/bin:${PATH}" \
42-
POETRY_CACHE_DIR='/tmp/poetry_cache' \
43-
POETRY_NO_INTERACTION=1 \
44-
POETRY_VIRTUALENVS_IN_PROJECT=1 \
45-
POETRY_VIRTUALENVS_CREATE=1
46-
RUN poetry install
25+
UV_CACHE_DIR='/tmp/uv_cache'
26+
COPY uv.lock pyproject.toml README.md ./
4727
COPY tests ./tests
4828
COPY fixtures.py utils.py workflow.py ./

mise.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[tools]
2+
uv = "latest"
3+
4+
[tasks.test]
5+
description = "Run tests using uv"
6+
run = "uv run pytest"
7+
8+
[tasks.lint]
9+
description = "Run ruff linter"
10+
run = "uv run ruff check"
11+
12+
[tasks.format]
13+
description = "Format code with ruff"
14+
run = "uv run ruff format"

poetry.lock

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

pyproject.toml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
[project]
22
name = "workflow-build-index"
3-
version = "0.0.0"
3+
version = "0.1.0"
4+
readme = "README.md"
45
description = "A workflow for building Virtool reference indexes"
56
authors = [
67
{ name = "Ian Boyes"},
78
{ name = "Blake Smith" },
8-
{ name = "Tiensheng Sui" }
9+
{ name = "Tiensheng Sui" },
10+
{ name = "Christine Wong Chong" },
11+
{ name = "Markus Swoveland" },
12+
{ name = "Matt Curtis" }
913
]
10-
license = "MIT"
11-
requires-python = ">=3.12.3,<3.13"
14+
license="MIT"
15+
requires-python = ">=3.13.7,<3.14.0"
1216

13-
[tool.poetry]
14-
package-mode = false
15-
16-
[tool.poetry.dependencies]
17-
virtool-workflow = "7.2.3"
17+
dependencies = [
18+
"virtool",
19+
]
1820

19-
[tool.poetry.group.dev.dependencies]
20-
pytest = ">=7.4.2"
21-
pytest-asyncio = ">=0.23.3"
22-
pytest-mock = ">=3.6.1"
23-
syrupy = ">=4.6.0"
24-
ruff = ">=0.4.5"
21+
[dependency-groups]
22+
dev = [
23+
"pytest>=8.4.1",
24+
"pytest-asyncio>=1.1.0",
25+
"pytest-mock>=3.14.1",
26+
"ruff>=0.12.11",
27+
"syrupy>=4.9.1",
28+
]
2529

2630
[tool.pytest.ini_options]
2731
asyncio_mode = "auto"
2832

2933
[tool.ruff.lint]
3034
select = ["ALL"]
3135

32-
[build-system]
33-
requires = ["poetry-core>=1.0.0"]
34-
build-backend = "poetry.core.masonry.api"
36+
[tool.uv.sources]
37+
virtool = { git = "https://github.com/virtool/virtool", tag = "31.11.3" }

0 commit comments

Comments
 (0)