yuyu_web/docs/installation.md

133 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2023-02-14 01:12:40 +07:00
# Installation
## **1. Yuyu API & Event Monitor**
1. Clone the latest source code and put it on any directory you want. Here i assume you put it on /var
```
cd /var
git clone https://github.com/Yuyu-billing/yuyu.git
2023-02-14 01:12:40 +07:00
cd yuyu
```
2. Create virtualenv (**Need activated**)
```
virtualenv env --python=python3.8
source env/bin/activate
pip install -r requirements.txt
```
3. Update local_settings.py configuration file
```
cp yuyu/local_settings.py.sample yuyu/local_settings.py
vi yuyu/local_settings.py
```
Bellow for configuration :
```
YUYU_NOTIFICATION_URL = "rabbit://openstack:password@127.0.0.1:5672//"
YUYU_NOTIFICATION_TOPICS = ["notifications"]
```
![yuyu](assets/images/email_config.png)
You can get YUYU_NOTIFICATION_URL from neutron.conf, bellow if using kolla-ansible deployment.
```
cat /etc/kolla/neutron-server/neutron.conf | grep transport_url
```
4. Run database migration
```
python manage.py migrate
```
5. Yuyu API installation
```
./bin/setup_api.sh
systemctl enable yuyu_api
systemctl start yuyu_api
systemctl status yuyu_api
```
6. Yuyu Event Monitor installation
```
./bin/setup_event_monitor.sh
systemctl enable yuyu_event_monitor
systemctl start yuyu_event_monitor
systemctl status yuyu_event_monitor
```
7. Crontab installation
```
crontab -e
```
Add on the end file bellow :
```
1 0 1 * * /var/yuyu/bin/process_invoice.sh
```
8. **Disable virtualenv**
Last step for Yuyu API is need disabled virtualenv.
```
deactivate
```
## **2. Yuyu Dashboard**
1. Clone Repository
```
cd /var
git clone https://github.com/Yuyu-billing/yuyu_dashboard.git
2023-02-14 01:12:40 +07:00
cd yuyu_dashboard
```
2. Setup Yuyu dashboard
```
./setup_yuyu.sh
...
Enter horizon location and press ENTER.
example: /var/www/html/horizon
...
```
3. Install Yuyu Dashboard Depencencies
```
pip3 install -r requirements.txt
```
4. Add config settings on horizon local_settings.py
```
vi /var/www/html/horizon/openstack_dashboard/local/local_settings.py
```
```
YUYU_URL="http://yuyu_server_url:8182"
CURRENCIES = ('IDR',)
DEFAULT_CURRENCY = "IDR"
```
For YUYU_URL you can use
```
YUYU_URL="http://127.0.0.1:8182"
```
5. Restart Horizon
```
systemctl restart apache2
```
6. Restart memcached (If dashboard login view not proper)
```
systemctl restart memcached
```
## **Verify Installation**
Access Dashboard, make sure Billing tab available in the navigation pane dashboard, next step need enabled billing & create pricing.