Skip to content

Commit

Permalink
Merge 8e67326 into 6442433
Browse files Browse the repository at this point in the history
  • Loading branch information
kula1922 committed Jun 26, 2014
2 parents 6442433 + 8e67326 commit f728b6e
Show file tree
Hide file tree
Showing 27 changed files with 940 additions and 197 deletions.
221 changes: 217 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
=====
Pricing module for Ralph
=====

.. image:: https://pypip.in/v/scrooge/badge.png
:target: https://crate.io/packages/scrooge/
:alt: Latest PyPI version
Expand All @@ -25,3 +21,220 @@ Pricing module for Ralph

The pricing module aggregates data from Ralph and from Ralph Assets to generate
reports showing the prices of the servers in inventory per their owners daily.

============
Installation
============
Scrooge contains ralph in requirements because is plugin for ralph. For more information how to configure or install ralph refer to ralph documentation.

Install Scrooge
~~~~~~~~~~~~~~~
There are two way to install scrooge, one of them is simple pip installation and it is easy and pleasant. Installation from sources require download scrooge from github and manually installation them.

Install Scrooge from pip
------------------------
Faster and easier way is install scrooge from pip::

(ralph)$ pip install scrooge

That's it.

Install Scrooge from sources
----------------------------
Also, there is a possible to install scrooge from sources. If you wanna do that, you need to download scrooge from github before.::

(ralph)$ git clone git://github.com/allegro/ralph_pricing.git

Enter to the project folder::

(ralph)$ cd ralph_pricing

and install them::

(ralph)$ pip install -e .

The scrooge requirements (ralph, ralph_assets) will be installed automatically.

Upgrade existing installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For upgrade scrooge you need stop any Ralph processes that is running. Good practice is not upgrading old version but create separated virtualenv and install there everything from the begin but if you need upgrade old version just be sure that everything is stopped.

Upgrade Scrooge from pip
------------------------
If you installed from pip, then you can simply do::

(ralph)$ pip install --upgrade scrooge

When upgrade will be finished, upgrade the static files::

(ralph)$ ralph collectstatic

Upgrade Scrooge from sources
----------------------------
You need to download scrooge from github before.::

(ralph)$ git clone git://github.com/allegro/ralph_pricing.git

Enter to the project folder::

(ralph)$ cd ralph_pricing

and upgrade them::

(ralph)$ pip install --upgrade -e .

at the end you need to upgrade the static files::

(ralph)$ ralph collectstatic

Migrate the database
~~~~~~~~~~~~~~~~~~~~
Some of updates require database migrations. For migrate database just run::

(ralph)$ ralph migrate ralph_pricing

Be sure that you have backup of your database. Some of migrations could migrate any data or create some complicate changes and unwanted for you changes.

Update the settings
~~~~~~~~~~~~~~~~~~~~
Some new features added to Ralph may require additional settings to work
properly. In order to enable them in your settings, follow the instructions in
the :doc:`change log <changes>` for the version you installed.

Testing if it works
~~~~~~~~~~~~~~~~~~~
For be sure that everything work fine, is recommended to run unit tests. For do this just run::

(ralph)$ DJANGO_SETTINGS_PROFILE=test-pricing ralph test ralph_pricing

=============
Configuration
=============

Configuration is available in file settings.py and there you should implement your settings.

PLUGGABLE_APPS <list of strings> - List with available applications for ralph

::

PLUGGABLE_APPS += ['scrooge']

VIRTUAL_VENTURE_NAMES <list of strings> - venture names for virtual devices

::

VIRTUAL_VENTURE_NAMES = ['venture1', 'venture2']

SCROOGE_SENTRY_DSN <string> - Full address with API key to sentry

::

SCROOGE_SENTRY_DSN = 'http://xxxxxx:yyyyyy@sentry/zz'

CURRENCY <string> - This currency will be added to each value on report. It is prefix to cost value.

::

CURRENCY = 'PLN'

HAMSTER_API_URL <string> - Url to hamster API

::

HAMSTER_API_URL = 'http://xxxxxxx/'

RQ_QUEUE_LIST <tuple of strings> - List of queue names

::

RQ_QUEUE_LIST += ('reports', 'reports_pricing')

SSH_NFSEN_CREDENTIALS <dict> - Credentials for servers

::

SSH_NFSEN_CREDENTIALS = {
'xxx.xxx.xxx.xxx': {
'login': 'xxx',
'password': 'xxx',
},
'yyy.yyy.yyy.yyy': {
'login': 'yyy',
'password': 'yyy',
},
}

NFSEN_CHANNELS <list of strings> - Channels like IN or OUT

::

NFSEN_CHANNELS = ['xxx-OUT', 'xxx-IN', 'yyy-OUT', 'yyy-IN']

NFSEN_FILES_PATH <string> - Path to nfsen data files on remote server

::

NFSEN_FILES_PATH = 'xxx/yyy/zzz'

NFSEN_CLASS_ADDRESS <list of strings> - Available class addresses

::

NFSEN_CLASS_ADDRESS = [
'xxx.xxx.xxx.x/yy'
'zzz.zzz.zzz.z/yy'
]

OPENSTACK_USER <string> - User login name to openstack

::

OPENSTACK_USER = 'xxx'

OPENSTACK_PASSWORD <string> - User password for given user name

::

OPENSTACK_PASSWORD = 'yyy'

OPENSTACK_URL <string> - Url to openstack

::

OPENSTACK_URL = 'yyy'

OPENSTACK_REGIONS <list of strings> - Datacenter names

::

OPENSTACK_REGIONS = ['xxx', 'yyy']

OPENSTACK_EXTRA_QUERIES <list of tuple> - Extra queries for openstacp

::

OPENSTACK_EXTRA_QUERIES = [('http://xxx', 'yyy'), ('http://zzz', 'aaa')]

SCALEME_API_URL <string> - Url to scaleme

::

SCALEME_API_URL = 'http://xxxxxxx/'

SPLUNK_HOST <string> - Splunk host name

::

SPLUNK_HOST = 'http://xxxxxxx/'

SPLUNK_USER <string> - Splunk user name

::

SPLUNK_USER = 'xxx'

SPLUNK_PASSWORD <string> - Password for splunk user

::

SPLUNK_PASSWORD = 'yyy'
Loading

0 comments on commit f728b6e

Please sign in to comment.