ood_appkit 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39b8d7a85e8c3c1493bf2ce9312efe948b4fc2ee
4
- data.tar.gz: 6b88fe091a61ac648c19257e6d6b6971706fdec8
3
+ metadata.gz: 58cb8f795dbc430bde09b26339cb5e907189fdc1
4
+ data.tar.gz: 291e7f60338fef29a2b9680042032190dfae5f97
5
5
  SHA512:
6
- metadata.gz: 27295db64c6f2845ce43e998d228102c02a872dd9f9fcc1540f6cb591eca728f3de40a950be5244e7d3798bab1321e6552f2d235475a6a3e7e9c071f92b9059e
7
- data.tar.gz: ce7771692a67c9fa0ddbcf71ae8bbde584b2e19ce9f99538ca65b05ad678d0a65870e8a3c114e0007965f8a95ef453a019302c87baeb2dc962c89958732e4fd1
6
+ metadata.gz: bb16fdb627591e06ff26cb38745bd2456b7f6553db95d9a1de3d5906324ac30646dfe3a5529021f61f27383c9f7e0c011580a222cd76d9b4920c0885c6c28cc2
7
+ data.tar.gz: b79ce930bf12d7fdfb72e7dde0f3a224c4504a7741e1141be8b27a90c4fd69a71e6c89891cdc18309f0a6b9760209d4bd1a28f7d71813a597186ba376c88e4ce
data/README.md CHANGED
@@ -112,6 +112,35 @@ OodAppkit.configure do |config|
112
112
  end
113
113
  ```
114
114
 
115
+ #### File Editor App
116
+
117
+ ```erb
118
+ <%# Link to the Editor app %>
119
+ <%= link_to OodAppkit.editor.title, OodAppkit.editor.url.to_s %>
120
+
121
+ <%# Link to open file editor app to edit specific file %>
122
+ <%= link_to "Edit /path/to/file", OodAppkit.editor.edit(path: "/path/to/file").to_s %>
123
+ <%= link_to "Edit /path/to/file", OodAppkit.editor.edit(path: Pathname.new("/path/to/file")).to_s %>
124
+ ```
125
+
126
+ You can change the options using environment variables:
127
+
128
+ ```bash
129
+ OOD_EDITOR_URL='/pun/sys/file-editor'
130
+ OOD_EDITOR_TITLE='EDITOR'
131
+ ```
132
+
133
+ Or by modifying the configuration in an initializer:
134
+
135
+ ```ruby
136
+ # config/initializers/ood_appkit.rb
137
+
138
+ OodAppkit.configure do |config|
139
+ # Defaults
140
+ config.editor = OodAppkit::EditorUrl.new title: 'Editor', base_url: '/pun/sys/file-editor'
141
+ end
142
+ ```
143
+
115
144
  #### Shell App
116
145
 
117
146
  ```erb
