<commit_before>.. only:: not (epub or latex or html)
  
    WARNING: You are looking at unreleased Cilium documentation.
    Please use the official rendered version released here:
    http://docs.cilium.io

.. _dev_env:

Development Setup
=================

Requirements
~~~~~~~~~~~~

You need to have the following tools available in order to effectively
contribute to Cilium:

+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
| Dependency                                                                       | Version / Commit ID         | Download Command                                                              |
+==================================================================================+=============================+===============================================================================+
|  git                                                                             | latest                      | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
|  clang                                                                           | >= 7.0 (latest recommended) | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
|  llvm                                                                            | >= 7.0 (latest recommended) | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
|  libelf-devel                                                                    | latest                      | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
| `go <https://golang.org/dl/>`_                                                   | |GO_RELEASE|                | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `ginkgo <https://github.com/onsi/ginkgo>`__                                      | >= 1.4.0                    | ``go get -u github.com/onsi/ginkgo/ginkgo``                                   |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `gomega <https://github.com/onsi/gomega>`_                                       | >= 1.2.0                    | ``go get -u github.com/onsi/gomega``                                          |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `ineffassign <https://github.com/gordonklaus/ineffassign>`_                      | >= ``1003c8b``              | ``go get -u github.com/gordonklaus/ineffassign``                              |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `Docker <https://docs.docker.com/engine/installation/>`_                         | OS-Dependent                | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `Docker-Compose <https://docs.docker.com/compose/install/>`_                     | OS-Dependent                | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ python3-pip                                                                      | latest                      | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+


To build the documentation, you will need to install its dependencies:

::

    $ sudo pip3 install -r Documentation/requirements.txt

Finally, in order to run Cilium locally on VMs, you need:

+----------------------------------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+
| Dependency                                                                       | Version / Commit ID   | Download Command                                                               |
+==================================================================================+=======================+================================================================================+
| `Vagrant <https://www.vagrantup.com/downloads.html>`_                            | >= 2.0                | `Vagrant Install Instructions <https://www.vagrantup.com/docs/installation/>`_ |
+----------------------------------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+
| `VirtualBox <https://www.virtualbox.org/wiki/Downloads>`_ (if not using libvirt) | >= 5.2                | N/A (OS-specific)                                                              |
+----------------------------------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+

You should start with the `gs_guide`, which walks you through the set-up, such
as installing Vagrant, getting the Cilium sources, and going through some
Cilium basics.


Vagrant Setup
~~~~~~~~~~~~~

While the `gs_guide` uses a Vagrantfile tuned for the basic walk through, the
setup for the Vagrantfile in the root of the Cilium tree depends on a number of
environment variables and network setup that are managed via<commit_msg>docs: Clarify need to run docker as non-root user<commit_after>.. only:: not (epub or latex or html)
  
    WARNING: You are looking at unreleased Cilium documentation.
    Please use the official rendered version released here:
    http://docs.cilium.io

.. _dev_env:

Development Setup
=================

Requirements
~~~~~~~~~~~~

You need to have the following tools available in order to effectively
contribute to Cilium:

+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
| Dependency                                                                       | Version / Commit ID         | Download Command                                                              |
+==================================================================================+=============================+===============================================================================+
|  git                                                                             | latest                      | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
|  clang                                                                           | >= 7.0 (latest recommended) | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
|  llvm                                                                            | >= 7.0 (latest recommended) | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
|  libelf-devel                                                                    | latest                      | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
| `go <https://golang.org/dl/>`_                                                   | |GO_RELEASE|                | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `ginkgo <https://github.com/onsi/ginkgo>`__                                      | >= 1.4.0                    | ``go get -u github.com/onsi/ginkgo/ginkgo``                                   |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `gomega <https://github.com/onsi/gomega>`_                                       | >= 1.2.0                    | ``go get -u github.com/onsi/gomega``                                          |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `ineffassign <https://github.com/gordonklaus/ineffassign>`_                      | >= ``1003c8b``              | ``go get -u github.com/gordonklaus/ineffassign``                              |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `Docker <https://docs.docker.com/engine/installation/>`_                         | OS-Dependent                | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ `Docker-Compose <https://docs.docker.com/compose/install/>`_                     | OS-Dependent                | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+
+ python3-pip                                                                      | latest                      | N/A (OS-specific)                                                             |
+----------------------------------------------------------------------------------+-----------------------------+-------------------------------------------------------------------------------+

For `unit_testing`, you will need to run ``docker`` without privileges. You can usually achieve this by adding your current user to the ``docker`` group.

To build the documentation, you will need to install its dependencies:

::

    $ sudo pip3 install -r Documentation/requirements.txt

Finally, in order to run Cilium locally on VMs, you need:

+----------------------------------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+
| Dependency                                                                       | Version / Commit ID   | Download Command                                                               |
+==================================================================================+=======================+================================================================================+
| `Vagrant <https://www.vagrantup.com/downloads.html>`_                            | >= 2.0                | `Vagrant Install Instructions <https://www.vagrantup.com/docs/installation/>`_ |
+----------------------------------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+
| `VirtualBox <https://www.virtualbox.org/wiki/Downloads>`_ (if not using libvirt) | >= 5.2                | N/A (OS-specific)                                                              |
+----------------------------------------------------------------------------------+-----------------------+--------------------------------------------------------------------------------+

You should start with the `gs_guide`, which walks you through the set-up, such
as installing Vagrant, getting the Cilium sources, and going through some
Cilium basics.


Vagrant Setup
~~~~~~~~~~~~~

While the `gs_guide` uses a Vagrantfile tuned for the basic walk through, the
setup for the Vagrantfile in the root of the Cilium tree depends on a number of
environment variables and network setup that are managed via
{'fraction_non_alphanumeric': 0.49692033944702985, 'fraction_numerical': 0.0028743498494388175, 'mean_word_length': 0.45984015984015986, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 35, 'https://': 18, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 116, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5521470', 'n_tokens_mistral': 1934, 'n_tokens_neox': 1750, 'n_words': 481}