Skip to content

Add container introspection via --from option#24

Merged
cokelaer merged 2 commits intomainfrom
copilot/add-container-introspection
Mar 5, 2026
Merged

Add container introspection via --from option#24
cokelaer merged 2 commits intomainfrom
copilot/add-container-introspection

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

versionix had no way to retrieve tool versions from inside a container image. This adds a --from option enabling introspection of Singularity/Apptainer and Docker containers.

versionix sequana_coverage --from sequana_0.18.img
versionix fastqc --from myimage.sif
versionix fastqc --from myrepo/myimage:latest

Core logic (parser.py)

  • _get_container_runner(container): detects container type by extension (.img/.sif) or file existence → apptainer exec/singularity exec; falls back to docker run --rm for image names. Uses shlex.quote() to safely interpolate paths into shell commands.
  • get_version(container=None): when container is provided, builds the runner and skips the local shutil.which check (the tool lives inside the container, not on the host).
  • Versionix and search_registered() both accept container_runner=None and prepend it to all version-probe commands.

CLI (scripts.py)

  • Adds --from option (mapped to from_container to avoid Python keyword collision), forwarded to get_version().
Original prompt

This section details on the original issue you should resolve

<issue_title>could have introspection of container</issue_title>
<issue_description>versionix sequana_coverage --from sequana_0.18.img</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: cokelaer <778821+cokelaer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add introspection feature for container Add container introspection via --from option Mar 5, 2026
@cokelaer cokelaer marked this pull request as ready for review March 5, 2026 22:40
@cokelaer cokelaer merged commit 07c847b into main Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

could have introspection of container

2 participants