yuyu_web/docs/installation.md
2023-09-15 15:50:24 +07:00

2.4 KiB

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
cd yuyu
  1. Create virtualenv (Need activated)
virtualenv env --python=python3.8
source env/bin/activate
pip install -r requirements.txt
  1. 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

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
  1. Run database migration
python manage.py migrate
  1. Yuyu API installation
./bin/setup_api.sh
systemctl enable yuyu_api
systemctl start yuyu_api
systemctl status yuyu_api
  1. Yuyu Event Monitor installation
./bin/setup_event_monitor.sh
systemctl enable yuyu_event_monitor
systemctl start yuyu_event_monitor
systemctl status yuyu_event_monitor
  1. Crontab installation
crontab -e

Add on the end file bellow :

1 0 1 * * /var/yuyu/bin/process_invoice.sh
  1. 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
cd yuyu_dashboard
  1. Setup Yuyu dashboard
./setup_yuyu.sh

...
Enter horizon location and press ENTER.
example: /var/www/html/horizon
...
  1. Install Yuyu Dashboard Depencencies
pip3 install -r requirements.txt
  1. 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"
  1. Restart Horizon
systemctl restart apache2
  1. 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.