2.4 KiB
2.4 KiB
Installation
1. Yuyu API & Event Monitor
- 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
cd yuyu
- Create virtualenv (Need activated)
virtualenv env --python=python3.8
source env/bin/activate
pip install -r requirements.txt
- 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"]
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
- Run database migration
python manage.py migrate
- Yuyu API installation
./bin/setup_api.sh
systemctl enable yuyu_api
systemctl start yuyu_api
systemctl status yuyu_api
- Yuyu Event Monitor installation
./bin/setup_event_monitor.sh
systemctl enable yuyu_event_monitor
systemctl start yuyu_event_monitor
systemctl status yuyu_event_monitor
- Crontab installation
crontab -e
Add on the end file bellow :
1 0 1 * * /var/yuyu/bin/process_invoice.sh
- Disable virtualenv
Last step for Yuyu API is need disabled virtualenv.
deactivate
2. Yuyu Dashboard
- Clone Repository
cd /var
git clone https://github.com/Yuyu-billing/yuyu_dashboard.git
cd yuyu_dashboard
- Setup Yuyu dashboard
./setup_yuyu.sh
...
Enter horizon location and press ENTER.
example: /var/www/html/horizon
...
- Install Yuyu Dashboard Depencencies
pip3 install -r requirements.txt
- 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"
- Restart Horizon
systemctl restart apache2
- 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.