How proteinverse/slivka-bio-installer works
Project Type and Purpose
• This is an open-source, CLI-based installer for bioinformatics “services” (tools).
• It automates creating Conda environments or Docker images, then generates Slivka service definitions and optionally publishes them.
File Structure Analysis
– install.py: the Python-Click entry point (CLI).
– services/: each subfolder is a “plugin” containing:
• Conda YAML (environment spec)
• Dockerfile or Docker YAML (container spec)
• Slivka service YAML (service metadata)
• Optional scripts (build wrappers) and testdata.
– shared/: reusable scripts & common Slivka profiles.
– test/: unit tests and sample resource files (validates install.py logic and parsing).
README Insights
– Dependencies: Python, click (CLI), ruamel.yaml (YAML parser), slivka (service API), plus Conda & Docker CLIs.
– Workflow: clone with submodules → run python install.py <target> → interactive prompts for each service → execute Conda or Docker builds → generate or push Slivka service YAMLs.
a. Main Components
• CLI Interface (install.py + click)
• Core Installer Engine
– Service Discovery Module (scans services/ directory)
– Config Parser Module (loads .conda.yaml, .docker.yaml, .service.yaml using ruamel.yaml)
– Execution Engine (invokes Conda CLI or Docker CLI; optionally runs custom build scripts)
– Service Generator (emits final Slivka YAML definitions, uses shared/_profiles.yaml)
• Shared Scripts Library (shared/scripts/run_with_docker.sh, shared/services/_profiles.yaml)
• Service Definitions (YAML files under services/)
• External Dependencies
– Conda CLI
– Docker CLI
– Slivka Server or Registry (for publishing services)
• Test Suite (pytest harness under test/)
b. Relationships & Data Flow
1. User invokes CLI →
2. CLI calls Core Installer Engine →
3. Discovery Module enumerates every services/<tool-version> folder →
4. Config Parser loads each tool’s Conda/Docker/Service YAML →
5. Execution Engine chooses method (Conda vs. Docker), calls External CLI, optionally runs plugin scripts →
6. Service Generator writes Slivka service YAML to target directory or pushes to Slivka Server →
7. Test Suite can invoke the CLI in dry-run or real mode, validate generated configs.
c. Architectural Patterns & Principles
– Plugin Architecture: each service is a self-contained plugin folder that “plugs in” automatically.
– Separation of Concerns:
• Discovery vs. Parsing vs. Execution vs. Generation.
• Shared logic abstracted into shared/
– Config-Driven Design: YAML files drive both build configuration and service metadata.
d. Key Technologies & Frameworks
– Python 3.10, click (CLI), ruamel.yaml (YAML)
– Conda package manager
– Docker Engine
– Slivka (bio-service API & registry)
– PyTest (unit tests)