Skip to content

Commit 8e70de2

Browse files
committed
Moving model refactor work
- Updated cartridge manifest files - Simplified descriptor - Switched from mongo gem to use mongoid
1 parent b2c6612 commit 8e70de2

File tree

122 files changed

+5491
-6519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+5491
-6519
lines changed

Rakefile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
require 'rake'
2+
3+
begin
4+
require 'yard'
5+
6+
namespace :doc do
7+
desc 'Create Ruby docs for all components'
8+
task :gen do
9+
doc_dir = File.join(File.dirname(__FILE__), "doc")
10+
FileUtils.rm_rf(doc_dir)
11+
gems = Dir.glob("**/*.gemspec")
12+
gems.each do |gem_file|
13+
gem_src_dir = File.dirname(gem_file)
14+
FileUtils.mkdir_p File.join(doc_dir, gem_src_dir)
15+
16+
args = ['--protected', '--private', '--no-yardopts', "--output-dir #{File.join(doc_dir, gem_src_dir)}"] #, File.join(gem_src_dir, "**/*")
17+
system "cd #{gem_src_dir}; yardoc #{args.join(" ")}\n"
18+
system "yardoc README.md"
19+
end
20+
end
21+
end
22+
rescue LoadError => e
23+
print e.message
24+
# YARD is not available
25+
end

broker/Gemfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ source 'http://rubygems.org'
33
gem 'rails', '~> 3.2.8'
44
gem 'json'
55
gem 'parseconfig', '0.5.2'
6-
gem 'mongo'
76
gem 'xml-simple'
87
gem 'rack'
98
gem 'regin'
109
gem 'open4'
1110
gem 'openshift-origin-controller'
1211
gem 'rest-client'
1312
gem 'systemu'
14-
gem 'bson'
15-
gem 'bson_ext'
13+
gem 'minitest'
14+
gem 'mongoid'
1615

1716
# Load plugin gems.
1817
Dir["/etc/openshift/plugins.d/*.conf"].delete_if{ |x| x.end_with? "-dev.conf" }.map{|x| File.basename(x, ".conf")}.each {|plugin| gem plugin}

broker/config/environment.rb

+26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Load the rails application
22
require File.expand_path('../application', __FILE__)
33

4+
if ENV["COVERAGE"]
5+
require 'simplecov'
6+
SimpleCov.adapters.delete(:root_filter)
7+
SimpleCov.filters.clear
8+
9+
class ProjectFilter < SimpleCov::Filter
10+
def matches?(source_file)
11+
engines = Rails.application.railties.engines.map { |e| e.config.root.to_s }
12+
engines.each do |root_path|
13+
return false if source_file.filename.start_with? root_path
14+
end
15+
return true
16+
end
17+
end
18+
SimpleCov.add_filter ProjectFilter.new(nil)
19+
20+
SimpleCov.start 'rails' do
21+
coverage_dir 'test/coverage/'
22+
command_name ENV["TEST_NAME"] || 'Broker tests'
23+
add_group 'REST API Models', 'app/rest_models'
24+
add_group 'Validators', 'app/validators'
25+
26+
merge_timeout 10000
27+
end
28+
end
29+
430
# Initialize the rails application
531
Broker::Application.initialize!

broker/config/mongoid.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
development:
2+
sessions:
3+
default:
4+
database: openshift_broker_dev
5+
hosts:
6+
- localhost:27017
7+
user: openshift
8+
password: mooo
9+
options:
10+
ssl: false
11+
production:
12+
sessions:
13+
default:
14+
database: openshift_broker_dev
15+
hosts:
16+
- localhost:27017
17+
user: openshift
18+
password: mooo
19+
options:
20+
ssl: false
21+
test:
22+
sessions:
23+
default:
24+
database: openshift_broker_test
25+
hosts:
26+
- localhost:27017
27+
user: openshift
28+
password: mooo
29+
options:
30+
ssl: false

cartridges/openshift-origin-cartridge-10gen-mms-agent-0.1/info/manifest.yml

+9-26
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ Name: 10gen-mms-agent-0.1
22
Display-Name: 10gen Mongo Monitoring Service Agent 0.1
33
Description: "MongoDB Monitoring Service (MMS) instruments MongoDB and provides information about current and historical operational metrics of your system."
44
Version: 1.3.7
5-
License: ""
65
License-Url: https://mms.10gen.com/links/terms-of-service
76
Vendor: 10gen.com
87
Categories:
9-
- cartridge
8+
- embedded
109
- database-support
1110
Website: https://mms.10gen.com/
1211
Help-Topics:
@@ -15,30 +14,14 @@ Cart-Data:
1514
- Key: monitoring_url
1615
Type: cart_data
1716
Description: "10gen-mms-agent-0.1 monitoring URL"
18-
Suggests:
19-
-
2017
Provides:
21-
- "10gen-mms"
22-
Requires:
23-
Conflicts:
24-
Service-Dependencies: mongodb-2.2
25-
Native-Requires:
26-
Architecture: noarch
27-
Reservations:
28-
- MEM >= 100MB
29-
Components:
30-
default:
31-
Service-Dependencies: ["mongodb-2.2"]
32-
Subscribes:
33-
set-mongo-connection-info:
34-
Type: "NET_TCP:db:mongodb"
35-
Required: true
36-
Groups:
37-
default:
38-
Components:
39-
comp1: default
40-
Scaling:
41-
Min: 1
42-
Max: 1
18+
- "10gen-mms-agent-0.1"
19+
Subscribes:
20+
set-mongo-connection-info:
21+
Type: "NET_TCP:db:mongodb"
22+
Required: true
23+
Scaling:
24+
Min: 1
25+
Max: 1
4326
Endpoints:
4427
- PROXY_PORT: 8080

