diff --git a/src/vagrant/obis/README.md b/src/vagrant/obis/README.md index a51ee548624015ae2dd1a1e5847ac4eec7facff1..2110e71c42b6130d5c4c9d94cc6e9234053ed4ba 100644 --- a/src/vagrant/obis/README.md +++ b/src/vagrant/obis/README.md @@ -6,19 +6,33 @@ To help users interested in trying out _obis_, we provide a vagrant setup that c 0. Download openbis from the https://wiki-bsse.ethz.ch/display/bis/Production+Releases 1. Put the extract the openbis installer to the src/vagrant/initialize folder -2. cd to `src/vagrant` -3. `vagrant up` -- initialize the virtual machine -4. `vagrant ssh` -- log into the virtual machine -6. install openBIS (inside the vagrant machine) +2. cd to `src/vagrant/obis_with_openbis` +3. `vagrant up --provision --provider virtualbox` -- initialize the virtual machine +4. `vagrant ssh obisserver` -- log into the virtual machine +5. install openBIS (inside the vagrant machine) - `/vagrant_initialize/install_openbis.sh` - wait until `/home/openbis/bin/post-install/0-create-initial-users.sh` appears. This script does not automatically run for some reason. Terminate it by pressing CTRL-C - run `sudo -u openbis /home/openbis/bin/post-install/0-create-initial-users.sh` manually - enter a password for the **admin** and the **etlserver** user when asked +6. For unknown reasons is seems to be necessary to set the etlserver password like this (otherwise AS and DSS will not be connected): `/home/openbis/servers/openBIS-server/jetty/bin/passwd.sh -P change etlserver` 7. Edit the file `/home/openbis/servers/datastore_server/etc/service.properties` - look for the `etlserver` user and enter its password - set the hostname to localhost -8. `exit` -- log off the virtual machine +8. To use obis, switch to the obis user with `sudo su obis` and `cd ~obis` +9. `exit` -- log off the virtual machine +When openBIS is running it can be accessed on the host machine from `https://localhost:8443/openbis`. + +obis can be used as the user `obis`. + +There is a second VM in case a second obis client is needed: + +1. `vagrant ssh obisclient` +2. `sudo su obis` +3. `cd ~obis` +4. Configure the openbis_url: `obis config -g openbis_url https://obisserver:8443` +5. Use obis. +6. `exit` -- log off the virtual machine ## obis/EasyBD Demo @@ -127,14 +141,15 @@ When setting up a machine the first time, Vagrant reads a file called «Vagrantf ## start openBIS 1. `vagrant ssh` -- to log into the virtual machine -1. `/vagrant_initialize/start_services.sh` -- start openBIS and any other services -1. point your browser to `https://localhost:8443/openbis/` and check whether your server is up and running. Try logging in as an admin user, for example. -1. check the AS and DSS logs if you encounter any problems +2. `/vagrant_initialize/start_services.sh` -- start openBIS and any other services +3. point your browser to `https://localhost:8443/openbis/` and check whether your server is up and running. Try logging in as an admin user, for example. +4. check the AS and DSS logs if you encounter any problems * `/home/openbis/bin/bislog.sh` -- openbis AS logfile * `/home/openbis/bin/dsslog.sh` -- datastore server DSS logfile +5. You can access the openBIS instance at https://localhost:8443/openbis/. ## create a new user in openBIS 1. point your browser to the ELN-LIMS Lab notebook running at `https://localhost:8443/openbis/webapp/eln-lims/` and log in as admin -1. go to Utilities -> User Manager, click on the Operations dropdown and choose "ceate User" -1. enter a username (User ID) and a password to create a new user in openBIS (this may a while) +2. go to Utilities -> User Manager, click on the Operations dropdown and choose "ceate User" +3. enter a username (User ID) and a password to create a new user in openBIS (this may a while) diff --git a/src/vagrant/obis/Vagrantfile b/src/vagrant/obis/Vagrantfile index ad0ddc3c979ac742f66f0d346a64f9f340701fbc..7a06582f2eb0d431ff0dfbd904832d243651fd71 100644 --- a/src/vagrant/obis/Vagrantfile +++ b/src/vagrant/obis/Vagrantfile @@ -15,21 +15,6 @@ Vagrant.configure(2) do |config| #config.vm.box = "centos7-vbox" config.vm.box = "centos/7" - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - config.vm.network "forwarded_port", guest: 8443, host: 8443 - config.vm.network "forwarded_port", guest: 8444, host: 8444 - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network "private_network", ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network "public_network" - # Share an additional folder to the guest VM. The first argument is # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third @@ -39,31 +24,75 @@ Vagrant.configure(2) do |config| config.vm.synced_folder "../../../", "/vagrant_repo", type: "virtualbox" config.vm.synced_folder "initialize", "/vagrant_initialize", type: "virtualbox" config.vm.synced_folder "./", "/vagrant", type: "virtualbox" - config.vm.synced_folder "../../core-plugins", "/vagrant_core-plugins", type: "virtualbox" + #config.vm.synced_folder "../../core-plugins", "/vagrant_core-plugins", type: "virtualbox" + + config.vm.define "obisserver" do |obisserver| + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + obisserver.vm.network "forwarded_port", guest: 8443, host: 8443 + obisserver.vm.network "forwarded_port", guest: 8444, host: 8444 + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + obisserver.vm.provider "virtualbox" do |vb| + # Customize the amount of memory on the VM: + vb.memory = "2048" + end + + # Install necessary packages and tools (yum commands + install conda) + obisserver.vm.provision :shell, inline: "/vagrant/initialize/setup_general.sh || true" + + # Install openBIS + obisserver.vm.provision :shell, inline: "/vagrant/initialize/setup_openbis.sh || true" + + # Install obis (including prereqs: python3, git, git-annex) + obisserver.vm.provision :shell, inline: "/vagrant/initialize/setup_obis.sh || true" + obisserver.vm.provision :shell, inline: "/vagrant/initialize/install_obis.sh || true" + + # update /etc/hostname + obisserver.vm.network "private_network", ip: "172.28.128.3" + + obisserver.vm.provision :shell do |sh| + sh.inline = "echo '127.0.0.1 obisserver' >> /etc/hosts + echo '172.28.128.3 obisclient' >> /etc/hosts + echo 'obisserver' > /etc/hostname + hostname `cat /etc/hostname`" + end + + end + + + config.vm.define "obisclient" do |obisclient| + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + obisclient.vm.provider "virtualbox" do |vb| + # Customize the amount of memory on the VM: + vb.memory = "1024" + end - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - config.vm.provider "virtualbox" do |vb| - # Customize the amount of memory on the VM: - vb.memory = "2048" - end + # Install necessary packages and tools (yum commands + install conda) + obisclient.vm.provision :shell, inline: "/vagrant/initialize/setup_general.sh || true" - # Install necessary packages and tools (yum commands + install conda) - config.vm.provision :shell, inline: "/vagrant/initialize/setup_general.sh || true" + # Install obis (including prereqs: python3, git, git-annex) + obisclient.vm.provision :shell, inline: "/vagrant/initialize/setup_obis.sh || true" + obisclient.vm.provision :shell, inline: "/vagrant/initialize/install_obis.sh || true" - # Install openBIS - config.vm.provision :shell, inline: "/vagrant/initialize/setup_openbis.sh || true" + obisclient.vm.network "private_network", ip: "172.28.128.4" - # Install obis (including prereqs: python3, git, git-annex) - config.vm.provision :shell, inline: "/vagrant/initialize/install_obis.sh || true" + obisclient.vm.provision :shell do |sh| + sh.inline = "echo '127.0.0.1 obisclient' >> /etc/hosts + echo '172.28.128.3 obisserver' >> /etc/hosts + echo 'obisclient' > /etc/hostname + hostname `cat /etc/hostname`" + end + end - # update /etc/hostname - #vm.provision :shell do |sh| - # sh.inline = "echo '127.0.0.1 appserver' >> /etc/hosts - # echo 'appserver' > /etc/hostname - # hostname `cat /etc/hostname`" - #end end diff --git a/src/vagrant/obis/initialize/install_obis.sh b/src/vagrant/obis/initialize/install_obis.sh index c0cc3c7cb8b1c856c2a852b7c100ad1c501cf5d7..de6509cc1d63838802d499d2b97c960d0bd94603 100755 --- a/src/vagrant/obis/initialize/install_obis.sh +++ b/src/vagrant/obis/initialize/install_obis.sh @@ -1,16 +1,20 @@ #!/bin/env bash -# Install prerequisites from obis.tar.xz (not from the yum repo) +sudo pip3 install -e /vagrant_python/PyBis/ +sudo pip3 install -e /vagrant_python/OBis/ -pushd . $@ > /dev/null -cd ~ -tar -xf /vagrant/initialize/obis_tools.tar.xz -C ./ -echo export PATH=\"/home/vagrant/obis_tools/bin:/home/vagrant/obis_tools/bin\$PATH\" >> .bashrc -export PATH=/home/vagrant/obis_tools/bin:$PATH -pip install -e /vagrant_python/PyBis/ -pip install -e /vagrant_python/OBis/ +sudo pip3 install pyOpenSSL -cd obis_tools/bin -ln -s ../Python-3.6/bin/obis ./ +if [ ! -L /usr/bin/git ]; then -popd $@ > /dev/null + pushd ~obis $@ > /dev/null + + wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz + tar -xvvf git-annex-standalone-amd64.tar.gz + + sudo ln -s /home/obis/git-annex.linux/git /usr/bin/git + sudo ln -s /home/obis/git-annex.linux/git-annex /usr/bin/git-annex + + popd $@ > /dev/null + +fi diff --git a/src/vagrant/obis/initialize/setup_general.sh b/src/vagrant/obis/initialize/setup_general.sh index 16c0a627e56da01e83a57bcb2a3569e5fd50fa5f..cf0f8e8a1a6fb75ca9745fd3eaa7d0d5b47abd54 100755 --- a/src/vagrant/obis/initialize/setup_general.sh +++ b/src/vagrant/obis/initialize/setup_general.sh @@ -9,3 +9,6 @@ sudo yum -y install wget sudo yum -y install epel-release sudo yum -y install unzip sudo yum -y install vim +sudo yum -y install nano +sudo yum -y install nmap +sudo yum -y install net-tools diff --git a/src/vagrant/obis/initialize/setup_obis.sh b/src/vagrant/obis/initialize/setup_obis.sh new file mode 100755 index 0000000000000000000000000000000000000000..2b31619097337962ca4a5bae1f100bc653985af4 --- /dev/null +++ b/src/vagrant/obis/initialize/setup_obis.sh @@ -0,0 +1,11 @@ +# Create the obis user +sudo useradd obis + +# obis dependencies +sudo yum -y install gcc-c++.x86_64 + +sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm +sudo yum -y install python36u.x86_64 +sudo yum -y install python36u-devel.x86_64 +sudo yum -y install python36u-setuptools.noarch +sudo easy_install-3.6 pip diff --git a/src/vagrant/obis/initialize/setup_openbis.sh b/src/vagrant/obis/initialize/setup_openbis.sh index 6021718d681c0c7115126e9e13f95407f836a065..7301f4c7f022ef72427f95249d250bcb93ae2a02 100755 --- a/src/vagrant/obis/initialize/setup_openbis.sh +++ b/src/vagrant/obis/initialize/setup_openbis.sh @@ -4,8 +4,7 @@ # NB openbis must be downloaded an installed separately because it is not available anonymously # Install Java -wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm" -sudo rpm -ivh jdk-8u92-linux-x64.rpm +sudo yum -y install java-1.8.0-openjdk.x86_64 # Install postgresql sudo yum -y install postgresql-server postgresql-contrib