Repository navigation
🐛 install dotnet-sdk-8.0 so DIA-NN >=2.1.0 can read Thermo .raw - #16
Conversation
major changes in containers deployment.
Link Gif to youtube video
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughDIA-NN container documentation and build infrastructure expanded: README updated with new versions (2.3.2, 2.5.0) and clarified Linux native Changes
Sequence DiagramsequenceDiagram
actor User
participant Script as build-diann-singularity.sh
participant Docker as Docker Daemon
participant Apptainer as Apptainer/Singularity
participant Filesystem as Output Directory
User->>Script: Execute with version args
Script->>Script: Detect Singularity/Apptainer CLI
Script->>Script: Validate Docker & Singularity/Apptainer installed
loop For each DIA-NN version
Script->>Script: Check if context dir exists
Script->>Script: Check if .img exists (skip if present, unless FORCE=1)
alt Skip Docker Build
Script->>Docker: Verify Docker tag exists locally
else Build Docker Image
Script->>Docker: Build image from local context
Docker->>Docker: Create Docker image
end
Script->>Docker: Reference image via docker-daemon://tag
Docker->>Apptainer: Convert Docker image to Singularity
Apptainer->>Apptainer: Build .tmp image
Apptainer->>Filesystem: Move .tmp to final .img path
end
Script->>Filesystem: List generated .img files
Script->>User: Print progress and results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
build-diann-singularity.sh (3)
89-94: Considerdocker-archive://to avoid the daemon dependency at conversion time.
docker-daemon://requires a running Docker daemon accessible to the user invokingsingularity build(often needs root/rootless setup to read the daemon socket). If that becomes a friction point in CI,docker save | singularity build … docker-archive://is a more portable alternative. Not a blocker — just flagging.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@build-diann-singularity.sh` around lines 89 - 94, The singluarity build invocation uses the docker-daemon:// URI which requires a running Docker daemon; change the conversion to use docker-archive:// by first exporting the image to a tar archive and then passing that archive to SIF_BIN build (replace the "$SIF_BIN build --force \"$tmp_sif\" \"docker-daemon://${docker_tag}\"" call). Implement creating a temporary archive (e.g., using docker save into a temp file named from docker_tag), ensure cleanup of that temp archive, and then call SIF_BIN with "docker-archive://<archive_path>" while still moving tmp_sif to "$sif_path" afterwards; reference the variables and commands tmp_sif, sif_path, docker_tag, and SIF_BIN when making changes.
96-96: Avoid parsingls(SC2012).Works fine here, but piping
ls -lhintoawkis fragile with unusual filenames and trips shellcheck. Consider usingstatordu -h+ basename.♻️ Proposed tweak
- echo " [done] $(ls -lh "$sif_path" | awk '{print $5, $9}')" + echo " [done] $(du -h "$sif_path" | awk '{print $1}') ${sif_path}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@build-diann-singularity.sh` at line 96, The current echo uses ls -lh piped to awk to extract size and name which is fragile for unusual filenames; replace that pipeline by querying file metadata directly for "$sif_path" (e.g., use stat or du -h plus basename) and format the echo to include the human-readable size and the file name without invoking ls; update the line that references "$sif_path" so it calls stat/du on that variable and prints the size and basename in the same " [done] ..." message.
25-31: Unknown versions are silently built as empty Docker images — fail fast instead.If the user passes a typo like
./build-diann-singularity.sh 2.5.1, the context directory check on line 68 prints[skip]to stderr andcontinues, but the script still exits 0 and produces no artifact for that request. For interactive use that's confusing. Consider validating requested versions againstALL_VERSIONS(or tracking skipped-due-to-missing-context as an error) and exiting non-zero when nothing was built.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@build-diann-singularity.sh` around lines 25 - 31, Validate requested versions against ALL_VERSIONS right after VERSIONS is set: filter VERSIONS to only those present in ALL_VERSIONS (using the ALL_VERSIONS array) and if the filtered list is empty print an error and exit non-zero; alternatively track how many images were actually built during the loop (increment a BUILT_COUNT in the build loop that currently uses the context directory check and [skip] continue) and at the end check BUILT_COUNT==0, then print a clear error listing the invalid/missing versions and exit non-zero. Ensure you reference and update the VERSIONS variable or use BUILT_COUNT so the script fails fast when nothing is built.README.md (1)
31-45: Docs read well and match the Dockerfile changes.One small nit: the quoted error message uses ".NET Runtime", which mirrors what DIA-NN prints, but the images install the SDK because DIA-NN's probe is
dotnet --list-sdks— you already note this, just make sure readers aren't tempted to swap indotnet-runtime-8.0to save space. A one-liner like "a runtime-only install is not sufficient; the SDK is required for the--list-sdksprobe to succeed" would preempt that.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 31 - 45, Clarify that a runtime-only install is insufficient because DIA-NN's startup probe runs `dotnet --list-sdks`; update the README text around the quoted error and the sentence noting the images install `dotnet-sdk-8.0` to add a one-line caution such as "Note: a runtime-only install is not sufficient; the SDK is required for the `--list-sdks` probe to succeed, so install the dotnet SDK (not just the runtime)." Reference the quoted error text and the mention of `dotnet-sdk-8.0`/`dotnet --list-sdks` when making this edit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@diann-2.1.0/Dockerfile`:
- Around line 17-28: Update the misleading comment that currently says
"dotnet-runtime-8.0" to accurately state "dotnet-sdk-8.0" so it matches the
actual installed package in the RUN apt-get install line; specifically, change
the comment above the RUN that lists packages (which mentions
dotnet-runtime-8.0) to reference dotnet-sdk-8.0 and add a brief note that the
SDK is intentionally used because DIA-NN probes with `dotnet --list-sdks`.
---
Nitpick comments:
In `@build-diann-singularity.sh`:
- Around line 89-94: The singluarity build invocation uses the docker-daemon://
URI which requires a running Docker daemon; change the conversion to use
docker-archive:// by first exporting the image to a tar archive and then passing
that archive to SIF_BIN build (replace the "$SIF_BIN build --force \"$tmp_sif\"
\"docker-daemon://${docker_tag}\"" call). Implement creating a temporary archive
(e.g., using docker save into a temp file named from docker_tag), ensure cleanup
of that temp archive, and then call SIF_BIN with
"docker-archive://<archive_path>" while still moving tmp_sif to "$sif_path"
afterwards; reference the variables and commands tmp_sif, sif_path, docker_tag,
and SIF_BIN when making changes.
- Line 96: The current echo uses ls -lh piped to awk to extract size and name
which is fragile for unusual filenames; replace that pipeline by querying file
metadata directly for "$sif_path" (e.g., use stat or du -h plus basename) and
format the echo to include the human-readable size and the file name without
invoking ls; update the line that references "$sif_path" so it calls stat/du on
that variable and prints the size and basename in the same " [done] ..."
message.
- Around line 25-31: Validate requested versions against ALL_VERSIONS right
after VERSIONS is set: filter VERSIONS to only those present in ALL_VERSIONS
(using the ALL_VERSIONS array) and if the filtered list is empty print an error
and exit non-zero; alternatively track how many images were actually built
during the loop (increment a BUILT_COUNT in the build loop that currently uses
the context directory check and [skip] continue) and at the end check
BUILT_COUNT==0, then print a clear error listing the invalid/missing versions
and exit non-zero. Ensure you reference and update the VERSIONS variable or use
BUILT_COUNT so the script fails fast when nothing is built.
In `@README.md`:
- Around line 31-45: Clarify that a runtime-only install is insufficient because
DIA-NN's startup probe runs `dotnet --list-sdks`; update the README text around
the quoted error and the sentence noting the images install `dotnet-sdk-8.0` to
add a one-line caution such as "Note: a runtime-only install is not sufficient;
the SDK is required for the `--list-sdks` probe to succeed, so install the
dotnet SDK (not just the runtime)." Reference the quoted error text and the
mention of `dotnet-sdk-8.0`/`dotnet --list-sdks` when making this edit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 574a1257-3d83-4940-a2f9-53de7174d73e
📒 Files selected for processing (6)
README.mdbuild-diann-singularity.shdiann-2.1.0/Dockerfilediann-2.2.0/Dockerfilediann-2.3.2/Dockerfilediann-2.5.0/Dockerfile
| # Update package lists and ensure package versions are up to date, Install necessary packages. | ||
| # dotnet-runtime-8.0 is required for DIA-NN >= 2.1.0 to read Thermo .raw natively on Linux | ||
| # (DIA-NN ships Thermo DLLs targeting net8.0 and will error with | ||
| # "cannot read .raw files, please download and install .NET Runtime 8.0.14 or later" | ||
| # if the runtime is missing). | ||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| wget \ | ||
| unzip \ | ||
| libgomp1 \ | ||
| locales && \ | ||
| locales \ | ||
| ca-certificates \ | ||
| dotnet-sdk-8.0 && \ |
There was a problem hiding this comment.
Comment/package mismatch: says dotnet-runtime-8.0 but installs dotnet-sdk-8.0.
Line 18 documents dotnet-runtime-8.0 as the required package, but line 28 (and the other three Dockerfiles in this PR) install dotnet-sdk-8.0. The SDK is indeed the correct choice because DIA-NN probes with dotnet --list-sdks (which returns empty on a runtime-only install), so please update the comment to match and avoid confusing future readers/maintainers who might "right-size" this to the runtime and break the startup probe.
📝 Proposed comment fix
# Update package lists and ensure package versions are up to date, Install necessary packages.
-# dotnet-runtime-8.0 is required for DIA-NN >= 2.1.0 to read Thermo .raw natively on Linux
-# (DIA-NN ships Thermo DLLs targeting net8.0 and will error with
-# "cannot read .raw files, please download and install .NET Runtime 8.0.14 or later"
-# if the runtime is missing).
+# dotnet-sdk-8.0 is required for DIA-NN >= 2.1.0 to read Thermo .raw natively on Linux.
+# DIA-NN ships Thermo DLLs targeting net8.0 and probes the environment via
+# `dotnet --list-sdks` at startup; a runtime-only install is NOT sufficient and
+# triggers: "cannot read .raw files, please download and install .NET Runtime 8.0.14 or later".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@diann-2.1.0/Dockerfile` around lines 17 - 28, Update the misleading comment
that currently says "dotnet-runtime-8.0" to accurately state "dotnet-sdk-8.0" so
it matches the actual installed package in the RUN apt-get install line;
specifically, change the comment above the RUN that lists packages (which
mentions dotnet-runtime-8.0) to reference dotnet-sdk-8.0 and add a brief note
that the SDK is intentionally used because DIA-NN probes with `dotnet
--list-sdks`.
There was a problem hiding this comment.
Sounds like it could be a bug in Diann. I don't think it should probe sdks if it only needs the runtime. But maybe it really needs the sdk?
There was a problem hiding this comment.
@jpfeuffer — great question! It does look like a questionable design choice (potentially a bug) in DIA-NN. Here's the breakdown:
Why it smells like a bug:
The SDK is for developing .NET apps, while the runtime is sufficient to simply run them. DIA-NN only needs to execute its bundled Thermo DLLs (targeting net8.0) — it has no need to compile or build anything. So probing via dotnet --list-sdks imposes an unnecessarily strict requirement.
Why dotnet --list-sdks returns nothing with a runtime-only install:
dotnet --list-sdks lists SDKs, dotnet --list-runtimes lists runtimes, and dotnet --info shows everything. These are distinct commands, and a runtime-only installation has no SDK entries. This is confirmed by the dotnet/sdk issue #27129, where a user with only the runtime installed saw No SDKs were found from dotnet --list-sdks even though the runtime was fully functional.
The practical impact:
The SDK is heavier than the runtime as it includes more components for development. Installing the full SDK in a production Docker container is suboptimal from a size and attack-surface standpoint, but it's the only workaround until DIA-NN changes its probe to use dotnet --list-runtimes (or simply dotnet --version) instead.
Bottom line: Yes, it does appear to be a bug (or at least an over-specification) on DIA-NN's part — it should probe dotnet --list-runtimes if it only needs to run .NET code. It may be worth filing an upstream issue at vdemichev/DiaNN. In the meantime, installing dotnet-sdk-8.0 is the correct and verified workaround, and the comment in the current Dockerfile now accurately documents why.
ヽ(。_°)ノ
There was a problem hiding this comment.
Pull request overview
Updates DIA-NN container images to support native Thermo .raw reading on Linux for DIA-NN ≥ 2.1.0 by ensuring a .NET 8 SDK is present, and adds a helper script to build matching Singularity/Apptainer images for Nextflow caching.
Changes:
- Install
dotnet-sdk-8.0(andca-certificates) in DIA-NN 2.1.0/2.2.0/2.3.2/2.5.0 Docker images. - Add
build-diann-singularity.shto build all DIA-NN Docker images locally and emit Nextflow-style.imgfiles. - Update
README.mdto document new versions and the .NET SDK requirement for native Thermo.rawsupport.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
diann-2.1.0/Dockerfile |
Adds dotnet-sdk-8.0/ca-certificates for DIA-NN’s net8 Thermo reader support. |
diann-2.2.0/Dockerfile |
Adds dotnet-sdk-8.0/ca-certificates for native .raw reading. |
diann-2.3.2/Dockerfile |
Adds dotnet-sdk-8.0/ca-certificates for native .raw reading. |
diann-2.5.0/Dockerfile |
Adds dotnet-sdk-8.0/ca-certificates for native .raw reading. |
build-diann-singularity.sh |
New script to build all versions and generate Nextflow-cache-named Singularity images. |
README.md |
Documents native Thermo .raw behavior, updated version list, and SDK bundling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| wget \ | ||
| unzip \ | ||
| libgomp1 \ | ||
| locales && \ | ||
| locales \ | ||
| ca-certificates \ | ||
| dotnet-sdk-8.0 && \ |
There was a problem hiding this comment.
Now that ca-certificates is installed, the later wget --no-check-certificate ... no longer needs to bypass TLS verification. Please remove --no-check-certificate so downloads fail closed if certificate validation fails.
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| wget \ | ||
| unzip \ | ||
| libgomp1 \ | ||
| locales && \ | ||
| locales \ | ||
| ca-certificates \ | ||
| dotnet-sdk-8.0 && \ |
There was a problem hiding this comment.
Now that ca-certificates is installed, the later wget --no-check-certificate ... no longer needs to bypass TLS verification. Please remove --no-check-certificate so downloads fail closed if certificate validation fails.
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| wget \ | ||
| unzip \ | ||
| libgomp1 \ | ||
| locales && \ | ||
| locales \ | ||
| ca-certificates \ | ||
| dotnet-sdk-8.0 && \ |
There was a problem hiding this comment.
Now that ca-certificates is installed, the later wget --no-check-certificate ... no longer needs to bypass TLS verification. Please remove --no-check-certificate so downloads fail closed if certificate validation fails.
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| wget \ | ||
| unzip \ | ||
| libgomp1 \ | ||
| locales && \ | ||
| locales \ | ||
| ca-certificates \ | ||
| dotnet-sdk-8.0 && \ |
There was a problem hiding this comment.
Now that ca-certificates is installed, the later wget --no-check-certificate ... no longer needs to bypass TLS verification. Please remove --no-check-certificate so downloads fail closed if certificate validation fails.
51bc81f to
10aeb53
Compare
DIA-NN 2.1.0+ bundles Thermo DLLs targeting net8.0 and calls `dotnet --list-sdks` at startup. Without the SDK, DIA-NN aborts with "ERROR: cannot read .raw files, please download and install .NET Runtime 8.0.14 or later". Installing the Ubuntu 22.04 `dotnet-sdk-8.0` package (jammy-updates, 8.0.126) satisfies the probe and enables native .raw reading on Linux. Applied to 2.1.0, 2.2.0, 2.3.2, 2.5.0; 2.0.2 is unchanged because it does not ship the Thermo reader. Verified end-to-end: `diann --f input.raw --convert` on a real 835 MB Thermo .raw succeeds in all four Docker images and all four Singularity images, producing a 239 MB .dia. Also gitignores build-diann-singularity.sh (a local build helper used during verification) and the singularity-cache/ output directory so the repo stays clean. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
10aeb53 to
4e8d795
Compare
|
Thanks — addressed the review:
Rebased onto |
Summary
net8.0(RawWrapper.dll,ThermoFisher.CommonCore.*,libnethost.so) and probes for .NET at startup viadotnet --list-sdks. Without the SDK, DIA-NN aborts withERROR: cannot read .raw files, please download and install .NET Runtime 8.0.14 or later.dotnet-sdk-8.0(Ubuntu 22.04jammy-updates, 8.0.126) in 2.1.0 / 2.2.0 / 2.3.2 / 2.5.0 Dockerfiles. 2.0.2 is left alone — it does not ship the Thermo reader on Linux..rawon Linux (bundles .NET SDK 8)" and a call-out explains the dependency for anyone rebuilding locally.build-diann-singularity.sh: builds every DIA-NN Docker image and converts it to a Singularity SIF under the Nextflow cache naming convention (ghcr.io-bigbio-diann-<version>.img).Test plan
dotnet --list-sdksinside each returns8.0.126 [/usr/lib/dotnet/sdk].docker run ghcr.io/bigbio/diann:<v> diann --f input.raw --converton a real 835 MB Thermo.raw(RD139_Narrow_UPS1_0_1fmol_inj1.raw) — produces a 239 MB.dia, no "cannot read .raw files" error, for all four versions../build-diann-singularity.sh 2.1.0 2.2.0 2.3.2 2.5.0— four SIFs built (328–562 MB each).singularity exec <sif> diann --f input.raw --convert— succeeds for all four SIFs, same 239 MB.diaoutput.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
.rawfiles in DIA-NN 2.1.0+Documentation
.rawfile support and .NET 8 SDK requirementsChores