ood_appkit 0.2.1 → 0.2.2
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/config/clusters.yml +3 -0
- data/lib/ood_appkit/cluster.rb +12 -3
- data/lib/ood_appkit/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: 7833ac972349630dee7639368c8496e808e84543
|
4
|
+
data.tar.gz: 7cf11f0e8808e5dbdc931a8b91ca21f6ac1264b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9edfd5afdd6d2de94aa5ef3020dfa7c544781879b674a756978db3a99e001308626ef42abf369c29a89c43ba8eee980998d914c3713a384459f5cccefc78b705
|
7
|
+
data.tar.gz: 6b985ac77fecc25a1ecb226d9cea4e5ed010204c938eb7730bb7644e4689de508ec5af2d3463c5a02b93e0cf6f5b03edcc5dbc863e53d94bbe2330d7c038984d
|
data/config/clusters.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
v1:
|
2
2
|
oakley:
|
3
|
+
title: 'Oakley'
|
3
4
|
servers:
|
4
5
|
login:
|
5
6
|
type: 'OodAppkit::Server'
|
@@ -24,6 +25,7 @@ v1:
|
|
24
25
|
c: 'Oakley nodes'
|
25
26
|
version: '3'
|
26
27
|
ruby:
|
28
|
+
title: 'Ruby'
|
27
29
|
validators:
|
28
30
|
in_valid_groups:
|
29
31
|
type: 'OodAppkit::Validators::Groups'
|
@@ -53,6 +55,7 @@ v1:
|
|
53
55
|
c: 'Ruby'
|
54
56
|
version: '3'
|
55
57
|
quick:
|
58
|
+
title: 'Quick'
|
56
59
|
hpc_cluster: false
|
57
60
|
servers:
|
58
61
|
resource_mgr:
|
data/lib/ood_appkit/cluster.rb
CHANGED
@@ -6,6 +6,10 @@ module OodAppkit
|
|
6
6
|
# YAML configuration version
|
7
7
|
VERSION = :v1
|
8
8
|
|
9
|
+
# Title of the cluster
|
10
|
+
# @return [String] title of cluster
|
11
|
+
attr_reader :title
|
12
|
+
|
9
13
|
# Hash of validators this cluster validates against
|
10
14
|
# @return [Hash<#valid?>] hash of validators
|
11
15
|
attr_reader :validators
|
@@ -16,18 +20,23 @@ module OodAppkit
|
|
16
20
|
|
17
21
|
# A list of accessible clusters for the currently running user
|
18
22
|
# @param file [String] yaml file with cluster configurations
|
23
|
+
# @param force [Boolean] whether we force invalid clusters to be included as well
|
19
24
|
# @return [Hash<Cluster>] list of clusters user has access to
|
20
|
-
def self.all(file: File.expand_path('../../../config/clusters.yml', __FILE__))
|
25
|
+
def self.all(file: File.expand_path('../../../config/clusters.yml', __FILE__), force: false)
|
21
26
|
parse_config(file).each_with_object({}) do |(k, v), h|
|
22
27
|
c = Cluster.new v
|
23
|
-
h[k] = c if c.valid?
|
28
|
+
h[k] = c if c.valid? || force
|
24
29
|
end
|
25
30
|
end
|
26
31
|
|
32
|
+
# @param title [String] title of cluster
|
27
33
|
# @param validators [Hash] hash of validations that describe the validators
|
28
34
|
# @param servers [Hash] hash of servers with corresponding server info
|
29
35
|
# @param hpc_cluster [Boolean] whether this is an hpc-style cluster
|
30
|
-
def initialize(validators: {}, servers: {}, hpc_cluster: true)
|
36
|
+
def initialize(title:, validators: {}, servers: {}, hpc_cluster: true)
|
37
|
+
# Set title of cluster
|
38
|
+
@title = title
|
39
|
+
|
31
40
|
# Generate hash of validations
|
32
41
|
@validators = validators.each_with_object({}) do |(k, v), h|
|
33
42
|
h[k] = v[:type].constantize.new(v)
|
data/lib/ood_appkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ood_appkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Franz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|