software_smithy 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/README.rdoc +114 -0
  2. data/bin/smithy +586 -0
  3. data/etc/completion/smithy-completion.bash +266 -0
  4. data/etc/completion/zsh/_smithy +130 -0
  5. data/etc/smithyrc +36 -0
  6. data/etc/templates/build/.owners +1 -0
  7. data/etc/templates/build/build-notes +0 -0
  8. data/etc/templates/build/dependencies +0 -0
  9. data/etc/templates/build/rebuild +13 -0
  10. data/etc/templates/build/relink +2 -0
  11. data/etc/templates/build/remodule.erb +21 -0
  12. data/etc/templates/build/retest +6 -0
  13. data/etc/templates/build/status +0 -0
  14. data/etc/templates/modulefile.erb +30 -0
  15. data/etc/templates/package/.check4newver +2 -0
  16. data/etc/templates/package/.exceptions +3 -0
  17. data/etc/templates/package/description +18 -0
  18. data/etc/templates/package/description.markdown +17 -0
  19. data/etc/templates/package/support +1 -0
  20. data/etc/templates/package/versions +3 -0
  21. data/etc/templates/web/all.html.erb +19 -0
  22. data/etc/templates/web/alphabetical.html.erb +12 -0
  23. data/etc/templates/web/category.html.erb +74 -0
  24. data/etc/templates/web/machine_version_table.html.erb +35 -0
  25. data/etc/templates/web/package.html.erb +53 -0
  26. data/etc/templates/web/version_list.html.erb +7 -0
  27. data/etc/templates/web/version_table.html.erb +24 -0
  28. data/lib/smithy/config.rb +167 -0
  29. data/lib/smithy/description.rb +276 -0
  30. data/lib/smithy/file_operations.rb +234 -0
  31. data/lib/smithy/format.rb +134 -0
  32. data/lib/smithy/helpers.rb +159 -0
  33. data/lib/smithy/module_file.rb +224 -0
  34. data/lib/smithy/package.rb +647 -0
  35. data/lib/smithy.rb +45 -0
  36. data/lib/smithy_version.rb +40 -0
  37. data/man/man1/smithy.1 +262 -0
  38. data/smithy.rdoc +281 -0
  39. metadata +230 -0
