ctshed

A Docker based CLI Tools manager.


Keywords
cli, containers, docker
License
MIT
Install
pip install ctshed==0.1.1

Documentation

Ctshed - Container Toolshed

Travis (.org) Coveralls github PyPI - Python Version PyPI GitHub Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.

Container Toolshed. A CLI tool manager for creating container centric namespaces with specific tools installed. This could possibly help to easier manage cli tools for users (multiple tool versions, no screw-up with os level package executables)

Example

# a single tool executable, debian:stable implicit source
ctshed install --packages=curl --cmd=curl mycurl
# downloads the P04156.fasta file and saves it in the current directory
ctshed-mycurl -LO https://www.uniprot.org/uniprot/P04156.fasta

# a tool namespace 
ctshed install --source=biocontainers/blast:2.2.31 myblast
ctshed-myblast curl -LO https://www.uniprot.org/uniprot/P04156.fasta
ctshed-myblast curl -LO ftp://ftp.ncbi.nih.gov/refseq/D_rerio/mRNA_Prot/zebrafish.1.protein.faa.gz
ctshed-myblast gunzip zebrafish.1.protein.faa.gz
ctshed-myblast makeblastdb -in zebrafish.1.protein.faa -dbtype prot
ctshed-myblast blastp -query P04156.fasta -db zebrafish.1.protein.faa -out results.txt

Installation

pip install ctshed

The tool places binaries to ~/bin directory blindly without checking if it exists or if theres a nameclash. Make sure ~/bin exists in your path. E.g. place something like this in ~/.bash_rc:

#~/.bash_rc file
export PATH="$HOME/bin:$PATH"

The tool depends on docker binary existing on the host system. You have to install it if you don't have it. Installation of docker on ubuntu systems is described docker-ce/ubuntu

Features

  • Create a docker based tool namespace
  • Create an executable with specific tool installation

Principles of working

  1. An image is created during the install step and some name is automatically given to it.
  2. An executable is created in executable directory of the users workspace.
  3. Executable contains a container run command with stdin/stdout/stderr attached and /home directory mounted.

Testing

python -m unittest discover tests

Limitations

There are limitations with using container as a wrapper for command line.

  • Configuration might not be picked up by the tool.
  • Input/Output works correctly only under /home directory
  • Security, because /home is mounted
  • More will come.