Skip to content

Commit

Permalink
Improving Polycube doc - Install/Update kernel process (#306)
Browse files Browse the repository at this point in the history
* Improving Polycube doc - Install/Update kernel process

Since we landed to Ubuntu 20.04, I though that a bit more specifics could be added into the guide

Signed-off-by: Simone Magnani <simonemagnani.96@gmail.com>
  • Loading branch information
s41m0n committed May 27, 2020
1 parent 643e7c3 commit cd14eaa
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions Documentation/installation.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Installing Polycube
===================
Installing Polycube from source files
=====================================

This installation guide includes instructions to install Polycube on ``Ubuntu 18.04``.
This installation guide includes instructions to install Polycube on ``Ubuntu >= 18.04``.
However those should also work on other versions and distributions with a few changes.

Dependencies
------------

Polycube requires following dependencies:
- At least **Linux kernel v4.15** that includes a set of the eBPF features which are needed by polycube
- **Recent Linux kernel**: most Polycube services work with kernel **>= v4.15**; however, there are cases in which a newer kernel may be required, e.g., in case we want to execute the ``dynmon`` service with a custom code that requires more recent kernel primitives. In case you are unsure, please upgrade to **kernel v5.4**.
- **pistache**: a library to build rest API servers
- **libints**: a library for crafting packets (needed only for some services)
- **Go language**: required to run ``polycubectl`` (polycube command line interface)
Expand All @@ -17,10 +17,15 @@ Following sections will detail the installation process for the above components

.. _updating-linux-kernel:

Updating Linux Kernel to v4.15
Updating Linux Kernel
-------------------------------

Use ``uname -a`` to check the kernel version you are running, if this is ``<v4.15`` please use the following instructions to update it.
Most Polycube services require at least the **Linux kernel v4.15**. However, the ``dynmon`` service allow the dynamic injection of a custom data plane, which may exploit latest eBPF kernel features and hence require more up-to-date kernel versions. Therefore we suggest to upgrade the to the latest Linux kernel (https://kernel.ubuntu.com/~kernel-ppa/mainline/) in order to be on the safe side.

The following examples show how to update kernel to version **4.15** and **5.4**. To check the kernel version you are running, please use ``uname -a``.
After a kernel update, please remember to reboot your machine at choose the newly installed one while the boot process starts.

To update to kernel **v4.15**:

::

Expand All @@ -31,22 +36,33 @@ Use ``uname -a`` to check the kernel version you are running, if this is ``<v4.1
sudo dpkg -i *.deb
sudo reboot

To update to kernel **v5.4**:

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4/linux-headers-5.4.0-050400_5.4.0-050400.201911242031_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4/linux-headers-5.4.0-050400-generic_5.4.0-050400.201911242031_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4/linux-image-5.4.0-050400-generic_5.4.0-050400.201911242031_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4/linux-modules-5.4.0-050400-generic_5.4.0-050400.201911242031_amd64.deb

sudo dpkg -i *.deb
sudo reboot

Automatic installation from source files
----------------------------------------

If you are running ``Ubuntu 18.04`` and you do not want to manually install polycube and its dependencies, you can use the install script available under the `scripts` folder.
This is not guaranteed that the script works on versions or distributions other than ``Ubuntu 18.04``.
If you are running ``Ubuntu >= 18.04`` and you do not want to manually install Polycube and its dependencies, you can use the install script available under the `scripts` folder.
This scripts has been tested on ``Ubuntu 18.04``, ``Ubuntu 19.04`` and ``Ubuntu 20.04``.

Please notice that this script does not update the kernel version.

In this case you have to:
In order to install Polycube with the script, you have to:

::

# install git
sudo apt-get install git

# clone the polycube repository
# clone the Polycube repository
git clone https://github.com/polycube-network/polycube
cd polycube
git submodule update --init --recursive
Expand Down Expand Up @@ -75,8 +91,10 @@ Go 1.8+ is needed to run ``polycubectl``, if you only plan to install ``polycube
Since Ubuntu 20.04, support for ``golang-go`` has been introduced into the main repositories. Thus, you just need to run

::

sudo apt install golang-go


Instead, for all the previous versions (< 20.04) please refer to the following instructions:

::
Expand Down Expand Up @@ -105,7 +123,7 @@ Install dependencies

::

# Install polycube dependencies
# Install Polycube dependencies
sudo apt-get -y install git build-essential cmake bison flex \
libelf-dev libllvm5.0 llvm-5.0-dev libclang-5.0-dev libpcap-dev \
libnl-route-3-dev libnl-genl-3-dev uuid-dev pkg-config \
Expand Down Expand Up @@ -161,10 +179,10 @@ Install libtins
sudo make install
sudo ldconfig

Installing polycube
Installing Polycube
^^^^^^^^^^^^^^^^^^^

This installs the polycube daemon (``polycubed``), the polycube CLI (``polycubectl``) and the services shipped with polycube.
This installs the Polycube daemon (``polycubed``), the Polycube CLI (``polycubectl``) and the network services shipped with Polycube.
If you want to disable some services, you can modify the cmake flags using ``ccmake``.

::
Expand All @@ -180,4 +198,4 @@ If you want to disable some services, you can modify the cmake flags using ``ccm
sudo make install


Hooray, you have ``polycube`` installed and ready to be used, please refer to :doc:`Quick Start <quickstart>` to start using your installation.
Hooray, you have Polycube installed and ready to be used, please refer to :doc:`Quick Start <quickstart>` to start using your installation.

0 comments on commit cd14eaa

Please sign in to comment.