@@ -0,0 +1,40 @@
1
+ # Smithy is freely available under the terms of the BSD license given below. {{{
2
+ #
3
+ # Copyright (c) 2012. UT-BATTELLE, LLC. All rights reserved.
4
+ #
5
+ # Produced by the National Center for Computational Sciences at Oak Ridge
6
+ # National Laboratory. Smithy is a based on SWTools, more information on SWTools
7
+ # can be found at: http://www.olcf.ornl.gov/center-projects/swtools/
8
+ #
9
+ # This product includes software produced by UT-Battelle, LLC under Contract No.
10
+ # DE-AC05-00OR22725 with the Department of Energy.
11
+ #
12
+ # Redistribution and use in source and binary forms, with or without
13
+ # modification, are permitted provided that the following conditions are met:
14
+ #
15
+ # - Redistributions of source code must retain the above copyright notice, this
16
+ # list of conditions and the following disclaimer.
17
+ #
18
+ # - Redistributions in binary form must reproduce the above copyright notice, this
19
+ # list of conditions and the following disclaimer in the documentation and/or
20
+ # other materials provided with the distribution.
21
+ #
22
+ # - Neither the name of the UT-BATTELLE nor the names of its contributors may
23
+ # be used to endorse or promote products derived from this software without
24
+ # specific prior written permission.
25
+ #
26
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30
+ # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ # }}}
37
+
38
+ module Smithy
39
+ VERSION = '1.1'
40
+ end
data/man/man1/smithy.1 ADDED
@@ -0,0 +1,262 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "SMITHY" "1" "November 2012" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBsmithy\fR \- build, test, and install software with ease\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBsmithy\fR \fBnew\fR APPLICATION/VERSION/BUILD
11
+ .
12
+ .br
13
+ \fBsmithy\fR \fBedit\fR last
14
+ .
15
+ .br
16
+ \fBsmithy\fR \fBbuild\fR last
17
+ .
18
+ .br
19
+ .
20
+ .SH "DESCRIPTION"
21
+ \fBsmithy\fR will help you get software installed quickly and painlessly\. This tool follows all the same conventions as swtools\. That is, directory structures, support files, and scripts are all in the same locations\. Smithy\'s goal is to make using those conventions easier\.
22
+ .
23
+ .P
24
+ This is still a work in progress\. If you have any questions, suggestions, or encounter any errors please send me an email: anthonyd@ornl\.gov
25
+ .
26
+ .SH "COMMANDS"
27
+ For help on all options and commands run \fBsmithy help\fR
28
+ .
29
+ .SH "EXAMPLES"
30
+ This section shows the typical work\-flow for adding a new software build\. Let\'s imagine we want to install petsc 3\.2 using the cray compiler\. We must create a place for the software build, build it, and create a module\.
31
+ .
32
+ .P
33
+ Note: all commands, options, and arguments have tab\-completion when using bash or zsh
34
+ .
35
+ .SS "1\. Creating The Build"
36
+ All software builds have the following name format: \fBAPPLICATION/VERSION/BUILD\fR That is three different parts separated by forward slashes \fB/\fR Each part consists of:
37
+ .
38
+ .TP
39
+ \fBAPPLICATION\fR
40
+ The name using lowercase characters
41
+ .
42
+ .TP
43
+ \fBVERSION\fR
44
+ Numbers with periods\. I recommend that whatever you choose as a version allows it to be lexigraphically sorted from oldest to newest\.
45
+ .
46
+ .TP
47
+ \fBBUILD\fR
48
+ Build is somewhat different, it consists of the intended operating system and compiler separated by underscores (\fB_\fR)\. It is important to use compiler version numbers that correspond to module versions\. This will allow smithy to auto\-generate modulefiles for software with multiple builds\. As an example:
49
+ .
50
+ .IP
51
+ \fBsles11\.1_gnu4\.6\.2\fR corresponds to SuSE Linux Enterprise Server 11\.1 and the GNU gcc compiler 4\.6\.2
52
+ .
53
+ .IP
54
+ \fBcle4\.0_pgi12\.1\.0\fR corresponds to Cray Linux Environment 4\.0 and the PGI 12\.1\.0 compile
55
+ .
56
+ .P
57
+ Let\'s use \fBpetsc/3\.2/cle4\.0_cray8\.0\.1\fR as the name\. This would be petsc designed to run on a cle4\.0 compute node and compiled with the cray cce 8\.0\.1 compiler\. This can be accomplished by running:
58
+ .
59
+ .IP "" 4
60
+ .
61
+ .nf
62
+
63
+ smithy new petsc/3\.2/cle4\.0_cray8\.0\.1
64
+ .
65
+ .fi
66
+ .
67
+ .IP "" 0
68
+ .
69
+ .P
70
+ You can save yourself some extra time by telling smithy where the tar file for petsc is:
71
+ .
72
+ .IP "" 4
73
+ .
74
+ .nf
75
+
76
+ smithy new \-t /sw/sources/petsc/3\.2/petsc\-lite\-3\.2\-p7\.tar\.gz petsc/3\.2/cle4\.0_cray8\.0\.1
77
+ .
78
+ .fi
79
+ .
80
+ .IP "" 0
81
+ .
82
+ .P
83
+ When using the \fB\-t\fR, \fB\-\-tarfile=\fR option smithy will extract the given archive to the \fBsource\fR directory\. For the petsc example above this would be \fB/sw/xk6/petsc/3\.2/cle4\.0_cray8\.0\.1/source\fR
84
+ .
85
+ .P
86
+ If this is a brand new piece of software add the \fB\-\-web\-description\fR switch\. This will create the application description files too\.
87
+ .
88
+ .SS "2\. Editing and Building the Software:"
89
+ Once you have created the build you may need to update the build (\fBrebuild\fR) and environment (\fBremodule\fR) scripts before building the software\. Both files live within the software prefix\. For our example it is located in \fB/sw/xk6/petsc/3\.2/cle4\.0_cray8\.0\.1\fR\. You can edit this and other related files using the \fBedit\fR command:
90
+ .
91
+ .IP "" 4
92
+ .
93
+ .nf
94
+
95
+ smithy edit build petsc/3\.2/cle4\.0_cray8\.0\.1
96
+ .
97
+ .fi
98
+ .
99
+ .IP "" 0
100
+ .
101
+ .P
102
+ This is just a convenience command to editing the rebuild script\. It will expect the \fB$EDITOR\fR environment variable to be set to the edior of your choice\. You can alternatively use the \fB\-e\fR,\fB\-\-editor=\fR option\. To make things quicker you can run:
103
+ .
104
+ .IP "" 4
105
+ .
106
+ .nf
107
+
108
+ smithy edit last
109
+ .
110
+ .fi
111
+ .
112
+ .IP "" 0
113
+ .
114
+ .P
115
+ By omitting the build argument, smithy will prompt you to select the file to edit\. The \fBlast\fR argument will tell smithy to use the last software build it worked with\. If you are not sure what the last one is you can run \fBsmithy show last\fR to see\.
116
+ .
117
+ .P
118
+ Once you have edited the files, it\'s time to build\. Do so by running:
119
+ .
120
+ .IP "" 4
121
+ .
122
+ .nf
123
+
124
+ smithy build last
125
+ .
126
+ .fi
127
+ .
128
+ .IP "" 0
129
+ .
130
+ .P
131
+ The results of the run will be shown on the screen and simultaneously logged to \fBbuild\.log\fR withing the software prefix folder\.
132
+ .
133
+ .SS "3\. Create and edit a modulefile:"
134
+ This step is best done after all builds for a particular application have been created\. When you create a new software build a modulefile is created too\. For our petsc install it lives in: \fB/sw/xk6/petsc/3\.2/modulefile\fR All builds of a particular application share a single modulefile\.
135
+ .
136
+ .P
137
+ Smithy does some guessing as to what should be inside the modulefile based on what builds you have\. If there is only one build the modulefile is relatively simple\. If you have multiple builds for different compilers then it will be more complicated\.
138
+ .
139
+ .P
140
+ To be sure the modulefile is up to date on each build, regenerate it with:
141
+ .
142
+ .IP "" 4
143
+ .
144
+ .nf
145
+
146
+ smithy module create last
147
+ .
148
+ .fi
149
+ .
150
+ .IP "" 0
151
+ .
152
+ .P
153
+ Launch your editor with:
154
+ .
155
+ .IP "" 4
156
+ .
157
+ .nf
158
+
159
+ smithy edit modulefile last
160
+ .
161
+ .fi
162
+ .
163
+ .IP "" 0
164
+ .
165
+ .P
166
+ Add any relevant variables to your application\. Next you will need to test it to make sure it is loading properly for each build and that there are no errors\. You can add the modulefile to your \fB$MODULEPATH\fR using:
167
+ .
168
+ .IP "" 4
169
+ .
170
+ .nf
171
+
172
+ smithy module use last
173
+ .
174
+ .fi
175
+ .
176
+ .IP "" 0
177
+ .
178
+ .P
179
+ Now you are free to display and load it using the normal module commands:
180
+ .
181
+ .IP "" 4
182
+ .
183
+ .nf
184
+
185
+ module avail petsc
186
+ module display petsc/3\.2
187
+ module load petsc/3\.2
188
+ .
189
+ .fi
190
+ .
191
+ .IP "" 0
192
+ .
193
+ .P
194
+ Once the modulefile is ready, you can copy it into place using:
195
+ .
196
+ .IP "" 4
197
+ .
198
+ .nf
199
+
200
+ smithy module deploy last
201
+ .
202
+ .fi
203
+ .
204
+ .IP "" 0
205
+ .
206
+ .P
207
+ For out petsc example, this command will copy \fB/sw/xk6/petsc/3\.2/modulefile/petsc/3\.2\fR to \fB/sw/xk6/modulefiles/petsc/3\.2\fR
208
+ .
209
+ .SS "4\. Website Description"
210
+ If this is a new application you will need to add some information to the description file\. For petsc this lives in: \fB/sw/xk6/petsc/description\fR This is an html formatted file\. Alternatively, it can live in \fB/sw/xk6/petsc/description\.markdown\fR this file is in markdown format and is a bit simpler to write than html\. See http://kramdown\.rubyforge\.org/quickref\.html for more information on markdown syntax\. If both files exist, the markdown file takes precedence\.
211
+ .
212
+ .P
213
+ If the description file is missing you can generate one by running:
214
+ .
215
+ .IP "" 4
216
+ .
217
+ .nf
218
+
219
+ smithy repair last
220
+ .
221
+ .fi
222
+ .
223
+ .IP "" 0
224
+ .
225
+ .P
226
+ To publish to the website run:
227
+ .
228
+ .IP "" 4
229
+ .
230
+ .nf
231
+
232
+ smithy publish petsc
233
+ .
234
+ .fi
235
+ .
236
+ .IP "" 0
237
+ .
238
+ .SH "LICENSE"
239
+ Smithy is freely available under the terms of the BSD license given below\.
240
+ .
241
+ .P
242
+ Copyright (c) 2012\. UT\-BATTELLE, LLC\. All rights reserved\.
243
+ .
244
+ .P
245
+ Produced at the National Center for Computational Sciences in Oak Ridge National Laboratory\.
246
+ .
247
+ .P
248
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
249
+ .
250
+ .IP "\(bu" 4
251
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\.
252
+ .
253
+ .IP "\(bu" 4
254
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\.
255
+ .
256
+ .IP "\(bu" 4
257
+ Neither the name of the UT\-BATTELLE nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\.
258
+ .
259
+ .IP "" 0
260
+ .
261
+ .P
262
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.
data/smithy.rdoc ADDED
@@ -0,0 +1,281 @@
1
+ == smithy - Smithy will help you build, test, and install software with ease.
2
+
3
+ v1.1
4
+
5
+ === Global Options
6
+ === --arch NAME
7
+
8
+ Machine architecure to operate on
9
+
10
+ [Default Value] None
11
+
12
+
13
+ === --config-file FILE
14
+
15
+ Alternate config file, also set by $SMITHY_CONFIG
16
+
17
+ [Default Value] None
18
+
19
+
20
+ === --descriptions-root PATH
21
+
22
+ The root level directory global description files
23
+
24
+ [Default Value] None
25
+
26
+
27
+ === --file-group-name GROUP
28
+
29
+ Group name for files created by smithy
30
+
31
+ [Default Value] None
32
+
33
+
34
+ === --prgenv-prefix NAME
35
+
36
+ The prefix of programming environments for this machine
37
+
38
+ [Default Value] None
39
+
40
+
41
+ === --software-root PATH
42
+
43
+ The root level directory for software
44
+
45
+ [Default Value] None
46
+
47
+
48
+ === --web-root PATH
49
+
50
+ The root level directory for published web files
51
+
52
+ [Default Value] None
53
+
54
+
55
+ === --[no-]colors
56
+ Disable or enable color output (default: enabled)
57
+
58
+
59
+
60
+ === --disable-group-writable
61
+ Disable group writable file creation
62
+
63
+
64
+
65
+ === -f|--force
66
+ Always overwrite existing files
67
+
68
+
69
+
70
+ === --help
71
+ Show this message
72
+
73
+
74
+
75
+ === --version
76
+
77
+
78
+
79
+
80
+ === Commands
81
+ ==== Command: <tt>build PATH</tt>
82
+ Build software
83
+
84
+ The software to build may be either the absolute path or the full name of the software. The full name includes version numbers and build names using the format: NAME/VERSION/BUILD.
85
+ ===== Options
86
+ ===== --log-name FILE
87
+
88
+ Build log file name located within the software prefix.
89
+
90
+ [Default Value] build.log
91
+
92
+
93
+ ===== --disable-log
94
+ Disable logging
95
+
96
+
97
+
98
+ ===== -f|--force
99
+ Ignore .lock file and run anyway
100
+
101
+
102
+
103
+ ===== -n|--dry-run
104
+ See what scripts will be run without running them
105
+
106
+
107
+
108
+ ===== -s|--suppress-stdout
109
+ Suppress messages from STDOUT.
110
+
111
+
112
+
113
+ ==== Command: <tt>edit build|test|env|modulefile NAME</tt>
114
+ Edit package support files
115
+
116
+
117
+ ===== Options
118
+ ===== -e|--editor BINARY
119
+
120
+ Editor for opening script files
121
+
122
+ [Default Value] None
123
+
124
+
125
+ ===== -s|--split
126
+ Split editing window with requested file and the environment (remodule) file
127
+
128
+
129
+
130
+ ==== Command: <tt>help command</tt>
131
+ Shows a list of commands or help for one command
132
+
133
+ Gets help for the application or its commands. Can also list the commands in a way helpful to creating a bash-style completion function
134
+ ===== Options
135
+ ===== -c
136
+ List commands one per line, to assist with shell completion
137
+
138
+
139
+
140
+ ==== Command: <tt>module NAME</tt>
141
+ Manage modulefiles for a package
142
+
143
+
144
+ ===== Options
145
+ ===== -n|--dry-run
146
+ See what files will be created without creating them
147
+
148
+
149
+
150
+ ===== Commands
151
+ ====== Command: <tt>create </tt>
152
+ Generate a modulefile for a given package. This operation normally happens after creating a new package. It is provided separately here for use with existing packages.
153
+
154
+
155
+ ====== Command: <tt>deploy </tt>
156
+ Copy a package's modulefile to the system module path. This is typically done after you have tested a new module in isolation.
157
+
158
+
159
+ ====== Command: <tt>edit </tt>
160
+ alias for 'smithy edit modulefile'
161
+
162
+
163
+ ====== Command: <tt>use </tt>
164
+ Run the proper module command to add a package's modulefile to the MODULEPATH. This allows you to edit and test a modulefile in isolation. By adding the correct directory to MODULEPATH you may run module commands as you normally would.
165
+
166
+
167
+ ==== Command: <tt>new NAME</tt>
168
+ Generate a new build and all necessary files
169
+
170
+ The new command will create all necessary files needed to add a new software package. Some care should be given to naming new packages. Some considerations are package names, version numbers, and build names. New package names should be of the format NAME/VERSION/BUILD
171
+
172
+ - NAME of the package should be all lower case and one word. If multiple words are necessary separate them with dashes '-'.
173
+
174
+ - VERSION numbers should be standard numbers separated by periods. If another format is necessary ensure that the numbers can be lexigraphically sorted in order of oldest release to newest.
175
+
176
+ - BUILD names should consist of two pieces of information separated by an underscore '_', the package's intended operating system and compiler.
177
+
178
+ EXAMPLES:
179
+
180
+ silo/4.8/sles11.1_gnu4.5.3
181
+ fftw/3.2.2/cle4.0_pgi11.10.0
182
+ ===== Options
183
+ ===== -t|--tarball FILE|URL
184
+
185
+ Provide a tarball to unpack, either a file or URL (optional)
186
+
187
+ [Default Value] None
188
+
189
+
190
+ ===== -n|--dry-run
191
+ See what files will be created when running new without creating them
192
+
193
+
194
+
195
+ ===== --skip-modulefile
196
+ Skip modulefile generation
197
+
198
+
199
+
200
+ ===== --web-description
201
+ Create description file for website
202
+
203
+
204
+
205
+ ==== Command: <tt>publish NAME</tt>
206
+ Publish packages to web
207
+
208
+
209
+ ===== Options
210
+ ===== -n|--dry-run
211
+ See what files will be created without creating them
212
+
213
+
214
+
215
+ ==== Command: <tt>repair NAME</tt>
216
+ Repair a package
217
+
218
+ Repair permissions and check that files exist
219
+ ===== Options
220
+ ===== -n|--dry-run
221
+ Verify permissions only
222
+
223
+
224
+
225
+ ==== Command: <tt>search PATTERN</tt>
226
+ Search currently installed software
227
+
228
+
229
+ ===== Options
230
+ ===== --format path|name|table|csv|dokuwiki
231
+
232
+ Format of the output
233
+
234
+ [Default Value] path
235
+
236
+
237
+ ==== Command: <tt>show </tt>
238
+ Display internal smithy values
239
+
240
+
241
+ ===== Commands
242
+ ====== Command: <tt>arch </tt>
243
+ List all architectures know to smithy.
244
+
245
+
246
+ ====== Command: <tt>last </tt>
247
+ Display the package name used in the last smithy command. This is stored in the '~/.smithyrc' file.
248
+
249
+
250
+ ==== Command: <tt>test </tt>
251
+ Test software
252
+
253
+
254
+ ===== Options
255
+ ===== --log-name FILE
256
+
257
+ Test log file name located within the software prefix.
258
+
259
+ [Default Value] test.log
260
+
261
+
262
+ ===== --disable-log
263
+ Disable logging
264
+
265
+
266
+
267
+ ===== -f|--force
268
+ Ignore .lock file and run anyway
269
+
270
+
271
+
272
+ ===== -n|--dry-run
273
+ See what scripts will be run without running them
274
+
275
+
276
+
277
+ ===== -s|--suppress-stdout
278
+ Suppress messages from STDOUT.
279
+
280
+
281
+