Project

General

Profile

Hacking prerequisites » History » Revision 68

Revision 67 (Tom Clegg, 04/07/2020 08:52 PM) → Revision 68/77 (Ward Vandewege, 04/13/2020 11:20 PM)

{{>toc}} 

 h1. Hacking prerequisites 

 The Arvados test suite can run in a Docker container, a VM, or your workstation -- provided a few prerequisites are satisfied. 

 h2. Host options 

 h3. Starting on your workstation 

 If your workstation is a debian stretch system -- and you don't mind installing a bunch of packages on your workstation, some of them without apt -- the easiest way to get running is to run tests on bare metal. Skip to "Dependencies". 

 Other linux distributions should work too with some modifications, but it's probably easier to use a VM. 

 h3. Starting on a VM 

 Another option is to create a virtual machine using something like Xen or VirtualBox, and run debian stretch on it. The instructions below assume you have just a few basic requirements: 
 * SSH server 
 * sudo (@apt-get install sudo@) 
 * A user account with sudo privileges 

 h3. Starting in a docker container 

 _[[Arvbox]] provides a preinstalled Docker-based dev environment.    The following instructions are for creating a dev environment inside Docker from scratch._ 

 This can get you started quickly, but (unlike the above options) you'll need to remember to use something like @docker commit@ to save your state before shutting down your container. 

 See http://docker.io for more about installing docker. On debian it looks something like this. 

 <pre> 
 sudo apt-get install docker-ce 
 sudo adduser $USER docker 
 # {log out & log back in} 
 groups 
 # {should include "docker"} 
 </pre> 

 Start up a new container with debian 9 (stretch), make a new user and log in as that user: 

 <pre> 
 docker run -it --privileged debian:9 bash 
 apt-get update 
 apt-get -y install sudo 
 adduser me 
 adduser me sudo 
 sudo -u me -i 
 </pre> 

 The &quot;--privileged&quot; is required in order for /dev/fuse to be accessible (without it, no tests that require FUSE will work). 

 

 h2. Install dev environment 

 Run the following commands as root. 

 Note that the last command here ("arvados-server install -type test") installs additional debian packages to your system, along with additional software in /var/lib/arvados/ (such as suitable versions of Ruby and Go) that do not interfere with system packages. It also creates a postgresql database user named "arvados" with an insecure password. Don't expose this postgresql server to the internet or to untrusted users! 

 <pre> 
 apt-get install --no-install-recommends build-essential ca-certificates git golang libpam0g-dev 
 cd 
 git clone https://git.arvados.org/arvados.git 
 cd arvados 
 go mod download 
 cd cmd/arvados-server 
 go install 
 ~/go/bin/arvados-server install -type test 
 </pre> 

 

 h2. Start Postgres 

 _If you're running in a docker container_ you'll need to start Postgres manually: 

 <pre> 
 sudo /etc/init.d/postgresql start 
 </pre> 

 (If you're on a regular workstation/server/VM, startup scripts have already taken care of that for you.) 

 h2. Setup groups 

 Make sure the fuse and docker groups exist (create them if necessary) and that the user who will run the tests is a member of them. 

 h2. Run tests 

 <pre> 
 time ~/arvados/build/run-tests.sh WORKSPACE=~/arvados 
 </pre> 

 During development, you'll probably want something more like this. It reuses the given temp directory, which avoids a lot of repetitive downloading of dependencies, and allows you to save time with @--skip-install@ or @--only-install sdk/ruby@ and so on. 

 <pre> 
 mkdir -p ~/.cache/arvados-build 
 time ~/arvados/build/run-tests.sh WORKSPACE=~/arvados --temp ~/.cache/arvados-build 
 </pre>