Skip to content

Instantly share code, notes, and snippets.

@Arkanosis
Last active March 3, 2022 18:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Arkanosis/fbd7299ce0aa6eb594b1ce3fc6f98f28 to your computer and use it in GitHub Desktop.
Save Arkanosis/fbd7299ce0aa6eb594b1ce3fc6f98f28 to your computer and use it in GitHub Desktop.
Installing VEP on Ubuntu 18.04 LTS Bionic Beaver

Installing VEP on Ubuntu 18.04 LTS Bionic Beaver

sudo apt install unzip curl git libmodule-build-perl libdbi-perl libdbd-mysql-perl build-essential zlib1g-dev
git clone https://github.com/Ensembl/ensembl-vep.git
cd ensembl-vep
./INSTALL.pl -a a

This will only build and install the base VEP and its dependencies. See the documentation (search for --AUTO and --PLUGINS) for the flags needed for additional content.

Appendix A: installing and running Ubuntu 18.04 LTS Bionic Beaver in a LXC container

lxc-create -n vep -t download -- -d ubuntu -r bionic -a amd64
lxc-start -n vep
lxc-attach -n vep

Appendix B: installing LXC 3.0 on ArchLinux

sudo pacman -S lxc dnsmasq
sudo mkdir -p /etc/lxc
sudo sh -c 'echo "$USER:100000:65536" > /etc/subuid'
sudo sh -c 'echo "$USER:100000:65536" > /etc/subgid'
sudo sh -c 'echo "$USER veth lxcbr0 10" > /etc/lxc/lxc-usernet'
sudo sh -c 'cat > /etc/default/lxc-net <<EOF
USE_LXC_BRIDGE="true"
LXC_BRIDGE="lxcbr0"
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"
EOF'
sudo sh -c 'cat > /etc/lxc/default.conf <<EOF
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536
EOF'
sudo sh -c 'echo "kernel.unprivileged_userns_clone=1" >> /etc/sysctl.d/userns.conf'
sudo sh -c 'echo "session optional pam_cgfs.so -c freezer,memory,name=systemd,unified" >> /etc/pam.d/system-login'
sudo systemctl enable lxc-net.service
mkdir -p ~/.config/lxc
cp /etc/lxc/default.conf ~/.config/lxc
mkdir -p ~/.local/share
setfacl -m u:100000:x ~ ~/.local ~/.local/share
sudo reboot now

Appendix C: building a clean Docker image of VEP

The VEP installer unfortunately leaves a lot of garbage behind it. Fortunately, the multi-stage build feature of Docker addresses this well.

One can spawn a full Ubuntu 18.04 LTS Bionic Beaver image, with all the required dependencies, git, etc. to build VEP, then pick only the interesting bits from this image to put them into another clean image, possibly based on a leaner distro (eg. Alpine).

FROM ubuntu:18.04 as builder
WORKDIR /root/
RUN apt install unzip curl git libmodule-build-perl libdbi-perl libdbd-mysql-perl build-essential zlib1g-dev && \
    git clone https://github.com/Ensembl/ensembl-vep.git && \
    cd ensembl-vep && \
    ./INSTALL.pl -a a

FROM alpine:latest
MAINTAINER dev@regovar.org
WORKDIR /root/
RUN apk --no-cache add ca-certificates
COPY --from=builder /root/ensembl-vep/vep .
CMD ["./vep"] 

Note: there's much more than just vep to copy to the lean image there. But you get the idea.

@Oodnadatta
Copy link

Oodnadatta commented Jul 15, 2018

More than /ensembl-vep/vep, are needed:

  • /ensembl-vep/Bio
  • /ensembl-vep/Faidx.so
  • /ensembl-vep/modules
  • /ensembl-vep/variant_recoder
  • /ensembl-vep/HTS.so
  • /ensembl-vep/

To test:

  • /ensembl-vep/convert_cache.pl
  • /ensembl-vep/htslib
  • /ensembl-vep/cpanfile
  • /ensembl-vep/filter_vep
  • /ensembl-vep/biodbhts
  • /ensembl-vep/haplo

Not needed:

  • /ensembl-vep/INSTALL.pl
  • /ensembl-vep/examples
  • /ensembl-vep/travisci
  • /ensembl-vep/README.md
  • /ensembl-vep/docker
  • /ensembl-vep/t

@Arkanosis
Copy link
Author

Note: LXC 3.0.2 is broken. If you get these errors:

lxc-start: vep: cgroups/cgfsng.c: all_controllers_found: 701 No freezer controller mountpoint found
lxc-start: vep: cgroups/cgroup.c: cgroup_init: 44 Failed to initialize cgroup driver                                                                          
lxc-start: vep: start.c: lxc_init: 861 Failed to initialize cgroup driver
lxc-start: vep: start.c: __lxc_start: 1876 Failed to initialize container "vep"
lxc-start: vep: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: vep: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

… it is because of lxc/lxc#2556 , which has been fixed already, but not backported to ArchLinux.

Downgrading to LXC 3.0.1 may solve the problem until the fix is packaged:

sudo pacman -U /var/cache/pacman/pkg/lxc-1:3.0.1-1-x86_64.pkg.tar.xz

@Arkanosis
Copy link
Author

Note: LXC 3.0.2 is broken.

LXC 3.1.0 is not broken anymore. One can disregard the tip above about downgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment