OS Installation on Turing Master

This page describes simple steps to install the OS (HypriotOS) on the PIs.

Overview

Turing Pi uses HypriotOS because the quickest to set up. SSH and Docker supported by default

Even if processor is 64bits, OS is still 32bits. (Memory is small anyway). Removed cloud-init once the site was up.

  • For simple arm32v7 OS, download the operating system from HypriotOS ARM32V7
  • For more complex arm64 OS, download the operating system from HypriotOS ARM64V8
  • Flash all 3 or 5 SD cards using Win32DiskImager or similar. It takes around 30 seconds per card.

OS on Turing Master

Do not power up the slaves nodes for right now. Either plug your home router directly to the master PI, or to the switch. The goal here is to get an IP address allocated by your home router to the master PI.

Access the Turing Node

  • Insert the SD card in the master PI.
  • Access your home router and look for “black-pearl” IP address.
  • SSH to the node using cygwin, putty or moba-xterm for instance. The credentials are pirate/hypriot.

Freeze your configuration

Cloud init is perfect for the first boot. Once the node is up, it can be challenging not to preserve the fine tuning done to the OS.

sudo apt-get remove --purge cloud-init
sudo apt-get autoremove

Update OS

Let’s update to the latest version

sudo apt-get update
sudo apt-get upgrade

Gain access to latest docker-ce

sudo -i

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
usermod -aG docker pirate

At the time this article is written 18.09 is not supported yet.

sudo apt-cache policy docker-ce
sudo apt-get remove --purge docker-ce
sudo apt-get autoremove

sudo apt-get install docker-ce=18.06.1~ce~3-0~debian

Update Turing Master name

As root, replace black-pearl by kubemaster-pi, in the two following files:

sudo -i

vi /etc/hosts

It seems on HypriotOS 64, you need to do

sudo hostnamectl set-hostname kubemaster-pi

Configure the pirate account

If you prefer to edit using vi instead of nano

vi /etc/environment

EDITOR=vi

Then you need to set up the ssh keys Either create a new ssh key (id_rsa, id_rsa.pub) and copy in id_rsa.pub into GitHub You also need to add those keys in GerritHub

ssh-keygen

or install your private and public key into the /home/pirate/.ssh directory (The same key you registered in GitHub)

scp id_rsa pirate@<PI>:/home/pirate/.ssh/id_rsa
scp id_rsa.pub pirate@<PI>:/home/pirate/.ssh/id_rsa.pub

Install GIT

Since you have ethernet access, it is a good time to install GIT in order to download usefull scripts from github.com

sudo apt-get update
sudo apt-get install git
sudo apt-get install git-review


```bash
$ mkdir -p $HOME/proj/turing
$ cd $HOME/proj/turing

create a cloneit1.sh file, edit it and run it

If you deployed on ARM64, be sure to replace arm32v7 by arm64v8

#!/bin/bash
GOODPATH=`pwd`
USERID=yourgithubaccount
for i in helmrepos kubeplay kubesim_5gc kubesim_base kubesim_elte kubesim_epc kubesim_lte kubesim_nr kubesim_blinkt kubesim_nats kubesim_linkio turing_utils
do
echo "======================================================"
echo $i
echo "======================================================"
# If you want to contribute
# git clone -b arm32v7 ssh://$USERID@review.gerrithub.io:29418/turing/$i && scp -p -P 29418 $USERID@review.gerrithub.io:hooks/commit-msg $i/.git/hooks/
# If you want to just pull the code
# git clone -b arm32v7 git@github.com:turing/$i.git
cd $GOODPATH
done

create a cloneit2.sh file, edit it and run it

#!/bin/bash
GOODPATH=`pwd`
USERID=yourgithubaccount
for i in kube-rpi ansible-kube-rpi
do
echo "======================================================"
echo $i
echo "======================================================"
# If you want to contribute
# git clone ssh://$USERID@review.gerrithub.io:29418/turing/$i && scp -p -P 29418 $USERID@review.gerrithub.io:hooks/commit-msg $i/.git/hooks/
# If you want to just pull the code
# git clone git@github.com:turing/$i.git
cd $GOODPATH
done

You know have access especially through kube-rpi and ansible-kube-rpi to example files and ansible playbook usefull to install your first node: cd $HOME/proj/turing/kube-rpi/config/cluster1/hypriotos/kubemaster-pi