flight_manifest 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f27f06b1c38d261ea71efbf616b8d1d7c803ed9a3d4698c4bf75e12da112ad4a
4
+ data.tar.gz: 3c48dc72e6d40e798ba4e7e8fc9dbac5b6441a2ff90068de611fbdadf601b20c
5
+ SHA512:
6
+ metadata.gz: ad24924b1be322712a52219f818204a2daa5ac6425f74473340662b99853171bf3e5a112c31ff1027852f4044d817c0eed9793cc055427b15e63ba2a572a09d2
7
+ data.tar.gz: 66e1b38d26405af23cdaa79cf85c9a4b225a7dc8ee373ce502a333a73647f1b28681ea7f9b4f2eb7b149a94a5ca1134b4aa83517b35510757e585eba229d4473
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ Gemfile.lock
10
+ *.gem
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.3
5
+ before_install: gem install bundler -v 1.16.2
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at william.mccumstie@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in flight_manifest.gemspec
6
+ gemspec
@@ -0,0 +1,277 @@
1
+ Eclipse Public License - v 2.0
2
+
3
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
4
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
5
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6
+
7
+ 1. DEFINITIONS
8
+
9
+ "Contribution" means:
10
+
11
+ a) in the case of the initial Contributor, the initial content
12
+ Distributed under this Agreement, and
13
+
14
+ b) in the case of each subsequent Contributor:
15
+ i) changes to the Program, and
16
+ ii) additions to the Program;
17
+ where such changes and/or additions to the Program originate from
18
+ and are Distributed by that particular Contributor. A Contribution
19
+ "originates" from a Contributor if it was added to the Program by
20
+ such Contributor itself or anyone acting on such Contributor's behalf.
21
+ Contributions do not include changes or additions to the Program that
22
+ are not Modified Works.
23
+
24
+ "Contributor" means any person or entity that Distributes the Program.
25
+
26
+ "Licensed Patents" mean patent claims licensable by a Contributor which
27
+ are necessarily infringed by the use or sale of its Contribution alone
28
+ or when combined with the Program.
29
+
30
+ "Program" means the Contributions Distributed in accordance with this
31
+ Agreement.
32
+
33
+ "Recipient" means anyone who receives the Program under this Agreement
34
+ or any Secondary License (as applicable), including Contributors.
35
+
36
+ "Derivative Works" shall mean any work, whether in Source Code or other
37
+ form, that is based on (or derived from) the Program and for which the
38
+ editorial revisions, annotations, elaborations, or other modifications
39
+ represent, as a whole, an original work of authorship.
40
+
41
+ "Modified Works" shall mean any work in Source Code or other form that
42
+ results from an addition to, deletion from, or modification of the
43
+ contents of the Program, including, for purposes of clarity any new file
44
+ in Source Code form that contains any contents of the Program. Modified
45
+ Works shall not include works that contain only declarations,
46
+ interfaces, types, classes, structures, or files of the Program solely
47
+ in each case in order to link to, bind by name, or subclass the Program
48
+ or Modified Works thereof.
49
+
50
+ "Distribute" means the acts of a) distributing or b) making available
51
+ in any manner that enables the transfer of a copy.
52
+
53
+ "Source Code" means the form of a Program preferred for making
54
+ modifications, including but not limited to software source code,
55
+ documentation source, and configuration files.
56
+
57
+ "Secondary License" means either the GNU General Public License,
58
+ Version 2.0, or any later versions of that license, including any
59
+ exceptions or additional permissions as identified by the initial
60
+ Contributor.
61
+
62
+ 2. GRANT OF RIGHTS
63
+
64
+ a) Subject to the terms of this Agreement, each Contributor hereby
65
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
66
+ license to reproduce, prepare Derivative Works of, publicly display,
67
+ publicly perform, Distribute and sublicense the Contribution of such
68
+ Contributor, if any, and such Derivative Works.
69
+
70
+ b) Subject to the terms of this Agreement, each Contributor hereby
71
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
72
+ license under Licensed Patents to make, use, sell, offer to sell,
73
+ import and otherwise transfer the Contribution of such Contributor,
74
+ if any, in Source Code or other form. This patent license shall
75
+ apply to the combination of the Contribution and the Program if, at
76
+ the time the Contribution is added by the Contributor, such addition
77
+ of the Contribution causes such combination to be covered by the
78
+ Licensed Patents. The patent license shall not apply to any other
79
+ combinations which include the Contribution. No hardware per se is
80
+ licensed hereunder.
81
+
82
+ c) Recipient understands that although each Contributor grants the
83
+ licenses to its Contributions set forth herein, no assurances are
84
+ provided by any Contributor that the Program does not infringe the
85
+ patent or other intellectual property rights of any other entity.
86
+ Each Contributor disclaims any liability to Recipient for claims
87
+ brought by any other entity based on infringement of intellectual
88
+ property rights or otherwise. As a condition to exercising the
89
+ rights and licenses granted hereunder, each Recipient hereby
90
+ assumes sole responsibility to secure any other intellectual
91
+ property rights needed, if any. For example, if a third party
92
+ patent license is required to allow Recipient to Distribute the
93
+ Program, it is Recipient's responsibility to acquire that license
94
+ before distributing the Program.
95
+
96
+ d) Each Contributor represents that to its knowledge it has
97
+ sufficient copyright rights in its Contribution, if any, to grant
98
+ the copyright license set forth in this Agreement.
99
+
100
+ e) Notwithstanding the terms of any Secondary License, no
101
+ Contributor makes additional grants to any Recipient (other than
102
+ those set forth in this Agreement) as a result of such Recipient's
103
+ receipt of the Program under the terms of a Secondary License
104
+ (if permitted under the terms of Section 3).
105
+
106
+ 3. REQUIREMENTS
107
+
108
+ 3.1 If a Contributor Distributes the Program in any form, then:
109
+
110
+ a) the Program must also be made available as Source Code, in
111
+ accordance with section 3.2, and the Contributor must accompany
112
+ the Program with a statement that the Source Code for the Program
113
+ is available under this Agreement, and informs Recipients how to
114
+ obtain it in a reasonable manner on or through a medium customarily
115
+ used for software exchange; and
116
+
117
+ b) the Contributor may Distribute the Program under a license
118
+ different than this Agreement, provided that such license:
119
+ i) effectively disclaims on behalf of all other Contributors all
120
+ warranties and conditions, express and implied, including
121
+ warranties or conditions of title and non-infringement, and
122
+ implied warranties or conditions of merchantability and fitness
123
+ for a particular purpose;
124
+
125
+ ii) effectively excludes on behalf of all other Contributors all
126
+ liability for damages, including direct, indirect, special,
127
+ incidental and consequential damages, such as lost profits;
128
+
129
+ iii) does not attempt to limit or alter the recipients' rights
130
+ in the Source Code under section 3.2; and
131
+
132
+ iv) requires any subsequent distribution of the Program by any
133
+ party to be under a license that satisfies the requirements
134
+ of this section 3.
135
+
136
+ 3.2 When the Program is Distributed as Source Code:
137
+
138
+ a) it must be made available under this Agreement, or if the
139
+ Program (i) is combined with other material in a separate file or
140
+ files made available under a Secondary License, and (ii) the initial
141
+ Contributor attached to the Source Code the notice described in
142
+ Exhibit A of this Agreement, then the Program may be made available
143
+ under the terms of such Secondary Licenses, and
144
+
145
+ b) a copy of this Agreement must be included with each copy of
146
+ the Program.
147
+
148
+ 3.3 Contributors may not remove or alter any copyright, patent,
149
+ trademark, attribution notices, disclaimers of warranty, or limitations
150
+ of liability ("notices") contained within the Program from any copy of
151
+ the Program which they Distribute, provided that Contributors may add
152
+ their own appropriate notices.
153
+
154
+ 4. COMMERCIAL DISTRIBUTION
155
+
156
+ Commercial distributors of software may accept certain responsibilities
157
+ with respect to end users, business partners and the like. While this
158
+ license is intended to facilitate the commercial use of the Program,
159
+ the Contributor who includes the Program in a commercial product
160
+ offering should do so in a manner which does not create potential
161
+ liability for other Contributors. Therefore, if a Contributor includes
162
+ the Program in a commercial product offering, such Contributor
163
+ ("Commercial Contributor") hereby agrees to defend and indemnify every
164
+ other Contributor ("Indemnified Contributor") against any losses,
165
+ damages and costs (collectively "Losses") arising from claims, lawsuits
166
+ and other legal actions brought by a third party against the Indemnified
167
+ Contributor to the extent caused by the acts or omissions of such
168
+ Commercial Contributor in connection with its distribution of the Program
169
+ in a commercial product offering. The obligations in this section do not
170
+ apply to any claims or Losses relating to any actual or alleged
171
+ intellectual property infringement. In order to qualify, an Indemnified
172
+ Contributor must: a) promptly notify the Commercial Contributor in
173
+ writing of such claim, and b) allow the Commercial Contributor to control,
174
+ and cooperate with the Commercial Contributor in, the defense and any
175
+ related settlement negotiations. The Indemnified Contributor may
176
+ participate in any such claim at its own expense.
177
+
178
+ For example, a Contributor might include the Program in a commercial
179
+ product offering, Product X. That Contributor is then a Commercial
180
+ Contributor. If that Commercial Contributor then makes performance
181
+ claims, or offers warranties related to Product X, those performance
182
+ claims and warranties are such Commercial Contributor's responsibility
183
+ alone. Under this section, the Commercial Contributor would have to
184
+ defend claims against the other Contributors related to those performance
185
+ claims and warranties, and if a court requires any other Contributor to
186
+ pay any damages as a result, the Commercial Contributor must pay
187
+ those damages.
188
+
189
+ 5. NO WARRANTY
190
+
191
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
192
+ PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
193
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
194
+ IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
195
+ TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
196
+ PURPOSE. Each Recipient is solely responsible for determining the
197
+ appropriateness of using and distributing the Program and assumes all
198
+ risks associated with its exercise of rights under this Agreement,
199
+ including but not limited to the risks and costs of program errors,
200
+ compliance with applicable laws, damage to or loss of data, programs
201
+ or equipment, and unavailability or interruption of operations.
202
+
203
+ 6. DISCLAIMER OF LIABILITY
204
+
205
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
206
+ PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
207
+ SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
208
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
209
+ PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
210
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
211
+ ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
212
+ EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
213
+ POSSIBILITY OF SUCH DAMAGES.
214
+
215
+ 7. GENERAL
216
+
217
+ If any provision of this Agreement is invalid or unenforceable under
218
+ applicable law, it shall not affect the validity or enforceability of
219
+ the remainder of the terms of this Agreement, and without further
220
+ action by the parties hereto, such provision shall be reformed to the
221
+ minimum extent necessary to make such provision valid and enforceable.
222
+
223
+ If Recipient institutes patent litigation against any entity
224
+ (including a cross-claim or counterclaim in a lawsuit) alleging that the
225
+ Program itself (excluding combinations of the Program with other software
226
+ or hardware) infringes such Recipient's patent(s), then such Recipient's
227
+ rights granted under Section 2(b) shall terminate as of the date such
228
+ litigation is filed.
229
+
230
+ All Recipient's rights under this Agreement shall terminate if it
231
+ fails to comply with any of the material terms or conditions of this
232
+ Agreement and does not cure such failure in a reasonable period of
233
+ time after becoming aware of such noncompliance. If all Recipient's
234
+ rights under this Agreement terminate, Recipient agrees to cease use
235
+ and distribution of the Program as soon as reasonably practicable.
236
+ However, Recipient's obligations under this Agreement and any licenses
237
+ granted by Recipient relating to the Program shall continue and survive.
238
+
239
+ Everyone is permitted to copy and distribute copies of this Agreement,
240
+ but in order to avoid inconsistency the Agreement is copyrighted and
241
+ may only be modified in the following manner. The Agreement Steward
242
+ reserves the right to publish new versions (including revisions) of
243
+ this Agreement from time to time. No one other than the Agreement
244
+ Steward has the right to modify this Agreement. The Eclipse Foundation
245
+ is the initial Agreement Steward. The Eclipse Foundation may assign the
246
+ responsibility to serve as the Agreement Steward to a suitable separate
247
+ entity. Each new version of the Agreement will be given a distinguishing
248
+ version number. The Program (including Contributions) may always be
249
+ Distributed subject to the version of the Agreement under which it was
250
+ received. In addition, after a new version of the Agreement is published,
251
+ Contributor may elect to Distribute the Program (including its
252
+ Contributions) under the new version.
253
+
254
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
255
+ receives no rights or licenses to the intellectual property of any
256
+ Contributor under this Agreement, whether expressly, by implication,
257
+ estoppel or otherwise. All rights in the Program not expressly granted
258
+ under this Agreement are reserved. Nothing in this Agreement is intended
259
+ to be enforceable by any entity that is not a Contributor or Recipient.
260
+ No third-party beneficiary rights are created under this Agreement.
261
+
262
+ Exhibit A - Form of Secondary Licenses Notice
263
+
264
+ "This Source Code may also be made available under the following
265
+ Secondary Licenses when the conditions for such availability set forth
266
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
267
+ version(s), and exceptions or additional permissions here}."
268
+
269
+ Simply including a copy of this Agreement, including this Exhibit A
270
+ is not sufficient to license the Source Code under Secondary Licenses.
271
+
272
+ If it is not possible or desirable to put the notice in a particular
273
+ file, then You may include the notice in a location (such as a LICENSE
274
+ file in a relevant directory) where a recipient would be likely to
275
+ look for such a notice.
276
+
277
+ You may add additional accurate notices of copyright ownership.
@@ -0,0 +1,104 @@
1
+ # FlightManifest
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/flight_manifest`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'flight_manifest'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install flight_manifest
22
+
23
+ ## Usage
24
+
25
+ FlightManifest defines the specification for how to list components of a cluster. It is comprised of three major objects:
26
+ * [FlightManifest::Domain](https://github.com/openflighthpc/flight_manifest/blob/master/lib/flight_manifest/domain.rb)
27
+ * [FlightManifest::Group](https://github.com/openflighthpc/flight_manifest/blob/master/lib/flight_manifest/group.rb)
28
+ * [FlightManifest::Node](https://github.com/openflighthpc/flight_manifest/blob/master/lib/flight_manifest/node.rb)
29
+
30
+ Each object is a hash like [Hashie::Trash](https://github.com/intridea/hashie#trash) that defines the parameters that are allowed to be set. All other properties will be ignored by the object initializer.
31
+
32
+ ### Loading the Manifest
33
+
34
+ The manifest objects can be loaded from files called `manifest.yaml` using the `FlightManifest.load(path)` method. Currently the `path` must be either:
35
+ 1. The absolute path to the `manifest.yaml` file, or
36
+ 2. The absolute path to the directory containing a `manifest.yaml`.
37
+
38
+ The basic structure of the manifest is:
39
+
40
+ ```
41
+ domain:
42
+ name:
43
+ gateway_ip
44
+ # See FlightManifest::Domain specification file for full list of properties
45
+ groups:
46
+ - name: # The first group
47
+ # See FlightManifest::Group specification file for full list of properties
48
+ - name: # The second group
49
+ nodes:
50
+ - name: # The first node
51
+ build_ip:
52
+ kickstart:
53
+ pxelinux:
54
+ # See FlightManifest::Node specification file for full list of properties
55
+ - name: # The second node
56
+ ```
57
+
58
+ Loading the file will automatically generate a collection of `Manifest` objects:
59
+
60
+ ```
61
+ > manifest = FlightManifest.load
62
+ => #<FlightManifest::Base>
63
+
64
+ > manifest.domain
65
+ => #<FlightManifest::Domain>
66
+
67
+ > manifest.groups
68
+ => [#<FlightManifest::Group>, ...]
69
+
70
+ > manifest.nodes
71
+ => [#<FlightManifest::Node>, ...]
72
+ ```
73
+
74
+ ### File Path Handling
75
+
76
+ All file path properties are suffixed with `_file` (or `_files` for an array of paths). The paths may be either relative or absolute paths. The `FlightManifest::Base` records the base path it was loaded from. By convention, the file paths should be relative to this location.
77
+
78
+ To maintain flexibility and simplicity, the paths are not expanded. It is up to the application to decide if it will follow/ enforce the convention. This allows for the manifest object to be used without loading them from a file.
79
+
80
+ Finally, all paths are coerced into `Pathname` objects. This provides the full range of methods from `File` and `FileUtils` which are commonly used with the path. Type casting the manifest to a hash will convert the `Pathname`s to `String`s
81
+
82
+ ## Development
83
+
84
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
85
+
86
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
87
+
88
+ ## Contributing
89
+
90
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/flight_manifest. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
91
+
92
+ ## Code of Conduct
93
+
94
+ Everyone interacting in the FlightManifest project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/flight_manifest/blob/master/CODE_OF_CONDUCT.md).
95
+
96
+ ## License
97
+ Eclipse Public License 2.0, see LICENSE.txt for details.
98
+
99
+ Copyright (C) 2019-present Alces Flight Ltd.
100
+
101
+ This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0, or alternative license terms made available by Alces Flight Ltd - please direct inquiries about licensing to licensing@alces-flight.com.
102
+
103
+ flight_manifest is distributed in the hope that it will be useful, but WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more details.
104
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "flight_manifest"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ require "pry"
11
+ Pry.start
12
+
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,30 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "flight_manifest/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "flight_manifest"
8
+ spec.version = FlightManifest::VERSION
9
+ spec.authors = ["Alces Flight Ltd"]
10
+ spec.email = ["flight@openflighthpc.org"]
11
+
12
+ spec.summary = "A collection of configuration objects for flight clusters"
13
+ spec.license = 'EPL-2.0'
14
+ spec.homepage = "https://github.com/openflighthpc/flight_manifest"
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_runtime_dependency "hashie"
26
+
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rspec", "~> 3.0"
29
+ spec.add_development_dependency "pry"
30
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ #==============================================================================
4
+ # Copyright (C) 2019-present Alces Flight Ltd.
5
+ #
6
+ # This file is part of flight_manifest.
7
+ #
8
+ # This program and the accompanying materials are made available under
9
+ # the terms of the Eclipse Public License 2.0 which is available at
10
+ # <https://www.eclipse.org/legal/epl-2.0>, or alternative license
11
+ # terms made available by Alces Flight Ltd - please direct inquiries
12
+ # about licensing to licensing@alces-flight.com.
13
+ #
14
+ # This project is distributed in the hope that it will be useful, but
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
16
+ # IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
17
+ # OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
18
+ # PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more
19
+ # details.
20
+ #
21
+ # You should have received a copy of the Eclipse Public License 2.0
22
+ # along with this project. If not, see:
23
+ #
24
+ # https://opensource.org/licenses/EPL-2.0
25
+ #
26
+ # For more information on flight_manifest, please visit:
27
+ # https://github.com/alces-software/flight_manifest
28
+ #===============================================================================
29
+
30
+ require "flight_manifest/version"
31
+ require 'yaml'
32
+
33
+ require 'flight_manifest/manifest'
34
+ require 'flight_manifest/domain'
35
+ require 'flight_manifest/group'
36
+ require 'flight_manifest/node'
37
+ require 'flight_manifest/base'
38
+
39
+ module FlightManifest
40
+ FILENAME = 'manifest.yaml'
41
+
42
+ def self.load(input_path)
43
+ path = if /#{FILENAME}\Z/.match?(input_path)
44
+ input_path
45
+ else
46
+ File.join(input_path, FILENAME)
47
+ end
48
+ data = YAML.safe_load(File.read(path), [Symbol]).to_h
49
+ data[:base] = File.dirname(path)
50
+ Base.new(data)
51
+ end
52
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ #==============================================================================
4
+ # Copyright (C) 2019-present Alces Flight Ltd.
5
+ #
6
+ # This file is part of flight_manifest.
7
+ #
8
+ # This program and the accompanying materials are made available under
9
+ # the terms of the Eclipse Public License 2.0 which is available at
10
+ # <https://www.eclipse.org/legal/epl-2.0>, or alternative license
11
+ # terms made available by Alces Flight Ltd - please direct inquiries
12
+ # about licensing to licensing@alces-flight.com.
13
+ #
14
+ # This project is distributed in the hope that it will be useful, but
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
16
+ # IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
17
+ # OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
18
+ # PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more
19
+ # details.
20
+ #
21
+ # You should have received a copy of the Eclipse Public License 2.0
22
+ # along with this project. If not, see:
23
+ #
24
+ # https://opensource.org/licenses/EPL-2.0
25
+ #
26
+ # For more information on flight_manifest, please visit:
27
+ # https://github.com/alces-software/flight_manifest
28
+ #===============================================================================
29
+
30
+ require 'pathname'
31
+
32
+ module FlightManifest
33
+ class Base < Manifest
34
+ property :base, required: true, coerce: Pathname
35
+ property :domain, default: {}, coerce: FlightManifest::Domain
36
+ property :groups, default: [], coerce: Array[FlightManifest::Group]
37
+ property :nodes, default: [], coerce: Array[FlightManifest::Node]
38
+
39
+ def write
40
+ File.write base.join(FlightManifest::FILENAME), dump
41
+ end
42
+
43
+ def dump
44
+ YAML.dump to_h.tap { |h| h.delete(:base) }
45
+ end
46
+
47
+ def to_h
48
+ super().map { |k,v| [k.to_sym, v] }
49
+ .to_h
50
+ .tap do |hash|
51
+ hash[:domain] = hash[:domain].to_h
52
+ [:groups, :nodes].each { |s| hash[s] = hash[s].map(&:to_h) }
53
+ hash[:base] = hash[:base].to_s
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ #==============================================================================
4
+ # Copyright (C) 2019-present Alces Flight Ltd.
5
+ #
6
+ # This file is part of flight_manifest.
7
+ #
8
+ # This program and the accompanying materials are made available under
9
+ # the terms of the Eclipse Public License 2.0 which is available at
10
+ # <https://www.eclipse.org/legal/epl-2.0>, or alternative license
11
+ # terms made available by Alces Flight Ltd - please direct inquiries
12
+ # about licensing to licensing@alces-flight.com.
13
+ #
14
+ # This project is distributed in the hope that it will be useful, but
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
16
+ # IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
17
+ # OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
18
+ # PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more
19
+ # details.
20
+ #
21
+ # You should have received a copy of the Eclipse Public License 2.0
22
+ # along with this project. If not, see:
23
+ #
24
+ # https://opensource.org/licenses/EPL-2.0
25
+ #
26
+ # For more information on flight_manifest, please visit:
27
+ # https://github.com/alces-software/flight_manifest
28
+ #===============================================================================
29
+
30
+ module FlightManifest
31
+ class Domain < Manifest
32
+ property :name
33
+ property :bmc_username
34
+ property :bmc_password
35
+ property :gateway_ip
36
+ end
37
+ end
38
+
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ #==============================================================================
4
+ # Copyright (C) 2019-present Alces Flight Ltd.
5
+ #
6
+ # This file is part of flight_manifest.
7
+ #
8
+ # This program and the accompanying materials are made available under
9
+ # the terms of the Eclipse Public License 2.0 which is available at
10
+ # <https://www.eclipse.org/legal/epl-2.0>, or alternative license
11
+ # terms made available by Alces Flight Ltd - please direct inquiries
12
+ # about licensing to licensing@alces-flight.com.
13
+ #
14
+ # This project is distributed in the hope that it will be useful, but
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
16
+ # IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
17
+ # OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
18
+ # PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more
19
+ # details.
20
+ #
21
+ # You should have received a copy of the Eclipse Public License 2.0
22
+ # along with this project. If not, see:
23
+ #
24
+ # https://opensource.org/licenses/EPL-2.0
25
+ #
26
+ # For more information on flight_manifest, please visit:
27
+ # https://github.com/alces-software/flight_manifest
28
+ #===============================================================================
29
+
30
+ module FlightManifest
31
+ class Group < Manifest
32
+ property :name
33
+ end
34
+ end
35
+
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ #==============================================================================
4
+ # Copyright (C) 2019-present Alces Flight Ltd.
5
+ #
6
+ # This file is part of flight_manifest.
7
+ #
8
+ # This program and the accompanying materials are made available under
9
+ # the terms of the Eclipse Public License 2.0 which is available at
10
+ # <https://www.eclipse.org/legal/epl-2.0>, or alternative license
11
+ # terms made available by Alces Flight Ltd - please direct inquiries
12
+ # about licensing to licensing@alces-flight.com.
13
+ #
14
+ # This project is distributed in the hope that it will be useful, but
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
16
+ # IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
17
+ # OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
18
+ # PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more
19
+ # details.
20
+ #
21
+ # You should have received a copy of the Eclipse Public License 2.0
22
+ # along with this project. If not, see:
23
+ #
24
+ # https://opensource.org/licenses/EPL-2.0
25
+ #
26
+ # For more information on flight_manifest, please visit:
27
+ # https://github.com/alces-software/flight_manifest
28
+ #===============================================================================
29
+
30
+ require 'hashie'
31
+ require 'pathname'
32
+
33
+ module FlightManifest
34
+ class Manifest < Hashie::Trash
35
+ include Hashie::Extensions::Dash::Coercion
36
+ include Hashie::Extensions::IndifferentAccess
37
+ include Hashie::Extensions::IgnoreUndeclared
38
+
39
+ def self.file_properties
40
+ @file_properties ||= []
41
+ end
42
+
43
+ def self.files_properties
44
+ @files_properties ||= []
45
+ end
46
+
47
+ def self.file_property(property)
48
+ name = :"#{property}_file"
49
+ self.file_properties << name
50
+ property name, default: '', coerce: Pathname
51
+ end
52
+
53
+ def self.files_property(property)
54
+ name = :"#{property}_files"
55
+ self.files_properties << name
56
+ property name, default: [], coerce: Array[Pathname]
57
+ end
58
+
59
+ def to_h
60
+ super().map { |k,v| [k.to_sym, v] }
61
+ .to_h
62
+ .tap do |hash|
63
+ self.class.file_properties.each { |p| hash[p] = hash[p].to_s }
64
+ self.class.files_properties.each { |p| hash[p] = hash[p].map(&:to_s) }
65
+ end
66
+ end
67
+ end
68
+ end
69
+
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ #==============================================================================
4
+ # Copyright (C) 2019-present Alces Flight Ltd.
5
+ #
6
+ # This file is part of flight_manifest.
7
+ #
8
+ # This program and the accompanying materials are made available under
9
+ # the terms of the Eclipse Public License 2.0 which is available at
10
+ # <https://www.eclipse.org/legal/epl-2.0>, or alternative license
11
+ # terms made available by Alces Flight Ltd - please direct inquiries
12
+ # about licensing to licensing@alces-flight.com.
13
+ #
14
+ # This project is distributed in the hope that it will be useful, but
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
16
+ # IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
17
+ # OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
18
+ # PARTICULAR PURPOSE. See the Eclipse Public License 2.0 for more
19
+ # details.
20
+ #
21
+ # You should have received a copy of the Eclipse Public License 2.0
22
+ # along with this project. If not, see:
23
+ #
24
+ # https://opensource.org/licenses/EPL-2.0
25
+ #
26
+ # For more information on flight_manifest, please visit:
27
+ # https://github.com/alces-software/flight_manifest
28
+ #===============================================================================
29
+
30
+ module FlightManifest
31
+ class Node < Manifest
32
+ property :name
33
+ property :build_ip
34
+ property :fqdn
35
+ property :gateway_ip
36
+ property :bmc_ip
37
+ property :bmc_username
38
+ property :bmc_password
39
+ property :primary_group
40
+ property :secondary_groups, coerce: Array
41
+
42
+ # File properties are appended with `_file` suffix
43
+ file_property :pxelinux
44
+ file_property :kickstart
45
+ file_property :aws
46
+ file_property :azure
47
+ end
48
+ end
49
+
@@ -0,0 +1,3 @@
1
+ module FlightManifest
2
+ VERSION = "0.1.1"
3
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flight_manifest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Alces Flight Ltd
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-06-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hashie
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - flight@openflighthpc.org
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
+ - CODE_OF_CONDUCT.md
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - bin/console
85
+ - bin/setup
86
+ - flight_manifest.gemspec
87
+ - lib/flight_manifest.rb
88
+ - lib/flight_manifest/base.rb
89
+ - lib/flight_manifest/domain.rb
90
+ - lib/flight_manifest/group.rb
91
+ - lib/flight_manifest/manifest.rb
92
+ - lib/flight_manifest/node.rb
93
+ - lib/flight_manifest/version.rb
94
+ homepage: https://github.com/openflighthpc/flight_manifest
95
+ licenses:
96
+ - EPL-2.0
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubygems_version: 3.0.3
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: A collection of configuration objects for flight clusters
117
+ test_files: []