Pawel Wieczorek | cc7624d | 2019-12-17 15:30:18 +0100 | [diff] [blame] | 1 | ============================================ |
| 2 | ONAP Integration > Bootstrap > Code search |
| 3 | ============================================ |
| 4 | |
| 5 | This directory contains a set of Vagrant scripts that will automatically set up a Hound_ instance |
| 6 | with config generator to index all ONAP code. |
| 7 | |
| 8 | This is intended to show a beginning ONAP developer how to set up and configure an environment that |
| 9 | allows to search through ONAP code repositories quickly. It is not intended to be used as |
| 10 | a production code search solution. |
| 11 | |
| 12 | `Upstream Docker image` has not been used due to lack of project activity. This environment |
| 13 | (together with daemon configuration generator) might be migrated to a new Docker image recipe in |
| 14 | future, though. |
| 15 | |
| 16 | .. _Hound: https://github.com/hound-search/hound |
| 17 | .. _`Upstream Docker image`: https://hub.docker.com/r/etsy/hound |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 18 | |
| 19 | |
| 20 | Prerequisites |
| 21 | ------------- |
| 22 | |
| 23 | Virtualisation provider |
| 24 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 25 | |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 26 | Provided vagrantfile is generic enough that it should work with any Vagrant provider. |
| 27 | It has been tested using default VirtualBox provider and also libvirt_ provider with vagrant-libvirt_ plugin. |
| 28 | Plugin documentation provides detailed `installation instructions`_ that will guide through the process. |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 29 | |
| 30 | .. note:: |
| 31 | Remember to uncomment `deb-src` repositories for `apt-get build-dep` step on Debian/Ubuntu. |
| 32 | |
| 33 | .. _libvirt: https://libvirt.org |
| 34 | .. _vagrant-libvirt: https://github.com/vagrant-libvirt/vagrant-libvirt |
| 35 | .. _`installation instructions`: https://github.com/vagrant-libvirt/vagrant-libvirt#installation |
| 36 | |
| 37 | Virtual machine manager |
| 38 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 39 | |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 40 | Environment has been tested using latest Vagrant_ as of writing this documentation (`v2.2.16`_). Some |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 41 | features (e.g. triggers_) might not be supported on older versions. |
| 42 | |
| 43 | .. _Vagrant: https://www.vagrantup.com/downloads.html |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 44 | .. _`v2.2.16`: https://github.com/hashicorp/vagrant/blob/v2.2.16/CHANGELOG.md |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 45 | .. _triggers: https://www.vagrantup.com/docs/triggers/ |
| 46 | |
| 47 | |
| 48 | Running |
| 49 | ------- |
| 50 | |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 51 | If using vagrant-libvirt provider additional `--provider` flag or setting `VAGRANT_DEFAULT_PROVIDER` environmental |
| 52 | variable might be required in case there are multiple providers available. |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 53 | |
| 54 | .. note:: |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 55 | One of the following commands should be executed depending on the provider you'd like to use. Run it within the |
| 56 | directory where `Vagrantfile` is stored (`integration/bootstrap/codesearch`). |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 57 | |
| 58 | .. code-block:: sh |
mrichomme | efb859d | 2020-03-19 19:02:41 +0100 | [diff] [blame] | 59 | |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 60 | vagrant up --provider=libvirt # to leverage vagrant-libvirt provider |
| 61 | vagrant up # to leverage default VirtualBox provider |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 62 | |
| 63 | This will: |
| 64 | |
| 65 | #. Start and prepare virtual machine |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 66 | #. Generate configuration files |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 67 | #. Run Hound instance as a tmux_ session named `codesearch` |
| 68 | |
Bartek Grzybowski | b698cde | 2021-07-14 10:50:01 +0200 | [diff] [blame^] | 69 | At any time you can reload or stop and later start the box, it's set up to automatically run the hound process. |
| 70 | |
Pawel Wieczorek | 0d63138 | 2020-01-10 17:24:05 +0100 | [diff] [blame] | 71 | .. _tmux: https://github.com/tmux/tmux/wiki |
| 72 | |
| 73 | |
| 74 | Usage |
| 75 | ----- |
| 76 | |
| 77 | Once ready (cloning repositories and building index might initially take some time) code search will |
| 78 | be available at http://localhost:6080 |