Skip to content
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
Compare
Choose a tag to compare
@JasonYangShadow JasonYangShadow released this 30 Apr 14:10

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:

  1. version (required) is the yaml template version info, should be 1 here
  2. apps (required) defines the top level apps label, just hardcoded
  3. Followings are all container definitions
  • name (required): container name, user defined
  • image (required): container image name (DockerHub name or local absolute path for sif file)
  • type (required): should be docker or singularity
  • command (optional): command running inside container
  • inject (optional): inject binaries from host or other container into current container (should be absolute path)
  • share (optional): directories shared between host and container
  • depends (optional): define the requirement of current container, name defined in depends should exist in yaml file
  • expose (optional): expose apps inside current contains to host or other containers
  • envs (optional): environment variables added to containers
  • port (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:

  1. for container named minimap2, it exposes inside minimap2 to host (version: 2.17-r941)
  2. 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.
  3. 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?
MobaXterm_o4fyTOQmZF