Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 1 | .. _dev_virtual: |
| 2 | |
| 3 | Developing code with a virtual VOLTHA POD |
| 4 | ========================================= |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 5 | |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 6 | A guide to install a virtual POD. A virtual pod is generally used to gain familiarity with the |
| 7 | environment or for development and testing purposes. |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 8 | |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 9 | How is it different from a Physical deployment? |
| 10 | ----------------------------------------------- |
| 11 | |
| 12 | The main difference is in the ``kubernetes`` cluster itself. |
| 13 | In a Physical deployment we assume that the ``kubernetes`` cluster is installed |
| 14 | on 3 (or mode) physical nodes. |
| 15 | When installing a ``virtual`` cluster we refer to a ``kind`` (``kubernetes-in-docker``) |
| 16 | cluster. |
| 17 | |
| 18 | Another common difference is that a Physical deployment is generally associated |
| 19 | with one or more physical OLTs while a Virtual deployment normally emulates the |
| 20 | PON network using :doc:`BBSim <../bbsim/docs/source/index>`. |
| 21 | |
| 22 | .. figure:: ../_static/voltha_cluster_virtual.png |
| 23 | :alt: VOLTHA Component Diagram |
| 24 | :width: 100% |
| 25 | |
| 26 | VOLTHA Kubernetes kind deployment |
| 27 | |
| 28 | Note that is anyway possible to connect a physical OLT to a virtual cluster, as |
| 29 | long as the OLT is reachable from the ``kind`` host machine. If you need to control |
| 30 | your OLT "in-band" then it's not advised to connect it to a virtual cluster. |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 31 | |
| 32 | Quickstart |
| 33 | ---------- |
| 34 | |
| 35 | Requires: |
| 36 | |
| 37 | - ``docker`` and ``go`` installed on your machine |
Zack Williams | 6ebfe06 | 2020-04-09 16:08:29 -0700 | [diff] [blame] | 38 | - `kind-voltha <https://gerrit.opencord.org/gitweb?p=kind-voltha.git>`_ cloned |
| 39 | on your machine |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 40 | |
| 41 | .. code:: bash |
| 42 | |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 43 | TYPE=minimal WITH_RADIUS=y CONFIG_SADIS=y WITH_BBSIM=y ./voltha up |
Matteo Scandolo | 1f5530b | 2019-12-17 10:12:31 -0800 | [diff] [blame] | 44 | |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 45 | For more information you can visit the :doc:`kind-voltha page <../kind-voltha/README>`. |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 46 | |
| 47 | Developing changes on a virtual pod |
| 48 | ----------------------------------- |
| 49 | |
| 50 | We assume you already have downloaded the git repository you want to modify and |
| 51 | your IDE is correctly set up. |
| 52 | |
| 53 | In this tutorial we are going to use ``voltha-go`` as an example. |
| 54 | |
| 55 | Make the required changes in the ``voltha-go`` repository (the process |
| 56 | is the same for all the VOLTHA repositories) to the code and build the |
| 57 | docker images and push them on your private dockerhub account: |
| 58 | |
| 59 | .. code:: bash |
| 60 | |
| 61 | $ DOCKER_REGISTRY="matteoscandolo/" DOCKER_TAG="dev" make docker-build |
| 62 | |
| 63 | Then push them to your docker hub account: |
| 64 | |
| 65 | .. code:: bash |
| 66 | |
| 67 | $ DOCKER_REGISTRY="matteoscandolo/" DOCKER_TAG="dev" make docker-push |
| 68 | |
| 69 | Deploy your changes on kind-voltha |
| 70 | ---------------------------------- |
| 71 | |
| 72 | Create a copy of the `minimal-values.yaml` file: |
| 73 | |
| 74 | .. code:: bash |
| 75 | |
| 76 | $ cp minimal-values.yaml dev-values.yaml |
| 77 | |
| 78 | And edit that file so that it contains the appropriate values for the images you want to try, |
| 79 | for example uncomment and change these two lines (mind the indentation): |
| 80 | |
| 81 | .. code:: yaml |
| 82 | |
| 83 | images: |
| 84 | ro_core: |
| 85 | repository: matteoscandolo/voltha-ro-core |
| 86 | tag: dev |
| 87 | rw_core: |
| 88 | repository: matteoscandolo/voltha-rw-core |
| 89 | tag: dev |
| 90 | |
| 91 | Then redeploy `kind-voltha` using that the edited value file: |
| 92 | |
| 93 | .. code:: bash |
| 94 | |
| 95 | $ DEPLOY_K8S=no ./voltha down && DEPLOY_K8S=no EXTRA_HELM_FLAGS="-f dev-values.yaml" ./voltha up |