oneacct-export 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +69 -34
- data/config/conf.yml +28 -28
- data/config/sidekiq.yml +2 -2
- data/lib/oneacct_exporter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 524b14a0f4c51ba085b4f104054dcce81070c6f5
|
4
|
+
data.tar.gz: cd2c0e62fb62505fd47dd6eecfc2cae241421353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1339fba2bb944512220a90c31ad71d132c11bd286b2252de0117e50d1989ecf0f669e37bc7f0f23a3a02be2e4bb5ac421e45fa2fcb5d06aef0058ebb77b8cc34
|
7
|
+
data.tar.gz: 51102cc765d368c534240c974493f0323edb44f3450e9c8063bcdd43bcea80ac9ea232583debd1a1f0213008d93dec01698dc88ba254f91883cabcf23a4ab7a6
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# OneacctExport
|
2
2
|
Exporting OpenNebula accounting data.
|
3
3
|
|
4
|
-
[](http://travis-ci.org/EGI-FCTF/oneacct_export)
|
5
|
+
[](https://gemnasium.com/EGI-FCTF/oneacct_export)
|
6
6
|
[](https://badge.fury.io/rb/oneacct-export)
|
7
|
-
[](https://codeclimate.com/github/EGI-FCTF/oneacct_export)
|
8
8
|
|
9
9
|
|
10
10
|
##Requirements
|
@@ -15,8 +15,11 @@ Exporting OpenNebula accounting data.
|
|
15
15
|
|
16
16
|
##Installation
|
17
17
|
###From distribution specific packages
|
18
|
-
Distribution specific packages can be created with
|
19
|
-
|
18
|
+
Distribution specific packages can be created with
|
19
|
+
[omnibus packaging for OneacctExport](https://github.com/EGI-FCTF/omnibus-oneacct-export).
|
20
|
+
When installing via packages you don't have to install neither ruby
|
21
|
+
nor rubygems. Packages contain embedded ruby and all the necessary gems
|
22
|
+
and libraries witch will not effect your system ruby, gems and libraries.
|
20
23
|
|
21
24
|
Currently supported distributions:
|
22
25
|
|
@@ -35,14 +38,15 @@ gem install oneacct-export
|
|
35
38
|
```
|
36
39
|
|
37
40
|
###From source (dev)
|
38
|
-
**Installation from source should never be your first choice! Especially, if you are not
|
41
|
+
**Installation from source should never be your first choice! Especially, if you are not
|
42
|
+
familiar with RVM, Bundler, Rake and other dev tools for Ruby!**
|
39
43
|
|
40
44
|
**However, if you wish to contribute to our project, this is the right way to start.**
|
41
45
|
|
42
46
|
To build and install the bleeding edge version from master
|
43
47
|
|
44
48
|
```bash
|
45
|
-
git clone git://github.com/
|
49
|
+
git clone git://github.com/EGI-FCTF/oneacct_export.git
|
46
50
|
cd oneacct_export
|
47
51
|
gem install bundler
|
48
52
|
bundle install
|
@@ -50,50 +54,81 @@ bundle exec rake spec
|
|
50
54
|
rake install
|
51
55
|
```
|
52
56
|
##Configuration
|
57
|
+
###Create a new user account
|
58
|
+
Create or use an existing `apel` user account which will be used to run
|
59
|
+
the export process. This account must be the same as the user account
|
60
|
+
used by the APEL SSM client.
|
61
|
+
|
53
62
|
###Create a configuration file for OneacctExport
|
54
|
-
Configuration file can be read by OneacctExport from these
|
55
|
-
|
56
|
-
|
57
|
-
*
|
58
|
-
*
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
+
Configuration file can be read by OneacctExport from these
|
64
|
+
three locations:
|
65
|
+
|
66
|
+
* `~/.oneacct-export/conf.yml`
|
67
|
+
* `/etc/oneacct-export/conf.yml`
|
68
|
+
* `PATH_TO_GEM_DIR/config/conf.yml`
|
69
|
+
|
70
|
+
The example configuration file can be found at the last location
|
71
|
+
`PATH_TO_GEM_DIR/config/conf.yml`. When editing a configuration
|
72
|
+
file you have to follow the division into three environments: `production`,
|
73
|
+
`development` and `test`. All the configuration options are described
|
74
|
+
in the example configuration file.
|
75
|
+
|
63
76
|
###Create a configuration file for Sidekiq
|
64
|
-
Sidekiq configuration file can be placed anywhere you want since you will provide
|
77
|
+
Sidekiq configuration file can be placed anywhere you want since you will provide
|
78
|
+
path to the configuration later during the Sidekiq start. How the Sidekiq
|
79
|
+
configuration should look like and what options you can use
|
65
80
|
can be found on its [wiki page](https://github.com/mperham/sidekiq/wiki/Advanced-Options).
|
66
|
-
|
67
|
-
|
68
|
-
|
81
|
+
An example is provided in `PATH_TO_GEM_DIR/config/sidekiq.yml`.
|
82
|
+
|
83
|
+
The important thing is to set the same queue name in both
|
84
|
+
OneacctExport and Sidekiq configuration files. OneacctExport
|
85
|
+
is currently supporting adding jobs to only one queue.
|
86
|
+
|
87
|
+
###Create required directories
|
88
|
+
```bash
|
89
|
+
mkdir -p /var/run/oneacct-export
|
90
|
+
chown apel:apel /var/run/oneacct-export
|
91
|
+
|
92
|
+
mkdir -p /var/log/oneacct-export
|
93
|
+
chown apel:apel /var/log/oneacct-export
|
94
|
+
```
|
95
|
+
|
69
96
|
###Configure RPC connection
|
70
97
|
RPC connection for OpenNebula can be configured in two ways:
|
71
98
|
|
72
99
|
* Via OneacctExport configuration file, option xml_rpc and its suboptions
|
73
|
-
* Via
|
74
|
-
|
75
|
-
System environment variable ONE_AUTH contains path to the file containing
|
76
|
-
|
77
|
-
|
78
|
-
|
100
|
+
* Via OpenNebula configuration mechanism:
|
101
|
+
|
102
|
+
System environment variable `ONE_AUTH` contains path to the file containing
|
103
|
+
string in format `username:password` to authenticate against OpenNebula.
|
104
|
+
If the variable is empty, default file location is `~/.one/one_auth`.
|
105
|
+
|
106
|
+
System environment variable `ONE_XMLRPC` contains URL of OpenNebula RPC
|
107
|
+
gate. If empty, the same information can be stored in `~/.one/one_endpoint`.
|
108
|
+
|
79
109
|
###Set Rails environment variable according to your environment
|
80
|
-
You have to set system environment variable RAILS_ENV to one of the
|
110
|
+
You have to set system environment variable `RAILS_ENV` to one of the
|
111
|
+
values production, development or test. OneacctExport is not a Rails
|
112
|
+
application but we chose the Rails variable for easier possible integration in
|
81
113
|
the future.
|
82
114
|
|
83
115
|
##Usage
|
84
116
|
|
85
|
-
**Both
|
117
|
+
**Both OpenNebula and Redis server must be running prior the next steps.**
|
86
118
|
|
87
119
|
###Start sidekiq
|
88
|
-
First you have to start Sidekiq so it can run the jobs from the queue. Since
|
120
|
+
First you have to start Sidekiq so it can run the jobs from the queue. Since
|
121
|
+
OneacctExport is not a Rails application Sidekiq has to be started with
|
122
|
+
OneacctExport's worker class as an argument. For example:
|
89
123
|
|
90
124
|
```bash
|
91
|
-
sidekiq -r
|
125
|
+
sidekiq -r $PATH_TO_GEM_DIR/lib/one_worker.rb -C $PATH_TO_GEM_DIR/config/sidekiq.yml
|
92
126
|
```
|
93
127
|
|
94
128
|
###Start OneacctExport
|
95
129
|
|
96
|
-
OneacctExport is run with executable `oneacct-export`. For a list of all
|
130
|
+
OneacctExport is run with executable `oneacct-export`. For a list of all
|
131
|
+
available options run `oneacct-export -h`:
|
97
132
|
|
98
133
|
```
|
99
134
|
$ oneacct-export -h
|
@@ -115,13 +150,13 @@ Usage oneacct-export [options]
|
|
115
150
|
```
|
116
151
|
|
117
152
|
##Code Documentation
|
118
|
-
[Code Documentation for OneacctExport by YARD](http://rubydoc.info/github/
|
153
|
+
[Code Documentation for OneacctExport by YARD](http://rubydoc.info/github/EGI-FCTF/oneacct_export/)
|
119
154
|
|
120
155
|
##Continuous integration
|
121
|
-
[Continuous integration for OneacctExport by Travis-CI](http://travis-ci.org/
|
156
|
+
[Continuous integration for OneacctExport by Travis-CI](http://travis-ci.org/EGI-FCTF/oneacct_export/)
|
122
157
|
|
123
158
|
## Contributing
|
124
|
-
1. Fork it ( https://github.com/
|
159
|
+
1. Fork it ( https://github.com/EGI-FCTF/oneacct_export/fork )
|
125
160
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
126
161
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
127
162
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/config/conf.yml
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
|
2
|
-
# site_name
|
3
|
-
# cloud_type
|
4
|
-
# endpoint
|
5
|
-
# output -> output_dir
|
6
|
-
# output -> output_type
|
7
|
-
# sidekiq -> queue
|
1
|
+
---
|
8
2
|
defaults: &defaults
|
9
|
-
site_name:
|
10
|
-
cloud_type: OpenNebula
|
11
|
-
endpoint:
|
3
|
+
site_name: Undefined # Usually a short provider name, e.g. CESNET
|
4
|
+
cloud_type: OpenNebula # CMF type, only OpenNebula is supported
|
5
|
+
endpoint: https://occi.localhost.com:11443/ # URL of your OCCI endpoint, e.g. https://fqdn.example.com:11443/
|
12
6
|
output:
|
13
|
-
output_dir:
|
14
|
-
output_type: apel-0.2 #Format of outgoing messages. apel-0.2 is currently the only option
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
#
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
# redis
|
26
|
-
# namespace: oneacct_export
|
27
|
-
# url: redis://localhost:6379 #URL of redis server, defaults to redis://localhost:6379.
|
28
|
-
# password: password #Password to access redis server if needed.
|
7
|
+
output_dir: /var/spool/apel/outgoing/00000000 # Directory for outgoing messages
|
8
|
+
output_type: apel-0.2 # Format of outgoing messages. apel-0.2 is currently the only option
|
9
|
+
num_of_vms_per_file: 500 # Maximum number of virtual machine records per one output file
|
10
|
+
logging:
|
11
|
+
log_type: file # Two options: file, syslog. Defaults to stdout
|
12
|
+
log_file: /var/log/oneacct-export/oneacct-export.log # Used when type file selected
|
13
|
+
xml_rpc:
|
14
|
+
secret: oneadmin:opennebula # If not specified looking for secret in ONE_AUTH and ~/.one/one_auth
|
15
|
+
endpoint: http://localhost:2633/RPC2 # Defaults to content of ONE_XMLRPC or content of ~/.one/one_endpoint or http://localhost:2633/RPC2
|
16
|
+
redis:
|
17
|
+
namespace: oneacct_export # Namespace used by redis for sidekiq jobs
|
18
|
+
url: redis://localhost:6379 # URL of redis server, defaults to redis://localhost:6379
|
19
|
+
password: # Password to access redis server if needed
|
29
20
|
sidekiq:
|
30
|
-
queue: oneacct_export
|
21
|
+
queue: oneacct_export # Name of the redis queue used by sidekiq, must match sidekiq.yml configuration
|
22
|
+
|
23
|
+
###############################################
|
24
|
+
####### DO NOT EDIT AFTER THIS POINT ########
|
25
|
+
###############################################
|
26
|
+
|
31
27
|
production:
|
32
28
|
<<: *defaults
|
29
|
+
|
30
|
+
|
33
31
|
development:
|
34
32
|
<<: *defaults
|
33
|
+
|
34
|
+
|
35
35
|
test:
|
36
36
|
site_name: <placeholder>
|
37
37
|
cloud_type: <placeholder>
|
38
38
|
endpoint: <placeholder>
|
39
39
|
output:
|
40
|
-
output_dir: <placeholder>
|
40
|
+
output_dir: <placeholder>
|
41
41
|
output_type: <placeholder>
|
42
42
|
num_of_vms_per_file: <placeholder>
|
43
43
|
logging:
|
data/config/sidekiq.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneacct-export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Kimle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|