Interactive simulations

Table of Contents

Test environment

Get a local compute node.

srun -n1 --partition=broadwl --pty bash
cd /project2/mstephens/aksarkar/projects/singlecell-modes/browser/
source activate scmodes

(Re)start the browser

pkill -u aksarkar bokeh
bokeh serve capture gof markers --address $(hostname -i) --allow-websocket-origin=$(hostname -i):5006 &

Production environment

rsync the code and data to the server.

rsync -au /project2/mstephens/aksarkar/projects/singlecell-modes/browser/ shiny:scmodes/

Start a remote session on shiny.stephenslab.uchicago.edu.

ssh shiny

Add the Debian Stretch box using the full URL.

vagrant box add --provider=virtualbox "https://app.vagrantup.com/debian/boxes/stretch64"

Initialize the VM.

Vagrant.configure(2) do |config|
  config.vm.box = "debian/stretch64"
  config.vm.network "forwarded_port", guest: 5006, host: 5009
  config.vm.provider "virtualbox" do |vb|
    vb.name = "singlecell-modes"
    vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
  end
  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    apt-get install git
    # https://github.com/chef/bento/issues/661#issuecomment-248136601
    DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
  SHELL
end

# -*- mode: ruby -*-
cd ~/scmodes
vagrant up --provision

(Re)start the VM.

cd ~/scmodes
vagrant halt
vagrant up --no-provision

ssh into the VM.

vagrant global-status
vagrant ssh 4233c3c

The data are available on the VM under /vagrant. Fake the location of the database as it appears on the test server (*.midway2.rcc.uchicago.edu).

sudo mkdir -p /project2/mstephens/aksarkar/projects/singlecell-modes/
sudo ln -s /vagrant /project2/mstephens/aksarkar/projects/singlecell-modes/browser

Install miniconda3 as user vagrant.

wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b
echo "export PATH=$PATH:$HOME/miniconda3/bin" >>$HOME/.bashrc
. $HOME/.bashrc

Initialize a new environment.

conda update -yn base conda
conda create -yqn scmodes numpy scipy pandas bokeh=1.2.0=py37_0

Start the QTL browser. The code/data are available under /vagrant inside the VM.

cd /vagrant
source activate scmodes
nohup bokeh serve capture gof markers --port 5006 --allow-websocket-origin=shiny.stephenslab.uchicago.edu --prefix=scmodes &

Docker

Specify the Dockerfile.

FROM continuumio/miniconda3
RUN conda init bash
RUN conda create -yqn scmodes numpy scipy pandas bokeh=1.2.0=py37_0
WORKDIR /project2/mstephens/aksarkar/projects/singlecell-modes/browser/
COPY browser.db .
COPY capture capture
COPY gof gof
COPY markers markers
EXPOSE 5006
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "scmodes", "bokeh", "serve", "capture", "gof", "markers", "--port=5006", "--allow-websocket-origin=shiny.stephenslab.uchicago.edu", "--prefix=/scmodes"]

Build the Docker container.

sudo docker build ~/scmodes -t scmodes

Start the Docker container.

sudo docker run --name scmodes -d -p 5009:5006 --rm scmodes

Author: Abhishek Sarkar

Created: 2021-05-20 Thu 16:51

Validate