Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

update to Ubuntu 18.04 #104

Merged
merged 61 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9f37663
additional packages for ubuntu18.04
paskino Oct 9, 2018
359901e
add path to local user binary directory
paskino Oct 23, 2018
ee76d45
Added vagrantfile for 18.04
paskino Oct 23, 2018
4c77ab9
use ubuntu18.04 branch of SIRF-SuperBuild
paskino Oct 24, 2018
981c2b5
remove install of gcc 6
paskino Oct 24, 2018
e4f971c
updates
paskino Nov 5, 2018
2466063
Merge branch 'master' into ubuntu18.04
KrisThielemans Dec 8, 2018
4896b68
remove checkout of ubuntu18.04 SIF-SuperBuild tag
KrisThielemans Dec 8, 2018
683df4f
Merge branch 'ubuntu18.04' of https://github.com/CCPPETMR/CCPPETMR_VM…
paskino Dec 12, 2018
b5bcd93
Merge branch 'master' into ubuntu18.04
KrisThielemans Dec 15, 2018
4342a64
Merge branch 'master' into ubuntu18.04
KrisThielemans Dec 15, 2018
c3dc47e
Use system boost
KrisThielemans Dec 15, 2018
92a8474
Merge branch 'master' into ubuntu18.04
KrisThielemans Dec 15, 2018
d251731
Merge branch 'master' into ubuntu18.04
KrisThielemans Dec 17, 2018
61c91fa
Merge branch 'master' into ubuntu18.04
KrisThielemans Dec 17, 2018
133cb34
use bento box
paskino Dec 17, 2018
dcb103e
Merge branch 'ubuntu18.04' of https://github.com/CCPPETMR/CCPPETMR_VM…
paskino Dec 17, 2018
ab1d82f
Added 50Gb VDI disk image
paskino Feb 4, 2019
1a1fb9f
builds VM with vagrant
paskino Feb 4, 2019
b0a6e76
add port forwarding, add 32 Mb video ram, 50 Gb HDD
paskino Feb 8, 2019
9c41fb5
use system boost
paskino Feb 8, 2019
b10f200
delete sirf_disk.vdi
paskino Feb 8, 2019
ad2d659
removed links to specific VM and SuperBuild branches
paskino Feb 8, 2019
6e24f0e
Merge branch 'master' into ubuntu18.04
KrisThielemans Mar 3, 2019
8d9ba4f
use globbing for resetting *URL and *TAG
KrisThielemans Mar 3, 2019
486eb75
set USE_ITK=ON
KrisThielemans Mar 3, 2019
8f8139f
created function find_boost_version
paskino Mar 4, 2019
f3a789b
moved shell provision script to file
paskino Mar 4, 2019
b906864
Merge branch 'ubuntu18.04' of https://github.com/CCPPETMR/CCPPETMR_VM…
paskino Mar 4, 2019
a02da85
install libhdf5-dev
paskino Mar 4, 2019
d14060a
vram is in modifyvm section
paskino Mar 4, 2019
2ff11bf
indentation fix
paskino Mar 4, 2019
0bba490
removed comment
paskino Mar 4, 2019
b331644
separate the install steps
paskino Mar 4, 2019
8f478bb
multi line install
paskino Mar 4, 2019
7472310
added bootstrap_ubuntu.sh script
paskino Mar 8, 2019
dd8098c
install missing boost libraries
paskino Mar 14, 2019
e69cca8
removes autosuspend notification
paskino Mar 15, 2019
116ac49
add info on 2.0rc1
paskino Mar 15, 2019
e2b60c1
builds ubuntu18.04 SuperBuild
paskino Mar 15, 2019
95cfaf4
build ubuntu18.04 branch of superbuild
paskino Mar 15, 2019
7fec580
Merge branch 'ubuntu18.04' of https://github.com/CCPPETMR/CCPPETMR_VM…
paskino Mar 15, 2019
15d685a
removed conflict message
paskino Mar 22, 2019
4498f4b
changed VM name
paskino Mar 22, 2019
fe620f5
uses SuperBuild master
paskino Mar 22, 2019
906c3fa
removed -V command
paskino Mar 22, 2019
ce6ea7f
checks if user and homedir is already created
paskino Mar 22, 2019
dc5a998
bugfix
paskino Mar 23, 2019
2f0aa63
bugfix~~
paskino Mar 23, 2019
c9d0898
fix test dir existence
paskino Mar 23, 2019
0be5275
install spyder and jupyter in pip script
paskino Apr 9, 2019
6a92d1b
force spyder 3.2
paskino Apr 9, 2019
9f77c76
manual configure jupyter
paskino Apr 10, 2019
3c04559
info on manual step to configure ip for jupyter
paskino Apr 10, 2019
9e39448
add info on jupyter config
paskino Apr 10, 2019
98069ce
removed reference to specific branches
paskino Apr 10, 2019
d2ed794
updated VM name
paskino Apr 10, 2019
eabb9f5
add new version
paskino Apr 10, 2019
df0c4b2
Merge remote-tracking branch 'origin/master' into ubuntu18.04
paskino Apr 10, 2019
4236308
update doc
paskino Apr 10, 2019
86de274
clean up
paskino Apr 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# ChangeLog