@@ -375,7 +404,7 @@ In production, a single log will look like:
375
404
  ```
376
405
 
377
406
 
378
- ## Branding Features
407
+ ### Branding Features
379
408
 
380
409
  To take advantage of branding features you must import it in your stylesheet:
381
410
 
@@ -417,6 +446,123 @@ the tree like style of the app in the navbar. It is used as such:
417
446
  Note that you must include `ood-appkit` as a class in the `nav` tag. The
418
447
  breadcrumbs style will resemble the `navbar-brand` style.
419
448
 
449
+ ### Cluster Information
450
+
451
+ A hash of available clusters is accessible from this gem through:
452
+
453
+ ```ruby
454
+ # Hash of all available clusters
455
+ OodAppkit.clusters.all
456
+ #=> {
457
+ # cluster1: <OodAppkit::Cluster ...>,
458
+ # cluster2: <OodAppkit::Cluster ...>,
459
+ # ...
460
+ # }
461
+
462
+ # Hash of all available High Performance Computing (hpc) clusters
463
+ OodAppkit.clusters.hpc
464
+ #=> {
465
+ # cluster1: <OodAppkit::Cluster ...>,
466
+ # cluster2: <OodAppkit::Cluster ...>,
467
+ # ...
468
+ # }
469
+
470
+ # Hash of all available Low Performance Computing (hpc) clusters
471
+ # NB: A low performance computing cluster expects jobs that request a single
472
+ # core and use minimal resources (e.g., a desktop for file browsing/editing,
473
+ # a web server that submits jobs to an HPC cluster, visualization software)
474
+ OodAppkit.clusters.lpc
475
+ #=> {
476
+ # cluster3: <OodAppkit::Cluster ...>,
477
+ # cluster4: <OodAppkit::Cluster ...>,
478
+ # ...
479
+ # }
480
+ ```
481
+
482
+ Each cluster object will have servers that the developer can communicate with
483
+ or link to:
484
+
485
+ ```ruby
486
+ # Choose cluster from available list
487
+ my_cluster = OodAppkit.clusters.hpc[:cluster1]
488
+
489
+ # Check if it has a login server
490
+ my_cluster.login_server?
491
+ #=> true
492
+
493
+ # View all available servers
494
+ my_cluster.servers
495
+ #=> {
496
+ # login: <OodAppkit::Server ...>,
497
+ # resource_mgr: <OodAppkit::Servers::Torque ...>,
498
+ # scheduler: <OodAppkit::Servers::Moab ...>,
499
+ # ...
500
+ # }
501
+
502
+ # Choose a particular server
503
+ login_server = my_cluster.login_server
504
+ ```
505
+
506
+ Depending on the type of server chosen, different helper methods will be
507
+ available to the developer. For all servers the `host` will be available:
508
+
509
+ ```ruby
510
+ # Choose a particular server
511
+ login_server = my_cluster.login_server
512
+
513
+ # Get host for this server
514
+ login_server.host
515
+ #=> "my_cluster.hpc_center.edu"
516
+ ```
517
+
518
+ The Torque/Moab servers will also supply information for the clients used to
519
+ communicate with the servers
520
+
521
+ ```ruby
522
+ # Get the Resource Manager server (known to be Torque at your HPC center)
523
+ torque_server = my_cluster.resource_mgr_server
524
+
525
+ # Get the path to the client library
526
+ torque_server.lib.to_s
527
+ #=> "/usr/local/torque/x.x.x/lib"
528
+
529
+ # Get the path to the client binaries
530
+ torque_server.bin.to_s
531
+ #=> "/usr/local/torque/x.x.x/bin"
532
+ ```
533
+
534
+ Web servers will have a URI method to access the server
535
+
536
+ ```ruby
537
+ # Get the Ganglia web server
538
+ ganglia_server = my_cluster.ganglia_server
539
+
540
+ # Get URI used to access this web server
541
+ ganglia_server.uri.to_s
542
+ #=> "https://www.ganglia.com/gweb/graph.php?c=MyCluster"
543
+
544
+ # To add query values as options for the server
545
+ ganglia_server.merge_query_values(g: 'cpu_report').to_s
546
+ #=> "https://www.ganglia.com/gweb/graph.php?c=MyCluster&g=cpu_report"
547
+ ```
548
+
549
+ The hash of clusters generated by OodAppkit can be modified by supplying a
550
+ different config file through the environment variable `OOD_CLUSTERS`
551
+
552
+ ```
553
+ OOD_CLUSTERS="/path/to/my/config.yml"
554
+ ```
555
+
556
+ or by modifying the configuration in an initializer
557
+
558
+ ```ruby
559
+ # config/initializers/ood_appkit.rb
560
+
561
+ OodAppkit.configure do |config|
562
+ config.clusters.all = OodAppkit::Cluster.all(file: "/path/to/my/config.yml")
563
+ end
564
+ ```
565
+
420
566
  ## Develop
421
567
 
422
568
  Generated using:
@@ -0,0 +1,71 @@
1
+ v1:
2
+ oakley:
3
+ servers:
4
+ login:
5
+ type: 'OodAppkit::Server'
6
+ host: 'oakley.osc.edu'
7
+ resource_mgr:
8
+ type: 'OodAppkit::Servers::Torque'
9
+ host: 'oak-batch.osc.edu'
10
+ prefix: '/usr/local/torque/5.1.1-1_fba25d92'
11
+ version: '5.1.1'
12
+ scheduler:
13
+ type: 'OodAppkit::Servers::Moab'
14
+ host: 'ruby-batch.osc.edu'
15
+ prefix: '/usr/local/moab/8.1.1.2-2015080516-eb28ad0-el6'
16
+ version: '8.1.1'
17
+ moabhomedir: '/var/spool/batch/moab'
18
+ ganglia:
19
+ type: 'OodAppkit::Servers::Ganglia'
20
+ host: 'cts05.osc.edu'
21
+ scheme: 'https'
22
+ path: '/gweb/graph.php'
23
+ query_values:
24
+ c: 'Oakley nodes'
25
+ version: '3'
26
+ ruby:
27
+ validators:
28
+ in_valid_groups:
29
+ type: 'OodAppkit::Validators::Groups'
30
+ groups:
31
+ - 'ruby'
32
+ servers:
33
+ login:
34
+ type: 'OodAppkit::Server'
35
+ host: 'ruby.osc.edu'
36
+ resource_mgr:
37
+ type: 'OodAppkit::Servers::Torque'
38
+ host: 'ruby-batch.osc.edu'
39
+ prefix: '/usr/local/torque/5.1.1-1_fba25d92'
40
+ version: '5.1.1'
41
+ scheduler:
42
+ type: 'OodAppkit::Servers::Moab'
43
+ host: 'ruby-batch.osc.edu'
44
+ prefix: '/usr/local/moab/8.1.1.2-2015080516-eb28ad0-el6'
45
+ version: '8.1.1'
46
+ moabhomedir: '/var/spool/batch/moab'
47
+ ganglia:
48
+ type: 'OodAppkit::Servers::Ganglia'
49
+ host: 'cts05.osc.edu'
50
+ scheme: 'https'
51
+ path: '/gweb/graph.php'
52
+ query_values:
53
+ c: 'Ruby'
54
+ version: '3'
55
+ quick:
56
+ hpc_cluster: false
57
+ servers:
58
+ resource_mgr:
59
+ type: 'OodAppkit::Servers::Torque'
60
+ host: 'quick-batch.osc.edu'
61
+ prefix: '/usr/local/torque/5.1.1-1_fba25d92'
62
+ version: '5.1.1'
63
+ sub_cluster:
64
+ - 'ruby'
65
+ - 'oakley'
66
+ scheduler:
67
+ type: 'OodAppkit::Servers::Moab'
68
+ host: 'quick-batch.osc.edu'
69
+ prefix: '/usr/local/moab/8.1.1.2-2015080516-eb28ad0-el6'
70
+ version: '8.1.1'
71
+ moabhomedir: '/var/spool/batch/moab'
@@ -0,0 +1,87 @@
1
+ require 'yaml'
2
+
3
+ module OodAppkit
4
+ # An object that describes a given cluster of nodes used by an HPC center
5
+ class Cluster
6
+ # YAML configuration version
7
+ VERSION = :v1
8
+
9
+ # Hash of validators this cluster validates against
10
+ # @return [Hash<#valid?>] hash of validators
11
+ attr_reader :validators
12
+
13
+ # Hash of servers this cluster supports
14
+ # @return [Hash<Server>] hash of servers
15
+ attr_reader :servers
16
+
17
+ # A list of accessible clusters for the currently running user
18
+ # @param file [String] yaml file with cluster configurations
19
+ # @return [Hash<Cluster>] list of clusters user has access to
20
+ def self.all(file: File.expand_path('../../../config/clusters.yml', __FILE__))
21
+ parse_config(file).each_with_object({}) do |(k, v), h|
22
+ c = Cluster.new v
23
+ h[k] = c if c.valid?
24
+ end
25
+ end
26
+
27
+ # @param validators [Hash] hash of validations that describe the validators
28
+ # @param servers [Hash] hash of servers with corresponding server info
29
+ # @param hpc_cluster [Boolean] whether this is an hpc-style cluster
30
+ def initialize(validators: {}, servers: {}, hpc_cluster: true)
31
+ # Generate hash of validations
32
+ @validators = validators.each_with_object({}) do |(k, v), h|
33
+ h[k] = v[:type].constantize.new(v)
34
+ end
35
+
36
+ # Generate hash of servers
37
+ @servers = servers.each_with_object({}) do |(k, v), h|
38
+ h[k] = v[:type].constantize.new(v)
39
+ end
40
+
41
+ # Is this an hpc-style cluster?
42
+ @hpc_cluster = hpc_cluster
43
+ end
44
+
45
+ # Whether this is a valid cluster
46
+ # @example Whether I have access to this cluster
47
+ # my_cluster.valid?
48
+ # #=> true
49
+ # @return [Boolean] whether user has access to this cluster
50
+ def valid?
51
+ !@validators.any? {|name, validator| !validator.valid?}
52
+ end
53
+
54
+ # Whether this is an hpc-style cluster (i.e., meant for heavy computation)
55
+ # @return [Boolean] whether this an hpc-style cluster
56
+ def hpc_cluster?
57
+ @hpc_cluster
58
+ end
59
+
60
+ # Grab object from {@servers} hash or check if it exists
61
+ # @param method_name the method name called
62
+ # @param arguments the arguments to the call
63
+ # @param block an optional block for the call
64
+ def method_missing(method_name, *arguments, &block)
65
+ if /^(.+)_server$/ =~ method_name.to_s
66
+ @servers.fetch($1.to_sym, nil)
67
+ elsif /^(.+)_server\?$/ =~ method_name.to_s
68
+ @servers.has_key? $1.to_sym
69
+ else
70
+ super
71
+ end
72
+ end
73
+
74
+ # Check if method ends with custom *_server or *_server?
75
+ # @param method_name the method name to check
76
+ # @return [Boolean]
77
+ def respond_to_missing?(method_name, include_private = false)
78
+ method_name.to_s.end_with?('_server', '_server?') || super
79
+ end
80
+
81
+ private
82
+ # Parse the config file
83
+ def self.parse_config(file)
84
+ YAML.load(File.read(file)).deep_symbolize_keys.fetch(VERSION, {})
85
+ end
86
+ end
87
+ end
@@ -11,6 +11,10 @@ module OodAppkit
11
11
  end
12
12
  attr_writer :dataroot
13
13
 
14
+ # Cluster information for local HPC center
15
+ # @return [OpenStruct] hash of available clusters
16
+ attr_accessor :clusters
17
+
14
18
  # A markdown renderer used when rendering `*.md` or `*.markdown` views
15
19
  # @return [Redcarpet::Markdown] the markdown renderer used
16
20
  attr_accessor :markdown
@@ -31,6 +35,10 @@ module OodAppkit
31
35
  # @return [FilesUrl] the url handler for the system files app
32
36
  attr_accessor :files
33
37
 
38
+ # System file editor app url handler
39
+ # @return [EditorUrl] the url handler for the system file editor app
40
+ attr_accessor :editor
41
+
34
42
  # Whether to auto-generate default routes for helpful apps/features
35
43
  # @return [OpenStruct] whether to generate routes for apps
36
44
  attr_accessor :routes
@@ -56,6 +64,16 @@ module OodAppkit
56
64
  ActiveSupport::Deprecation.warn("The environment variable RAILS_DATAROOT will be deprecated in an upcoming release, please use OOD_DATAROOT instead.") if ENV['RAILS_DATAROOT']
57
65
  self.dataroot = ENV['OOD_DATAROOT'] || ENV['RAILS_DATAROOT']
58
66
 
67
+ # Initialize list of available clusters
68
+ self.clusters = OpenStruct.new
69
+ clusters.all = OodAppkit::Cluster.all( ENV['OOD_CLUSTERS'] ? {file: ENV['OOD_CLUSTERS']} : {} )
70
+ def clusters.hpc
71
+ all.select {|k,v| v.hpc_cluster?}
72
+ end
73
+ def clusters.lpc
74
+ all.reject {|k,v| v.hpc_cluster?}
75
+ end
76
+
59
77
  # Add markdown template support
60
78
  self.markdown = Redcarpet::Markdown.new(
61
79
  Redcarpet::Render::HTML,
@@ -83,6 +101,10 @@ module OodAppkit
83
101
  title: ENV['OOD_FILES_TITLE'] || 'Files',
84
102
  base_url: ENV['OOD_FILES_URL'] || '/pun/sys/files'
85
103
  )
104
+ self.editor = EditorUrl.new(
105
+ title: ENV['OOD_EDITOR_TITLE'] || 'Editor',
106
+ base_url: ENV['OOD_EDITOR_URL'] || '/pun/sys/file-editor'
107
+ )
86
108
 
87
109
  # Add routes for useful features
88
110
  self.routes = OpenStruct.new(
@@ -0,0 +1,35 @@
1
+ module OodAppkit
2
+ # A class used to handle URLs for the system file Editor app.
3
+ class EditorUrl
4
+ # The title for this URL
5
+ # @return [String] the title of the URL
6
+ attr_reader :title
7
+
8
+ # @param title [String] the title of the URL
9
+ # @param base_url [String] the base URL used to access this app
10
+ # @param edit_url [String] the URL used to request the file editor api
11
+ # @param template [String] the template used to generate URLs for this app
12
+ # @see https://www.rfc-editor.org/rfc/rfc6570.txt RFC describing template format
13
+ def initialize(title: '', base_url: '/', edit_url: '/edit', template: '{/url*}{+path}')
14
+ @title = title
15
+ @template = Addressable::Template.new template
16
+
17
+ # Break up into arrays of strings
18
+ @base_url = base_url.split('/').reject(&:empty?)
19
+ @edit_url = edit_url.split('/').reject(&:empty?)
20
+ end
21
+
22
+ # URL to access this app
23
+ # @return [Addressable::URI] absolute url to access app
24
+ def url
25
+ @template.expand url: @base_url
26
+ end
27
+
28
+ # URL to access this app's file editor API for a given absolute file path
29
+ # @param path [String, #to_s] the absolute path to the file on the filesystem
30
+ # @return [Addressable::URI] absolute url to access path in file editor api
31
+ def edit(path: '')
32
+ @template.expand url: @base_url + @edit_url, path: path.to_s
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,15 @@
1
+ module OodAppkit
2
+ # An object that describes a server hosted by a given cluster
3
+ class Server
4
+ # The host information for this server object
5
+ # @example Host information for login node
6
+ # "my_server.host" #=> "oakley.osc.edu"
7
+ # @return [String] the host for this server
8
+ attr_reader :host
9
+
10
+ # @param host [String] host info
11
+ def initialize(host:, **_)
12
+ @host = host
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,43 @@
1
+ module OodAppkit
2
+ module Servers
3
+ # This defines a Ganglia server and defining parameters
4
+ class Ganglia < Server
5
+ # The URI used to access information about given cluster
6
+ # @return [Addressable] the uri for ganglia server
7
+ attr_reader :uri
8
+
9
+ # The version of this software
10
+ # @return [String] version of software
11
+ attr_reader :version
12
+
13
+ # @param scheme [String] scheme component of URI
14
+ # @param path [String] path component of URI
15
+ # @param query_values [Hash<String>] hash of query values
16
+ # @param version [String] version of server software
17
+ def initialize(scheme:, path:, query_values: {}, version:, **kwargs)
18
+ super(kwargs)
19
+
20
+ # uri
21
+ @uri = Addressable::URI.new({
22
+ scheme: scheme,
23
+ host: host,
24
+ path: path,
25
+ query_values: query_values
26
+ })
27
+
28
+ # version number
29
+ @version = version
30
+ end
31
+
32
+ # Merge a hash of query values into this URI
33
+ # NB: This doesn't alter the original URI
34
+ # @param new_query_values [Hash] hash of query values
35
+ # @return [Addressable] new uri with merged query values
36
+ def merge_query_values(new_query_values)
37
+ uri.dup.tap do |u|
38
+ u.query_values = (uri.query_values || {}).merge(new_query_values)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,54 @@
1
+ module OodAppkit
2
+ module Servers
3
+ # This defines a Moab server / client software installation
4
+ class Moab < Server
5
+ # The path to the installation location for this software
6
+ # @return [Pathname] the path to software installation location
7
+ attr_reader :prefix
8
+
9
+ # The version of this software
10
+ # @return [String] version of software
11
+ attr_reader :version
12
+
13
+ # The required Moab environment variable
14
+ # @return [Pathname] require moab env var
15
+ attr_reader :moabhomedir
16
+
17
+ # @param prefix [String] installation path of client software
18
+ # @param version [String] version of client software
19
+ # @param moabhomedir [String] required moab env var
20
+ def initialize(prefix:, version:, moabhomedir:, **kwargs)
21
+ super(kwargs)
22
+
23
+ # installation path
24
+ @prefix = Pathname.new prefix
25
+ raise ArgumentError, "prefix path doesn't exist (#{@prefix})" unless @prefix.exist?
26
+ raise ArgumentError, "prefix not valid directory (#{@prefix})" unless @prefix.directory?
27
+
28
+ # version number
29
+ @version = version
30
+
31
+ # required moab env var
32
+ @moabhomedir = Pathname.new moabhomedir
33
+ raise ArgumentError, "moabhomedir path doesn't exist (#{@moabhomedir})" unless @moabhomedir.exist?
34
+ raise ArgumentError, "moabhomedir not valid directory (#{@moabhomedir})" unless @moabhomedir.directory?
35
+ end
36
+
37
+ # The path to Torque software library
38
+ # @example Locally installed Torque v5.1.1
39
+ # "my_software.lib" #=> "/usr/local/torque/5.1.1/lib"
40
+ # @return [Pathname] path to libraries
41
+ def lib
42
+ prefix.join('lib')
43
+ end
44
+
45
+ # The path to Torque software binaries
46
+ # @example Locally installed Torque v5.1.1
47
+ # "my_software.lib" #=> "/usr/local/torque/5.1.1/bin"
48
+ # @return [Pathname] path to binaries
49
+ def bin
50
+ prefix.join('bin')
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,44 @@
1
+ module OodAppkit
2
+ module Servers
3
+ # This defines a Torque server / client software installation
4
+ class Torque < Server
5
+ # The path to the installation location for this software
6
+ # @return [Pathname] the path to software installation location
7
+ attr_reader :prefix
8
+
9
+ # The version of this software
10
+ # @return [String] version of software
11
+ attr_reader :version
12
+
13
+ # @param prefix [String] installation path of client software
14
+ # @param version [String] version of client software
15
+ def initialize(prefix:, version:, **kwargs)
16
+ super(kwargs)
17
+
18
+ # installation path
19
+ @prefix = Pathname.new prefix
20
+ raise ArgumentError, "prefix path doesn't exist (#{@prefix})" unless @prefix.exist?
21
+ raise ArgumentError, "prefix not valid directory (#{@prefix})" unless @prefix.directory?
22
+
23
+ # version number
24
+ @version = version
25
+ end
26
+
27
+ # The path to Torque software library
28
+ # @example Locally installed Torque v5.1.1
29
+ # "my_software.lib" #=> "/usr/local/torque/5.1.1/lib"
30
+ # @return [Pathname] path to libraries
31
+ def lib
32
+ prefix.join('lib')
33
+ end
34
+
35
+ # The path to Torque software binaries
36
+ # @example Locally installed Torque v5.1.1
37
+ # "my_software.lib" #=> "/usr/local/torque/5.1.1/bin"
38
+ # @return [Pathname] path to binaries
39
+ def bin
40
+ prefix.join('bin')
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,19 @@
1
+ require 'ood_support'
2
+
3
+ module OodAppkit
4
+ module Validators
5
+ # Class used to determine if user is in valid list of groups
6
+ class Groups
7
+ # @param groups [Array<String>] list of groups
8
+ def initialize(groups:, **_)
9
+ @groups = [*groups].map {|g| OodSupport::Group.new g}
10
+ end
11
+
12
+ # Whether user is in a valid group
13
+ # @return [Boolean] whether in a valid group
14
+ def valid?
15
+ !(@groups & OodSupport::User.new.groups).empty?
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,4 +1,4 @@
1
1
  module OodAppkit
2
2
  # The current version of OodAppkit
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.1"
4
4
  end
data/lib/ood_appkit.rb CHANGED
@@ -6,12 +6,27 @@ require 'ood_appkit/public_url'
6
6
  require 'ood_appkit/dashboard_url'
7
7
  require 'ood_appkit/shell_url'
8
8
  require 'ood_appkit/files_url'
9
+ require 'ood_appkit/editor_url'
9
10
  require 'ood_appkit/files_rack_app'
10
11
  require 'ood_appkit/markdown_template_handler'
11
12
  require 'ood_appkit/log_formatter'
13
+ require 'ood_appkit/cluster'
14
+ require 'ood_appkit/server'
12
15
 
13
16
  # The main namespace for OodAppkit. Provides a global configuration.
14
17
  module OodAppkit
15
18
  extend Configuration
16
19
  require 'ood_appkit/engine' if defined?(Rails)
20
+
21
+ # A namespace to hold all subclasses of {Server}
22
+ module Servers
23
+ require 'ood_appkit/servers/torque'
24
+ require 'ood_appkit/servers/moab'
25
+ require 'ood_appkit/servers/ganglia'
26
+ end
27
+
28
+ # A namespace for validators used to validate a cluster
29
+ module Validators
30
+ require 'ood_appkit/validators/groups'
31
+ end
17
32
  end
File without changes
@@ -0,0 +1,285 @@
1
+  (4.3ms) begin transaction
2
+ ---------------------------
3
+ OodAppkitTest: test_files_urls
4
+ ---------------------------
5
+  (0.1ms) rollback transaction
6
+  (0.1ms) begin transaction
7
+ ---------------------------
8
+ OodAppkitTest: test_shell_urls
9
+ ---------------------------
10
+  (0.1ms) rollback transaction
11
+  (0.0ms) begin transaction
12
+ ----------------------
13
+ OodAppkitTest: test_truth
14
+ ----------------------
15
+  (0.0ms) rollback transaction
16
+  (1.9ms) begin transaction
17
+ ---------------------------
18
+ OodAppkitTest: test_files_urls
19
+ ---------------------------
20
+  (0.1ms) rollback transaction
21
+  (0.1ms) begin transaction
22
+ ---------------------------
23
+ OodAppkitTest: test_shell_urls
24
+ ---------------------------
25
+  (0.1ms) rollback transaction
26
+  (0.1ms) begin transaction
27
+ ----------------------
28
+ OodAppkitTest: test_truth
29
+ ----------------------
30
+  (0.0ms) rollback transaction
31
+  (1.9ms) begin transaction
32
+ ---------------------------
33
+ OodAppkitTest: test_files_urls
34
+ ---------------------------
35
+  (0.1ms) rollback transaction
36
+  (0.1ms) begin transaction
37
+ ---------------------------
38
+ OodAppkitTest: test_shell_urls
39
+ ---------------------------
40
+  (0.1ms) rollback transaction
41
+  (0.0ms) begin transaction
42
+ ----------------------
43
+ OodAppkitTest: test_truth
44
+ ----------------------
45
+  (0.1ms) rollback transaction
46
+  (1.1ms) begin transaction
47
+ ---------------------------
48
+ OodAppkitTest: test_files_urls
49
+ ---------------------------
50
+  (0.1ms) rollback transaction
51
+  (0.1ms) begin transaction
52
+ ---------------------------
53
+ OodAppkitTest: test_shell_urls
54
+ ---------------------------
55
+  (0.1ms) rollback transaction
56
+  (0.1ms) begin transaction
57
+ ----------------------
58
+ OodAppkitTest: test_truth
59
+ ----------------------
60
+  (0.0ms) rollback transaction
61
+  (2.5ms) begin transaction
62
+ ---------------------------
63
+ OodAppkitTest: test_files_urls
64
+ ---------------------------
65
+  (0.1ms) rollback transaction
66
+  (0.1ms) begin transaction
67
+ ---------------------------
68
+ OodAppkitTest: test_shell_urls
69
+ ---------------------------
70
+  (0.1ms) rollback transaction
71
+  (0.1ms) begin transaction
72
+ ----------------------
73
+ OodAppkitTest: test_truth
74
+ ----------------------
75
+  (0.0ms) rollback transaction
76
+  (48.7ms) begin transaction
77
+ ------------------------------------------------
78
+ OodAppkit::WikiControllerTest: test_should_get_show
79
+ ------------------------------------------------
80
+  (0.1ms) rollback transaction
81
+  (0.1ms) begin transaction
82
+ ---------------------------
83
+ OodAppkitTest: test_files_urls
84
+ ---------------------------
85
+  (0.1ms) rollback transaction
86
+  (0.1ms) begin transaction
87
+ ---------------------------
88
+ OodAppkitTest: test_shell_urls
89
+ ---------------------------
90
+  (0.1ms) rollback transaction
91
+  (0.1ms) begin transaction
92
+ ----------------------
93
+ OodAppkitTest: test_truth
94
+ ----------------------
95
+  (0.0ms) rollback transaction
96
+  (2.6ms) begin transaction
97
+ ------------------------------------------------
98
+ OodAppkit::WikiControllerTest: test_should_get_show
99
+ ------------------------------------------------
100
+  (0.1ms) rollback transaction
101
+  (0.1ms) begin transaction
102
+ ---------------------------
103
+ OodAppkitTest: test_files_urls
104
+ ---------------------------
105
+  (0.1ms) rollback transaction
106
+  (0.1ms) begin transaction
107
+ ---------------------------
108
+ OodAppkitTest: test_shell_urls
109
+ ---------------------------
110
+  (0.1ms) rollback transaction
111
+  (0.0ms) begin transaction
112
+ ----------------------
113
+ OodAppkitTest: test_truth
114
+ ----------------------
115
+  (0.0ms) rollback transaction
116
+  (1.9ms) begin transaction
117
+ ------------------------------------------------
118
+ OodAppkit::WikiControllerTest: test_should_get_show
119
+ ------------------------------------------------
120
+  (0.1ms) rollback transaction
121
+  (0.1ms) begin transaction
122
+ ---------------------------
123
+ OodAppkitTest: test_files_urls
124
+ ---------------------------
125
+  (0.1ms) rollback transaction
126
+  (0.0ms) begin transaction
127
+ ---------------------------
128
+ OodAppkitTest: test_shell_urls
129
+ ---------------------------
130
+  (0.1ms) rollback transaction
131
+  (0.0ms) begin transaction
132
+ ----------------------
133
+ OodAppkitTest: test_truth
134
+ ----------------------
135
+  (0.1ms) rollback transaction
136
+  (2.5ms) begin transaction
137
+ ------------------------------------------------
138
+ OodAppkit::WikiControllerTest: test_should_get_show
139
+ ------------------------------------------------
140
+  (0.1ms) rollback transaction
141
+  (0.1ms) begin transaction
142
+ ---------------------------
143
+ OodAppkitTest: test_files_urls
144
+ ---------------------------
145
+  (0.1ms) rollback transaction
146
+  (0.0ms) begin transaction
147
+ ---------------------------
148
+ OodAppkitTest: test_shell_urls
149
+ ---------------------------
150
+  (0.1ms) rollback transaction
151
+  (0.0ms) begin transaction
152
+ ----------------------
153
+ OodAppkitTest: test_truth
154
+ ----------------------
155
+  (0.1ms) rollback transaction
156
+  (1.9ms) begin transaction
157
+ ------------------------------------------------
158
+ OodAppkit::WikiControllerTest: test_should_get_show
159
+ ------------------------------------------------
160
+  (0.1ms) rollback transaction
161
+  (0.1ms) begin transaction
162
+ ---------------------------
163
+ OodAppkitTest: test_files_urls
164
+ ---------------------------
165
+  (0.1ms) rollback transaction
166
+  (0.1ms) begin transaction
167
+ ---------------------------
168
+ OodAppkitTest: test_shell_urls
169
+ ---------------------------
170
+  (0.1ms) rollback transaction
171
+  (0.0ms) begin transaction
172
+ ----------------------
173
+ OodAppkitTest: test_truth
174
+ ----------------------
175
+  (0.1ms) rollback transaction
176
+  (2.7ms) begin transaction
177
+ ------------------------------------------------
178
+ OodAppkit::WikiControllerTest: test_should_get_show
179
+ ------------------------------------------------
180
+  (0.1ms) rollback transaction
181
+  (0.1ms) begin transaction
182
+ ---------------------------
183
+ OodAppkitTest: test_files_urls
184
+ ---------------------------
185
+  (0.1ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+ ---------------------------
188
+ OodAppkitTest: test_shell_urls
189
+ ---------------------------
190
+  (0.1ms) rollback transaction
191
+  (0.1ms) begin transaction
192
+ ----------------------
193
+ OodAppkitTest: test_truth
194
+ ----------------------
195
+  (0.1ms) rollback transaction
196
+  (4.1ms) begin transaction
197
+ ------------------------------------------------
198
+ OodAppkit::WikiControllerTest: test_should_get_show
199
+ ------------------------------------------------
200
+  (0.1ms) rollback transaction
201
+  (0.1ms) begin transaction
202
+ ---------------------------
203
+ OodAppkitTest: test_files_urls
204
+ ---------------------------
205
+  (0.1ms) rollback transaction
206
+  (0.1ms) begin transaction
207
+ ---------------------------
208
+ OodAppkitTest: test_shell_urls
209
+ ---------------------------
210
+  (0.1ms) rollback transaction
211
+  (0.1ms) begin transaction
212
+ ----------------------
213
+ OodAppkitTest: test_truth
214
+ ----------------------
215
+  (0.0ms) rollback transaction
216
+  (2.4ms) begin transaction
217
+ ------------------------------------------------
218
+ OodAppkit::WikiControllerTest: test_should_get_show
219
+ ------------------------------------------------
220
+  (0.1ms) rollback transaction
221
+  (0.1ms) begin transaction
222
+ ---------------------------
223
+ OodAppkitTest: test_files_urls
224
+ ---------------------------
225
+  (0.1ms) rollback transaction
226
+  (0.1ms) begin transaction
227
+ ---------------------------
228
+ OodAppkitTest: test_shell_urls
229
+ ---------------------------
230
+  (0.1ms) rollback transaction
231
+  (0.0ms) begin transaction
232
+ ----------------------
233
+ OodAppkitTest: test_truth
234
+ ----------------------
235
+  (0.0ms) rollback transaction
236
+  (2.5ms) begin transaction
237
+ ------------------------------------------------
238
+ OodAppkit::WikiControllerTest: test_should_get_show
239
+ ------------------------------------------------
240
+  (0.1ms) rollback transaction
241
+  (0.1ms) begin transaction
242
+ ---------------------------
243
+ OodAppkitTest: test_files_urls
244
+ ---------------------------
245
+  (0.1ms) rollback transaction
246
+  (0.1ms) begin transaction
247
+ ---------------------------
248
+ OodAppkitTest: test_shell_urls
249
+ ---------------------------
250
+  (0.1ms) rollback transaction
251
+  (0.0ms) begin transaction
252
+ ----------------------
253
+ OodAppkitTest: test_truth
254
+ ----------------------
255
+  (0.1ms) rollback transaction
256
+  (2.5ms) begin transaction
257
+ ---------------------------
258
+ OodAppkitTest: test_files_urls
259
+ ---------------------------
260
+  (0.1ms) rollback transaction
261
+  (0.1ms) begin transaction
262
+ ---------------------------
263
+ OodAppkitTest: test_shell_urls
264
+ ---------------------------
265
+  (0.1ms) rollback transaction
266
+  (0.1ms) begin transaction
267
+ ----------------------
268
+ OodAppkitTest: test_truth
269
+ ----------------------
270
+  (0.0ms) rollback transaction
271
+  (30.5ms) begin transaction
272
+ ------------------------------
273
+ OodAppkitTest: test_files_urls
274
+ ------------------------------
275
+  (0.1ms) rollback transaction
276
+  (0.1ms) begin transaction
277
+ ------------------------------
278
+ OodAppkitTest: test_shell_urls
279
+ ------------------------------
280
+  (0.1ms) rollback transaction
281
+  (0.0ms) begin transaction
282
+ -------------------------
283
+ OodAppkitTest: test_truth
284
+ -------------------------
285
+  (0.0ms) rollback transaction
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.1.0
4
+ version: 0.2.1
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-06-20 00:00:00.000000000 Z
11
+ date: 2016-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ood_support
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: addressable
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,17 +114,25 @@ files:
100
114
  - app/controllers/concerns/ood_appkit/wiki_page.rb
101
115
  - app/controllers/ood_appkit/wiki_controller.rb
102
116
  - app/views/ood_appkit/wiki/show.html.erb
117
+ - config/clusters.yml
103
118
  - config/routes.rb
104
119
  - lib/ood_appkit.rb
120
+ - lib/ood_appkit/cluster.rb
105
121
  - lib/ood_appkit/configuration.rb
106
122
  - lib/ood_appkit/dashboard_url.rb
123
+ - lib/ood_appkit/editor_url.rb
107
124
  - lib/ood_appkit/engine.rb
108
125
  - lib/ood_appkit/files_rack_app.rb
109
126
  - lib/ood_appkit/files_url.rb
110
127
  - lib/ood_appkit/log_formatter.rb
111
128
  - lib/ood_appkit/markdown_template_handler.rb
112
129
  - lib/ood_appkit/public_url.rb
130
+ - lib/ood_appkit/server.rb
131
+ - lib/ood_appkit/servers/ganglia.rb
132
+ - lib/ood_appkit/servers/moab.rb
133
+ - lib/ood_appkit/servers/torque.rb
113
134
  - lib/ood_appkit/shell_url.rb
135
+ - lib/ood_appkit/validators/groups.rb
114
136
  - lib/ood_appkit/version.rb
115
137
  - lib/tasks/ood_appkit_tasks.rake
116
138
  - test/dummy/README.rdoc
@@ -140,6 +162,8 @@ files:
140
162
  - test/dummy/config/initializers/wrap_parameters.rb
141
163
  - test/dummy/config/locales/en.yml
142
164
  - test/dummy/config/routes.rb
165
+ - test/dummy/db/test.sqlite3
166
+ - test/dummy/log/test.log
143
167
  - test/dummy/public/404.html
144
168
  - test/dummy/public/422.html
145
169
  - test/dummy/public/500.html
@@ -167,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
191
  version: '0'
168
192
  requirements: []
169
193
  rubyforge_project:
170
- rubygems_version: 2.4.8
194
+ rubygems_version: 2.4.5
171
195
  signing_key:
172
196
  specification_version: 4
173
197
  summary: Open OnDemand gem to help build OOD apps and interface with other OOD apps.
@@ -180,29 +204,32 @@ test_files:
180
204
  - test/dummy/bin/bundle
181
205
  - test/dummy/bin/rails
182
206
  - test/dummy/bin/rake
183
- - test/dummy/config/application.rb
184
- - test/dummy/config/boot.rb
185
- - test/dummy/config/database.yml
186
- - test/dummy/config/environment.rb
187
207
  - test/dummy/config/environments/development.rb
188
208
  - test/dummy/config/environments/production.rb
189
209
  - test/dummy/config/environments/test.rb
190
- - test/dummy/config/initializers/backtrace_silencers.rb
191
210
  - test/dummy/config/initializers/filter_parameter_logging.rb
211
+ - test/dummy/config/initializers/backtrace_silencers.rb
192
212
  - test/dummy/config/initializers/inflections.rb
193
213
  - test/dummy/config/initializers/mime_types.rb
194
214
  - test/dummy/config/initializers/secret_token.rb
195
215
  - test/dummy/config/initializers/session_store.rb
196
216
  - test/dummy/config/initializers/wrap_parameters.rb
197
217
  - test/dummy/config/locales/en.yml
218
+ - test/dummy/config/application.rb
219
+ - test/dummy/config/boot.rb
220
+ - test/dummy/config/database.yml
221
+ - test/dummy/config/environment.rb
198
222
  - test/dummy/config/routes.rb
199
- - test/dummy/config.ru
223
+ - test/dummy/db/test.sqlite3
224
+ - test/dummy/log/test.log
200
225
  - test/dummy/public/404.html
201
226
  - test/dummy/public/422.html
202
227
  - test/dummy/public/500.html
203
228
  - test/dummy/public/favicon.ico
204
- - test/dummy/Rakefile
205
229
  - test/dummy/README.rdoc
230
+ - test/dummy/Rakefile
231
+ - test/dummy/config.ru
206
232
  - test/integration/navigation_test.rb
207
233
  - test/ood_appkit_test.rb
208
234
  - test/test_helper.rb
235
+ has_rdoc: