aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/README.md
blob: ba334a7d62399df9a9efa50c1c1507e9ce6ac8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Modules for the Moon project

This directory contains all the modules for MoonV4


## Usage

### Prerequist

```bash
sudo apt install python3-dev python3-pip
sudo pip3 install pip --upgrade
sudo apt -y install docker-engine # ([Get Docker](https://docs.docker.com/engine/installation/))
echo 127.0.0.1 messenger db keystone | sudo tee -a /etc/hosts
```

### Install Docker Engine

```bash
sudo apt-get remove docker docker-engine
sudo apt-get install     apt-transport-https     ca-certificates     curl     software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo docker run hello-world
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart
```

## Launch MySql, RabbitMQ, Keystone containers
TODO: put all the containers to `dockerhub`
### moon_mysql:v4.1

### moon_rabbitmq:v4.1

### moon_keystone:v4.1
```bash
docker container run -dti --net moon --hostname keystone  --name keystone  -e DB_HOST=db -e DB_PASSWORD_ROOT=p4sswOrd1 -p 35357:35357 -p 5000:5000 asteroide/keystone_mitaka:latest
```

## Install Orchestrator
### Get the code

```bash
git clone https://git.opnfv.org/moon
cd moon/moonv4
export MOON_HOME=$(pwd)
sudo ln -s $(pwd)/conf /etc/moon
```

### Start Orchestrator
To start the Moon platform, you have to run the Orchestrator.

TODO: put all Python packages to PIP

```bash
cd ${MOON_HOME}/moon_orchestrator
sudo apt install python3-venv
pyvenv tests/venv
. tests/venv/bin/activate
pip3 install -r requirements.txt --upgrade
pip3 install dist/moon_db-0.1.0.tar.gz --upgrade
pip3 install dist/moon_utilities-0.1.0.tar.gz --upgrade
pip3 install .  --upgrade
moon_db_manager upgrade
```

### `/etc/moon/moon.conf`
- edit `dist_dir` variable
- check each `container` variable 

Launch `Moon Orchestrator`
```bash
moon_orchestrator
```

### Tests
In the Python venv 
```bash
pip3 install pytest
cd ${MOON_HOME}/moon_interface/tests/apitests
pytest
```

## Log
### Get some logs
```bash
docker ps
docker logs messenger
docker logs keystone
docker logs moon_router
docker logs moon_interface
```