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 | |
| 26 | Environment has been tested using libvirt_ provider with vagrant-libvirt_ plugin. Plugin |
| 27 | documentation provides detailed `installation instructions`_ that will guide through the process. |
| 28 | |
| 29 | .. note:: |
| 30 | Remember to uncomment `deb-src` repositories for `apt-get build-dep` step on Debian/Ubuntu. |
| 31 | |
| 32 | .. _libvirt: https://libvirt.org |
| 33 | .. _vagrant-libvirt: https://github.com/vagrant-libvirt/vagrant-libvirt |
| 34 | .. _`installation instructions`: https://github.com/vagrant-libvirt/vagrant-libvirt#installation |
| 35 | |
| 36 | Virtual machine manager |
| 37 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 38 | |
| 39 | Environment has been tested using latest Vagrant_ as of writing this documentation (`v2.2.6`_). Some |
| 40 | features (e.g. triggers_) might not be supported on older versions. |
| 41 | |
| 42 | .. _Vagrant: https://www.vagrantup.com/downloads.html |
| 43 | .. _`v2.2.6`: https://github.com/hashicorp/vagrant/blob/v2.2.6/CHANGELOG.md#226-october-14-2019 |
| 44 | .. _triggers: https://www.vagrantup.com/docs/triggers/ |
| 45 | |
| 46 | |
| 47 | Running |
| 48 | ------- |
| 49 | |
| 50 | Additional `--provider` flag or setting `VAGRANT_DEFAULT_PROVIDER` environmental variable might be |
| 51 | useful in case there are multiple providers available. |
| 52 | |
| 53 | .. note:: |
| 54 | Following command should be executed within the directory where `Vagrantfile` is stored |
| 55 | (`integration/bootstrap/codesearch`). |
| 56 | |
| 57 | .. code-block:: sh |
| 58 | vagrant up --provider=libvirt |
| 59 | |
| 60 | This will: |
| 61 | |
| 62 | #. Start and prepare virtual machine |
| 63 | #. Generate required authorization and configuration files |
| 64 | #. Run Hound instance as a tmux_ session named `codesearch` |
| 65 | |
| 66 | .. _tmux: https://github.com/tmux/tmux/wiki |
| 67 | |
| 68 | |
| 69 | Usage |
| 70 | ----- |
| 71 | |
| 72 | Once ready (cloning repositories and building index might initially take some time) code search will |
| 73 | be available at http://localhost:6080 |