## 2.0.0-rc.1
- upgraded to Ubuntu 18.04
- installs more recent Gadgetron https://github.com/gadgetron/gadgetron/commit/b6191eaaa72ccca6c6a5fe4c0fa3319694f512ab
- add port forwarding (8888 -> 8888 for jupyter)
paskino marked this conversation as resolved.
Show resolved Hide resolved
- install jupyter notebook, with default password
- installs spyder v3.2
- does not install a browser
- add cython for CIL


## 1.1.1
- added nbstripout (https://github.com/kynan/nbstripout) to handle conflicts in SIRF-Exercises

Expand Down
2 changes: 1 addition & 1 deletion VM_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
2.0.0-rc.1
59 changes: 34 additions & 25 deletions scripts/INSTALL_prerequisites_with_apt-get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,76 @@
# without asking any questions.
# We use it for the CCP PETMR VM etc.
# Use it with caution.

set -e

#if [ -z "SUDO" ]; then SUDO=sudo; fi

export DEBIAN_FRONTEND=noninteractive
SUDO=sudo
echo "Installing Gadgetron pre-requisites..."

$SUDO apt-get install -y --no-install-recommends libhdf5-serial-dev git-core cmake \
build-essential libfftw3-dev h5utils \
hdf5-tools hdfview liblapack-dev \
libarmadillo-dev libace-dev \
libgtest-dev \
libopenblas-dev libatlas-base-dev \
libxml2-dev libxslt-dev \ # for siemens_to_ismrmrd
cython
# g++-6 gcc-6
# Gadgetron dependencies, not required (yet) by SIRF
# only plplot install once https://github.com/gadgetron/gadgetron/issues/608 fixed
# in the Gadgetron version that we use
# libplplot-dev
APT_GET_INSTALL="$SUDO apt-get install -y --no-install-recommends"
${APT_GET_INSTALL} libhdf5-serial-dev git build-essential libfftw3-dev h5utils hdf5-tools \
hdfview liblapack-dev libarmadillo-dev libace-dev libgtest-dev libopenblas-dev \
libatlas-base-dev libatlas-base-dev libxml2-dev libxslt1-dev cython

echo "Installing boost 1.65 or later"
# first find current boost version (if any)
# the 'tail' makes sure we use the last one listed by apt-cache in case there is more than 1 version
tmp=`apt-cache search libboost|grep ALL|egrep libboost[1-9]|tail -n 1`
boost_major=${tmp:8:1}
boost_minor=${tmp:10:2}
function find_boost_version() {
tmp=`apt-cache search libboost|grep ALL|egrep libboost[1-9]|tail -n 1`
boost_major=${tmp:8:1}
boost_minor=${tmp:10:2}
}

find_boost_version

echo "Found Boost major version ${boost_major}, minor ${boost_minor}"
if [ $boost_major -gt 1 -o $boost_minor -gt 64 ]
then
echo "installing Boost ${boost_major}.${boost_minor} from system apt"
$SUDO apt install -y libboost-dev
$SUDO apt install -y libboost-chrono-dev
$SUDO apt install -y libboost-filesystem-dev
$SUDO apt install -y libboost-thread-dev
$SUDO apt install -y libboost-date-time-dev
$SUDO apt install -y libboost-regex-dev
$SUDO apt install -y libboost-program-options-dev
$SUDO apt install -y libboost-atomic-dev
$SUDO apt install -y libboost-test-dev
$SUDO apt install -y libboost-timer-dev
else
# packaged boost is too old
# we need to find a ppa that has it. This is unsafe and likely prone to falling over
# when the ppa is no longer maintained
$SUDO apt install -y software-properties-common
echo "trying to find boost from ppa:mhier/libboost-latest"
${APT_GET_INSTALL} software-properties-common
$SUDO add-apt-repository -y ppa:mhier/libboost-latest
$SUDO apt update
# get rid of the default installed boost version
$SUDO apt remove -y libboost-all-dev
$SUDO apt auto-remove -y
# TODO: find out which version is in the ppa
$SUDO apt install -y libboost1.68-dev
find_boost_version
echo "installing Boost ${boost_major}.${boost_minor} from system apt"
${APT_GET_INSTALL} libboost${boost_major}.${boost_minor}-all-dev
fi

echo "Installing SWIG..."

$SUDO apt-get install -y --no-install-recommends swig
${APT_GET_INSTALL} --no-install-recommends swig

echo "Installing doxygen related packages"
$SUDO apt-get install -y --no-install-recommends doxygen graphviz
${APT_GET_INSTALL} --no-install-recommends doxygen graphviz

# replaced with pip install
#echo "Installing python libraries etc"
#$SUDO apt-get install -y --no-install-recommends python-scipy python-docopt python-numpy python-h5py python-matplotlib python-libxml2 python-psutil python-tk python-nose

echo "installing glog"
$SUDO apt-get install -y libgoogle-glog-dev
${APT_GET_INSTALL} libgoogle-glog-dev

echo "Installing python APT packages"
# we will use pip for most
# some extra package needed for jupyter
qt=pyqt5
$SUDO apt-get install -y python-dev python-pip python-tk python-${qt} python-${qt}.qtsvg python-${qt}.qtwebkit
${APT_GET_INSTALL} python-dev python-pip python-tk python-${qt} python-${qt}.qtsvg python-${qt}.qtwebkit
echo "Run INSTALL_python_packages.sh after this."
1 change: 1 addition & 0 deletions scripts/INSTALL_python_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ done

$PYTHON -m pip install $PIPOPTIONS --upgrade pip wheel setuptools
$PYTHON -m pip install $PIPOPTIONS --only-binary=numpy,scipy,matplotlib numpy scipy matplotlib nose coverage docopt
$PYTHON -m pip install $PIPOPTIONS jupyter spyder==3.2
21 changes: 10 additions & 11 deletions scripts/UPDATE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,16 @@ SuperBuild(){

cd buildVM
cmake ../SIRF-SuperBuild \
-DCMAKE_INSTALL_PREFIX=${SIRF_INSTALL_PATH} \
-USIRF_URL -USIRF_TAG -USTIR_URL -USTIR_TAG \
-UGadgetron_URL -UGadgetron_TAG -UISMRMRD_URL \
-UISMRMRD_TAG \
-DUSE_SYSTEM_SWIG=On \
-DUSE_SYSTEM_Boost=On \
-DUSE_SYSTEM_Armadillo=On \
-DUSE_SYSTEM_FFTW3=On \
-DUSE_SYSTEM_HDF5=ON \
-DBUILD_siemens_to_ismrmrd=On \
-DDEVEL_BUILD=OFF
-DCMAKE_INSTALL_PREFIX=${SIRF_INSTALL_PATH} \
-U\*_URL -U\*_TAG \
-DUSE_SYSTEM_SWIG=On \
-DUSE_SYSTEM_Boost=On \
-DUSE_SYSTEM_Armadillo=On \
-DUSE_SYSTEM_FFTW3=On \
-DUSE_SYSTEM_HDF5=ON \
-DBUILD_siemens_to_ismrmrd=On \
-DUSE_ITK=ON \
-DDEVEL_BUILD=OFF
make -j${num_parallel}

if [ ! -f ${SIRF_INSTALL_PATH}/share/gadgetron/config/gadgetron.xml ]
Expand Down
82 changes: 82 additions & 0 deletions scripts/bootstrap_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash

set -x
SIRFUSERNAME=sirfuser
SIRFPASS=virtual

# check if user exists. if not create it. Useful for vagrant provision
id -u $SIRFUSERNAME
if [ $? -eq "1" ] ; then
adduser $SIRFUSERNAME
adduser $SIRFUSERNAME sudo
{ echo $SIRFPASS; echo $SIRFPASS; } | passwd $SIRFUSERNAME
fi

# fail hard on any step
set -ex
# update the apt-get database
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y -o Dpkg::Options::=--force-confnew
# upgrade the list of packages


#install upgrades
apt-get update && apt-get install -y --no-install-recommends wget git xorg xterm gdm3 menu policykit-1-gnome synaptic gnome-session gnome-panel metacity
apt-get update && apt-get install -y at-spi2-core gnome-terminal gnome-control-center nautilus dmz-cursor-theme network-manager network-manager-gnome

# start gnome display manager
service gdm start

# set the current locale, otherwise the gnome-terminal doesn't start
sudo locale-gen en_GB.UTF-8
sudo locale-gen en_US.UTF-8
sudo locale-gen de_DE.UTF-8
sudo locale-gen fr_FR.UTF-8
sudo locale-gen es_ES.UTF-8
sudo locale-gen it_IT.UTF-8
sudo locale-gen pt_PT.UTF-8
sudo locale-gen pt_BR.UTF-8
sudo locale-gen ja_JP.UTF-8
sudo locale-gen zh_CN.UTF-8
sudo update-locale LANG=en_GB.UTF-8
sudo localectl set-x11-keymap uk
sudo localectl status


# To hide vagrant from login screen:
# 1. Log-in as vagrant
# 2. In /var/lib/AccountsService/users/vagrant change 'SystemAccount=true'
sudo echo '[User]' > vagrant
sudo echo 'SystemAccount=true' >> vagrant
sudo cp -v vagrant /var/lib/AccountsService/users/vagrant

# To remove the Ubuntu user from VM:
#sudo deluser --remove-home ubuntu
# Could add custom logos here: /etc/gdm3/greeter.dconf-defaults

userHOME=/home/$SIRFUSERNAME

if [ ! -d $userHOME/devel ]; then
mkdir $userHOME/devel
fi
cd $userHOME/devel

if [ ! -d $userHOME/devel/CCPPETMR_VM ]; then
git clone https://github.com/CCPPETMR/CCPPETMR_VM.git
cd CCPPETMR_VM
else
cd CCPPETMR_VM
git pull
fi



bash $userHOME/devel/CCPPETMR_VM/scripts/INSTALL_prerequisites_with_apt-get.sh
bash $userHOME/devel/CCPPETMR_VM/scripts/INSTALL_CMake.sh /usr/local
bash $userHOME/devel/CCPPETMR_VM/scripts/INSTALL_python_packages.sh

# port 8888 is forwarded to 8888 so the user can use the host browser
# Therefore no browser is installed on the VM

chown -R $SIRFUSERNAME:users $userHOME
sudo -u $SIRFUSERNAME -H bash $userHOME/devel/CCPPETMR_VM/scripts/UPDATE.sh
3 changes: 3 additions & 0 deletions scripts/configure_gnome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
# enlarge pointer size
gsettings set org.gnome.desktop.interface cursor-size 120
# remove autosuspend notification
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout '0'
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout '0'

9 changes: 9 additions & 0 deletions scripts/first_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@ location=`dirname $0`

$location/configure_gnome.sh

# configure jupyter notebook
mkdir ~/.jupyter
jupyter notebook --generate-config
# requires to set the following variable manually by editing the file
# jupyter_notebook_config.py
# c.NotebookApp.ip = '0.0.0.0'
jupyter notebook password

$location/zero_fill.sh

90 changes: 13 additions & 77 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#=========================================================================

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.box = "bento/ubuntu-18.04"
config.vm.synced_folder '.', '/vagrant', disabled: true

# Disable automatic box update checking. If you disable this, then
Expand All @@ -31,8 +31,10 @@ Vagrant.configure("2") do |config|
# 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: 80, host: 8080

# Forward port for jupyter notebooks
config.vm.network "forwarded_port", guest: 8888, host: 8888

# 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"
Expand All @@ -52,6 +54,7 @@ Vagrant.configure("2") do |config|
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#

config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
Expand All @@ -62,17 +65,17 @@ Vagrant.configure("2") do |config|

vb.customize "pre-boot", [
"storageattach", :id,
"--storagectl", "IDE",
"--storagectl", "IDE Controller",
"--port", "1",
"--device", "0",
"--type", "dvddrive",
"--medium", "emptydrive",
"--medium", "emptydrive"
]
vb.name = "SIRF_1.1.1"
vb.name = "SIRF_2.0.0-rc.1"
vb.customize ["modifyvm", :id,
"--clipboard", "bidirectional"]
#vb.customize [ "modifyvm", :id,
# "--uartmode1", "disconnected" ]
"--clipboard", "bidirectional",
"--vram", "32"]
end

#
Expand All @@ -90,73 +93,6 @@ Vagrant.configure("2") do |config|
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.

config.vm.provision "shell", inline: <<-SHELL
SIRFUSERNAME=sirfuser
SIRFPASS=virtual

adduser $SIRFUSERNAME
adduser $SIRFUSERNAME sudo
{ echo $SIRFPASS; echo $SIRFPASS; } | passwd $SIRFUSERNAME

# remove serial port from grub configuration and update configuration
sed -i 's/ console=ttyS0//' /etc/default/grub.d/50-cloudimg-settings.cfg
update-grub
# update the apt-get database
apt-get update
# upgrade the list of packages
apt-get upgrade -y

#install upgrades
apt-get install -y wget git xorg xterm gdm menu gksu synaptic gnome-session gnome-panel metacity --no-install-recommends
apt-get install -y at-spi2-core gnome-terminal gnome-control-center nautilus dmz-cursor-theme network-manager network-manager-gnome

# start gnome display manager
service gdm start

# set the current locale, otherwise the gnome-terminal doesn't start
sudo locale-gen en_GB.UTF-8
sudo locale-gen en_US.UTF-8
sudo locale-gen de_DE.UTF-8
sudo locale-gen fr_FR.UTF-8
sudo locale-gen es_ES.UTF-8
sudo locale-gen it_IT.UTF-8
sudo locale-gen pt_PT.UTF-8
sudo locale-gen pt_BR.UTF-8
sudo locale-gen ja_JP.UTF-8
sudo locale-gen zh_CN.UTF-8
sudo update-locale LANG=en_GB.UTF-8
sudo localectl set-x11-keymap uk
sudo localectl status


# To hide vagrant from login screen:
# 1. Log-in as vagrant
# 2. In /var/lib/AccountsService/users/vagrant change 'SystemAccount=true'
sudo echo '[User]' > vagrant
sudo echo 'SystemAccount=true' >> vagrant
sudo cp -v vagrant /var/lib/AccountsService/users/vagrant

# To remove the Ubuntu user from VM:
sudo deluser --remove-home ubuntu
# Could add custom logos here: /etc/gdm3/greeter.dconf-defaults

userHOME=/home/$SIRFUSERNAME
mkdir $userHOME/devel
cd $userHOME/devel

git clone https://github.com/CCPPETMR/CCPPETMR_VM.git
cd CCPPETMR_VM
#git checkout ubuntu18.04
bash $userHOME/devel/CCPPETMR_VM/scripts/INSTALL_prerequisites_with_apt-get.sh
bash $userHOME/devel/CCPPETMR_VM/scripts/INSTALL_CMake.sh /usr/local
bash $userHOME/devel/CCPPETMR_VM/scripts/INSTALL_python_packages.sh

apt-get install -y firefox
python -m pip install jupyter
python -m pip install spyder
chown -R $SIRFUSERNAME:users $userHOME
sudo -u $SIRFUSERNAME -H bash $userHOME/devel/CCPPETMR_VM/scripts/UPDATE.sh


SHELL
config.vm.provision "shell", path: "../scripts/bootstrap_ubuntu.sh"
end