cartridges/openshift-origin-cartridge-cron-1.4/info/manifest.yml

+18-31
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,26 @@ Display-Name: Cron 1.4
55
Description: "The Cron cartridge allows you to run command line programs at scheduled times. Use this for background jobs and periodic processing."
66
License: "ASL 2.0"
77
License-Url: http://www.apache.org/licenses/LICENSE-2.0.txt
8-
Vendor:
9-
Categories:
10-
- cartridge
118
Website: "http://openshift.redhat.com/"
9+
Categories:
10+
- embedded
1211
Help-Topics:
1312
"Getting Started Guide": https://openshift.redhat.com/community/blogs/getting-started-with-cron-jobs-on-openshift
14-
Cart-Data:
15-
Suggests:
16-
17-
Provides: openshift-origin-cartridge-cron
18-
Native-Requires:
19-
- cronie
20-
- crontabs
21-
Profiles:
22-
scheduler-service:
23-
Provides: scheduler-service, cron-service
24-
Components:
25-
executor:
26-
Publishes:
27-
get-job-listing:
28-
Type: "STRING:jobs"
29-
Subscribes:
30-
add-job:
31-
Type: "STRING:job"
32-
remove-job:
33-
Type: "STRING:job"
34-
Groups:
35-
default:
36-
Components:
37-
job-executor: executor
38-
Scaling:
39-
Min: 1
40-
Max: 1
41-
Default-Profile: scheduler-service
13+
Provides:
14+
- cron-1.4
15+
- cron
16+
- scheduler-service
17+
- cron-service
18+
Publishes:
19+
get-job-listing:
20+
Type: "STRING:jobs"
21+
Subscribes:
22+
add-job:
23+
Type: "STRING:job"
24+
remove-job:
25+
Type: "STRING:job"
26+
Scaling:
27+
Min: 1
28+
Max: 1
4229
Endpoints:
4330
- PROXY_PORT: 8080

cartridges/openshift-origin-cartridge-diy-0.1/info/manifest.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ Description: "The Do-It-Yourself (DIY) application type is a blank slate for try
44
Version: 1.0.0
55
License: "ASL 2.0"
66
License-Url: http://www.apache.org/licenses/LICENSE-2.0.txt
7-
Vendor:
87
Categories:
9-
- cartridge
108
- web_framework
119
- experimental
1210
Website:
@@ -43,17 +41,10 @@ Cart-Data:
4341
- Key: OPENSHIFT_GEAR_UUID
4442
Type: environment
4543
Description: "Unique ID which identified the gear. This value changes between gears."
46-
Suggests:
47-
4844
Provides:
49-
- "diy-0.1"
50-
Requires:
51-
Conflicts:
52-
Native-Requires:
53-
Architecture: noarch
45+
- diy-0.1
46+
- diy
5447
Publishes:
55-
get-doc-root:
56-
Type: "FILESYSTEM:doc-root"
5748
publish-http-url:
5849
Type: "NET_TCP:httpd-proxy-info"
5950
publish-gear-endpoint:
@@ -65,8 +56,6 @@ Subscribes:
6556
set-nosql-db-connection-info:
6657
Type: "NET_TCP:nosqldb:connection-info"
6758
Required: false
68-
Reservations:
69-
- MEM >= 10MB
7059
Scaling:
7160
Min: 1
7261
Max: 1

cartridges/openshift-origin-cartridge-haproxy-1.4/info/manifest.yml

+23-31
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,30 @@ License:
66
License-Url:
77
Vendor: http://haproxy.1wt.eu/
88
Categories:
9-
- cartridge
109
- web_proxy
11-
- git_host
1210
- scales
13-
Website:
14-
Help-Topics:
15-
Cart-Data:
16-
Suggests:
17-
11+
- embedded
12+
Website: http://haproxy.1wt.eu/
1813
Provides:
19-
- "haproxy"
14+
- haproxy-1.4
15+
- haproxy
2016
- "haproxy(version) = 1.4"
21-
Requires:
22-
Conflicts:
23-
Native-Requires:
24-
- "haproxy >= 1.4"
25-
Architecture: noarch
26-
Publishes:
27-
get-balancer-connection-info:
28-
Type: "NET_TCP:http:http"
29-
Subscribes:
30-
haproxy-colocation-hack:
31-
Type: "FILESYSTEM:haproxy:colocate-hack"
32-
set-proxy:
33-
Type: "NET_TCP:httpd-proxy-info"
34-
Required : false
35-
set-gear-endpoints:
36-
Type: "NET_TCP:gear-endpoint-info"
37-
Required: false
38-
set-db-connection-info:
39-
Type: "NET_TCP:db:connection-info"
40-
Required: false
41-
Scaling:
42-
Min: 1
43-
Max: 1
17+
- web_proxy
18+
Components:
19+
web_proxy:
20+
Publishes:
21+
get-balancer-connection-info:
22+
Type: "NET_TCP:http:http"
23+
Subscribes:
24+
set-proxy:
25+
Type: "NET_TCP:httpd-proxy-info"
26+
Required : false
27+
set-gear-endpoints:
28+
Type: "NET_TCP:gear-endpoint-info"
29+
Required: false
30+
set-db-connection-info:
31+
Type: "NET_TCP:db:connection-info"
32+
Required: false
33+
Scaling:
34+
Min: 1
35+
Max: 1

0 commit comments

Comments
 (0)