|
|
# Build JoX
|
|
|
JoX comes with an automated build script.Note that the steps detailed here are tested with Ubuntu 18.04, Juju version 2.5.1 (Juju version 2+ recommended).
|
|
|
In order to use JoX, please follow the next steps:
|
|
|
JoX comes with an automated build script. Note that the steps detailed here are tested with Ubuntu 18.04, Juju version 2.5.1 (Juju version 2+ recommended).
|
|
|
In the following, we refer to `DIR_JOX` to the directory of JoX project. In order to use JoX, please follow the following steps:
|
|
|
|
|
|
# 1. Clone stable source
|
|
|
firstly, install `git`:
|
|
|
Firstly, you need to install `git` in order to get the JoX project:
|
|
|
```bash
|
|
|
$ sudo apt install git -y
|
|
|
```
|
|
|
and then clone JoX:
|
|
|
and then you can clone JoX:
|
|
|
```bash
|
|
|
$ git clone -b develop https://gitlab.eurecom.fr/mosaic5g/jox.git
|
|
|
```
|
|
|
Or
|
|
|
```bash
|
|
|
$ git clone -b develop https://gitlab.eurecom.fr/mosaic5g/jox.git OR
|
|
|
$ git clone -b develop git@gitlab.eurecom.fr:mosaic5g/jox.git
|
|
|
```
|
|
|
|
... | ... | @@ -24,12 +28,12 @@ This will build all the dependencies of JoX. For more options, |
|
|
```bash
|
|
|
$ ./build_jox.sh -h # to print help
|
|
|
$ ./build_jox.sh -i # to build JoX
|
|
|
$ ./build_jox.sh -x # to install ubuntu-xenial image necessary for kvm
|
|
|
$ ./build_jox.sh -x # to download ubuntu-xenial cloud images necessary for kvm
|
|
|
```
|
|
|
|
|
|
|
|
|
When building JoX, at the end of the build you should see the following message:
|
|
|
```bash
|
|
|
When building JoX, and at the end of the build, you should see the following message:
|
|
|
```
|
|
|
###### JoX built successfully !!! ######
|
|
|
Creating cache dir in /mnt/jox_store
|
|
|
JoX store was not mounted, Mounting ...
|
... | ... | @@ -37,7 +41,7 @@ Mount success |
|
|
```
|
|
|
|
|
|
# 3. Fetch cloud image for kvm
|
|
|
If you plan to use kvm (Optional), which is the case for some juju charms like oai-spgw, you should firstly fetch the Ubuntu cloud image(Xenial) as follows:
|
|
|
If you plan to use kvm (Optional), which is the case for some juju charms like oai-spgw, you should firstly fetch the ubuntu cloud image(xenial) as follows:
|
|
|
|
|
|
```bash
|
|
|
./build_jox.sh -x
|
... | ... | @@ -45,7 +49,7 @@ If you plan to use kvm (Optional), which is the case for some juju charms like o |
|
|
|
|
|
|
|
|
# 4. Prepare lxd for juju
|
|
|
Before using juju with lxd, you should firstly configure it, please refer to [https://docs.jujucharms.com](https://docs.jujucharms.com) for more details:
|
|
|
Before using juju with lxd, you should firstly configure it (please refer to [https://docs.jujucharms.com](https://docs.jujucharms.com) for more details):
|
|
|
```bash
|
|
|
sudo lxd init
|
|
|
```
|
... | ... | @@ -73,7 +77,7 @@ $ sudo adduser $USER lxd |
|
|
$ newgrp lxd
|
|
|
```
|
|
|
# 5. Prepare juju for JoX
|
|
|
In order to use JoX, you should create the juju controller that you can use it later in JoX. TO list all the clouds configured with juju, please type:
|
|
|
In order to use JoX, you should create the juju controller that you can use it later in JoX. To list all the clouds configured with juju, please type:
|
|
|
```bash
|
|
|
$ juju clouds
|
|
|
```
|
... | ... | @@ -82,11 +86,11 @@ In order to create juju controller, you can use: |
|
|
$ juju bootstrap "cloud name" "name of your juju controller"
|
|
|
```
|
|
|
|
|
|
In this documentation we use localhost (of lxd type) as cloud.
|
|
|
In this documentation we use *localhost* (of lxd type) as cloud.
|
|
|
```bash
|
|
|
$ juju bootstrap localhost localhost
|
|
|
```
|
|
|
where `localhost` is the name of your controller. After that add your juju controller to the list of
|
|
|
where the second `localhost` in the previous command is the name of your controller. After that add your juju controller to the list of
|
|
|
*"clouds-list"* that is in the file ``DIR_JOX/common/config/jox_config.json``. If the name of your juju controller is
|
|
|
*localhost* then, you the *"clouds-list"* you can add it like
|
|
|
```
|
... | ... | @@ -98,11 +102,10 @@ where `localhost` is the name of your controller. After that add your juju contr |
|
|
}
|
|
|
],
|
|
|
```
|
|
|
# 7. Add ssh-key to be used for kvm
|
|
|
If you intend to use kvm, you need to configure jox for the right ssh-key, user, and password.
|
|
|
For that, go the *"ssh-config"* in jox configuration file that is located at
|
|
|
``DIR_JOX/common/config/jox_config.json``
|
|
|
where *"ssh-key-directory"* is the full path to your ssh-key that you will use for kvm machines
|
|
|
# 7. Add ssh-key to be used for kvm and lxd (when adding lxd containers manually)
|
|
|
If you intend to use kvm or use JoX in manual mode, you need to configure jox for the right ssh-key, user, and password.
|
|
|
For that, go to *"ssh-config"* in jox configuration file that is located at
|
|
|
``DIR_JOX/common/config/jox_config.json``, and change the parameters accordingly, where *"ssh-key-directory"* is the full path to your ssh-key that you will use for kvm machines
|
|
|
|
|
|
## Note:
|
|
|
*If you would like run jox, nbi, and elasticsearch on
|
... | ... | @@ -112,19 +115,16 @@ change the host and the port for every component accordingly* |
|
|
|
|
|
|
|
|
|
|
|
# 6. Run rabbitMQ (RBMQ)
|
|
|
JoX uses RabbitMq (RBMQ) as message bus between jox and nbi modules. You can run RBMQ by typing the following:
|
|
|
```bash
|
|
|
$ sudo service rabbitmq-server start
|
|
|
```
|
|
|
# 6. Run rabbitMQ (RBMQ) and Elasticsearch (ES)
|
|
|
JoX uses RabbitMq (RBMQ) as message bus between jox and nbi modules. RBMQ will be run automatically when running jox and nbi.
|
|
|
|
|
|
# 7. Run Elasticsearch (ES)
|
|
|
For monitoring, JoX uses elasticsearch where monitoring information are pushed automatically from juju models to ES. in order to use ES with JoX, run ES by the following:
|
|
|
Concerning ES, we use docker to run it, and thus you can use the folllowing to run ES:
|
|
|
You can run RBMQ by typing the following:
|
|
|
```bash
|
|
|
$ sudo -i service elasticsearch start
|
|
|
$ sudo docker run -itd -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.6.2
|
|
|
```
|
|
|
|
|
|
# 8. Start JoX and nbi
|
|
|
# 8. Start jox and nbi
|
|
|
At this stage, there is nothing to do other than just run jox and nbi.
|
|
|
For that, go to jox directory *DIR_JOX* and then in two different
|
|
|
terminals type ``./jox.sh`` in the first and ``./nbi.sh`` in the second
|
... | ... | |