-
Use VirtualBox for virtualization.
-
Create a virtual machine in VirtualBox using Ubuntu 18.04.03 as a base image. Get the .iso here http://releases.ubuntu.com/18.04/
-
Configure the VM with at least 2 CPUs.
-
Configure main memory to use 4 GB.
-
Configure video memory to use the maximum of 128 MB.
-
Call the user
travis
-
Set his password to
password
-
Update packages
sudo apt update sudo apt upgrade
-
Enable Bash completion from history
echo '"\e[A": history-search-backward # arrow up' >> ~/.inputrc echo '"\e[B": history-search-forward # arrow down' >> ~/.inputrc echo 'set completion-ignore-case on' >> ~/.inputrc
-
Install Java version 11
sudo apt install openjdk-11-jre
-
Get docker (instructions from here https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce)
# Install packages to allow apt to use a repository over HTTPS: sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common # Add Docker’s official GPG key: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # Confirm you have the correct key ending in 0EBFCD88 sudo apt-key fingerprint 0EBFCD88 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) <docker@docker.com> sub rsa4096 2017-02-22 [S] # add the correct repository depending on architecture and linux distribution: sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" # update package index sudo apt-get update # install docker packages sudo apt-get install docker-ce docker-ce-cli containerd.io
-
Configure the current user to allow running docker without asking for password
# docker install should have created the docker group already, but just in case: sudo groupadd docker # add current user to docker group sudo usermod -aG docker $USER # start using the new settings (no sudo) # Note: I actually had to reboot to make this work. newgrp docker
-
Install Git
sudo apt install git
-
Get a copy of the tutorial materials:
git clone https://github.com/xenon-middleware/xenon-tutorial.git
-
Install dependencies for generating the Sphinx documentation
sudo apt install python3-pip cd ~/xenon-tutorial/readthedocs/ pip3 install --user -r requirements.txt
-
Add the user-space Python packages to the PATH
echo '' >> ~/.bashrc echo '# add directory where python has user space packages, e.g. when installing' >> ~/.bashrc echo '# with pip3 install --user <package name>' >> ~/.bashrc echo 'PATH=$PATH:~/.local/bin' >> ~/.bashrc # enable the new settings source ~/.bashrc
-
Generate the Sphinx documentation
cd ~/xenon-tutorial/readthedocs/ sphinx-build -b html . build/
-
Get a copy of xenon cli, install it, add to PATH:
cd ~/Downloads wget https://github.com/xenon-middleware/xenon-cli/releases/download/v3.0.4/xenon-cli-shadow-3.0.4.tar tar -xvf xenon-cli-shadow-3.0.4.tar mkdir -p ~/.local/bin/xenon mv xenon-cli-shadow-3.0.4 ~/.local/bin/xenon/ echo '' >> ~/.bashrc echo '# add xenon-cli directory to PATH' >> ~/.bashrc echo 'PATH=$PATH:~/.local/bin/xenon/xenon-cli-shadow-3.0.4/bin' >> ~/.bashrc # enable the new settings source ~/.bashrc
-
Check that the downloaded version of xenon-cli uses the same xenon as what is defined in
readthedocs/code-tabs/java/build.gradle
. -
Check that the downloaded version of xenon-cli is the same as what is defined in
.travis.yml
. -
Create filesystem fixtures
mkdir -p /home/travis/fixtures/dir1 mkdir -p /home/travis/fixtures/.dir2 echo 'dir1/file1.txt' > /home/travis/fixtures/dir1/file1.txt echo 'dir1/.file2.txt' > /home/travis/fixtures/dir1/.file2.txt echo '.dir2/file3.txt' > /home/travis/fixtures/.dir2/file3.txt echo '.dir2/.file4.txt' > /home/travis/fixtures/.dir2/.file4.txt
-
Install
tree
sudo apt install tree
-
Install simple editors: nano, others
sudo apt install geany sudo apt install leafpad sudo apt install joe # choose which editor should be default (nano) sudo update-alternatives --config editor
-
Install Eclipse
# (from https://download.eclipse.org/eclipse/downloads/drops4/R-4.12-201906051800/) # download platform runtime binary cd ~/Downloads wget http://ftp.snt.utwente.nl/pub/software/eclipse//eclipse/downloads/drops4/R-4.12-201906051800/eclipse-platform-4.12-linux-gtk-x86_64.tar.gz tar -xzvf eclipse-platform-4.12-linux-gtk-x86_64.tar.gz mkdir -p ~/opt/eclipse/ mv eclipse ~/opt/eclipse/eclipse-4.12
mkdir -p $HOME/.local/share/applications/ echo "[Desktop Entry] Type=Application GenericName=Text Editor Encoding=UTF-8 Name=Eclipse Comment=Java IDE Exec=$HOME/opt/eclipse/eclipse-4.12/eclipse Icon=$HOME/opt/eclipse/eclipse-4.12/icon.xpm Terminal=false Categories=GNOME;GTK;Utility;TextEditor;Development; MimeType=text/plain" > $HOME/.local/share/applications/eclipse.desktop echo " # Add directory containing eclipse to the PATH PATH=\$PATH:$HOME/opt/eclipse/eclipse-4.12 " >> $HOME/.profile
Configure Eclipse by installing Help >> Install New Software... >> (select --All Available Sites--) >> Programming Languages >> Eclipse Java Development Tools (see https://medium.com/@acisternino/a-minimal-eclipse-java-ide-d9ba75491418).
Prepare Java snippets directory as an Eclipse Java project:
cd $HOME/xenon-tutorial/readthedocs/code-tabs/java ./gradlew eclipse
In Eclipse, Import project.
-
Download Docker images
docker pull xenonmiddleware/s3 docker pull xenonmiddleware/slurm:17 docker pull xenonmiddleware/ssh docker pull xenonmiddleware/webdav
-
Generate the Sphinx documentation locally just in case there are network problems
-
Configure OpenSSH
sudo apt install openssh-client chmod go-w /home/travis chmod 700 /home/travis/.ssh cp vm-prep/.ssh/known_hosts /home/travis/.ssh/known_hosts chmod 644 /home/travis/.ssh/known_hosts cp vm-prep/.ssh/config /home/travis/.ssh/config chmod 600 /home/travis/.ssh/config chown -R travis:travis /home/.ssh
-
Install python
virtualenv
, make a virtual environment, activate it, and installpyxenon
in it (pyxenon does not work outside a virtual environment).sudo apt install virtualenv cd ~/xenon-tutorial/readthedocs/code-tabs/python/ virtualenv -p /usr/bin/python3.6 venv36 source venv36/bin/activate pip3 install -r requirements.txt
Also include the test framework
pip3 install -r requirements-dev.txt
Check that it works by
which xenon-grpc
and
pytest tests/ --ignore=tests/test_upload_file_local_to_sftp_absolute_paths.py \ --ignore=tests/test_download_file_sftp_to_local_absolute_paths.py
-
Export vm as ova
-
Test the installation
This here is @jmaassen's setup to avoid having to deal with intricacies related to an OS that is not your own. With this setup, you can ssh into the VM, then make edits there from the comfort of the terminal that you are used to, with the tooling that you are used to.
- Start the RSE2017 Fedora virtual machine from VirtualBox, log in as user
tutorial
using passwordtutorial
- In the VM, open a terminal and type
ifconfig
. Look for an entry that has aninet
value starting with10.
(mine is10.0.2.15
). We will use this value as Guest IP later. - In the terminal, start the SSH server with
sudo systemctl start sshd.service
- In VirtualBox, change the port forwarding settings, as follows:
- Go to menu item
Machine
- Go to
Settings
- Go to
Network
- On tab
Adaptor 1
, go toAdvanced
, click onPort Forwarding
- Click the
plus
icon to add a rule- Under
protocol
fill inTCP
- Under
Host IP
fill in127.0.0.1
- Under
Host Port
fill in2222
- Under
Guest IP
fill in the value we got fromifconfig
- Under
Guest Port
fill in22
- Under
- Go to menu item
- Outside the VM, open a terminal, type
ssh -p 2222 tutorial@127.0.0.1
(type passwordtutorial
when asked). You should now be logged in to the RSE2017 VM.
Not sure we still need any of this (from the rse17 tutorial)
preparations for the rse vm
- virtualbox guest additions
- number of cpus
import ovafile
set number of cpus to 2
# enable 3D hardware acceleration
# set virtual memory to max, 128 MB
start fedora
in terminal
sudo dnf update kernel*
reboot
sudo dnf install gcc kernel-devel kernel-headers dkms make bzip2 perl
KERN_DIR=/usr/src/kernels/`uname -r`
export KERN_DIR
from top virtualbox dropdown menu, select devices, insert guest additions
let guest additions install from the autorun, shutdown afterwards
# disable 3d acceleration again
login