This repository has been archived by the owner on May 27, 2023. It is now read-only.
Alpha Pre-Release v2.0.1
Pre-release
Pre-release
In this release, I have added new support for parsing yaml file, users can have docker-compose like experience when using LPMX.
The command to use compose
is:
lpmx compose -f yaml_file
version: 1
apps:
- name: "minimap2"
image: "evolbioinfo/minimap2:v2.17"
type: "docker"
expose:
- /usr/local/bin/minimap2:minimap2
share:
- /home/vagrant/share:/share
- name: "target"
image: "jasonyangshadow/example:1"
type: "docker"
command: "minimap -V && minimap '-a /share/human.fa /share/orang.fa > /share/test.sam'"
inject:
- /home/vagrant/bin/minimap2:/usr/bin/minimap
share:
- /home/vagrant/share:/share
depends:
- minimap2
- name: "singularity container"
image: "/home/vagrant/ubuntu.sif"
type: "singularity"
command: "cat /etc/os-release && echo $hello"
envs:
- hello=1
- world=2
An explanation for the yaml template structure:
version
(required) is the yaml template version info, should be1
hereapps
(required) defines the top level apps label, just hardcoded- Followings are all container definitions
name
(required): container name, user definedimage
(required): container image name (DockerHub name or local absolute path for sif file)type
(required): should bedocker
orsingularity
command
(optional): command running inside containerinject
(optional): inject binaries from host or other container into current container (should be absolute path)share
(optional): directories shared between host and containerdepends
(optional): define the requirement of current container, name defined independs
should exist in yaml fileexpose
(optional): expose apps inside current contains to host or other containersenvs
(optional): environment variables added to containersport
(optional): mapping ports (not support now)
An example showing the usage. (The example is from https://github.com/JasonYangShadow/lpmx#quick-run)
The demo shows that we are composing two containers, one is built based on docker image named evolbioinfo/minimap2:v2.17
, another one is based on docker image named jasonyangshadow/example:1
, the definitions in the yaml file indicates that:
- for container named
minimap2
, it exposes inside minimap2 to host (version: 2.17-r941) - for container named
target
, it injects exposed minimap2 (version: 2.17-r941) into itself and thus overrides its default minimap (version: 0.2-r123), and runs minimap analysis based on the data in shared folder with host. - for container named
singularity container
, it extracts and imports layers from sif image and runs simple commands inside container
This demo shows that LPMX can inject apps in other containers into current container to dynamically override inside executables without touching the image. Fantastic, hah! isn't it?