Skip to main content

Unified container management for Apptainer and Docker

Project description

SciTeX Container

SciTeX

Unified container management for Apptainer and Docker

PyPI version Documentation CI License: AGPL-3.0

Full Documentation · pip install scitex-container


Problem

Research computing environments depend on containers (Apptainer/Singularity for High-Performance Computing (HPC), Docker for cloud services), yet managing them involves disparate tools, manual version tracking, and no simple way to verify reproducibility. Switching between container runtimes, managing sandbox development, and keeping host-side dependencies aligned with container expectations are recurring pain points.

Solution

scitex-container provides a single Python package with four interfaces — Python API, Command-Line Interface (CLI), Model Context Protocol (MCP) server, and Skills — to manage Apptainer and Docker containers uniformly. It handles building, versioning, sandboxing, host-package verification, and environment snapshots for reproducibility, all through one consistent interface.

Installation

Requires Python >= 3.10.

pip install scitex-container

With MCP server support (for AI agent integration):

pip install scitex-container[mcp]

Full installation:

pip install scitex-container[all]

Quick Start

# Unified status dashboard
scitex-container status

# Build Apptainer SIF from definition file
scitex-container build --def-name scitex-final

# Version management
scitex-container list
scitex-container switch 2.19.5
scitex-container rollback

# Show all commands
scitex-container --help-recursive

Four Interfaces

Python API
import scitex_container

# Apptainer container management
scitex_container.apptainer.build(def_name="scitex-final", sandbox=True)
scitex_container.apptainer.list_versions(containers_dir="/opt/containers")
scitex_container.apptainer.switch_version("2.19.5", containers_dir="/opt/containers")
scitex_container.apptainer.rollback(containers_dir="/opt/containers")

# Host package management
scitex_container.host.check_packages()

# Docker operations
scitex_container.docker.rebuild(env="prod")
scitex_container.docker.restart(env="prod")

# Environment reproducibility snapshot
snapshot = scitex_container.env_snapshot()
Verification API
from pathlib import Path
import scitex_container

# Verify container integrity
result = scitex_container.apptainer.verify(sif_path="/opt/containers/scitex-final.sif")
# Returns: {sif, def_origin, pip_lock, dpkg_lock, overall}

# Command builder for scitex-cloud terminal integration
args = scitex_container.apptainer.build_exec_args(
    container_path="/opt/containers/scitex-final.sif",
    username="user01",
    host_user_dir=Path("/data/users/user01"),
    host_project_dir=Path("/data/projects/proj01"),
    project_slug="proj01",
    texlive_prefix="/usr",
)
CLI Commands
scitex-container status                 # Unified dashboard
scitex-container build scitex-final     # Build SIF
scitex-container list                   # List versions
scitex-container switch 2.19.5         # Switch version
scitex-container rollback              # Revert to previous
scitex-container verify                # Verify SIF integrity
scitex-container env-snapshot          # Reproducibility snapshot
Sandbox Operations
scitex-container sandbox create --sif scitex-final.sif
scitex-container sandbox maintain --sandbox scitex-sandbox/
Host Package Management
scitex-container host install          # Install TeX Live + ImageMagick
scitex-container host check            # Verify host packages
scitex-container host mounts           # Show configured bind mounts
Docker Operations
scitex-container docker rebuild        # Rebuild Compose services
scitex-container docker restart        # Restart services
MCP Server

scitex-container exposes an MCP server so AI agents (Claude, etc.) can manage containers autonomously.

# Start MCP server
scitex-container-mcp

# Diagnostics and tool listing
scitex-container mcp doctor
scitex-container mcp list-tools -vv
Tool Description
status Unified container/host status dashboard
build Build SIF from definition file
list List available container versions
switch Switch active container version
rollback Roll back to previous version
sandbox_create Create writable sandbox from SIF
docker_rebuild Rebuild Docker Compose services
host_install Install host-side packages
env_snapshot Capture reproducibility snapshot
verify Verify SIF integrity against lock files
Skills — for AI Agent Discovery

Skills provide workflow-oriented guides that AI agents query to discover capabilities and usage patterns.

scitex-container skills list              # List available skill pages
scitex-container skills get SKILL         # Show main skill page
scitex-dev skills export --package scitex-container  # Export to Claude Code
Skill Content
quick-start Install and first-use examples
python-api Full Python API with signatures
cli-reference CLI commands reference
mcp-tools MCP tools for AI agents
environment Environment variables

Part of SciTeX

scitex-container is part of SciTeX. When used inside the orchestrator package scitex, container operations integrate with the broader ecosystem — for example, scitex-clew can consume environment snapshots produced by scitex-container to track reproducibility provenance across experiments.

import scitex_container

# Capture snapshot for Clew integration
snapshot = scitex_container.env_snapshot()
# snapshot includes: container version, SIF hash, lock files, host packages

The SciTeX ecosystem follows the Four Freedoms for researchers, inspired by the Free Software Definition:

  • Freedom 0 — Run your research without restriction
  • Freedom 1 — Study and adapt the tools you depend on
  • Freedom 2 — Share your work and its infrastructure with colleagues
  • Freedom 3 — Improve the tools and share improvements with the community

AGPL-3.0 — because research infrastructure deserves the same freedoms as the software it runs on.

SciTeX

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_container-0.1.8.tar.gz (535.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_container-0.1.8-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

Details for the file scitex_container-0.1.8.tar.gz.

File metadata

  • Download URL: scitex_container-0.1.8.tar.gz
  • Upload date:
  • Size: 535.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scitex_container-0.1.8.tar.gz
Algorithm Hash digest
SHA256 869e8f3122931e58dca5ad2df0d3c8c3a9a11d9581ecd7546c70899410ca21cd
MD5 e6c74613e619d70d91da34312f64ff49
BLAKE2b-256 97b2795fef92da22e4f77d07eeb45592b934c4281524b5bb9ed9823aeb35e1c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_container-0.1.8.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-container

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_container-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for scitex_container-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ad4b5fb8c7f8a139dc37fcffff731df31d2c0dc6e3e4eb7f7bc1f6217fa63966
MD5 d3421da1313cc84f7e8b515de0c56c34
BLAKE2b-256 a51b183ebe20e32d7b6b247ca70e7d9aed0306911085a77c04280e3d16a7c16c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_container-0.1.8-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-container

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page