Setting up the hpc-admin node
The hpc-admin node will be the physical server hosting the MrProvisioner and Jenkins services for the HPC lab.
The baremetal installation is : a Debian9 (stretch) hosting the two services using KVM/QEMU for the moment (migration to Docker/Containers will be possible when MrP support for containers is production ready.)
Install Debian as you normally would for a server, do care to install the ssh server and to plan for enough space for the Jenkins logs (a bare minimum of 500Go for the Jenkins VM is desirable)
root@hpc-admin # apt update && apt upgrade root@hpc-admin # apt install sudo git net-tools vim bridge-utils qemu-kvm libvirt-clients libvirt-daemon-system virtinst dirmngr build-essential root@hpc-admin # echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" >> /etc/apt/sources.list root@hpc-admin # apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 root@hpc-admin # apt update && apt install ansible
You now have a working baremetal server running Debian9 with all the appropriate utilities and tools.
NOTE: To directly ssh in the server as root, you have to add your public SSH key to /root/.ssh/authorized_keys
Setting up the VMs
First you need to setup libvirt's network to have a default internet access via NAT on the VMs at creation.
root@hpc-admin # virsh net-define /etc/libvirt/qemu/networks/default.xml root@hpc-admin # virsh net-autostart default root@hpc-admin # virsh net-start default # Makesure it worked root@hpc-admin # brctl show # Make sure FORWARD works on reboot root@hpc-admin # echo net.ipv4.ip_forward=1 > /etc/sysctl.conf
Then create 2 VMs : one for MrP, one for Jenkins.
NOTE: FOR THE PRESEED, use the one attached to JIRA issue HPC-115 the one entitled "preseed_replace_SSHPUBKEY.cfg" and be sure to replace it, as else it won't add your sshkey to the root user.
user@hpc-admin $ sed -i "s/SSHROOTPUB/$(sed 's:/:\\/:g' /home/user/.ssh/id_rsa.pub)/" preseed_replace_SSHPUBKEY.cfg user@hpc-admin $ mv preseed_replace_SSHPUBKEY.cfg preseed.cfg
NOTE: The pressed NEEDS to be called "preseed.cfg" else the virt-install WILL NOT take it.
root@hpc-admin # virt-install --virt-type kvm \ --name jenkins-hpc \ --memory 16384 \ --vcpus 4 \ --disk size=500 \ --os-variant debian9 \ --graphics none \ --initrd-inject=preseed.cfg \ --location http://cdn-fastly.deb.debian.org/debian/dists/stretch/main/installer-amd64/ \ --extra-args "console=ttyS0,115200n8 serial"
root@hpc-admin # virt-install --virt-type kvm \ --name mrp-hpc \ --memory 4096 \ --vcpus 2 \ --disk size=20 \ --os-variant debian9 \ --graphics none \ --initrd-inject=preseed.cfg \ --location http://cdn-fastly.deb.debian.org/debian/dists/stretch/main/installer-amd64/ \ --extra-args "console=ttyS0,115200n8 serial"
Installing the Jenkins service
Add your jenkins-hpc IP to /etc/ansible/hosts under the tag "[jenkins]"
Then :
root@hpc-admin # git clone https://github.com/BaptisteGerondeau/ans_setup_jenkins.git && cd ans_setup_jenkins // Do put the secret files in the right place : pending upload to private repo root@hpc-admin # ansible-playbook configure-jenkins.yml -vvv -u root
Setup networking so that you can connect to your Jenkins VM on port 8080 (or whatever you set) and login with your linaro.org ldap account (with @linaro.org at the end).
Installing the MrP service
Add your mrp-hpc IP to /etc/ansible/hosts under the tag "[infra_servers]"
Then :
root@hpc-admin # git clone https://github.com/niedbalski/infra-automation.git && cd infra_automation/ansible // Do put the secret files in the right place : pending upload to private repo root@hpc-admin # ansible-playbook playbooks/infra-server.yml -vvv -u root
Then you can login to MrP on port 5000 (or whatever you set) and login with the usual first install login.