Labkey Virtual Machine

Resources

Labkey virtual machine setup (merlin, onko-nix)

Documents related to virtual machine setup.

Notes on disk management. Growing file system works by creating new partition. Watchout - the last command is called xfs_growfs.

Notes on installation on virtual machine.

Docker

Setup of docker for labkey on git0.

Post-install tasks (handled by image/compose.yaml):

  • link files: Files are linked to /data/labkey/files on docker, separate from home or similar directories
  • line externalModules (links from /home/labkey/externalModules on host or override in bin/env.sh, compose.yaml)
  • update R packages (moved to image)
    docker exec -it config_labkey-web_1 bash
    #system install should be taken care of by Dockerfile
    #sudo apt-get update
    #sudo apt-get install libcurl4-openssl-dev libxml2-dev libssl-dev libfontconfig1-dev  libharfbuzz-dev libfribidi-dev libtiff5-dev git
    /usr/local/tomcat>R
    >install.packages('devtools')
    >install.packages('ggtools2')
    
    

Update scripts running on labkey PC

  1. Install websocket on labkey docker, not required, analysisModule uses java WebSockets directly:

          docker exec -it config_labkey-web_1 bash
    /usr/local/tomcat>cd
    /home/labkey>mkdir -p software/src
    /home/labkey>cd software/src
    /home/labkey/software/src>git clone https://git0.fmf.uni-lj.si/studen/websocket
    /home/labkey/software/src>sed 's/origin=\".*\"/origin="labkey-vm"/' send.py
    #update origin to labkey-vm
    /home/labkey/software/src>cd
    /home/labkey>mkdir venv
    /home/labkey>sudo apt-get install virtualenv
    /home/labkey>virtualenv venv/socket -p python3
    /home/labkey>. venv/socket/bin/activate
    /home/labkey socket >pip install websockets
    /home/labkey socket >deactivate
    #test
    /home/labkey>~/venv/socket/bin/python ~/software/src/websocket/send.py onko-nix.onko-i.si:TEST:1
    #this probably fails, see steps below
    #copy scripts/runPythonLog.sh or use python directly in analysisModule (TODO!)
    
    
  2. Run server on host, ie. labkey-public or onko-nix or whatever:

    • Set IPSERVER to external eth0 or like address.
    • Set IPCLIENT to internal docker network address.
    • Run open_port.sh. If needed, delete obsolete 8765 directives with iptables -D instead of iptables -A or iptables -D. Since labkey_network is set to use range, it is enough to use masks, 172.16.1.0/24, say.
    • Edit websocketServer.py and add labkey-vm to origin (this is why previous test failed)
    • Start, websocket/serviceScripts/start.sh
    • Do the suggested monitoring, websocket, also previous point
  3. Update server on work pc, rubens, vangogh, etc.:

    • Stop server, websocket/serviceScripts/stop.sh
    • No changes to iptables are needed, since IP address will be the same as for docker host
    • Edit websocketServer.py and add labkey-vm to origin (this is why previous test failed)
    • Start server, websocket/serviceScripts/start.sh
    • Do the suggested monitoring, websocket, including labkey-public to vangogh and docker to vangogh,
    /home/labkey>~/venv/socket/bin/python ~/software/src/websocket/send.py vangogh.fmf.uni-lj.si:TEST:1
    
    

Discussion