Imported Upstream version 1.7.3
SVN-Git Migration
6 years ago
0 | GNU LESSER GENERAL PUBLIC LICENSE | |
1 | Version 2.1, February 1999 | |
2 | ||
3 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. | |
4 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | [This is the first released version of the Lesser GPL. It also counts | |
9 | as the successor of the GNU Library Public License, version 2, hence | |
10 | the version number 2.1.] | |
11 | ||
12 | Preamble | |
13 | ||
14 | The licenses for most software are designed to take away your | |
15 | freedom to share and change it. By contrast, the GNU General Public | |
16 | Licenses are intended to guarantee your freedom to share and change | |
17 | free software--to make sure the software is free for all its users. | |
18 | ||
19 | This license, the Lesser General Public License, applies to some | |
20 | specially designated software packages--typically libraries--of the | |
21 | Free Software Foundation and other authors who decide to use it. You | |
22 | can use it too, but we suggest you first think carefully about whether | |
23 | this license or the ordinary General Public License is the better | |
24 | strategy to use in any particular case, based on the explanations below. | |
25 | ||
26 | When we speak of free software, we are referring to freedom of use, | |
27 | not price. Our General Public Licenses are designed to make sure that | |
28 | you have the freedom to distribute copies of free software (and charge | |
29 | for this service if you wish); that you receive source code or can get | |
30 | it if you want it; that you can change the software and use pieces of | |
31 | it in new free programs; and that you are informed that you can do | |
32 | these things. | |
33 | ||
34 | To protect your rights, we need to make restrictions that forbid | |
35 | distributors to deny you these rights or to ask you to surrender these | |
36 | rights. These restrictions translate to certain responsibilities for | |
37 | you if you distribute copies of the library or if you modify it. | |
38 | ||
39 | For example, if you distribute copies of the library, whether gratis | |
40 | or for a fee, you must give the recipients all the rights that we gave | |
41 | you. You must make sure that they, too, receive or can get the source | |
42 | code. If you link other code with the library, you must provide | |
43 | complete object files to the recipients, so that they can relink them | |
44 | with the library after making changes to the library and recompiling | |
45 | it. And you must show them these terms so they know their rights. | |
46 | ||
47 | We protect your rights with a two-step method: (1) we copyright the | |
48 | library, and (2) we offer you this license, which gives you legal | |
49 | permission to copy, distribute and/or modify the library. | |
50 | ||
51 | To protect each distributor, we want to make it very clear that | |
52 | there is no warranty for the free library. Also, if the library is | |
53 | modified by someone else and passed on, the recipients should know | |
54 | that what they have is not the original version, so that the original | |
55 | author's reputation will not be affected by problems that might be | |
56 | introduced by others. | |
57 | ||
58 | Finally, software patents pose a constant threat to the existence of | |
59 | any free program. We wish to make sure that a company cannot | |
60 | effectively restrict the users of a free program by obtaining a | |
61 | restrictive license from a patent holder. Therefore, we insist that | |
62 | any patent license obtained for a version of the library must be | |
63 | consistent with the full freedom of use specified in this license. | |
64 | ||
65 | Most GNU software, including some libraries, is covered by the | |
66 | ordinary GNU General Public License. This license, the GNU Lesser | |
67 | General Public License, applies to certain designated libraries, and | |
68 | is quite different from the ordinary General Public License. We use | |
69 | this license for certain libraries in order to permit linking those | |
70 | libraries into non-free programs. | |
71 | ||
72 | When a program is linked with a library, whether statically or using | |
73 | a shared library, the combination of the two is legally speaking a | |
74 | combined work, a derivative of the original library. The ordinary | |
75 | General Public License therefore permits such linking only if the | |
76 | entire combination fits its criteria of freedom. The Lesser General | |
77 | Public License permits more lax criteria for linking other code with | |
78 | the library. | |
79 | ||
80 | We call this license the "Lesser" General Public License because it | |
81 | does Less to protect the user's freedom than the ordinary General | |
82 | Public License. It also provides other free software developers Less | |
83 | of an advantage over competing non-free programs. These disadvantages | |
84 | are the reason we use the ordinary General Public License for many | |
85 | libraries. However, the Lesser license provides advantages in certain | |
86 | special circumstances. | |
87 | ||
88 | For example, on rare occasions, there may be a special need to | |
89 | encourage the widest possible use of a certain library, so that it becomes | |
90 | a de-facto standard. To achieve this, non-free programs must be | |
91 | allowed to use the library. A more frequent case is that a free | |
92 | library does the same job as widely used non-free libraries. In this | |
93 | case, there is little to gain by limiting the free library to free | |
94 | software only, so we use the Lesser General Public License. | |
95 | ||
96 | In other cases, permission to use a particular library in non-free | |
97 | programs enables a greater number of people to use a large body of | |
98 | free software. For example, permission to use the GNU C Library in | |
99 | non-free programs enables many more people to use the whole GNU | |
100 | operating system, as well as its variant, the GNU/Linux operating | |
101 | system. | |
102 | ||
103 | Although the Lesser General Public License is Less protective of the | |
104 | users' freedom, it does ensure that the user of a program that is | |
105 | linked with the Library has the freedom and the wherewithal to run | |
106 | that program using a modified version of the Library. | |
107 | ||
108 | The precise terms and conditions for copying, distribution and | |
109 | modification follow. Pay close attention to the difference between a | |
110 | "work based on the library" and a "work that uses the library". The | |
111 | former contains code derived from the library, whereas the latter must | |
112 | be combined with the library in order to run. | |
113 | ||
114 | GNU LESSER GENERAL PUBLIC LICENSE | |
115 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
116 | ||
117 | 0. This License Agreement applies to any software library or other | |
118 | program which contains a notice placed by the copyright holder or | |
119 | other authorized party saying it may be distributed under the terms of | |
120 | this Lesser General Public License (also called "this License"). | |
121 | Each licensee is addressed as "you". | |
122 | ||
123 | A "library" means a collection of software functions and/or data | |
124 | prepared so as to be conveniently linked with application programs | |
125 | (which use some of those functions and data) to form executables. | |
126 | ||
127 | The "Library", below, refers to any such software library or work | |
128 | which has been distributed under these terms. A "work based on the | |
129 | Library" means either the Library or any derivative work under | |
130 | copyright law: that is to say, a work containing the Library or a | |
131 | portion of it, either verbatim or with modifications and/or translated | |
132 | straightforwardly into another language. (Hereinafter, translation is | |
133 | included without limitation in the term "modification".) | |
134 | ||
135 | "Source code" for a work means the preferred form of the work for | |
136 | making modifications to it. For a library, complete source code means | |
137 | all the source code for all modules it contains, plus any associated | |
138 | interface definition files, plus the scripts used to control compilation | |
139 | and installation of the library. | |
140 | ||
141 | Activities other than copying, distribution and modification are not | |
142 | covered by this License; they are outside its scope. The act of | |
143 | running a program using the Library is not restricted, and output from | |
144 | such a program is covered only if its contents constitute a work based | |
145 | on the Library (independent of the use of the Library in a tool for | |
146 | writing it). Whether that is true depends on what the Library does | |
147 | and what the program that uses the Library does. | |
148 | ||
149 | 1. You may copy and distribute verbatim copies of the Library's | |
150 | complete source code as you receive it, in any medium, provided that | |
151 | you conspicuously and appropriately publish on each copy an | |
152 | appropriate copyright notice and disclaimer of warranty; keep intact | |
153 | all the notices that refer to this License and to the absence of any | |
154 | warranty; and distribute a copy of this License along with the | |
155 | Library. | |
156 | ||
157 | You may charge a fee for the physical act of transferring a copy, | |
158 | and you may at your option offer warranty protection in exchange for a | |
159 | fee. | |
160 | ||
161 | 2. You may modify your copy or copies of the Library or any portion | |
162 | of it, thus forming a work based on the Library, and copy and | |
163 | distribute such modifications or work under the terms of Section 1 | |
164 | above, provided that you also meet all of these conditions: | |
165 | ||
166 | a) The modified work must itself be a software library. | |
167 | ||
168 | b) You must cause the files modified to carry prominent notices | |
169 | stating that you changed the files and the date of any change. | |
170 | ||
171 | c) You must cause the whole of the work to be licensed at no | |
172 | charge to all third parties under the terms of this License. | |
173 | ||
174 | d) If a facility in the modified Library refers to a function or a | |
175 | table of data to be supplied by an application program that uses | |
176 | the facility, other than as an argument passed when the facility | |
177 | is invoked, then you must make a good faith effort to ensure that, | |
178 | in the event an application does not supply such function or | |
179 | table, the facility still operates, and performs whatever part of | |
180 | its purpose remains meaningful. | |
181 | ||
182 | (For example, a function in a library to compute square roots has | |
183 | a purpose that is entirely well-defined independent of the | |
184 | application. Therefore, Subsection 2d requires that any | |
185 | application-supplied function or table used by this function must | |
186 | be optional: if the application does not supply it, the square | |
187 | root function must still compute square roots.) | |
188 | ||
189 | These requirements apply to the modified work as a whole. If | |
190 | identifiable sections of that work are not derived from the Library, | |
191 | and can be reasonably considered independent and separate works in | |
192 | themselves, then this License, and its terms, do not apply to those | |
193 | sections when you distribute them as separate works. But when you | |
194 | distribute the same sections as part of a whole which is a work based | |
195 | on the Library, the distribution of the whole must be on the terms of | |
196 | this License, whose permissions for other licensees extend to the | |
197 | entire whole, and thus to each and every part regardless of who wrote | |
198 | it. | |
199 | ||
200 | Thus, it is not the intent of this section to claim rights or contest | |
201 | your rights to work written entirely by you; rather, the intent is to | |
202 | exercise the right to control the distribution of derivative or | |
203 | collective works based on the Library. | |
204 | ||
205 | In addition, mere aggregation of another work not based on the Library | |
206 | with the Library (or with a work based on the Library) on a volume of | |
207 | a storage or distribution medium does not bring the other work under | |
208 | the scope of this License. | |
209 | ||
210 | 3. You may opt to apply the terms of the ordinary GNU General Public | |
211 | License instead of this License to a given copy of the Library. To do | |
212 | this, you must alter all the notices that refer to this License, so | |
213 | that they refer to the ordinary GNU General Public License, version 2, | |
214 | instead of to this License. (If a newer version than version 2 of the | |
215 | ordinary GNU General Public License has appeared, then you can specify | |
216 | that version instead if you wish.) Do not make any other change in | |
217 | these notices. | |
218 | ||
219 | Once this change is made in a given copy, it is irreversible for | |
220 | that copy, so the ordinary GNU General Public License applies to all | |
221 | subsequent copies and derivative works made from that copy. | |
222 | ||
223 | This option is useful when you wish to copy part of the code of | |
224 | the Library into a program that is not a library. | |
225 | ||
226 | 4. You may copy and distribute the Library (or a portion or | |
227 | derivative of it, under Section 2) in object code or executable form | |
228 | under the terms of Sections 1 and 2 above provided that you accompany | |
229 | it with the complete corresponding machine-readable source code, which | |
230 | must be distributed under the terms of Sections 1 and 2 above on a | |
231 | medium customarily used for software interchange. | |
232 | ||
233 | If distribution of object code is made by offering access to copy | |
234 | from a designated place, then offering equivalent access to copy the | |
235 | source code from the same place satisfies the requirement to | |
236 | distribute the source code, even though third parties are not | |
237 | compelled to copy the source along with the object code. | |
238 | ||
239 | 5. A program that contains no derivative of any portion of the | |
240 | Library, but is designed to work with the Library by being compiled or | |
241 | linked with it, is called a "work that uses the Library". Such a | |
242 | work, in isolation, is not a derivative work of the Library, and | |
243 | therefore falls outside the scope of this License. | |
244 | ||
245 | However, linking a "work that uses the Library" with the Library | |
246 | creates an executable that is a derivative of the Library (because it | |
247 | contains portions of the Library), rather than a "work that uses the | |
248 | library". The executable is therefore covered by this License. | |
249 | Section 6 states terms for distribution of such executables. | |
250 | ||
251 | When a "work that uses the Library" uses material from a header file | |
252 | that is part of the Library, the object code for the work may be a | |
253 | derivative work of the Library even though the source code is not. | |
254 | Whether this is true is especially significant if the work can be | |
255 | linked without the Library, or if the work is itself a library. The | |
256 | threshold for this to be true is not precisely defined by law. | |
257 | ||
258 | If such an object file uses only numerical parameters, data | |
259 | structure layouts and accessors, and small macros and small inline | |
260 | functions (ten lines or less in length), then the use of the object | |
261 | file is unrestricted, regardless of whether it is legally a derivative | |
262 | work. (Executables containing this object code plus portions of the | |
263 | Library will still fall under Section 6.) | |
264 | ||
265 | Otherwise, if the work is a derivative of the Library, you may | |
266 | distribute the object code for the work under the terms of Section 6. | |
267 | Any executables containing that work also fall under Section 6, | |
268 | whether or not they are linked directly with the Library itself. | |
269 | ||
270 | 6. As an exception to the Sections above, you may also combine or | |
271 | link a "work that uses the Library" with the Library to produce a | |
272 | work containing portions of the Library, and distribute that work | |
273 | under terms of your choice, provided that the terms permit | |
274 | modification of the work for the customer's own use and reverse | |
275 | engineering for debugging such modifications. | |
276 | ||
277 | You must give prominent notice with each copy of the work that the | |
278 | Library is used in it and that the Library and its use are covered by | |
279 | this License. You must supply a copy of this License. If the work | |
280 | during execution displays copyright notices, you must include the | |
281 | copyright notice for the Library among them, as well as a reference | |
282 | directing the user to the copy of this License. Also, you must do one | |
283 | of these things: | |
284 | ||
285 | a) Accompany the work with the complete corresponding | |
286 | machine-readable source code for the Library including whatever | |
287 | changes were used in the work (which must be distributed under | |
288 | Sections 1 and 2 above); and, if the work is an executable linked | |
289 | with the Library, with the complete machine-readable "work that | |
290 | uses the Library", as object code and/or source code, so that the | |
291 | user can modify the Library and then relink to produce a modified | |
292 | executable containing the modified Library. (It is understood | |
293 | that the user who changes the contents of definitions files in the | |
294 | Library will not necessarily be able to recompile the application | |
295 | to use the modified definitions.) | |
296 | ||
297 | b) Use a suitable shared library mechanism for linking with the | |
298 | Library. A suitable mechanism is one that (1) uses at run time a | |
299 | copy of the library already present on the user's computer system, | |
300 | rather than copying library functions into the executable, and (2) | |
301 | will operate properly with a modified version of the library, if | |
302 | the user installs one, as long as the modified version is | |
303 | interface-compatible with the version that the work was made with. | |
304 | ||
305 | c) Accompany the work with a written offer, valid for at | |
306 | least three years, to give the same user the materials | |
307 | specified in Subsection 6a, above, for a charge no more | |
308 | than the cost of performing this distribution. | |
309 | ||
310 | d) If distribution of the work is made by offering access to copy | |
311 | from a designated place, offer equivalent access to copy the above | |
312 | specified materials from the same place. | |
313 | ||
314 | e) Verify that the user has already received a copy of these | |
315 | materials or that you have already sent this user a copy. | |
316 | ||
317 | For an executable, the required form of the "work that uses the | |
318 | Library" must include any data and utility programs needed for | |
319 | reproducing the executable from it. However, as a special exception, | |
320 | the materials to be distributed need not include anything that is | |
321 | normally distributed (in either source or binary form) with the major | |
322 | components (compiler, kernel, and so on) of the operating system on | |
323 | which the executable runs, unless that component itself accompanies | |
324 | the executable. | |
325 | ||
326 | It may happen that this requirement contradicts the license | |
327 | restrictions of other proprietary libraries that do not normally | |
328 | accompany the operating system. Such a contradiction means you cannot | |
329 | use both them and the Library together in an executable that you | |
330 | distribute. | |
331 | ||
332 | 7. You may place library facilities that are a work based on the | |
333 | Library side-by-side in a single library together with other library | |
334 | facilities not covered by this License, and distribute such a combined | |
335 | library, provided that the separate distribution of the work based on | |
336 | the Library and of the other library facilities is otherwise | |
337 | permitted, and provided that you do these two things: | |
338 | ||
339 | a) Accompany the combined library with a copy of the same work | |
340 | based on the Library, uncombined with any other library | |
341 | facilities. This must be distributed under the terms of the | |
342 | Sections above. | |
343 | ||
344 | b) Give prominent notice with the combined library of the fact | |
345 | that part of it is a work based on the Library, and explaining | |
346 | where to find the accompanying uncombined form of the same work. | |
347 | ||
348 | 8. You may not copy, modify, sublicense, link with, or distribute | |
349 | the Library except as expressly provided under this License. Any | |
350 | attempt otherwise to copy, modify, sublicense, link with, or | |
351 | distribute the Library is void, and will automatically terminate your | |
352 | rights under this License. However, parties who have received copies, | |
353 | or rights, from you under this License will not have their licenses | |
354 | terminated so long as such parties remain in full compliance. | |
355 | ||
356 | 9. You are not required to accept this License, since you have not | |
357 | signed it. However, nothing else grants you permission to modify or | |
358 | distribute the Library or its derivative works. These actions are | |
359 | prohibited by law if you do not accept this License. Therefore, by | |
360 | modifying or distributing the Library (or any work based on the | |
361 | Library), you indicate your acceptance of this License to do so, and | |
362 | all its terms and conditions for copying, distributing or modifying | |
363 | the Library or works based on it. | |
364 | ||
365 | 10. Each time you redistribute the Library (or any work based on the | |
366 | Library), the recipient automatically receives a license from the | |
367 | original licensor to copy, distribute, link with or modify the Library | |
368 | subject to these terms and conditions. You may not impose any further | |
369 | restrictions on the recipients' exercise of the rights granted herein. | |
370 | You are not responsible for enforcing compliance by third parties with | |
371 | this License. | |
372 | ||
373 | 11. If, as a consequence of a court judgment or allegation of patent | |
374 | infringement or for any other reason (not limited to patent issues), | |
375 | conditions are imposed on you (whether by court order, agreement or | |
376 | otherwise) that contradict the conditions of this License, they do not | |
377 | excuse you from the conditions of this License. If you cannot | |
378 | distribute so as to satisfy simultaneously your obligations under this | |
379 | License and any other pertinent obligations, then as a consequence you | |
380 | may not distribute the Library at all. For example, if a patent | |
381 | license would not permit royalty-free redistribution of the Library by | |
382 | all those who receive copies directly or indirectly through you, then | |
383 | the only way you could satisfy both it and this License would be to | |
384 | refrain entirely from distribution of the Library. | |
385 | ||
386 | If any portion of this section is held invalid or unenforceable under any | |
387 | particular circumstance, the balance of the section is intended to apply, | |
388 | and the section as a whole is intended to apply in other circumstances. | |
389 | ||
390 | It is not the purpose of this section to induce you to infringe any | |
391 | patents or other property right claims or to contest validity of any | |
392 | such claims; this section has the sole purpose of protecting the | |
393 | integrity of the free software distribution system which is | |
394 | implemented by public license practices. Many people have made | |
395 | generous contributions to the wide range of software distributed | |
396 | through that system in reliance on consistent application of that | |
397 | system; it is up to the author/donor to decide if he or she is willing | |
398 | to distribute software through any other system and a licensee cannot | |
399 | impose that choice. | |
400 | ||
401 | This section is intended to make thoroughly clear what is believed to | |
402 | be a consequence of the rest of this License. | |
403 | ||
404 | 12. If the distribution and/or use of the Library is restricted in | |
405 | certain countries either by patents or by copyrighted interfaces, the | |
406 | original copyright holder who places the Library under this License may add | |
407 | an explicit geographical distribution limitation excluding those countries, | |
408 | so that distribution is permitted only in or among countries not thus | |
409 | excluded. In such case, this License incorporates the limitation as if | |
410 | written in the body of this License. | |
411 | ||
412 | 13. The Free Software Foundation may publish revised and/or new | |
413 | versions of the Lesser General Public License from time to time. | |
414 | Such new versions will be similar in spirit to the present version, | |
415 | but may differ in detail to address new problems or concerns. | |
416 | ||
417 | Each version is given a distinguishing version number. If the Library | |
418 | specifies a version number of this License which applies to it and | |
419 | "any later version", you have the option of following the terms and | |
420 | conditions either of that version or of any later version published by | |
421 | the Free Software Foundation. If the Library does not specify a | |
422 | license version number, you may choose any version ever published by | |
423 | the Free Software Foundation. | |
424 | ||
425 | 14. If you wish to incorporate parts of the Library into other free | |
426 | programs whose distribution conditions are incompatible with these, | |
427 | write to the author to ask for permission. For software which is | |
428 | copyrighted by the Free Software Foundation, write to the Free | |
429 | Software Foundation; we sometimes make exceptions for this. Our | |
430 | decision will be guided by the two goals of preserving the free status | |
431 | of all derivatives of our free software and of promoting the sharing | |
432 | and reuse of software generally. | |
433 | ||
434 | NO WARRANTY | |
435 | ||
436 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | |
437 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | |
438 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | |
439 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | |
440 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | |
441 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
442 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | |
443 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | |
444 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
445 | ||
446 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | |
447 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | |
448 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | |
449 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | |
450 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | |
451 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | |
452 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | |
453 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | |
454 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | |
455 | DAMAGES. | |
456 | ||
457 | END OF TERMS AND CONDITIONS | |
458 | ||
459 | How to Apply These Terms to Your New Libraries | |
460 | ||
461 | If you develop a new library, and you want it to be of the greatest | |
462 | possible use to the public, we recommend making it free software that | |
463 | everyone can redistribute and change. You can do so by permitting | |
464 | redistribution under these terms (or, alternatively, under the terms of the | |
465 | ordinary General Public License). | |
466 | ||
467 | To apply these terms, attach the following notices to the library. It is | |
468 | safest to attach them to the start of each source file to most effectively | |
469 | convey the exclusion of warranty; and each file should have at least the | |
470 | "copyright" line and a pointer to where the full notice is found. | |
471 | ||
472 | <one line to give the library's name and a brief idea of what it does.> | |
473 | Copyright (C) <year> <name of author> | |
474 | ||
475 | This library is free software; you can redistribute it and/or | |
476 | modify it under the terms of the GNU Lesser General Public | |
477 | License as published by the Free Software Foundation; either | |
478 | version 2.1 of the License, or (at your option) any later version. | |
479 | ||
480 | This library is distributed in the hope that it will be useful, | |
481 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
482 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
483 | Lesser General Public License for more details. | |
484 | ||
485 | You should have received a copy of the GNU Lesser General Public | |
486 | License along with this library; if not, write to the Free Software | |
487 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
488 | ||
489 | Also add information on how to contact you by electronic and paper mail. | |
490 | ||
491 | You should also get your employer (if you work as a programmer) or your | |
492 | school, if any, to sign a "copyright disclaimer" for the library, if | |
493 | necessary. Here is a sample; alter the names: | |
494 | ||
495 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | |
496 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | |
497 | ||
498 | <signature of Ty Coon>, 1 April 1990 | |
499 | Ty Coon, President of Vice | |
500 | ||
501 | That's all there is to it! |
0 | 2016-12-20 S. Thiell <sthiell@stanford.edu> | |
1 | ||
2 | * Version 1.7.3 released. | |
3 | ||
4 | * conf/groups.conf.d: add an external group source example file for xCAT | |
5 | static groups (xcat.conf.example). | |
6 | ||
7 | 2016-12-18 S. Thiell <sthiell@stanford.edu> | |
8 | ||
9 | * Clush.py: fix sorting issue with clush -L (ticket #326). | |
10 | ||
11 | 2016-11-06 S. Thiell <sthiell@stanford.edu> | |
12 | ||
13 | * cluset: add cluset command with doc to avoid a conflict with xCAT's | |
14 | nodeset command (ticket #300). | |
15 | ||
16 | 2016-10-12 All contributors | |
17 | ||
18 | * Change license from "CeCILL-C V1" to "LGPL v2.1 or later". | |
19 | ||
20 | 2016-10-04 S. Thiell <sthiell@stanford.edu> | |
21 | ||
22 | * setup.py: remove scripts/*; use console_scripts instead. | |
23 | ||
24 | 2016-10-02 S. Thiell <sthiell@stanford.edu> | |
25 | ||
26 | * Tree.py: in copy mode, do not send tar data to local targets, but only | |
27 | remote ones; this does fix broken pipe errors (ticket #319). | |
28 | ||
29 | * Engine.py: implement basic per worker fanout (private), allowing the use | |
30 | of fanout=1 in tree mode (ticket #322). | |
31 | ||
32 | 2016-06-18 S. Thiell <sthiell@stanford.edu> | |
33 | ||
34 | * Version 1.7.2 released. | |
35 | ||
36 | 2016-06-07 D. Martinet <dominique.martinet@cea.fr> | |
37 | ||
38 | * Clush/Nodeset: add --pick N option (ticket #311). | |
39 | ||
0 | 40 | 2016-05-22 S. Thiell <sthiell@stanford.edu> |
1 | 41 | |
42 | * Tree.py: fix the tracking of gateway active targets (ticket #308). | |
2 | 43 | * EngineClient.py: handle broken pipe on write() (ticket #196). |
3 | 44 | |
4 | 45 | 2016-04-24 S. Thiell <sthiell@stanford.edu> |
0 | ||
1 | CeCILL-C FREE SOFTWARE LICENSE AGREEMENT | |
2 | ||
3 | ||
4 | Notice | |
5 | ||
6 | This Agreement is a Free Software license agreement that is the result | |
7 | of discussions between its authors in order to ensure compliance with | |
8 | the two main principles guiding its drafting: | |
9 | ||
10 | * firstly, compliance with the principles governing the distribution | |
11 | of Free Software: access to source code, broad rights granted to | |
12 | users, | |
13 | * secondly, the election of a governing law, French law, with which | |
14 | it is conformant, both as regards the law of torts and | |
15 | intellectual property law, and the protection that it offers to | |
16 | both authors and holders of the economic rights over software. | |
17 | ||
18 | The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) | |
19 | license are: | |
20 | ||
21 | Commissariat à l'Energie Atomique - CEA, a public scientific, technical | |
22 | and industrial research establishment, having its principal place of | |
23 | business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France. | |
24 | ||
25 | Centre National de la Recherche Scientifique - CNRS, a public scientific | |
26 | and technological establishment, having its principal place of business | |
27 | at 3 rue Michel-Ange, 75794 Paris cedex 16, France. | |
28 | ||
29 | Institut National de Recherche en Informatique et en Automatique - | |
30 | INRIA, a public scientific and technological establishment, having its | |
31 | principal place of business at Domaine de Voluceau, Rocquencourt, BP | |
32 | 105, 78153 Le Chesnay cedex, France. | |
33 | ||
34 | ||
35 | Preamble | |
36 | ||
37 | The purpose of this Free Software license agreement is to grant users | |
38 | the right to modify and re-use the software governed by this license. | |
39 | ||
40 | The exercising of this right is conditional upon the obligation to make | |
41 | available to the community the modifications made to the source code of | |
42 | the software so as to contribute to its evolution. | |
43 | ||
44 | In consideration of access to the source code and the rights to copy, | |
45 | modify and redistribute granted by the license, users are provided only | |
46 | with a limited warranty and the software's author, the holder of the | |
47 | economic rights, and the successive licensors only have limited liability. | |
48 | ||
49 | In this respect, the risks associated with loading, using, modifying | |
50 | and/or developing or reproducing the software by the user are brought to | |
51 | the user's attention, given its Free Software status, which may make it | |
52 | complicated to use, with the result that its use is reserved for | |
53 | developers and experienced professionals having in-depth computer | |
54 | knowledge. Users are therefore encouraged to load and test the | |
55 | suitability of the software as regards their requirements in conditions | |
56 | enabling the security of their systems and/or data to be ensured and, | |
57 | more generally, to use and operate it in the same conditions of | |
58 | security. This Agreement may be freely reproduced and published, | |
59 | provided it is not altered, and that no provisions are either added or | |
60 | removed herefrom. | |
61 | ||
62 | This Agreement may apply to any or all software for which the holder of | |
63 | the economic rights decides to submit the use thereof to its provisions. | |
64 | ||
65 | ||
66 | Article 1 - DEFINITIONS | |
67 | ||
68 | For the purpose of this Agreement, when the following expressions | |
69 | commence with a capital letter, they shall have the following meaning: | |
70 | ||
71 | Agreement: means this license agreement, and its possible subsequent | |
72 | versions and annexes. | |
73 | ||
74 | Software: means the software in its Object Code and/or Source Code form | |
75 | and, where applicable, its documentation, "as is" when the Licensee | |
76 | accepts the Agreement. | |
77 | ||
78 | Initial Software: means the Software in its Source Code and possibly its | |
79 | Object Code form and, where applicable, its documentation, "as is" when | |
80 | it is first distributed under the terms and conditions of the Agreement. | |
81 | ||
82 | Modified Software: means the Software modified by at least one | |
83 | Integrated Contribution. | |
84 | ||
85 | Source Code: means all the Software's instructions and program lines to | |
86 | which access is required so as to modify the Software. | |
87 | ||
88 | Object Code: means the binary files originating from the compilation of | |
89 | the Source Code. | |
90 | ||
91 | Holder: means the holder(s) of the economic rights over the Initial | |
92 | Software. | |
93 | ||
94 | Licensee: means the Software user(s) having accepted the Agreement. | |
95 | ||
96 | Contributor: means a Licensee having made at least one Integrated | |
97 | Contribution. | |
98 | ||
99 | Licensor: means the Holder, or any other individual or legal entity, who | |
100 | distributes the Software under the Agreement. | |
101 | ||
102 | Integrated Contribution: means any or all modifications, corrections, | |
103 | translations, adaptations and/or new functions integrated into the | |
104 | Source Code by any or all Contributors. | |
105 | ||
106 | Related Module: means a set of sources files including their | |
107 | documentation that, without modification to the Source Code, enables | |
108 | supplementary functions or services in addition to those offered by the | |
109 | Software. | |
110 | ||
111 | Derivative Software: means any combination of the Software, modified or | |
112 | not, and of a Related Module. | |
113 | ||
114 | Parties: mean both the Licensee and the Licensor. | |
115 | ||
116 | These expressions may be used both in singular and plural form. | |
117 | ||
118 | ||
119 | Article 2 - PURPOSE | |
120 | ||
121 | The purpose of the Agreement is the grant by the Licensor to the | |
122 | Licensee of a non-exclusive, transferable and worldwide license for the | |
123 | Software as set forth in Article 5 hereinafter for the whole term of the | |
124 | protection granted by the rights over said Software. | |
125 | ||
126 | ||
127 | Article 3 - ACCEPTANCE | |
128 | ||
129 | 3.1 The Licensee shall be deemed as having accepted the terms and | |
130 | conditions of this Agreement upon the occurrence of the first of the | |
131 | following events: | |
132 | ||
133 | * (i) loading the Software by any or all means, notably, by | |
134 | downloading from a remote server, or by loading from a physical | |
135 | medium; | |
136 | * (ii) the first time the Licensee exercises any of the rights | |
137 | granted hereunder. | |
138 | ||
139 | 3.2 One copy of the Agreement, containing a notice relating to the | |
140 | characteristics of the Software, to the limited warranty, and to the | |
141 | fact that its use is restricted to experienced users has been provided | |
142 | to the Licensee prior to its acceptance as set forth in Article 3.1 | |
143 | hereinabove, and the Licensee hereby acknowledges that it has read and | |
144 | understood it. | |
145 | ||
146 | ||
147 | Article 4 - EFFECTIVE DATE AND TERM | |
148 | ||
149 | ||
150 | 4.1 EFFECTIVE DATE | |
151 | ||
152 | The Agreement shall become effective on the date when it is accepted by | |
153 | the Licensee as set forth in Article 3.1. | |
154 | ||
155 | ||
156 | 4.2 TERM | |
157 | ||
158 | The Agreement shall remain in force for the entire legal term of | |
159 | protection of the economic rights over the Software. | |
160 | ||
161 | ||
162 | Article 5 - SCOPE OF RIGHTS GRANTED | |
163 | ||
164 | The Licensor hereby grants to the Licensee, who accepts, the following | |
165 | rights over the Software for any or all use, and for the term of the | |
166 | Agreement, on the basis of the terms and conditions set forth hereinafter. | |
167 | ||
168 | Besides, if the Licensor owns or comes to own one or more patents | |
169 | protecting all or part of the functions of the Software or of its | |
170 | components, the Licensor undertakes not to enforce the rights granted by | |
171 | these patents against successive Licensees using, exploiting or | |
172 | modifying the Software. If these patents are transferred, the Licensor | |
173 | undertakes to have the transferees subscribe to the obligations set | |
174 | forth in this paragraph. | |
175 | ||
176 | ||
177 | 5.1 RIGHT OF USE | |
178 | ||
179 | The Licensee is authorized to use the Software, without any limitation | |
180 | as to its fields of application, with it being hereinafter specified | |
181 | that this comprises: | |
182 | ||
183 | 1. permanent or temporary reproduction of all or part of the Software | |
184 | by any or all means and in any or all form. | |
185 | ||
186 | 2. loading, displaying, running, or storing the Software on any or | |
187 | all medium. | |
188 | ||
189 | 3. entitlement to observe, study or test its operation so as to | |
190 | determine the ideas and principles behind any or all constituent | |
191 | elements of said Software. This shall apply when the Licensee | |
192 | carries out any or all loading, displaying, running, transmission | |
193 | or storage operation as regards the Software, that it is entitled | |
194 | to carry out hereunder. | |
195 | ||
196 | ||
197 | 5.2 RIGHT OF MODIFICATION | |
198 | ||
199 | The right of modification includes the right to translate, adapt, | |
200 | arrange, or make any or all modifications to the Software, and the right | |
201 | to reproduce the resulting software. It includes, in particular, the | |
202 | right to create a Derivative Software. | |
203 | ||
204 | The Licensee is authorized to make any or all modification to the | |
205 | Software provided that it includes an explicit notice that it is the | |
206 | author of said modification and indicates the date of the creation thereof. | |
207 | ||
208 | ||
209 | 5.3 RIGHT OF DISTRIBUTION | |
210 | ||
211 | In particular, the right of distribution includes the right to publish, | |
212 | transmit and communicate the Software to the general public on any or | |
213 | all medium, and by any or all means, and the right to market, either in | |
214 | consideration of a fee, or free of charge, one or more copies of the | |
215 | Software by any means. | |
216 | ||
217 | The Licensee is further authorized to distribute copies of the modified | |
218 | or unmodified Software to third parties according to the terms and | |
219 | conditions set forth hereinafter. | |
220 | ||
221 | ||
222 | 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION | |
223 | ||
224 | The Licensee is authorized to distribute true copies of the Software in | |
225 | Source Code or Object Code form, provided that said distribution | |
226 | complies with all the provisions of the Agreement and is accompanied by: | |
227 | ||
228 | 1. a copy of the Agreement, | |
229 | ||
230 | 2. a notice relating to the limitation of both the Licensor's | |
231 | warranty and liability as set forth in Articles 8 and 9, | |
232 | ||
233 | and that, in the event that only the Object Code of the Software is | |
234 | redistributed, the Licensee allows effective access to the full Source | |
235 | Code of the Software at a minimum during the entire period of its | |
236 | distribution of the Software, it being understood that the additional | |
237 | cost of acquiring the Source Code shall not exceed the cost of | |
238 | transferring the data. | |
239 | ||
240 | ||
241 | 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE | |
242 | ||
243 | When the Licensee makes an Integrated Contribution to the Software, the | |
244 | terms and conditions for the distribution of the resulting Modified | |
245 | Software become subject to all the provisions of this Agreement. | |
246 | ||
247 | The Licensee is authorized to distribute the Modified Software, in | |
248 | source code or object code form, provided that said distribution | |
249 | complies with all the provisions of the Agreement and is accompanied by: | |
250 | ||
251 | 1. a copy of the Agreement, | |
252 | ||
253 | 2. a notice relating to the limitation of both the Licensor's | |
254 | warranty and liability as set forth in Articles 8 and 9, | |
255 | ||
256 | and that, in the event that only the object code of the Modified | |
257 | Software is redistributed, the Licensee allows effective access to the | |
258 | full source code of the Modified Software at a minimum during the entire | |
259 | period of its distribution of the Modified Software, it being understood | |
260 | that the additional cost of acquiring the source code shall not exceed | |
261 | the cost of transferring the data. | |
262 | ||
263 | ||
264 | 5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE | |
265 | ||
266 | When the Licensee creates Derivative Software, this Derivative Software | |
267 | may be distributed under a license agreement other than this Agreement, | |
268 | subject to compliance with the requirement to include a notice | |
269 | concerning the rights over the Software as defined in Article 6.4. | |
270 | In the event the creation of the Derivative Software required modification | |
271 | of the Source Code, the Licensee undertakes that: | |
272 | ||
273 | 1. the resulting Modified Software will be governed by this Agreement, | |
274 | 2. the Integrated Contributions in the resulting Modified Software | |
275 | will be clearly identified and documented, | |
276 | 3. the Licensee will allow effective access to the source code of the | |
277 | Modified Software, at a minimum during the entire period of | |
278 | distribution of the Derivative Software, such that such | |
279 | modifications may be carried over in a subsequent version of the | |
280 | Software; it being understood that the additional cost of | |
281 | purchasing the source code of the Modified Software shall not | |
282 | exceed the cost of transferring the data. | |
283 | ||
284 | ||
285 | 5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE | |
286 | ||
287 | When a Modified Software contains an Integrated Contribution subject to | |
288 | the CeCILL license agreement, or when a Derivative Software contains a | |
289 | Related Module subject to the CeCILL license agreement, the provisions | |
290 | set forth in the third item of Article 6.4 are optional. | |
291 | ||
292 | ||
293 | Article 6 - INTELLECTUAL PROPERTY | |
294 | ||
295 | ||
296 | 6.1 OVER THE INITIAL SOFTWARE | |
297 | ||
298 | The Holder owns the economic rights over the Initial Software. Any or | |
299 | all use of the Initial Software is subject to compliance with the terms | |
300 | and conditions under which the Holder has elected to distribute its work | |
301 | and no one shall be entitled to modify the terms and conditions for the | |
302 | distribution of said Initial Software. | |
303 | ||
304 | The Holder undertakes that the Initial Software will remain ruled at | |
305 | least by this Agreement, for the duration set forth in Article 4.2. | |
306 | ||
307 | ||
308 | 6.2 OVER THE INTEGRATED CONTRIBUTIONS | |
309 | ||
310 | The Licensee who develops an Integrated Contribution is the owner of the | |
311 | intellectual property rights over this Contribution as defined by | |
312 | applicable law. | |
313 | ||
314 | ||
315 | 6.3 OVER THE RELATED MODULES | |
316 | ||
317 | The Licensee who develops a Related Module is the owner of the | |
318 | intellectual property rights over this Related Module as defined by | |
319 | applicable law and is free to choose the type of agreement that shall | |
320 | govern its distribution under the conditions defined in Article 5.3.3. | |
321 | ||
322 | ||
323 | 6.4 NOTICE OF RIGHTS | |
324 | ||
325 | The Licensee expressly undertakes: | |
326 | ||
327 | 1. not to remove, or modify, in any manner, the intellectual property | |
328 | notices attached to the Software; | |
329 | ||
330 | 2. to reproduce said notices, in an identical manner, in the copies | |
331 | of the Software modified or not; | |
332 | ||
333 | 3. to ensure that use of the Software, its intellectual property | |
334 | notices and the fact that it is governed by the Agreement is | |
335 | indicated in a text that is easily accessible, specifically from | |
336 | the interface of any Derivative Software. | |
337 | ||
338 | The Licensee undertakes not to directly or indirectly infringe the | |
339 | intellectual property rights of the Holder and/or Contributors on the | |
340 | Software and to take, where applicable, vis-Ã -vis its staff, any and all | |
341 | measures required to ensure respect of said intellectual property rights | |
342 | of the Holder and/or Contributors. | |
343 | ||
344 | ||
345 | Article 7 - RELATED SERVICES | |
346 | ||
347 | 7.1 Under no circumstances shall the Agreement oblige the Licensor to | |
348 | provide technical assistance or maintenance services for the Software. | |
349 | ||
350 | However, the Licensor is entitled to offer this type of services. The | |
351 | terms and conditions of such technical assistance, and/or such | |
352 | maintenance, shall be set forth in a separate instrument. Only the | |
353 | Licensor offering said maintenance and/or technical assistance services | |
354 | shall incur liability therefor. | |
355 | ||
356 | 7.2 Similarly, any Licensor is entitled to offer to its licensees, under | |
357 | its sole responsibility, a warranty, that shall only be binding upon | |
358 | itself, for the redistribution of the Software and/or the Modified | |
359 | Software, under terms and conditions that it is free to decide. Said | |
360 | warranty, and the financial terms and conditions of its application, | |
361 | shall be subject of a separate instrument executed between the Licensor | |
362 | and the Licensee. | |
363 | ||
364 | ||
365 | Article 8 - LIABILITY | |
366 | ||
367 | 8.1 Subject to the provisions of Article 8.2, the Licensee shall be | |
368 | entitled to claim compensation for any direct loss it may have suffered | |
369 | from the Software as a result of a fault on the part of the relevant | |
370 | Licensor, subject to providing evidence thereof. | |
371 | ||
372 | 8.2 The Licensor's liability is limited to the commitments made under | |
373 | this Agreement and shall not be incurred as a result of in particular: | |
374 | (i) loss due the Licensee's total or partial failure to fulfill its | |
375 | obligations, (ii) direct or consequential loss that is suffered by the | |
376 | Licensee due to the use or performance of the Software, and (iii) more | |
377 | generally, any consequential loss. In particular the Parties expressly | |
378 | agree that any or all pecuniary or business loss (i.e. loss of data, | |
379 | loss of profits, operating loss, loss of customers or orders, | |
380 | opportunity cost, any disturbance to business activities) or any or all | |
381 | legal proceedings instituted against the Licensee by a third party, | |
382 | shall constitute consequential loss and shall not provide entitlement to | |
383 | any or all compensation from the Licensor. | |
384 | ||
385 | ||
386 | Article 9 - WARRANTY | |
387 | ||
388 | 9.1 The Licensee acknowledges that the scientific and technical | |
389 | state-of-the-art when the Software was distributed did not enable all | |
390 | possible uses to be tested and verified, nor for the presence of | |
391 | possible defects to be detected. In this respect, the Licensee's | |
392 | attention has been drawn to the risks associated with loading, using, | |
393 | modifying and/or developing and reproducing the Software which are | |
394 | reserved for experienced users. | |
395 | ||
396 | The Licensee shall be responsible for verifying, by any or all means, | |
397 | the suitability of the product for its requirements, its good working | |
398 | order, and for ensuring that it shall not cause damage to either persons | |
399 | or properties. | |
400 | ||
401 | 9.2 The Licensor hereby represents, in good faith, that it is entitled | |
402 | to grant all the rights over the Software (including in particular the | |
403 | rights set forth in Article 5). | |
404 | ||
405 | 9.3 The Licensee acknowledges that the Software is supplied "as is" by | |
406 | the Licensor without any other express or tacit warranty, other than | |
407 | that provided for in Article 9.2 and, in particular, without any warranty | |
408 | as to its commercial value, its secured, safe, innovative or relevant | |
409 | nature. | |
410 | ||
411 | Specifically, the Licensor does not warrant that the Software is free | |
412 | from any error, that it will operate without interruption, that it will | |
413 | be compatible with the Licensee's own equipment and software | |
414 | configuration, nor that it will meet the Licensee's requirements. | |
415 | ||
416 | 9.4 The Licensor does not either expressly or tacitly warrant that the | |
417 | Software does not infringe any third party intellectual property right | |
418 | relating to a patent, software or any other property right. Therefore, | |
419 | the Licensor disclaims any and all liability towards the Licensee | |
420 | arising out of any or all proceedings for infringement that may be | |
421 | instituted in respect of the use, modification and redistribution of the | |
422 | Software. Nevertheless, should such proceedings be instituted against | |
423 | the Licensee, the Licensor shall provide it with technical and legal | |
424 | assistance for its defense. Such technical and legal assistance shall be | |
425 | decided on a case-by-case basis between the relevant Licensor and the | |
426 | Licensee pursuant to a memorandum of understanding. The Licensor | |
427 | disclaims any and all liability as regards the Licensee's use of the | |
428 | name of the Software. No warranty is given as regards the existence of | |
429 | prior rights over the name of the Software or as regards the existence | |
430 | of a trademark. | |
431 | ||
432 | ||
433 | Article 10 - TERMINATION | |
434 | ||
435 | 10.1 In the event of a breach by the Licensee of its obligations | |
436 | hereunder, the Licensor may automatically terminate this Agreement | |
437 | thirty (30) days after notice has been sent to the Licensee and has | |
438 | remained ineffective. | |
439 | ||
440 | 10.2 A Licensee whose Agreement is terminated shall no longer be | |
441 | authorized to use, modify or distribute the Software. However, any | |
442 | licenses that it may have granted prior to termination of the Agreement | |
443 | shall remain valid subject to their having been granted in compliance | |
444 | with the terms and conditions hereof. | |
445 | ||
446 | ||
447 | Article 11 - MISCELLANEOUS | |
448 | ||
449 | ||
450 | 11.1 EXCUSABLE EVENTS | |
451 | ||
452 | Neither Party shall be liable for any or all delay, or failure to | |
453 | perform the Agreement, that may be attributable to an event of force | |
454 | majeure, an act of God or an outside cause, such as defective | |
455 | functioning or interruptions of the electricity or telecommunications | |
456 | networks, network paralysis following a virus attack, intervention by | |
457 | government authorities, natural disasters, water damage, earthquakes, | |
458 | fire, explosions, strikes and labor unrest, war, etc. | |
459 | ||
460 | 11.2 Any failure by either Party, on one or more occasions, to invoke | |
461 | one or more of the provisions hereof, shall under no circumstances be | |
462 | interpreted as being a waiver by the interested Party of its right to | |
463 | invoke said provision(s) subsequently. | |
464 | ||
465 | 11.3 The Agreement cancels and replaces any or all previous agreements, | |
466 | whether written or oral, between the Parties and having the same | |
467 | purpose, and constitutes the entirety of the agreement between said | |
468 | Parties concerning said purpose. No supplement or modification to the | |
469 | terms and conditions hereof shall be effective as between the Parties | |
470 | unless it is made in writing and signed by their duly authorized | |
471 | representatives. | |
472 | ||
473 | 11.4 In the event that one or more of the provisions hereof were to | |
474 | conflict with a current or future applicable act or legislative text, | |
475 | said act or legislative text shall prevail, and the Parties shall make | |
476 | the necessary amendments so as to comply with said act or legislative | |
477 | text. All other provisions shall remain effective. Similarly, invalidity | |
478 | of a provision of the Agreement, for any reason whatsoever, shall not | |
479 | cause the Agreement as a whole to be invalid. | |
480 | ||
481 | ||
482 | 11.5 LANGUAGE | |
483 | ||
484 | The Agreement is drafted in both French and English and both versions | |
485 | are deemed authentic. | |
486 | ||
487 | ||
488 | Article 12 - NEW VERSIONS OF THE AGREEMENT | |
489 | ||
490 | 12.1 Any person is authorized to duplicate and distribute copies of this | |
491 | Agreement. | |
492 | ||
493 | 12.2 So as to ensure coherence, the wording of this Agreement is | |
494 | protected and may only be modified by the authors of the License, who | |
495 | reserve the right to periodically publish updates or new versions of the | |
496 | Agreement, each with a separate number. These subsequent versions may | |
497 | address new issues encountered by Free Software. | |
498 | ||
499 | 12.3 Any Software distributed under a given version of the Agreement may | |
500 | only be subsequently distributed under the same version of the Agreement | |
501 | or a subsequent version. | |
502 | ||
503 | ||
504 | Article 13 - GOVERNING LAW AND JURISDICTION | |
505 | ||
506 | 13.1 The Agreement is governed by French law. The Parties agree to | |
507 | endeavor to seek an amicable solution to any disagreements or disputes | |
508 | that may arise during the performance of the Agreement. | |
509 | ||
510 | 13.2 Failing an amicable solution within two (2) months as from their | |
511 | occurrence, and unless emergency proceedings are necessary, the | |
512 | disagreements or disputes shall be referred to the Paris Courts having | |
513 | jurisdiction, by the more diligent Party. | |
514 | ||
515 | ||
516 | Version 1.0 dated 2006-09-05. |
0 | ||
1 | CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-C | |
2 | ||
3 | ||
4 | Avertissement | |
5 | ||
6 | Ce contrat est une licence de logiciel libre issue d'une concertation | |
7 | entre ses auteurs afin que le respect de deux grands principes préside à | |
8 | sa rédaction: | |
9 | ||
10 | * d'une part, le respect des principes de diffusion des logiciels | |
11 | libres: accès au code source, droits étendus conférés aux | |
12 | utilisateurs, | |
13 | * d'autre part, la désignation d'un droit applicable, le droit | |
14 | français, auquel elle est conforme, tant au regard du droit de la | |
15 | responsabilité civile que du droit de la propriété intellectuelle | |
16 | et de la protection qu'il offre aux auteurs et titulaires des | |
17 | droits patrimoniaux sur un logiciel. | |
18 | ||
19 | Les auteurs de la licence CeCILL-C (pour Ce[a] C[nrs] I[nria] L[ogiciel] | |
20 | L[ibre]) sont: | |
21 | ||
22 | Commissariat à l'Energie Atomique - CEA, établissement public de | |
23 | recherche à caractère scientifique, technique et industriel, dont le | |
24 | siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris. | |
25 | ||
26 | Centre National de la Recherche Scientifique - CNRS, établissement | |
27 | public à caractère scientifique et technologique, dont le siège est | |
28 | situé 3 rue Michel-Ange, 75794 Paris cedex 16. | |
29 | ||
30 | Institut National de Recherche en Informatique et en Automatique - | |
31 | INRIA, établissement public à caractère scientifique et technologique, | |
32 | dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153 | |
33 | Le Chesnay cedex. | |
34 | ||
35 | ||
36 | Préambule | |
37 | ||
38 | Ce contrat est une licence de logiciel libre dont l'objectif est de | |
39 | conférer aux utilisateurs la liberté de modifier et de réutiliser le | |
40 | logiciel régi par cette licence. | |
41 | ||
42 | L'exercice de cette liberté est assorti d'une obligation de remettre à | |
43 | la disposition de la communauté les modifications apportées au code | |
44 | source du logiciel afin de contribuer à son évolution. | |
45 | ||
46 | L'accessibilité au code source et les droits de copie, de modification | |
47 | et de redistribution qui découlent de ce contrat ont pour contrepartie | |
48 | de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire | |
49 | peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et | |
50 | les concédants successifs qu'une responsabilité restreinte. | |
51 | ||
52 | A cet égard l'attention de l'utilisateur est attirée sur les risques | |
53 | associés au chargement, à l'utilisation, à la modification et/ou au | |
54 | développement et à la reproduction du logiciel par l'utilisateur étant | |
55 | donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |
56 | manipuler et qui le réserve donc à des développeurs ou des | |
57 | professionnels avertis possédant des connaissances informatiques | |
58 | approfondies. Les utilisateurs sont donc invités à charger et tester | |
59 | l'adéquation du logiciel à leurs besoins dans des conditions permettant | |
60 | d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus | |
61 | généralement, à l'utiliser et l'exploiter dans les mêmes conditions de | |
62 | sécurité. Ce contrat peut être reproduit et diffusé librement, sous | |
63 | réserve de le conserver en l'état, sans ajout ni suppression de clauses. | |
64 | ||
65 | Ce contrat est susceptible de s'appliquer à tout logiciel dont le | |
66 | titulaire des droits patrimoniaux décide de soumettre l'exploitation aux | |
67 | dispositions qu'il contient. | |
68 | ||
69 | ||
70 | Article 1 - DEFINITIONS | |
71 | ||
72 | Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une | |
73 | lettre capitale, auront la signification suivante: | |
74 | ||
75 | Contrat: désigne le présent contrat de licence, ses éventuelles versions | |
76 | postérieures et annexes. | |
77 | ||
78 | Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code | |
79 | Source et le cas échéant sa documentation, dans leur état au moment de | |
80 | l'acceptation du Contrat par le Licencié. | |
81 | ||
82 | Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et | |
83 | éventuellement de Code Objet et le cas échéant sa documentation, dans | |
84 | leur état au moment de leur première diffusion sous les termes du Contrat. | |
85 | ||
86 | Logiciel Modifié: désigne le Logiciel modifié par au moins une | |
87 | Contribution Intégrée. | |
88 | ||
89 | Code Source: désigne l'ensemble des instructions et des lignes de | |
90 | programme du Logiciel et auquel l'accès est nécessaire en vue de | |
91 | modifier le Logiciel. | |
92 | ||
93 | Code Objet: désigne les fichiers binaires issus de la compilation du | |
94 | Code Source. | |
95 | ||
96 | Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur | |
97 | sur le Logiciel Initial. | |
98 | ||
99 | Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le | |
100 | Contrat. | |
101 | ||
102 | Contributeur: désigne le Licencié auteur d'au moins une Contribution | |
103 | Intégrée. | |
104 | ||
105 | Concédant: désigne le Titulaire ou toute personne physique ou morale | |
106 | distribuant le Logiciel sous le Contrat. | |
107 | ||
108 | Contribution Intégrée: désigne l'ensemble des modifications, | |
109 | corrections, traductions, adaptations et/ou nouvelles fonctionnalités | |
110 | intégrées dans le Code Source par tout Contributeur. | |
111 | ||
112 | Module Lié: désigne un ensemble de fichiers sources y compris leur | |
113 | documentation qui, sans modification du Code Source, permet de réaliser | |
114 | des fonctionnalités ou services supplémentaires à ceux fournis par le | |
115 | Logiciel. | |
116 | ||
117 | Logiciel Dérivé: désigne toute combinaison du Logiciel, modifié ou non, | |
118 | et d'un Module Lié. | |
119 | ||
120 | Parties: désigne collectivement le Licencié et le Concédant. | |
121 | ||
122 | Ces termes s'entendent au singulier comme au pluriel. | |
123 | ||
124 | ||
125 | Article 2 - OBJET | |
126 | ||
127 | Le Contrat a pour objet la concession par le Concédant au Licencié d'une | |
128 | licence non exclusive, cessible et mondiale du Logiciel telle que | |
129 | définie ci-après à l'article 5 pour toute la durée de protection des droits | |
130 | portant sur ce Logiciel. | |
131 | ||
132 | ||
133 | Article 3 - ACCEPTATION | |
134 | ||
135 | 3.1 L'acceptation par le Licencié des termes du Contrat est réputée | |
136 | acquise du fait du premier des faits suivants: | |
137 | ||
138 | * (i) le chargement du Logiciel par tout moyen notamment par | |
139 | téléchargement à partir d'un serveur distant ou par chargement à | |
140 | partir d'un support physique; | |
141 | * (ii) le premier exercice par le Licencié de l'un quelconque des | |
142 | droits concédés par le Contrat. | |
143 | ||
144 | 3.2 Un exemplaire du Contrat, contenant notamment un avertissement | |
145 | relatif aux spécificités du Logiciel, à la restriction de garantie et à | |
146 | la limitation à un usage par des utilisateurs expérimentés a été mis à | |
147 | disposition du Licencié préalablement à son acceptation telle que | |
148 | définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris | |
149 | connaissance. | |
150 | ||
151 | ||
152 | Article 4 - ENTREE EN VIGUEUR ET DUREE | |
153 | ||
154 | ||
155 | 4.1 ENTREE EN VIGUEUR | |
156 | ||
157 | Le Contrat entre en vigueur à la date de son acceptation par le Licencié | |
158 | telle que définie en 3.1. | |
159 | ||
160 | ||
161 | 4.2 DUREE | |
162 | ||
163 | Le Contrat produira ses effets pendant toute la durée légale de | |
164 | protection des droits patrimoniaux portant sur le Logiciel. | |
165 | ||
166 | ||
167 | Article 5 - ETENDUE DES DROITS CONCEDES | |
168 | ||
169 | Le Concédant concède au Licencié, qui accepte, les droits suivants sur | |
170 | le Logiciel pour toutes destinations et pour la durée du Contrat dans | |
171 | les conditions ci-après détaillées. | |
172 | ||
173 | Par ailleurs, si le Concédant détient ou venait à détenir un ou | |
174 | plusieurs brevets d'invention protégeant tout ou partie des | |
175 | fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas | |
176 | opposer les éventuels droits conférés par ces brevets aux Licenciés | |
177 | successifs qui utiliseraient, exploiteraient ou modifieraient le | |
178 | Logiciel. En cas de cession de ces brevets, le Concédant s'engage à | |
179 | faire reprendre les obligations du présent alinéa aux cessionnaires. | |
180 | ||
181 | ||
182 | 5.1 DROIT D'UTILISATION | |
183 | ||
184 | Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant | |
185 | aux domaines d'application, étant ci-après précisé que cela comporte: | |
186 | ||
187 | 1. la reproduction permanente ou provisoire du Logiciel en tout ou | |
188 | partie par tout moyen et sous toute forme. | |
189 | ||
190 | 2. le chargement, l'affichage, l'exécution, ou le stockage du | |
191 | Logiciel sur tout support. | |
192 | ||
193 | 3. la possibilité d'en observer, d'en étudier, ou d'en tester le | |
194 | fonctionnement afin de déterminer les idées et principes qui sont | |
195 | à la base de n'importe quel élément de ce Logiciel; et ceci, | |
196 | lorsque le Licencié effectue toute opération de chargement, | |
197 | d'affichage, d'exécution, de transmission ou de stockage du | |
198 | Logiciel qu'il est en droit d'effectuer en vertu du Contrat. | |
199 | ||
200 | ||
201 | 5.2 DROIT DE MODIFICATION | |
202 | ||
203 | Le droit de modification comporte le droit de traduire, d'adapter, | |
204 | d'arranger ou d'apporter toute autre modification au Logiciel et le | |
205 | droit de reproduire le logiciel en résultant. Il comprend en particulier | |
206 | le droit de créer un Logiciel Dérivé. | |
207 | ||
208 | Le Licencié est autorisé à apporter toute modification au Logiciel sous | |
209 | réserve de mentionner, de façon explicite, son nom en tant qu'auteur de | |
210 | cette modification et la date de création de celle-ci. | |
211 | ||
212 | ||
213 | 5.3 DROIT DE DISTRIBUTION | |
214 | ||
215 | Le droit de distribution comporte notamment le droit de diffuser, de | |
216 | transmettre et de communiquer le Logiciel au public sur tout support et | |
217 | par tout moyen ainsi que le droit de mettre sur le marché à titre | |
218 | onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé. | |
219 | ||
220 | Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou | |
221 | non, à des tiers dans les conditions ci-après détaillées. | |
222 | ||
223 | ||
224 | 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION | |
225 | ||
226 | Le Licencié est autorisé à distribuer des copies conformes du Logiciel, | |
227 | sous forme de Code Source ou de Code Objet, Ã condition que cette | |
228 | distribution respecte les dispositions du Contrat dans leur totalité et | |
229 | soit accompagnée: | |
230 | ||
231 | 1. d'un exemplaire du Contrat, | |
232 | ||
233 | 2. d'un avertissement relatif à la restriction de garantie et de | |
234 | responsabilité du Concédant telle que prévue aux articles 8 | |
235 | et 9, | |
236 | ||
237 | et que, dans le cas où seul le Code Objet du Logiciel est redistribué, | |
238 | le Licencié permette un accès effectif au Code Source complet du | |
239 | Logiciel pendant au moins toute la durée de sa distribution du Logiciel, | |
240 | étant entendu que le coût additionnel d'acquisition du Code Source ne | |
241 | devra pas excéder le simple coût de transfert des données. | |
242 | ||
243 | ||
244 | 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE | |
245 | ||
246 | Lorsque le Licencié apporte une Contribution Intégrée au Logiciel, les | |
247 | conditions de distribution du Logiciel Modifié en résultant sont alors | |
248 | soumises à l'intégralité des dispositions du Contrat. | |
249 | ||
250 | Le Licencié est autorisé à distribuer le Logiciel Modifié sous forme de | |
251 | code source ou de code objet, Ã condition que cette distribution | |
252 | respecte les dispositions du Contrat dans leur totalité et soit | |
253 | accompagnée: | |
254 | ||
255 | 1. d'un exemplaire du Contrat, | |
256 | ||
257 | 2. d'un avertissement relatif à la restriction de garantie et de | |
258 | responsabilité du Concédant telle que prévue aux articles 8 | |
259 | et 9, | |
260 | ||
261 | et que, dans le cas où seul le code objet du Logiciel Modifié est | |
262 | redistribué, le Licencié permette un accès effectif à son code source | |
263 | complet pendant au moins toute la durée de sa distribution du Logiciel | |
264 | Modifié, étant entendu que le coût additionnel d'acquisition du code | |
265 | source ne devra pas excéder le simple coût de transfert des données. | |
266 | ||
267 | ||
268 | 5.3.3 DISTRIBUTION DU LOGICIEL DERIVE | |
269 | ||
270 | Lorsque le Licencié crée un Logiciel Dérivé, ce Logiciel Dérivé peut | |
271 | être distribué sous un contrat de licence autre que le présent Contrat à | |
272 | condition de respecter les obligations de mention des droits sur le | |
273 | Logiciel telles que définies à l'article 6.4. Dans le cas où la création du | |
274 | Logiciel Dérivé a nécessité une modification du Code Source le licencié | |
275 | s'engage à ce que: | |
276 | ||
277 | 1. le Logiciel Modifié correspondant à cette modification soit régi | |
278 | par le présent Contrat, | |
279 | 2. les Contributions Intégrées dont le Logiciel Modifié résulte | |
280 | soient clairement identifiées et documentées, | |
281 | 3. le Licencié permette un accès effectif au code source du Logiciel | |
282 | Modifié, pendant au moins toute la durée de la distribution du | |
283 | Logiciel Dérivé, de telle sorte que ces modifications puissent | |
284 | être reprises dans une version ultérieure du Logiciel, étant | |
285 | entendu que le coût additionnel d'acquisition du code source du | |
286 | Logiciel Modifié ne devra pas excéder le simple coût du transfert | |
287 | des données. | |
288 | ||
289 | ||
290 | 5.3.4 COMPATIBILITE AVEC LA LICENCE CeCILL | |
291 | ||
292 | Lorsqu'un Logiciel Modifié contient une Contribution Intégrée soumise au | |
293 | contrat de licence CeCILL, ou lorsqu'un Logiciel Dérivé contient un | |
294 | Module Lié soumis au contrat de licence CeCILL, les stipulations prévues | |
295 | au troisième item de l'article 6.4 sont facultatives. | |
296 | ||
297 | ||
298 | Article 6 - PROPRIETE INTELLECTUELLE | |
299 | ||
300 | ||
301 | 6.1 SUR LE LOGICIEL INITIAL | |
302 | ||
303 | Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel | |
304 | Initial. Toute utilisation du Logiciel Initial est soumise au respect | |
305 | des conditions dans lesquelles le Titulaire a choisi de diffuser son | |
306 | oeuvre et nul autre n'a la faculté de modifier les conditions de | |
307 | diffusion de ce Logiciel Initial. | |
308 | ||
309 | Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi | |
310 | par le Contrat et ce, pour la durée visée à l'article 4.2. | |
311 | ||
312 | ||
313 | 6.2 SUR LES CONTRIBUTIONS INTEGREES | |
314 | ||
315 | Le Licencié qui a développé une Contribution Intégrée est titulaire sur | |
316 | celle-ci des droits de propriété intellectuelle dans les conditions | |
317 | définies par la législation applicable. | |
318 | ||
319 | ||
320 | 6.3 SUR LES MODULES LIES | |
321 | ||
322 | Le Licencié qui a développé un Module Lié est titulaire sur celui-ci des | |
323 | droits de propriété intellectuelle dans les conditions définies par la | |
324 | législation applicable et reste libre du choix du contrat régissant sa | |
325 | diffusion dans les conditions définies à l'article 5.3.3. | |
326 | ||
327 | ||
328 | 6.4 MENTIONS DES DROITS | |
329 | ||
330 | Le Licencié s'engage expressément: | |
331 | ||
332 | 1. à ne pas supprimer ou modifier de quelque manière que ce soit les | |
333 | mentions de propriété intellectuelle apposées sur le Logiciel; | |
334 | ||
335 | 2. à reproduire à l'identique lesdites mentions de propriété | |
336 | intellectuelle sur les copies du Logiciel modifié ou non; | |
337 | ||
338 | 3. Ã faire en sorte que l'utilisation du Logiciel, ses mentions de | |
339 | propriété intellectuelle et le fait qu'il est régi par le Contrat | |
340 | soient indiqués dans un texte facilement accessible notamment | |
341 | depuis l'interface de tout Logiciel Dérivé. | |
342 | ||
343 | Le Licencié s'engage à ne pas porter atteinte, directement ou | |
344 | indirectement, aux droits de propriété intellectuelle du Titulaire et/ou | |
345 | des Contributeurs sur le Logiciel et à prendre, le cas échéant, à | |
346 | l'égard de son personnel toutes les mesures nécessaires pour assurer le | |
347 | respect des dits droits de propriété intellectuelle du Titulaire et/ou | |
348 | des Contributeurs. | |
349 | ||
350 | ||
351 | Article 7 - SERVICES ASSOCIES | |
352 | ||
353 | 7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de | |
354 | prestations d'assistance technique ou de maintenance du Logiciel. | |
355 | ||
356 | Cependant le Concédant reste libre de proposer ce type de services. Les | |
357 | termes et conditions d'une telle assistance technique et/ou d'une telle | |
358 | maintenance seront alors déterminés dans un acte séparé. Ces actes de | |
359 | maintenance et/ou assistance technique n'engageront que la seule | |
360 | responsabilité du Concédant qui les propose. | |
361 | ||
362 | 7.2 De même, tout Concédant est libre de proposer, sous sa seule | |
363 | responsabilité, à ses licenciés une garantie, qui n'engagera que lui, | |
364 | lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce, | |
365 | dans les conditions qu'il souhaite. Cette garantie et les modalités | |
366 | financières de son application feront l'objet d'un acte séparé entre le | |
367 | Concédant et le Licencié. | |
368 | ||
369 | ||
370 | Article 8 - RESPONSABILITE | |
371 | ||
372 | 8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la | |
373 | faculté, sous réserve de prouver la faute du Concédant concerné, de | |
374 | solliciter la réparation du préjudice direct qu'il subirait du fait du | |
375 | Logiciel et dont il apportera la preuve. | |
376 | ||
377 | 8.2 La responsabilité du Concédant est limitée aux engagements pris en | |
378 | application du Contrat et ne saurait être engagée en raison notamment: | |
379 | (i) des dommages dus à l'inexécution, totale ou partielle, de ses | |
380 | obligations par le Licencié, (ii) des dommages directs ou indirects | |
381 | découlant de l'utilisation ou des performances du Logiciel subis par le | |
382 | Licencié et (iii) plus généralement d'un quelconque dommage indirect. En | |
383 | particulier, les Parties conviennent expressément que tout préjudice | |
384 | financier ou commercial (par exemple perte de données, perte de | |
385 | bénéfices, perte d'exploitation, perte de clientèle ou de commandes, | |
386 | manque à gagner, trouble commercial quelconque) ou toute action dirigée | |
387 | contre le Licencié par un tiers, constitue un dommage indirect et | |
388 | n'ouvre pas droit à réparation par le Concédant. | |
389 | ||
390 | ||
391 | Article 9 - GARANTIE | |
392 | ||
393 | 9.1 Le Licencié reconnaît que l'état actuel des connaissances | |
394 | scientifiques et techniques au moment de la mise en circulation du | |
395 | Logiciel ne permet pas d'en tester et d'en vérifier toutes les | |
396 | utilisations ni de détecter l'existence d'éventuels défauts. L'attention | |
397 | du Licencié a été attirée sur ce point sur les risques associés au | |
398 | chargement, à l'utilisation, la modification et/ou au développement et à | |
399 | la reproduction du Logiciel qui sont réservés à des utilisateurs avertis. | |
400 | ||
401 | Il relève de la responsabilité du Licencié de contrôler, par tous | |
402 | moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et | |
403 | de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens. | |
404 | ||
405 | 9.2 Le Concédant déclare de bonne foi être en droit de concéder | |
406 | l'ensemble des droits attachés au Logiciel (comprenant notamment les | |
407 | droits visés à l'article 5). | |
408 | ||
409 | 9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le | |
410 | Concédant sans autre garantie, expresse ou tacite, que celle prévue à | |
411 | l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, | |
412 | son caractère sécurisé, innovant ou pertinent. | |
413 | ||
414 | En particulier, le Concédant ne garantit pas que le Logiciel est exempt | |
415 | d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible | |
416 | avec l'équipement du Licencié et sa configuration logicielle ni qu'il | |
417 | remplira les besoins du Licencié. | |
418 | ||
419 | 9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le | |
420 | Logiciel ne porte pas atteinte à un quelconque droit de propriété | |
421 | intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout | |
422 | autre droit de propriété. Ainsi, le Concédant exclut toute garantie au | |
423 | profit du Licencié contre les actions en contrefaçon qui pourraient être | |
424 | diligentées au titre de l'utilisation, de la modification, et de la | |
425 | redistribution du Logiciel. Néanmoins, si de telles actions sont | |
426 | exercées contre le Licencié, le Concédant lui apportera son aide | |
427 | technique et juridique pour sa défense. Cette aide technique et | |
428 | juridique est déterminée au cas par cas entre le Concédant concerné et | |
429 | le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage | |
430 | toute responsabilité quant à l'utilisation de la dénomination du | |
431 | Logiciel par le Licencié. Aucune garantie n'est apportée quant à | |
432 | l'existence de droits antérieurs sur le nom du Logiciel et sur | |
433 | l'existence d'une marque. | |
434 | ||
435 | ||
436 | Article 10 - RESILIATION | |
437 | ||
438 | 10.1 En cas de manquement par le Licencié aux obligations mises à sa | |
439 | charge par le Contrat, le Concédant pourra résilier de plein droit le | |
440 | Contrat trente (30) jours après notification adressée au Licencié et | |
441 | restée sans effet. | |
442 | ||
443 | 10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à | |
444 | utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les | |
445 | licences qu'il aura concédées antérieurement à la résiliation du Contrat | |
446 | resteront valides sous réserve qu'elles aient été effectuées en | |
447 | conformité avec le Contrat. | |
448 | ||
449 | ||
450 | Article 11 - DISPOSITIONS DIVERSES | |
451 | ||
452 | ||
453 | 11.1 CAUSE EXTERIEURE | |
454 | ||
455 | Aucune des Parties ne sera responsable d'un retard ou d'une défaillance | |
456 | d'exécution du Contrat qui serait dû à un cas de force majeure, un cas | |
457 | fortuit ou une cause extérieure, telle que, notamment, le mauvais | |
458 | fonctionnement ou les interruptions du réseau électrique ou de | |
459 | télécommunication, la paralysie du réseau liée à une attaque | |
460 | informatique, l'intervention des autorités gouvernementales, les | |
461 | catastrophes naturelles, les dégâts des eaux, les tremblements de terre, | |
462 | le feu, les explosions, les grèves et les conflits sociaux, l'état de | |
463 | guerre... | |
464 | ||
465 | 11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou | |
466 | plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du | |
467 | Contrat, ne pourra en aucun cas impliquer renonciation par la Partie | |
468 | intéressée à s'en prévaloir ultérieurement. | |
469 | ||
470 | 11.3 Le Contrat annule et remplace toute convention antérieure, écrite | |
471 | ou orale, entre les Parties sur le même objet et constitue l'accord | |
472 | entier entre les Parties sur cet objet. Aucune addition ou modification | |
473 | aux termes du Contrat n'aura d'effet à l'égard des Parties à moins | |
474 | d'être faite par écrit et signée par leurs représentants dûment habilités. | |
475 | ||
476 | 11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat | |
477 | s'avèrerait contraire à une loi ou à un texte applicable, existants ou | |
478 | futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les | |
479 | amendements nécessaires pour se conformer à cette loi ou à ce texte. | |
480 | Toutes les autres dispositions resteront en vigueur. De même, la | |
481 | nullité, pour quelque raison que ce soit, d'une des dispositions du | |
482 | Contrat ne saurait entraîner la nullité de l'ensemble du Contrat. | |
483 | ||
484 | ||
485 | 11.5 LANGUE | |
486 | ||
487 | Le Contrat est rédigé en langue française et en langue anglaise, ces | |
488 | deux versions faisant également foi. | |
489 | ||
490 | ||
491 | Article 12 - NOUVELLES VERSIONS DU CONTRAT | |
492 | ||
493 | 12.1 Toute personne est autorisée à copier et distribuer des copies de | |
494 | ce Contrat. | |
495 | ||
496 | 12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé | |
497 | et ne peut être modifié que par les auteurs de la licence, lesquels se | |
498 | réservent le droit de publier périodiquement des mises à jour ou de | |
499 | nouvelles versions du Contrat, qui posséderont chacune un numéro | |
500 | distinct. Ces versions ultérieures seront susceptibles de prendre en | |
501 | compte de nouvelles problématiques rencontrées par les logiciels libres. | |
502 | ||
503 | 12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra | |
504 | faire l'objet d'une diffusion ultérieure que sous la même version du | |
505 | Contrat ou une version postérieure. | |
506 | ||
507 | ||
508 | Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE | |
509 | ||
510 | 13.1 Le Contrat est régi par la loi française. Les Parties conviennent | |
511 | de tenter de régler à l'amiable les différends ou litiges qui | |
512 | viendraient à se produire par suite ou à l'occasion du Contrat. | |
513 | ||
514 | 13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter | |
515 | de leur survenance et sauf situation relevant d'une procédure d'urgence, | |
516 | les différends ou litiges seront portés par la Partie la plus diligente | |
517 | devant les Tribunaux compétents de Paris. | |
518 | ||
519 | ||
520 | Version 1.0 du 2006-09-05. |
17 | 17 | Requirements (v1.7) |
18 | 18 | ------------------- |
19 | 19 | |
20 | * GNU/Linux, *BSD, Mac OS X | |
20 | * GNU/Linux, BSD, Mac OS X | |
21 | 21 | * OpenSSH (ssh/scp) or rsh |
22 | 22 | * Python 2.x (x >= 4) |
23 | 23 | * PyYAML (optional) |
25 | 25 | License |
26 | 26 | ------- |
27 | 27 | |
28 | ClusterShell is distributed under the CeCILL-C license, a French transposition | |
29 | of the GNU LGPL, and is fully LGPL-compatible (see Licence_CeCILL-C_V1-en.txt). | |
28 | ClusterShell is distributed under the GNU Lesser General Public License version | |
29 | 2.1 or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. | |
30 | 30 | |
31 | 31 | Documentation |
32 | 32 | ------------- |
0 | 0 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} |
1 | 1 | |
2 | 2 | Name: clustershell |
3 | Version: 1.7.2 | |
3 | Version: 1.7.3 | |
4 | 4 | Release: 1%{?dist} |
5 | 5 | Summary: Python framework for efficient cluster administration |
6 | 6 | |
7 | 7 | Group: System Environment/Base |
8 | License: CeCILL-C | |
8 | License: LGPLv2+ | |
9 | 9 | URL: http://cea-hpc.github.io/clustershell/ |
10 | 10 | Source0: https://github.com/cea-hpc/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz |
11 | 11 | BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
12 | 12 | BuildArch: noarch |
13 | 13 | BuildRequires: python-devel python-setuptools |
14 | Requires: PyYAML | |
14 | Requires: python-setuptools PyYAML | |
15 | 15 | |
16 | 16 | %description |
17 | 17 | Tools and event-based Python library to execute commands on cluster nodes in |
18 | 18 | parallel depending on selected engine and worker mechanisms. The library |
19 | 19 | provides also advanced NodeSet and NodeGroups handling methods to ease and |
20 | 20 | improve administration of large compute clusters or server farms. Three |
21 | convenient command line utilities, clush, clubak and nodeset, allow traditional | |
22 | shell scripts to benefit some useful features offered by the library. | |
21 | convenient command line utilities, clush, clubak and nodeset (or cluset) allow | |
22 | traditional shell scripts to benefit some useful features offered by the | |
23 | library. | |
23 | 24 | |
24 | 25 | %package -n vim-%{name} |
25 | 26 | Summary: VIM files for ClusterShell |
50 | 51 | # man pages |
51 | 52 | install -d %{buildroot}/%{_mandir}/{man1,man5} |
52 | 53 | install -p -m 0644 doc/man/man1/clubak.1 %{buildroot}/%{_mandir}/man1/ |
54 | install -p -m 0644 doc/man/man1/cluset.1 %{buildroot}/%{_mandir}/man1/ | |
53 | 55 | install -p -m 0644 doc/man/man1/clush.1 %{buildroot}/%{_mandir}/man1/ |
54 | 56 | install -p -m 0644 doc/man/man1/nodeset.1 %{buildroot}/%{_mandir}/man1/ |
55 | 57 | install -p -m 0644 doc/man/man5/clush.conf.5 %{buildroot}/%{_mandir}/man5/ |
67 | 69 | |
68 | 70 | %files |
69 | 71 | %defattr(-,root,root,-) |
70 | %doc README.md ChangeLog Licence_CeCILL-C_V1-en.txt Licence_CeCILL-C_V1-fr.txt | |
72 | %doc ChangeLog COPYING.LGPLv2.1 README.md | |
71 | 73 | %doc doc/examples |
72 | 74 | %doc doc/sphinx |
73 | 75 | %{_mandir}/man1/clubak.1* |
76 | %{_mandir}/man1/cluset.1* | |
74 | 77 | %{_mandir}/man1/clush.1* |
75 | 78 | %{_mandir}/man1/nodeset.1* |
76 | 79 | %{_mandir}/man5/clush.conf.5* |
90 | 93 | %{python_sitelib}/ClusterShell/ |
91 | 94 | %{python_sitelib}/ClusterShell-*-py?.?.egg-info |
92 | 95 | %{_bindir}/clubak |
96 | %{_bindir}/cluset | |
93 | 97 | %{_bindir}/clush |
94 | 98 | %{_bindir}/nodeset |
95 | 99 | |
100 | 104 | %{vimdatadir}/syntax/groupsconf.vim |
101 | 105 | |
102 | 106 | %changelog |
107 | * Tue Dec 20 2016 Stephane Thiell <sthiell@stanford.edu> 1.7.3-1 | |
108 | - update to 1.7.3 | |
109 | ||
103 | 110 | * Sat Jun 18 2016 Stephane Thiell <sthiell@stanford.edu> 1.7.2-1 |
104 | 111 | - update to 1.7.2 |
105 | 112 |
0 | # Additional ClusterShell group source config file | |
1 | # | |
2 | # Please see `man 5 groups.conf` for further details. | |
3 | # | |
4 | ||
5 | # xCAT static node group binding | |
6 | # | |
7 | [xcat] | |
8 | ||
9 | # this will list the nodes in the specified node group | |
10 | map: nodels $GROUP | |
11 | ||
12 | # as an example here, we use a group named 'server' containing all servers | |
13 | all: nodels server | |
14 | ||
15 | # list all groups | |
16 | list: lsdef -t group | cut -d' ' -f1 |
0 | 0 | .\" Man page generated from reStructuredText. |
1 | 1 | . |
2 | .TH CLUBAK 1 "2016-02-28" "1.7.1" "ClusterShell User Manual" | |
2 | .TH CLUBAK 1 "2016-12-20" "1.7.3" "ClusterShell User Manual" | |
3 | 3 | .SH NAME |
4 | 4 | clubak \- format output from clush/pdsh-like output and more |
5 | 5 | . |
36 | 36 | .sp |
37 | 37 | \fBclubak\fP formats text from standard input containing lines of the form |
38 | 38 | "\fInode:output\fP". It is fully backward compatible with \fBdshbak\fP(1) but |
39 | provides additonal features. For instance, \fBclubak\fP always displays | |
39 | provides additional features. For instance, \fBclubak\fP always displays | |
40 | 40 | its results sorted by node/nodeset. |
41 | 41 | .sp |
42 | 42 | You do not need to use \fBclubak\fP when using \fBclush\fP(1) as all output |
137 | 137 | .SH AUTHOR |
138 | 138 | Stephane Thiell <sthiell@stanford.edu> |
139 | 139 | .SH COPYRIGHT |
140 | CeCILL-C V1 | |
140 | GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
141 | 141 | .\" Generated by docutils manpage writer. |
142 | 142 | . |
0 | .\" Man page generated from reStructuredText. | |
1 | . | |
2 | .TH CLUSET 1 "2016-12-20" "1.7.3" "ClusterShell User Manual" | |
3 | .SH NAME | |
4 | cluset \- compute advanced cluster node set operations | |
5 | . | |
6 | .nr rst2man-indent-level 0 | |
7 | . | |
8 | .de1 rstReportMargin | |
9 | \\$1 \\n[an-margin] | |
10 | level \\n[rst2man-indent-level] | |
11 | level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] | |
12 | - | |
13 | \\n[rst2man-indent0] | |
14 | \\n[rst2man-indent1] | |
15 | \\n[rst2man-indent2] | |
16 | .. | |
17 | .de1 INDENT | |
18 | .\" .rstReportMargin pre: | |
19 | . RS \\$1 | |
20 | . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] | |
21 | . nr rst2man-indent-level +1 | |
22 | .\" .rstReportMargin post: | |
23 | .. | |
24 | .de UNINDENT | |
25 | . RE | |
26 | .\" indent \\n[an-margin] | |
27 | .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] | |
28 | .nr rst2man-indent-level -1 | |
29 | .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] | |
30 | .in \\n[rst2man-indent\\n[rst2man-indent-level]]u | |
31 | .. | |
32 | .SH SYNOPSIS | |
33 | .INDENT 0.0 | |
34 | .INDENT 3.5 | |
35 | \fBcluset\fP [OPTIONS] [COMMAND] [nodeset1 [OPERATION] nodeset2|...] | |
36 | .UNINDENT | |
37 | .UNINDENT | |
38 | .SH DESCRIPTION | |
39 | .sp | |
40 | Note: \fBcluset\fP and \fBnodeset\fP are the same command. | |
41 | .sp | |
42 | \fBcluset\fP is an utility command provided with the ClusterShell library which | |
43 | implements some features of ClusterShell\(aqs NodeSet and RangeSet Python classes. | |
44 | It provides easy manipulation of 1D or nD\-indexed cluster nodes and node | |
45 | groups and supports RFC 1123 (except that a node name can\(aqt be entirely numeric). | |
46 | .sp | |
47 | Also, \fBcluset\fP is automatically bound to the library node group resolution | |
48 | mechanism. Thus, it is especially useful to enhance cluster aware | |
49 | administration shell scripts. | |
50 | .SH OPTIONS | |
51 | .INDENT 0.0 | |
52 | .INDENT 3.5 | |
53 | .INDENT 0.0 | |
54 | .TP | |
55 | .B \-\-version | |
56 | show program\(aqs version number and exit | |
57 | .TP | |
58 | .B \-h\fP,\fB \-\-help | |
59 | show this help message and exit | |
60 | .TP | |
61 | .BI \-s \ GROUPSOURCE\fP,\fB \ \-\-groupsource\fB= GROUPSOURCE | |
62 | optional \fBgroups.conf\fP(5) group source to use | |
63 | .UNINDENT | |
64 | .INDENT 0.0 | |
65 | .TP | |
66 | .B Commands: | |
67 | .INDENT 7.0 | |
68 | .TP | |
69 | .B \-c\fP,\fB \-\-count | |
70 | show number of nodes in nodeset(s) | |
71 | .TP | |
72 | .B \-e\fP,\fB \-\-expand | |
73 | expand nodeset(s) to separate nodes (see also \-S \fISEPARATOR\fP) | |
74 | .TP | |
75 | .B \-f\fP,\fB \-\-fold | |
76 | fold nodeset(s) (or separate nodes) into one nodeset | |
77 | .TP | |
78 | .B \-l\fP,\fB \-\-list | |
79 | list node groups, list node groups and nodes (\fB\-ll\fP) or list node groups, nodes and node count (\fB\-lll\fP). When no argument is specified at all, this command will list all node group names found in selected group source (see also \-s \fIGROUPSOURCE\fP). If any nodesets are specified as argument, this command will find node groups these nodes belongs to (individually). Optionally for each group, the fraction of these nodes being member of the group may be displayed (with \fB\-ll\fP), and also member count/total group node count (with \fB\-lll\fP). If a single hyphen\-minus (\-) is given as a nodeset, it will be read from standard input. | |
80 | .TP | |
81 | .B \-r\fP,\fB \-\-regroup | |
82 | fold nodes using node groups (see \-s \fIGROUPSOURCE\fP) | |
83 | .TP | |
84 | .B \-\-groupsources | |
85 | list all active group sources (see \fBgroups.conf\fP(5)) | |
86 | .UNINDENT | |
87 | .TP | |
88 | .B Operations: | |
89 | .INDENT 7.0 | |
90 | .TP | |
91 | .BI \-x \ SUB_NODES\fP,\fB \ \-\-exclude\fB= SUB_NODES | |
92 | exclude specified set | |
93 | .TP | |
94 | .BI \-i \ AND_NODES\fP,\fB \ \-\-intersection\fB= AND_NODES | |
95 | calculate sets intersection | |
96 | .TP | |
97 | .BI \-X \ XOR_NODES\fP,\fB \ \-\-xor\fB= XOR_NODES | |
98 | calculate symmetric difference between sets | |
99 | .UNINDENT | |
100 | .TP | |
101 | .B Options: | |
102 | .INDENT 7.0 | |
103 | .TP | |
104 | .B \-a\fP,\fB \-\-all | |
105 | call external node groups support to display all nodes | |
106 | .TP | |
107 | .BI \-\-autostep\fB= AUTOSTEP | |
108 | enable a\-b/step style syntax when folding nodesets, value is min node count threshold (integer \(aq4\(aq, percentage \(aq50%\(aq or \(aqauto\(aq). If not specified, auto step is disabled (best for compatibility with other cluster tools. Example: autostep=4, "node2 node4 node6" folds in node[2,4,6] but autostep=3, "node2 node4 node6" folds in node[2\-6/2]. | |
109 | .TP | |
110 | .B \-d\fP,\fB \-\-debug | |
111 | output more messages for debugging purpose | |
112 | .TP | |
113 | .B \-q\fP,\fB \-\-quiet | |
114 | be quiet, print essential output only | |
115 | .TP | |
116 | .B \-R\fP,\fB \-\-rangeset | |
117 | switch to RangeSet instead of NodeSet. Useful when | |
118 | working on numerical cluster ranges, eg. 1,5,18\-31 | |
119 | .TP | |
120 | .B \-G\fP,\fB \-\-groupbase | |
121 | hide group source prefix (always \fI@groupname\fP) | |
122 | .TP | |
123 | .BI \-S \ SEPARATOR\fP,\fB \ \-\-separator\fB= SEPARATOR | |
124 | separator string to use when expanding nodesets | |
125 | (default: \(aq \(aq) | |
126 | .TP | |
127 | .BI \-O \ FORMAT\fP,\fB \ \-\-output\-format\fB= FORMAT | |
128 | output format (default: \(aq%s\(aq) | |
129 | .TP | |
130 | .BI \-I \ SLICE_RANGESET\fP,\fB \ \-\-slice\fB= SLICE_RANGESET | |
131 | return sliced off result; examples of SLICE_RANGESET are "0" for simple index selection, or "1\-9/2,16" for complex rangeset selection | |
132 | .TP | |
133 | .BI \-\-split\fB= MAXSPLIT | |
134 | split result into a number of subsets | |
135 | .TP | |
136 | .B \-\-contiguous | |
137 | split result into contiguous subsets (ie. for nodeset, subsets will contain nodes with same pattern name and a contiguous range of indexes, like foobar[1\-100]; for rangeset, subsets with consists in contiguous index ranges)""" | |
138 | .TP | |
139 | .BI \-\-axis\fB= RANGESET | |
140 | for nD nodesets, fold along provided axis only. Axis are indexed from 1 to n and can be specified here either using the rangeset syntax, eg. \(aq1\(aq, \(aq1\-2\(aq, \(aq1,3\(aq, or by a single negative number meaning that the indice is counted from the end. Because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range. | |
141 | .TP | |
142 | .BI \-\-pick\fB= N | |
143 | pick N node(s) at random in nodeset | |
144 | .UNINDENT | |
145 | .UNINDENT | |
146 | .UNINDENT | |
147 | .UNINDENT | |
148 | .sp | |
149 | For a short explanation of these options, see \fB\-h, \-\-help\fP\&. | |
150 | .sp | |
151 | If a single hyphen\-minus (\-) is given as a nodeset, it will be read from | |
152 | standard input. | |
153 | .SH EXTENDED PATTERNS | |
154 | .sp | |
155 | The \fBcluset\fP command benefits from ClusterShell NodeSet basic | |
156 | arithmetic addition. This feature extends recognized string patterns by | |
157 | supporting operators matching all Operations seen previously. String | |
158 | patterns are read from left to right, by proceeding any character | |
159 | operators accordingly. | |
160 | .INDENT 0.0 | |
161 | .TP | |
162 | .B Supported character operators | |
163 | .INDENT 7.0 | |
164 | .TP | |
165 | .B \fB,\fP | |
166 | indicates that the \fIunion\fP of both left and right nodeset should be | |
167 | computed before continuing | |
168 | .TP | |
169 | .B \fB!\fP | |
170 | indicates the \fIdifference\fP operation | |
171 | .TP | |
172 | .B \fB&\fP | |
173 | indicates the \fIintersection\fP operation | |
174 | .TP | |
175 | .B \fB^\fP | |
176 | indicates the \fIsymmetric difference\fP (XOR) operation | |
177 | .UNINDENT | |
178 | .sp | |
179 | Care should be taken to escape these characters as needed when the shell | |
180 | does not interpret them literally. | |
181 | .TP | |
182 | .B Examples of use of extended patterns | |
183 | .INDENT 7.0 | |
184 | .TP | |
185 | .B $ cluset \-f node[0\-7],node[8\-10] | |
186 | .UNINDENT | |
187 | .nf | |
188 | node[0\-10] | |
189 | .fi | |
190 | .sp | |
191 | .INDENT 7.0 | |
192 | .TP | |
193 | .B $ cluset \-f node[0\-10]!node[8\-10] | |
194 | .UNINDENT | |
195 | .nf | |
196 | node[0\-7] | |
197 | .fi | |
198 | .sp | |
199 | .INDENT 7.0 | |
200 | .TP | |
201 | .B $ cluset \-f node[0\-10]&node[5\-13] | |
202 | .UNINDENT | |
203 | .nf | |
204 | node[5\-10] | |
205 | .fi | |
206 | .sp | |
207 | .INDENT 7.0 | |
208 | .TP | |
209 | .B $ cluset \-f node[0\-10]^node[5\-13] | |
210 | .UNINDENT | |
211 | .nf | |
212 | node[0\-4,11\-13] | |
213 | .fi | |
214 | .sp | |
215 | .TP | |
216 | .B Example of advanced usage | |
217 | .INDENT 7.0 | |
218 | .TP | |
219 | .B $ cluset \-f @gpu^@slurm:bigmem!@chassis[1\-9/2] | |
220 | .UNINDENT | |
221 | .sp | |
222 | This computes a folded nodeset containing nodes found in group @gpu and @slurm:bigmem, but not in both, minus the nodes found in odd chassis groups from 1 to 9. | |
223 | .TP | |
224 | .B "All nodes" extension (v1.7+) | |
225 | The \fB@*\fP and \fB@SOURCE:*\fP special notations may be used in extended patterns to represent all nodes (in SOURCE) according to the \fIall\fP external shell command (see \fBgroups.conf\fP(5)) and are equivalent to: | |
226 | .INDENT 7.0 | |
227 | .INDENT 3.5 | |
228 | .INDENT 0.0 | |
229 | .TP | |
230 | .B $ cluset [\-s SOURCE] \-a \-f | |
231 | .UNINDENT | |
232 | .UNINDENT | |
233 | .UNINDENT | |
234 | .UNINDENT | |
235 | .SH EXIT STATUS | |
236 | .sp | |
237 | An exit status of zero indicates success of the \fBcluset\fP command. A non\-zero | |
238 | exit status indicates failure. | |
239 | .SH EXAMPLES | |
240 | .INDENT 0.0 | |
241 | .TP | |
242 | .B Getting the node count | |
243 | .INDENT 7.0 | |
244 | .TP | |
245 | .B $ cluset \-c node[0\-7,32\-159] | |
246 | .UNINDENT | |
247 | .nf | |
248 | 136 | |
249 | .fi | |
250 | .sp | |
251 | .INDENT 7.0 | |
252 | .TP | |
253 | .B $ cluset \-c node[0\-7,32\-159] node[160\-163] | |
254 | .UNINDENT | |
255 | .nf | |
256 | 140 | |
257 | .fi | |
258 | .sp | |
259 | .INDENT 7.0 | |
260 | .TP | |
261 | .B $ cluset \-c dc[1\-2]n[100\-199] | |
262 | .UNINDENT | |
263 | .nf | |
264 | 200 | |
265 | .fi | |
266 | .sp | |
267 | .INDENT 7.0 | |
268 | .TP | |
269 | .B $ cluset \-c @login | |
270 | .UNINDENT | |
271 | .nf | |
272 | 4 | |
273 | .fi | |
274 | .sp | |
275 | .TP | |
276 | .B Folding nodesets | |
277 | .INDENT 7.0 | |
278 | .TP | |
279 | .B $ cluset \-f node[0\-7,32\-159] node[160\-163] | |
280 | .UNINDENT | |
281 | .nf | |
282 | node[0\-7,32\-163] | |
283 | .fi | |
284 | .sp | |
285 | .INDENT 7.0 | |
286 | .TP | |
287 | .B $ echo node3 node6 node1 node2 node7 node5 | cluset \-f | |
288 | .UNINDENT | |
289 | .nf | |
290 | node[1\-3,5\-7] | |
291 | .fi | |
292 | .sp | |
293 | .INDENT 7.0 | |
294 | .TP | |
295 | .B $ cluset \-f dc1n2 dc2n2 dc1n1 dc2n1 | |
296 | .UNINDENT | |
297 | .nf | |
298 | dc[1\-2]n[1\-2] | |
299 | .fi | |
300 | .sp | |
301 | .INDENT 7.0 | |
302 | .TP | |
303 | .B $ cluset \-\-axis=1 \-f dc1n2 dc2n2 dc1n1 dc2n1 | |
304 | .UNINDENT | |
305 | .nf | |
306 | dc[1\-2]n1,dc[1\-2]n2 | |
307 | .fi | |
308 | .sp | |
309 | .TP | |
310 | .B Expanding nodesets | |
311 | .INDENT 7.0 | |
312 | .TP | |
313 | .B $ cluset \-e node[160\-163] | |
314 | .UNINDENT | |
315 | .nf | |
316 | node160 node161 node162 node163 | |
317 | .fi | |
318 | .sp | |
319 | .INDENT 7.0 | |
320 | .TP | |
321 | .B $ echo \(aqdc[1\-2]n[2\-6/2]\(aq | cluset \-e | |
322 | .UNINDENT | |
323 | .nf | |
324 | dc1n2 dc1n4 dc1n6 dc2n2 dc2n4 dc2n6 | |
325 | .fi | |
326 | .sp | |
327 | .TP | |
328 | .B Excluding nodes from nodeset | |
329 | .INDENT 7.0 | |
330 | .TP | |
331 | .B $ cluset \-f node[32\-159] \-x node33 | |
332 | .UNINDENT | |
333 | .nf | |
334 | node[32,34\-159] | |
335 | .fi | |
336 | .sp | |
337 | .TP | |
338 | .B Computing nodesets intersection | |
339 | .INDENT 7.0 | |
340 | .TP | |
341 | .B $ cluset \-f node[32\-159] \-i node[0\-7,20\-21,32,156\-159] | |
342 | .UNINDENT | |
343 | .nf | |
344 | node[32,156\-159] | |
345 | .fi | |
346 | .sp | |
347 | .TP | |
348 | .B Computing nodesets symmetric difference (xor) | |
349 | .INDENT 7.0 | |
350 | .TP | |
351 | .B $ cluset \-f node[33\-159] \-\-xor node[32\-33,156\-159] | |
352 | .UNINDENT | |
353 | .nf | |
354 | node[32,34\-155] | |
355 | .fi | |
356 | .sp | |
357 | .TP | |
358 | .B Splitting nodes into several nodesets (expanding results) | |
359 | .INDENT 7.0 | |
360 | .TP | |
361 | .B $ cluset \-\-split=3 \-e node[1\-9] | |
362 | .UNINDENT | |
363 | .nf | |
364 | node1 node2 node3 | |
365 | node4 node5 node6 | |
366 | node7 node8 node9 | |
367 | .fi | |
368 | .sp | |
369 | .TP | |
370 | .B Splitting non\-contiguous nodesets (folding results) | |
371 | .INDENT 7.0 | |
372 | .TP | |
373 | .B $ cluset \-\-contiguous \-f node2 node3 node4 node8 node9 | |
374 | .UNINDENT | |
375 | .nf | |
376 | node[2\-4] | |
377 | node[8\-9] | |
378 | .fi | |
379 | .sp | |
380 | .INDENT 7.0 | |
381 | .TP | |
382 | .B $ cluset \-\-contiguous \-f dc[1,3]n[1\-2,4\-5] | |
383 | .UNINDENT | |
384 | .nf | |
385 | dc1n[1\-2] | |
386 | dc1n[4\-5] | |
387 | dc3n[1\-2] | |
388 | dc3n[4\-5] | |
389 | .fi | |
390 | .sp | |
391 | .UNINDENT | |
392 | .SH HISTORY | |
393 | .sp | |
394 | \fBcluset\fP was added in 1.7.3 to avoid a conflict with xCAT\(aqs \fBnodeset\fP | |
395 | command and also to conform with ClusterShell\(aqs "clu*" command nomenclature. | |
396 | .SH SEE ALSO | |
397 | .sp | |
398 | \fBnodeset\fP(1), \fBclush\fP(1), \fBclubak\fP(1), \fBgroups.conf\fP(5). | |
399 | .SH BUG REPORTS | |
400 | .INDENT 0.0 | |
401 | .TP | |
402 | .B Use the following URL to submit a bug report or feedback: | |
403 | \fI\%https://github.com/cea\-hpc/clustershell/issues\fP | |
404 | .UNINDENT | |
405 | .SH AUTHOR | |
406 | Stephane Thiell <sthiell@stanford.edu> | |
407 | .SH COPYRIGHT | |
408 | GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
409 | .\" Generated by docutils manpage writer. | |
410 | . |
0 | 0 | .\" Man page generated from reStructuredText. |
1 | 1 | . |
2 | .TH CLUSH 1 "2016-06-18" "1.7.2" "ClusterShell User Manual" | |
2 | .TH CLUSH 1 "2016-12-20" "1.7.3" "ClusterShell User Manual" | |
3 | 3 | .SH NAME |
4 | 4 | clush \- execute shell commands on a cluster |
5 | 5 | . |
210 | 210 | do not display group source prefix |
211 | 211 | .TP |
212 | 212 | .B \-L |
213 | disable header block and order output by nodes; additionally, when used in conjunction with \-b/\-B, it will enable "life gathering" of results by line mode, such as the next line is displayed as soon as possible (eg. when all nodes have sent the line) | |
213 | disable header block and order output by nodes; if \-b/\-B is not specified, \fBclush\fP will wait for all commands to finish and then display aggregated output of commands with same return codes, ordered by node name; alternatively, when used in conjunction with \-b/\-B (eg. \-bL), \fBclush\fP will enable a "life gathering" of results by line, such as the next line is displayed as soon as possible (eg. when all nodes have sent the line) | |
214 | 214 | .TP |
215 | 215 | .B \-N |
216 | 216 | disable labeling of command line |
219 | 219 | show progress during command execution; if writing is performed to standard input, the live progress indicator will display the global bandwidth of data written to the target nodes |
220 | 220 | .TP |
221 | 221 | .B \-b\fP,\fB \-\-dshbak |
222 | display gathered results in a dshbak\-like way | |
222 | display gathered results in a dshbak\-like way (note: it will only try to aggregate the output of commands with same return codes) | |
223 | 223 | .TP |
224 | 224 | .B \-B |
225 | 225 | like \-b but including standard error |
259 | 259 | .INDENT 7.0 |
260 | 260 | .TP |
261 | 261 | .BI \-f \ FANOUT\fP,\fB \ \-\-fanout\fB= FANOUT |
262 | use a specified maximum fanout size (ie. do not execute more than FANOUT commands at the same time, useful to limit resource usage) | |
262 | do not execute more than FANOUT commands at the same time, useful to limit resource usage. In tree mode, the same \fIfanout\fP value is used on the head node and on each gateway (the \fIfanout\fP value is propagated). That is, if the \fIfanout\fP is \fB16\fP, each gateway will initate up to \fB16\fP connections to their target nodes at the same time. Default \fIfanout\fP value is defined in \fBclush.conf\fP(5). | |
263 | 263 | .TP |
264 | 264 | .BI \-l \ USER\fP,\fB \ \-\-user\fB= USER |
265 | 265 | execute remote command as user |
389 | 389 | .SH AUTHOR |
390 | 390 | Stephane Thiell <sthiell@stanford.edu> |
391 | 391 | .SH COPYRIGHT |
392 | CeCILL-C V1 | |
392 | GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
393 | 393 | .\" Generated by docutils manpage writer. |
394 | 394 | . |
0 | 0 | .\" Man page generated from reStructuredText. |
1 | 1 | . |
2 | .TH NODESET 1 "2016-06-18" "1.7.2" "ClusterShell User Manual" | |
2 | .TH NODESET 1 "2016-12-20" "1.7.3" "ClusterShell User Manual" | |
3 | 3 | .SH NAME |
4 | 4 | nodeset \- compute advanced nodeset operations |
5 | 5 | . |
37 | 37 | .UNINDENT |
38 | 38 | .SH DESCRIPTION |
39 | 39 | .sp |
40 | Note: \fBnodeset\fP and \fBcluset\fP are the same command. | |
41 | .sp | |
40 | 42 | \fBnodeset\fP is an utility command provided with the ClusterShell library which |
41 | 43 | implements some features of ClusterShell\(aqs NodeSet and RangeSet Python classes. |
42 | 44 | It provides easy manipulation of 1D or nD\-indexed cluster nodes and node |
412 | 414 | .fi |
413 | 415 | .sp |
414 | 416 | .UNINDENT |
417 | .sp | |
418 | \fBcluset\fP was added in 1.7.3 to avoid a conflict with xCAT\(aqs \fBnodeset\fP | |
419 | command and also to conform with ClusterShell\(aqs "clu*" command nomenclature. | |
415 | 420 | .SH SEE ALSO |
416 | 421 | .sp |
417 | \fBclush\fP(1), \fBclubak\fP(1), \fBgroups.conf\fP(5). | |
422 | \fBcluset\fP(1), \fBclush\fP(1), \fBclubak\fP(1), \fBgroups.conf\fP(5). | |
418 | 423 | .SH BUG REPORTS |
419 | 424 | .INDENT 0.0 |
420 | 425 | .TP |
424 | 429 | .SH AUTHOR |
425 | 430 | Stephane Thiell <sthiell@stanford.edu> |
426 | 431 | .SH COPYRIGHT |
427 | CeCILL-C V1 | |
432 | GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
428 | 433 | .\" Generated by docutils manpage writer. |
429 | 434 | . |
0 | 0 | .\" Man page generated from reStructuredText. |
1 | 1 | . |
2 | .TH CLUSH.CONF 5 "2016-06-18" "1.7.2" "ClusterShell User Manual" | |
2 | .TH CLUSH.CONF 5 "2016-12-20" "1.7.3" "ClusterShell User Manual" | |
3 | 3 | .SH NAME |
4 | 4 | clush.conf \- Configuration file for clush |
5 | 5 | . |
63 | 63 | .INDENT 0.0 |
64 | 64 | .TP |
65 | 65 | .B fanout |
66 | Size of the sliding window of ssh connectors. | |
66 | Size of the sliding window (fanout) of active commands for \fBclush\fP\&. This | |
67 | \fIfanout\fP is used to avoid too many concurrent connections and to conserve | |
68 | resources on the initiating hosts. In tree mode, the same \fIfanout\fP value is | |
69 | used on the head node and on each gateway (the \fIfanout\fP value is propagated). | |
70 | That is, if the \fIfanout\fP is \fB16\fP on the head node, each gateway will | |
71 | initate up to \fB16\fP connections to their target nodes at the same time. | |
67 | 72 | .TP |
68 | 73 | .B connect_timeout |
69 | 74 | Timeout in seconds to allow a connection to establish. This parameter is |
173 | 178 | .SH AUTHOR |
174 | 179 | Stephane Thiell, <sthiell@stanford.edu> |
175 | 180 | .SH COPYRIGHT |
176 | CeCILL-C V1 | |
181 | GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
177 | 182 | .\" Generated by docutils manpage writer. |
178 | 183 | . |
0 | 0 | .\" Man page generated from reStructuredText. |
1 | 1 | . |
2 | .TH GROUPS.CONF 5 "2016-06-18" "1.7.2" "ClusterShell User Manual" | |
2 | .TH GROUPS.CONF 5 "2016-12-20" "1.7.3" "ClusterShell User Manual" | |
3 | 3 | .SH NAME |
4 | 4 | groups.conf \- Configuration file for ClusterShell node groups |
5 | 5 | . |
207 | 207 | .SH AUTHOR |
208 | 208 | Stephane Thiell, <sthiell@stanford.edu> |
209 | 209 | .SH COPYRIGHT |
210 | CeCILL-C V1 | |
210 | GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
211 | 211 | .\" Generated by docutils manpage writer. |
212 | 212 | . |
47 | 47 | # built documents. |
48 | 48 | # |
49 | 49 | # The short X.Y version. |
50 | version = '1.7.2' | |
50 | version = '1.7.3' | |
51 | 51 | # The full version, including alpha/beta/rc tags. |
52 | release = '1.7.2' | |
52 | release = '1.7.3' | |
53 | 53 | |
54 | 54 | # The language for content autogenerated by Sphinx. Refer to documentation |
55 | 55 | # for a list of supported languages. |
26 | 26 | |
27 | 27 | * GNU/Linux RedHat EL5 or CentOS 5.x (Python 2.4), EL6 (Python 2.6) and EL7 |
28 | 28 | (Python 2.7) |
29 | * GNU/Linux Fedora 11 to 22 (Python 2.6 - 2.7), | |
29 | * GNU/Linux Fedora 22 to 24 (Python 2.6 - 2.7), | |
30 | 30 | * GNU/Linux Debian (wheezy and above) |
31 | 31 | * Mac OS X 10.5.8 or more |
32 | 32 | |
33 | 33 | Distribution |
34 | 34 | ------------ |
35 | 35 | |
36 | ClusterShell is an open-source project distributed under the CeCILL-C flavor | |
37 | of the `CeCILL license family`_, which is in conformance with the French law | |
38 | and fully compatible with the GNU LGPL (Lesser GPL) license, which means that | |
39 | many possibilities are offered to the end user. Also, as a software library, | |
40 | ClusterShell has to remain easily available to everyone. Hopefully, packages | |
41 | are currently maintained in Fedora Linux, RHEL (through EPEL repositories), | |
42 | Debian and Arch Linux. | |
36 | ClusterShell is an open-source project distributed under the GNU Lesser General | |
37 | Public License version or later (`LGPL v2.1+`_), which means that many | |
38 | possibilities are offered to the end user. Also, as a software library, | |
39 | ClusterShell should remain easily available to everyone. Hopefully, packages are | |
40 | currently available for Fedora Linux, RHEL (through EPEL repositories), Debian | |
41 | and Arch Linux. | |
43 | 42 | |
44 | 43 | Fedora |
45 | 44 | ^^^^^^ |
46 | 45 | |
47 | At the time of writing, ClusterShell |version| is available on Fedora 22 | |
46 | At the time of writing, ClusterShell |version| is available on Fedora 24 | |
48 | 47 | (releases being maintained by the Fedora Project). |
49 | 48 | |
50 | 49 | Install ClusterShell from *Fedora Updates* |
51 | 50 | """""""""""""""""""""""""""""""""""""""""" |
52 | 51 | |
53 | 52 | ClusterShell is part of Fedora, so it is really easy to install it with |
54 | ``yum``, although you have to keep the Fedora *updates* default repository. | |
55 | The following command checks whether the packages are available on a Fedora | |
56 | machine:: | |
53 | ``dnf`` or ``yum``, although you have to keep the Fedora *updates* default | |
54 | repository. The following command checks whether the packages are available | |
55 | on a Fedora machine:: | |
57 | 56 | |
58 | $ yum list \*clustershell | |
59 | Loaded plugins: presto, priorities, refresh-packagekit | |
57 | $ dnf list \*clustershell | |
60 | 58 | Available Packages |
61 | clustershell.noarch 1.5.1-1.fc15 updates | |
62 | vim-clustershell.noarch 1.5.1-1.fc15 updates | |
59 | clustershell.noarch 1.7.2-1.fc24 updates | |
60 | vim-clustershell.noarch 1.7.2-1.fc24 updates | |
61 | ||
63 | 62 | |
64 | 63 | Then, install ClusterShell (library and tools) with the following command:: |
65 | 64 | |
66 | $ yum install clustershell vim-clustershell | |
65 | $ dnf install clustershell vim-clustershell | |
67 | 66 | |
68 | 67 | Please note that optional (but recommended) ``vim-clustershell`` package will |
69 | 68 | install VIM syntax files for ClusterShell configuration files like |
73 | 72 | """""""""""""""""""""""""""""""""""""""""""""""" |
74 | 73 | |
75 | 74 | Recent releases of ClusterShell are first available through the `Test |
76 | Updates`_ ``yum`` repository of Fedora, then it is later pushed to the stable | |
77 | *updates* repository. The following ``yum`` command will also checks for | |
75 | Updates`_ repository of Fedora, then it is later pushed to the stable | |
76 | *updates* repository. The following ``dnf`` command will also checks for | |
78 | 77 | packages availability in the *updates-testing* repository:: |
79 | 78 | |
80 | $ yum list \*clustershell --enablerepo=updates-testing | |
79 | $ dnf list \*clustershell --enablerepo=updates-testing | |
81 | 80 | |
82 | 81 | To install, also add the ``--enablerepo=updates-testing`` option, for |
83 | 82 | instance:: |
84 | 83 | |
85 | $ yum install clustershell vim-clustershell --enablerepo=updates-testing | |
84 | $ dnf install clustershell vim-clustershell --enablerepo=updates-testing | |
86 | 85 | |
87 | 86 | Red Hat Enterprise Linux (and CentOS) |
88 | 87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
97 | 96 | """""""""""""""""""""""""""""" |
98 | 97 | |
99 | 98 | First you have to enable the ``yum`` EPEL repository. We recommend to download |
100 | and install the EPEL repository RPM package. | |
99 | and install the `EPEL`_ repository RPM package. On CentOS, this can be easily | |
100 | done using the following command:: | |
101 | ||
102 | $ yum --enablerepo=extras install epel-release | |
101 | 103 | |
102 | 104 | Then, the ClusterShell installation procedure is quite the same of the Fedora |
103 | 105 | *Updates* one, for instance:: |
183 | 185 | .. [#] pip is a tool for installing and managing Python packages, such as |
184 | 186 | those found in the Python Package Index |
185 | 187 | |
186 | .. _CeCILL license family: http://www.cecill.info/index.en.html | |
188 | .. _LGPL v2.1+: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html | |
187 | 189 | .. _Test Updates: http://fedoraproject.org/wiki/QA/Updates_Testing |
188 | 190 | .. _EPEL: http://fedoraproject.org/wiki/EPEL |
1 | 1 | |
2 | 2 | Release Notes |
3 | 3 | ============= |
4 | ||
5 | Version 1.7.3 | |
6 | ------------- | |
7 | ||
8 | This update contains a few bug fixes and some interesting performance | |
9 | improvements. This is also the first release published under the | |
10 | GNU Lesser General Public License, version 2.1 or later (`LGPL v2.1+`_). | |
11 | Previous releases were published under the `CeCILL-C V1`_. | |
12 | ||
13 | Quite a bit of work has been done on the *fanout* of processes that the library | |
14 | uses to execute commands. We implemenented a basic per-worker *fanout* to fix | |
15 | the broken behaviour in tree mode. Thanks to this, it is now possible to use | |
16 | fanout=1 with gateways. The :ref:`documentation <clush-tree-fanout>` has also | |
17 | been clarified. | |
18 | ||
19 | An issue that led to broken pipe errors but also affected performance has been | |
20 | fixed in :ref:`tree mode <clush-tree>` when copying files. | |
21 | ||
22 | An issue with :ref:`clush-tool` -L where nodes weren't always properly sorted | |
23 | has been fixed. | |
24 | ||
25 | The performance of :class:`.MsgTree`, the class used by the library to | |
26 | aggregate identical command outputs, has been improved. We have seen up to 75% | |
27 | speed improvement in some cases. | |
28 | ||
29 | Finally, a :ref:`cluset <cluset-tool>` command has been added to avoid a | |
30 | conflict with `xCAT`_ nodeset command. It is the same command as | |
31 | :ref:`nodeset-tool`. | |
32 | ||
33 | For more details, please have a look at `GitHub Issues for 1.7.3 milestone`_. | |
34 | ||
35 | ClusterShell 1.7.3 is compatible with Python 2.4 up to Python 2.7 (for | |
36 | example: from RedHat EL5 to EL7). Upgrades from versions 1.6 or 1.7 are | |
37 | supported. | |
4 | 38 | |
5 | 39 | Version 1.7.2 |
6 | 40 | ------------- |
271 | 305 | |
272 | 306 | .. _GitHub Issues for 1.7.1 milestone: https://github.com/cea-hpc/clustershell/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A1.7.1 |
273 | 307 | .. _GitHub Issues for 1.7.2 milestone: https://github.com/cea-hpc/clustershell/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A1.7.2 |
308 | .. _GitHub Issues for 1.7.3 milestone: https://github.com/cea-hpc/clustershell/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A1.7.3 | |
309 | .. _LGPL v2.1+: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html | |
310 | .. _CeCILL-C V1: http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html | |
311 | .. _xCAT: https://xcat.org/ |
35 | 35 | |
36 | 36 | Indeed, *clubak* formats text from standard input containing lines of the form |
37 | 37 | *node: output*. It is fully backward compatible with *dshbak(1)* available |
38 | with *pdsh* but provides additonal features. For instance, *clubak* always | |
38 | with *pdsh* but provides additional features. For instance, *clubak* always | |
39 | 39 | displays its results sorted by node/nodeset. |
40 | 40 | |
41 | 41 | But you do not need to execute *clubak* when using *clush* as all output |
0 | .. _cluset-tool: | |
1 | ||
2 | cluset | |
3 | ------ | |
4 | ||
5 | .. highlight:: console | |
6 | ||
7 | The *cluset* command is the same as :ref:`nodeset-tool` and has been added | |
8 | in ClusterShell 1.7.3 to avoid a conflict with xCAT's nodeset command. | |
9 |
19 | 19 | + **tree mode**: commands propagated to the targets through a tree of |
20 | 20 | pre-configured gateways; gateways are then using a sliding window of local |
21 | 21 | or *ssh(1)* commands to reach the targets (if the target count per gateway |
22 | is greater than the fanout value) | |
22 | is greater than the :ref:`fanout <clush-tree-fanout>` value) | |
23 | 23 | |
24 | 24 | * smart display of command results (integrated output gathering, sorting by |
25 | 25 | node, nodeset or node groups) |
91 | 91 | """"""""""""""""""""""""" |
92 | 92 | |
93 | 93 | Use ``--pick`` with a maximum number of nodes you wish to pick randomly from |
94 | the targeted node set. *clush* will then run only on selected node(s). The | |
94 | the targeted node set. **clush** will then run only on selected node(s). The | |
95 | 95 | following example will run a script on a single random node picked from the |
96 | 96 | ``@compute`` group:: |
97 | 97 | |
131 | 131 | at the Ottawa Linux Symposium Conference in 2012 and at the PyHPC 2013 |
132 | 132 | workshop in Denver, USA. |
133 | 133 | |
134 | .. highlight:: text | |
135 | ||
136 | The diagram below illustrates the hierarchical command propagation principle | |
137 | with a head node, gateways (GW) and target nodes:: | |
138 | ||
139 | .-----------. | |
140 | | Head node | | |
141 | '-----------' | |
142 | /|\ | |
143 | .------------' | '--.-----------. | |
144 | / | \ \ | |
145 | .-----. .-----. \ .-----. | |
146 | | GW1 | | GW2 | \ | GW3 | | |
147 | '-----' '-----' \ '-----' | |
148 | /|\ /|\ \ |\ | |
149 | .-' | '-. .-' | '-. \ | '---. | |
150 | / | \ / | \ \ | \ | |
151 | .---. .---. .---. .---. .---. .---. .---. .---. .-----. | |
152 | '---' '---' '---' '---' '---' '---' '---' '---' | GW4 | | |
153 | target nodes '-----' | |
154 | | | |
155 | ... | |
156 | ||
157 | ||
134 | 158 | The Tree mode is implemented at the library level, so that all applications |
135 | 159 | using ClusterShell may benefits from it. However, this section describes how |
136 | 160 | to use the tree mode with the **clush** command only. |
189 | 213 | representation of the initial propagation tree used. This is useful when |
190 | 214 | working on Tree mode configuration. |
191 | 215 | |
216 | Enabling tree mode should be as much transparent as possible to the end user. | |
217 | Most **clush** options, including options defined in | |
218 | :ref:`clush.conf <clush-config>` or specified using ``-O`` or ``-o`` (ssh | |
219 | options) are propagated to the gateways and taken into account there. | |
220 | ||
192 | 221 | .. _clush-tree-options: |
193 | 222 | |
194 | More Tree command line options | |
195 | """""""""""""""""""""""""""""" | |
223 | Tree mode specific options | |
224 | """""""""""""""""""""""""" | |
196 | 225 | |
197 | 226 | The ``--remote=yes|no`` command line option controls the remote execution |
198 | 227 | behavior: |
218 | 247 | node in a batch fashion. This contributes to reducing the load on the root |
219 | 248 | node by delegating the first steps of this CPU intensive task to the gateways. |
220 | 249 | |
250 | .. _clush-tree-fanout: | |
251 | ||
252 | Fanout considerations | |
253 | """"""""""""""""""""" | |
254 | ||
255 | ClusterShell uses a "sliding window" or *fanout* of processes to avoid too | |
256 | many concurrent connections and to conserve resources on the initiating hosts. | |
257 | ||
258 | The ``--fanout`` (or ``-f``) option of **clush** allows the user to change the | |
259 | default *fanout* value defined in :ref:`clush.conf <clush-config>` or in the | |
260 | :ref:`library defaults <defaults-config>` if not specified. | |
261 | ||
262 | In tree mode, the same *fanout* value is used on the head node and on each | |
263 | gateway. That is, if the *fanout* is **16**, each gateway will initate up to | |
264 | **16** connections to their target nodes at the same time. | |
265 | ||
266 | .. note:: This is likely to **change** in the future, as it makes the *fanout* | |
267 | behaviour different if you are using the tree mode or not. For example, | |
268 | some administrators are using a *fanout* value of 1 to "sequentialize" a | |
269 | command on the cluster. In tree mode, please note that in that case, each | |
270 | gateway will be able to run a command at the same time. | |
271 | ||
221 | 272 | Debugging Tree mode |
222 | 273 | """"""""""""""""""" |
223 | 274 | |
249 | 300 | completion while displaying a :ref:`progress indicator <clush-progress>` and |
250 | 301 | then displays gathered output results. If standard output is redirected to a |
251 | 302 | file, *clush* detects it and disable any progress indicator. |
303 | ||
304 | .. warning:: *clush* will only consolidate identical command outputs if the | |
305 | command return codes are also the same. | |
252 | 306 | |
253 | 307 | The following is a simple example of *clush* command used to execute ``uname |
254 | 308 | -r`` on *node40*, *node41* and *node42*, wait for their completion and finally |
5 | 5 | Three Python scripts using the ClusterShell library are provided with the |
6 | 6 | distribution: |
7 | 7 | |
8 | * `nodeset`, a tool to manage cluster node sets and groups, | |
8 | * `cluset` or `nodeset`, both are the same tool to manage cluster node sets and groups, | |
9 | 9 | * `clush`, a powerful parallel command execution tool with output gathering, |
10 | 10 | * `clubak`, a tool to gather and display results from clush/pdsh-like output (and more). |
11 | 11 | |
14 | 14 | :maxdepth: 2 |
15 | 15 | |
16 | 16 | nodeset |
17 | cluset | |
17 | 18 | clush |
18 | 19 | clubak |
6 | 6 | -------------------------------------------------- |
7 | 7 | |
8 | 8 | :Author: Stephane Thiell <sthiell@stanford.edu> |
9 | :Date: 2016-06-18 | |
10 | :Copyright: CeCILL-C V1 | |
11 | :Version: 1.7.2 | |
9 | :Date: 2016-12-20 | |
10 | :Copyright: GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
11 | :Version: 1.7.3 | |
12 | 12 | :Manual section: 1 |
13 | 13 | :Manual group: ClusterShell User Manual |
14 | 14 | |
22 | 22 | =========== |
23 | 23 | ``clubak`` formats text from standard input containing lines of the form |
24 | 24 | "`node:output`". It is fully backward compatible with ``dshbak``\(1) but |
25 | provides additonal features. For instance, ``clubak`` always displays | |
25 | provides additional features. For instance, ``clubak`` always displays | |
26 | 26 | its results sorted by node/nodeset. |
27 | 27 | |
28 | 28 | You do not need to use ``clubak`` when using ``clush``\(1) as all output |
0 | ======== | |
1 | cluset | |
2 | ======== | |
3 | ||
4 | -------------------------------------------- | |
5 | compute advanced cluster node set operations | |
6 | -------------------------------------------- | |
7 | ||
8 | :Author: Stephane Thiell <sthiell@stanford.edu> | |
9 | :Date: 2016-12-20 | |
10 | :Copyright: GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
11 | :Version: 1.7.3 | |
12 | :Manual section: 1 | |
13 | :Manual group: ClusterShell User Manual | |
14 | ||
15 | ||
16 | SYNOPSIS | |
17 | ======== | |
18 | ||
19 | ``cluset`` [OPTIONS] [COMMAND] [nodeset1 [OPERATION] nodeset2|...] | |
20 | ||
21 | ||
22 | DESCRIPTION | |
23 | =========== | |
24 | Note: ``cluset`` and ``nodeset`` are the same command. | |
25 | ||
26 | ``cluset`` is an utility command provided with the ClusterShell library which | |
27 | implements some features of ClusterShell's NodeSet and RangeSet Python classes. | |
28 | It provides easy manipulation of 1D or nD-indexed cluster nodes and node | |
29 | groups and supports RFC 1123 (except that a node name can't be entirely numeric). | |
30 | ||
31 | Also, ``cluset`` is automatically bound to the library node group resolution | |
32 | mechanism. Thus, it is especially useful to enhance cluster aware | |
33 | administration shell scripts. | |
34 | ||
35 | ||
36 | OPTIONS | |
37 | ======= | |
38 | ||
39 | --version show program's version number and exit | |
40 | -h, --help show this help message and exit | |
41 | -s GROUPSOURCE, --groupsource=GROUPSOURCE | |
42 | optional ``groups.conf``\(5) group source to use | |
43 | ||
44 | Commands: | |
45 | -c, --count show number of nodes in nodeset(s) | |
46 | -e, --expand expand nodeset(s) to separate nodes (see also -S *SEPARATOR*) | |
47 | -f, --fold fold nodeset(s) (or separate nodes) into one nodeset | |
48 | -l, --list list node groups, list node groups and nodes (``-ll``) or list node groups, nodes and node count (``-lll``). When no argument is specified at all, this command will list all node group names found in selected group source (see also -s *GROUPSOURCE*). If any nodesets are specified as argument, this command will find node groups these nodes belongs to (individually). Optionally for each group, the fraction of these nodes being member of the group may be displayed (with ``-ll``), and also member count/total group node count (with ``-lll``). If a single hyphen-minus (-) is given as a nodeset, it will be read from standard input. | |
49 | -r, --regroup fold nodes using node groups (see -s *GROUPSOURCE*) | |
50 | --groupsources list all active group sources (see ``groups.conf``\(5)) | |
51 | ||
52 | Operations: | |
53 | -x SUB_NODES, --exclude=SUB_NODES | |
54 | exclude specified set | |
55 | -i AND_NODES, --intersection=AND_NODES | |
56 | calculate sets intersection | |
57 | -X XOR_NODES, --xor=XOR_NODES | |
58 | calculate symmetric difference between sets | |
59 | ||
60 | Options: | |
61 | -a, --all call external node groups support to display all nodes | |
62 | --autostep=AUTOSTEP | |
63 | enable a-b/step style syntax when folding nodesets, value is min node count threshold (integer '4', percentage '50%' or 'auto'). If not specified, auto step is disabled (best for compatibility with other cluster tools. Example: autostep=4, "node2 node4 node6" folds in node[2,4,6] but autostep=3, "node2 node4 node6" folds in node[2-6/2]. | |
64 | -d, --debug output more messages for debugging purpose | |
65 | -q, --quiet be quiet, print essential output only | |
66 | -R, --rangeset switch to RangeSet instead of NodeSet. Useful when | |
67 | working on numerical cluster ranges, eg. 1,5,18-31 | |
68 | -G, --groupbase hide group source prefix (always `@groupname`) | |
69 | -S SEPARATOR, --separator=SEPARATOR | |
70 | separator string to use when expanding nodesets | |
71 | (default: ' ') | |
72 | -O FORMAT, --output-format=FORMAT | |
73 | output format (default: '%s') | |
74 | -I SLICE_RANGESET, --slice=SLICE_RANGESET | |
75 | return sliced off result; examples of SLICE_RANGESET are "0" for simple index selection, or "1-9/2,16" for complex rangeset selection | |
76 | --split=MAXSPLIT split result into a number of subsets | |
77 | --contiguous split result into contiguous subsets (ie. for nodeset, subsets will contain nodes with same pattern name and a contiguous range of indexes, like foobar[1-100]; for rangeset, subsets with consists in contiguous index ranges)""" | |
78 | --axis=RANGESET for nD nodesets, fold along provided axis only. Axis are indexed from 1 to n and can be specified here either using the rangeset syntax, eg. '1', '1-2', '1,3', or by a single negative number meaning that the indice is counted from the end. Because some nodesets may have several different dimensions, axis indices are silently truncated to fall in the allowed range. | |
79 | --pick=N pick N node(s) at random in nodeset | |
80 | ||
81 | ||
82 | For a short explanation of these options, see ``-h, --help``. | |
83 | ||
84 | If a single hyphen-minus (-) is given as a nodeset, it will be read from | |
85 | standard input. | |
86 | ||
87 | EXTENDED PATTERNS | |
88 | ================= | |
89 | ||
90 | The ``cluset`` command benefits from ClusterShell NodeSet basic | |
91 | arithmetic addition. This feature extends recognized string patterns by | |
92 | supporting operators matching all Operations seen previously. String | |
93 | patterns are read from left to right, by proceeding any character | |
94 | operators accordingly. | |
95 | ||
96 | Supported character operators | |
97 | ``,`` | |
98 | indicates that the *union* of both left and right nodeset should be | |
99 | computed before continuing | |
100 | ``!`` | |
101 | indicates the *difference* operation | |
102 | ``&`` | |
103 | indicates the *intersection* operation | |
104 | ``^`` | |
105 | indicates the *symmetric difference* (XOR) operation | |
106 | ||
107 | Care should be taken to escape these characters as needed when the shell | |
108 | does not interpret them literally. | |
109 | ||
110 | Examples of use of extended patterns | |
111 | :$ cluset -f node[0-7],node[8-10]: | |
112 | ||
113 | | node[0-10] | |
114 | ||
115 | :$ cluset -f node[0-10]\!node[8-10]: | |
116 | ||
117 | | node[0-7] | |
118 | ||
119 | :$ cluset -f node[0-10]\&node[5-13]: | |
120 | ||
121 | | node[5-10] | |
122 | ||
123 | :$ cluset -f node[0-10]^node[5-13]: | |
124 | ||
125 | | node[0-4,11-13] | |
126 | ||
127 | Example of advanced usage | |
128 | :$ cluset -f @gpu^@slurm\:bigmem!@chassis[1-9/2]: | |
129 | ||
130 | This computes a folded nodeset containing nodes found in group @gpu and @slurm:bigmem, but not in both, minus the nodes found in odd chassis groups from 1 to 9. | |
131 | ||
132 | "All nodes" extension (v1.7+) | |
133 | The ``@*`` and ``@SOURCE:*`` special notations may be used in extended patterns to represent all nodes (in SOURCE) according to the *all* external shell command (see ``groups.conf``\(5)) and are equivalent to: | |
134 | ||
135 | :$ cluset [-s SOURCE] -a -f: | |
136 | ||
137 | ||
138 | ||
139 | EXIT STATUS | |
140 | =========== | |
141 | ||
142 | An exit status of zero indicates success of the ``cluset`` command. A non-zero | |
143 | exit status indicates failure. | |
144 | ||
145 | EXAMPLES | |
146 | =========== | |
147 | ||
148 | Getting the node count | |
149 | :$ cluset -c node[0-7,32-159]: | |
150 | ||
151 | | 136 | |
152 | ||
153 | :$ cluset -c node[0-7,32-159] node[160-163]: | |
154 | ||
155 | | 140 | |
156 | ||
157 | :$ cluset -c dc[1-2]n[100-199]: | |
158 | ||
159 | | 200 | |
160 | ||
161 | :$ cluset -c @login: | |
162 | ||
163 | | 4 | |
164 | ||
165 | Folding nodesets | |
166 | :$ cluset -f node[0-7,32-159] node[160-163]: | |
167 | ||
168 | | node[0-7,32-163] | |
169 | ||
170 | :$ echo node3 node6 node1 node2 node7 node5 | cluset -f: | |
171 | ||
172 | | node[1-3,5-7] | |
173 | ||
174 | :$ cluset -f dc1n2 dc2n2 dc1n1 dc2n1: | |
175 | ||
176 | | dc[1-2]n[1-2] | |
177 | ||
178 | :$ cluset --axis=1 -f dc1n2 dc2n2 dc1n1 dc2n1: | |
179 | ||
180 | | dc[1-2]n1,dc[1-2]n2 | |
181 | ||
182 | ||
183 | ||
184 | Expanding nodesets | |
185 | :$ cluset -e node[160-163]: | |
186 | ||
187 | | node160 node161 node162 node163 | |
188 | ||
189 | :$ echo 'dc[1-2]n[2-6/2]' | cluset -e: | |
190 | ||
191 | | dc1n2 dc1n4 dc1n6 dc2n2 dc2n4 dc2n6 | |
192 | ||
193 | Excluding nodes from nodeset | |
194 | :$ cluset -f node[32-159] -x node33: | |
195 | ||
196 | | node[32,34-159] | |
197 | ||
198 | Computing nodesets intersection | |
199 | :$ cluset -f node[32-159] -i node[0-7,20-21,32,156-159]: | |
200 | ||
201 | | node[32,156-159] | |
202 | ||
203 | Computing nodesets symmetric difference (xor) | |
204 | :$ cluset -f node[33-159] --xor node[32-33,156-159]: | |
205 | ||
206 | | node[32,34-155] | |
207 | ||
208 | Splitting nodes into several nodesets (expanding results) | |
209 | :$ cluset --split=3 -e node[1-9]: | |
210 | ||
211 | | node1 node2 node3 | |
212 | | node4 node5 node6 | |
213 | | node7 node8 node9 | |
214 | ||
215 | Splitting non-contiguous nodesets (folding results) | |
216 | :$ cluset --contiguous -f node2 node3 node4 node8 node9: | |
217 | ||
218 | | node[2-4] | |
219 | | node[8-9] | |
220 | ||
221 | :$ cluset --contiguous -f dc[1,3]n[1-2,4-5]: | |
222 | ||
223 | | dc1n[1-2] | |
224 | | dc1n[4-5] | |
225 | | dc3n[1-2] | |
226 | | dc3n[4-5] | |
227 | ||
228 | ||
229 | HISTORY | |
230 | ======= | |
231 | ||
232 | ``cluset`` was added in 1.7.3 to avoid a conflict with xCAT's ``nodeset`` | |
233 | command and also to conform with ClusterShell's "clu*" command nomenclature. | |
234 | ||
235 | SEE ALSO | |
236 | ======== | |
237 | ||
238 | ``nodeset``\(1), ``clush``\(1), ``clubak``\(1), ``groups.conf``\(5). | |
239 | ||
240 | BUG REPORTS | |
241 | =========== | |
242 | ||
243 | Use the following URL to submit a bug report or feedback: | |
244 | https://github.com/cea-hpc/clustershell/issues | |
245 |
6 | 6 | ------------------------------ |
7 | 7 | |
8 | 8 | :Author: Stephane Thiell, <sthiell@stanford.edu> |
9 | :Date: 2016-06-18 | |
10 | :Copyright: CeCILL-C V1 | |
11 | :Version: 1.7.2 | |
9 | :Date: 2016-12-20 | |
10 | :Copyright: GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
11 | :Version: 1.7.3 | |
12 | 12 | :Manual section: 5 |
13 | 13 | :Manual group: ClusterShell User Manual |
14 | 14 | |
38 | 38 | Configuration parameters of the ``Main`` section are described below. |
39 | 39 | |
40 | 40 | fanout |
41 | Size of the sliding window of ssh connectors. | |
41 | Size of the sliding window (fanout) of active commands for ``clush``. This | |
42 | `fanout` is used to avoid too many concurrent connections and to conserve | |
43 | resources on the initiating hosts. In tree mode, the same `fanout` value is | |
44 | used on the head node and on each gateway (the `fanout` value is propagated). | |
45 | That is, if the `fanout` is **16** on the head node, each gateway will | |
46 | initate up to **16** connections to their target nodes at the same time. | |
42 | 47 | connect_timeout |
43 | 48 | Timeout in seconds to allow a connection to establish. This parameter is |
44 | 49 | passed to ssh. If set to *0*, no timeout occurs. |
6 | 6 | ----------------------------------- |
7 | 7 | |
8 | 8 | :Author: Stephane Thiell <sthiell@stanford.edu> |
9 | :Date: 2016-06-18 | |
10 | :Copyright: CeCILL-C V1 | |
11 | :Version: 1.7.2 | |
9 | :Date: 2016-12-20 | |
10 | :Copyright: GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
11 | :Version: 1.7.3 | |
12 | 12 | :Manual section: 1 |
13 | 13 | :Manual group: ClusterShell User Manual |
14 | 14 | |
150 | 150 | -v, --verbose be verbose, print informative messages |
151 | 151 | -d, --debug output more messages for debugging purpose |
152 | 152 | -G, --groupbase do not display group source prefix |
153 | -L disable header block and order output by nodes; additionally, when used in conjunction with -b/-B, it will enable "life gathering" of results by line mode, such as the next line is displayed as soon as possible (eg. when all nodes have sent the line) | |
153 | -L disable header block and order output by nodes; if -b/-B is not specified, ``clush`` will wait for all commands to finish and then display aggregated output of commands with same return codes, ordered by node name; alternatively, when used in conjunction with -b/-B (eg. -bL), ``clush`` will enable a "life gathering" of results by line, such as the next line is displayed as soon as possible (eg. when all nodes have sent the line) | |
154 | 154 | -N disable labeling of command line |
155 | 155 | -P, --progress show progress during command execution; if writing is performed to standard input, the live progress indicator will display the global bandwidth of data written to the target nodes |
156 | -b, --dshbak display gathered results in a dshbak-like way | |
156 | -b, --dshbak display gathered results in a dshbak-like way (note: it will only try to aggregate the output of commands with same return codes) | |
157 | 157 | -B like -b but including standard error |
158 | 158 | -r, --regroup fold nodeset using node groups |
159 | 159 | -S return the largest of command return codes |
170 | 170 | |
171 | 171 | Connection options: |
172 | 172 | -f FANOUT, --fanout=FANOUT |
173 | use a specified maximum fanout size (ie. do not execute more than FANOUT commands at the same time, useful to limit resource usage) | |
173 | do not execute more than FANOUT commands at the same time, useful to limit resource usage. In tree mode, the same *fanout* value is used on the head node and on each gateway (the *fanout* value is propagated). That is, if the *fanout* is **16**, each gateway will initate up to **16** connections to their target nodes at the same time. Default *fanout* value is defined in ``clush.conf``\(5). | |
174 | 174 | -l USER, --user=USER |
175 | 175 | execute remote command as user |
176 | 176 | -o OPTIONS, --options=OPTIONS |
6 | 6 | ----------------------------------------------- |
7 | 7 | |
8 | 8 | :Author: Stephane Thiell, <sthiell@stanford.edu> |
9 | :Date: 2016-06-18 | |
10 | :Copyright: CeCILL-C V1 | |
11 | :Version: 1.7.2 | |
9 | :Date: 2016-12-20 | |
10 | :Copyright: GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
11 | :Version: 1.7.3 | |
12 | 12 | :Manual section: 5 |
13 | 13 | :Manual group: ClusterShell User Manual |
14 | 14 |
6 | 6 | ----------------------------------- |
7 | 7 | |
8 | 8 | :Author: Stephane Thiell <sthiell@stanford.edu> |
9 | :Date: 2016-06-18 | |
10 | :Copyright: CeCILL-C V1 | |
11 | :Version: 1.7.2 | |
9 | :Date: 2016-12-20 | |
10 | :Copyright: GNU Lesser General Public License version 2.1 or later (LGPLv2.1+) | |
11 | :Version: 1.7.3 | |
12 | 12 | :Manual section: 1 |
13 | 13 | :Manual group: ClusterShell User Manual |
14 | 14 | |
21 | 21 | |
22 | 22 | DESCRIPTION |
23 | 23 | =========== |
24 | Note: ``nodeset`` and ``cluset`` are the same command. | |
25 | ||
24 | 26 | ``nodeset`` is an utility command provided with the ClusterShell library which |
25 | 27 | implements some features of ClusterShell's NodeSet and RangeSet Python classes. |
26 | 28 | It provides easy manipulation of 1D or nD-indexed cluster nodes and node |
239 | 241 | |
240 | 242 | | node[1-2,4,7-8] |
241 | 243 | |
244 | ``cluset`` was added in 1.7.3 to avoid a conflict with xCAT's ``nodeset`` | |
245 | command and also to conform with ClusterShell's "clu*" command nomenclature. | |
242 | 246 | |
243 | 247 | SEE ALSO |
244 | 248 | ======== |
245 | 249 | |
246 | ``clush``\(1), ``clubak``\(1), ``groups.conf``\(5). | |
250 | ``cluset``\(1), ``clush``\(1), ``clubak``\(1), ``groups.conf``\(5). | |
247 | 251 | |
248 | 252 | BUG REPORTS |
249 | 253 | =========== |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010, 2011, 2012) | |
3 | # Contributor: Stephane THIELL <stephane.thiell@cea.fr> | |
2 | # Copyright (C) 2010-2012 CEA/DAM | |
4 | 3 | # |
5 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
6 | 5 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 10 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
18 | 15 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 19 | |
33 | 20 | """ |
34 | 21 | format dsh/pdsh-like output for humans and more |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2007-2016) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
2 | # Copyright (C) 2007-2016 CEA/DAM | |
3 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
4 | 4 | # |
5 | # This file is part of the ClusterShell library. | |
5 | # This file is part of ClusterShell. | |
6 | 6 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 11 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
18 | 16 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 20 | |
33 | 21 | """ |
34 | 22 | Execute cluster commands in parallel |
215 | 203 | self.update_prompt(worker) |
216 | 204 | |
217 | 205 | class GatherOutputHandler(OutputHandler): |
218 | """Gathered output event handler class.""" | |
206 | """Gathered output event handler class (clush -b).""" | |
219 | 207 | |
220 | 208 | def __init__(self, display): |
221 | 209 | OutputHandler.__init__(self) |
277 | 265 | self._display.vprint_err(verbexit, "clush: %s: command timeout" % \ |
278 | 266 | NodeSet._fromlist1(worker.iter_keys_timeout())) |
279 | 267 | |
268 | class SortedOutputHandler(GatherOutputHandler): | |
269 | """Sorted by node output event handler class (clush -L).""" | |
270 | ||
271 | def ev_close(self, worker): | |
272 | # Overrides GatherOutputHandler.ev_close() | |
273 | self._runtimer_finalize(worker) | |
274 | ||
275 | # Display command output, try to order buffers by rc | |
276 | for _rc, nodelist in sorted(worker.iter_retcodes()): | |
277 | for node in nodelist: | |
278 | # NOTE: msg should be a MsgTreeElem as Display will iterate | |
279 | # over it to display multiple lines. As worker.node_buffer() | |
280 | # returns either a string or None if there is no output, it | |
281 | # cannot be used here. We use worker.iter_node_buffers() with | |
282 | # a single node as match_keys instead. | |
283 | for node, msg in worker.iter_node_buffers(match_keys=(node,)): | |
284 | self._display.print_gather(node, msg) | |
285 | ||
286 | self._close_common(worker) | |
287 | ||
288 | # Notify main thread to update its prompt | |
289 | self.update_prompt(worker) | |
290 | ||
280 | 291 | class LiveGatherOutputHandler(GatherOutputHandler): |
281 | """Live line-gathered output event handler class.""" | |
292 | """Live line-gathered output event handler class (-bL).""" | |
282 | 293 | |
283 | 294 | def __init__(self, display, nodes): |
284 | 295 | assert nodes is not None, "cannot gather local command" |
643 | 654 | if (display.gather or display.line_mode) and ns is not None: |
644 | 655 | if display.gather and display.line_mode: |
645 | 656 | handler = LiveGatherOutputHandler(display, ns) |
657 | elif not display.gather and display.line_mode: | |
658 | handler = SortedOutputHandler(display) | |
646 | 659 | else: |
647 | 660 | handler = GatherOutputHandler(display) |
648 | 661 |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2016) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of the ClusterShell library. | |
6 | # | |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
12 | # | |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
18 | # | |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
2 | # Copyright (C) 2010-2016 CEA/DAM | |
3 | # | |
4 | # This file is part of ClusterShell. | |
5 | # | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
10 | # | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 19 | |
33 | 20 | """ |
34 | 21 | CLI configuration classes |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2015) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of the ClusterShell library. | |
6 | # | |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
12 | # | |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
18 | # | |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
2 | # Copyright (C) 2010-2015 CEA/DAM | |
3 | # | |
4 | # This file is part of ClusterShell. | |
5 | # | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
10 | # | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 19 | |
33 | 20 | """ |
34 | 21 | CLI results display class |
239 | 226 | """Display a MsgTree buffer by line with prefixed header.""" |
240 | 227 | out = self.out |
241 | 228 | if self.label: |
242 | if self.gather: | |
243 | header = self.color_stdout_fmt % \ | |
244 | ("%s: " % self._format_nodeset(nodeset)) | |
245 | for line in msg: | |
246 | out.write("%s%s\n" % (header, line)) | |
247 | else: | |
248 | for node in nodeset: | |
249 | header = self.color_stdout_fmt % \ | |
250 | ("%s: " % self._format_nodeset(node)) | |
251 | for line in msg: | |
252 | out.write("%s%s\n" % (header, line)) | |
253 | else: | |
254 | if self.gather: | |
255 | for line in msg: | |
256 | out.write(line + '\n') | |
257 | else: | |
258 | for node in nodeset: | |
259 | for line in msg: | |
260 | out.write(line + '\n') | |
229 | header = self.color_stdout_fmt % \ | |
230 | ("%s: " % self._format_nodeset(nodeset)) | |
231 | for line in msg: | |
232 | out.write("%s%s\n" % (header, line)) | |
233 | else: | |
234 | for line in msg: | |
235 | out.write(line + '\n') | |
261 | 236 | |
262 | 237 | def vprint(self, level, message): |
263 | 238 | """Utility method to print a message if verbose level is high |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010, 2011, 2012) | |
3 | # Contributor: Stephane THIELL <stephane.thiell@cea.fr> | |
2 | # Copyright (C) 2010-2012 CEA/DAM | |
4 | 3 | # |
5 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
6 | 5 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 10 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
18 | 15 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 19 | |
33 | 20 | """ |
34 | 21 | CLI error handling helper functions |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2008-2016) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of the ClusterShell library. | |
6 | # | |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
12 | # | |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
18 | # | |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
2 | # Copyright (C) 2008-2016 CEA/DAM | |
3 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of ClusterShell. | |
6 | # | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
11 | # | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 20 | |
33 | 21 | """ |
34 | 22 | compute advanced nodeset operations |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2015) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of the ClusterShell library. | |
6 | # | |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
12 | # | |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
18 | # | |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
2 | # Copyright (C) 2010-2015 CEA/DAM | |
3 | # | |
4 | # This file is part of ClusterShell. | |
5 | # | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
10 | # | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 19 | |
33 | 20 | """ |
34 | 21 | Common ClusterShell CLI OptionParser |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2015) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
2 | # Copyright (C) 2010-2015 CEA/DAM | |
4 | 3 | # |
5 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
6 | 5 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 10 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
18 | 15 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 19 | |
33 | 20 | """ |
34 | 21 | CLI utility functions |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2016) | |
3 | # Contributor: Henri DOREAU <henri.doreau@cea.fr> | |
4 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
2 | # Copyright (C) 2010-2016 CEA/DAM | |
3 | # Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr> | |
4 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
5 | 5 | # |
6 | # This file is part of the ClusterShell library. | |
6 | # This file is part of ClusterShell. | |
7 | 7 | # |
8 | # This software is governed by the CeCILL-C license under French law and abiding | |
9 | # by the rules of distribution of free software. You can use, modify and/ or | |
10 | # redistribute the software under the terms of the CeCILL-C license as | |
11 | # circulated by CEA, CNRS and INRIA at the following URL | |
12 | # "http://www.cecill.info". | |
8 | # ClusterShell is free software; you can redistribute it and/or | |
9 | # modify it under the terms of the GNU Lesser General Public | |
10 | # License as published by the Free Software Foundation; either | |
11 | # version 2.1 of the License, or (at your option) any later version. | |
13 | 12 | # |
14 | # As a counterpart to the access to the source code and rights to copy, modify | |
15 | # and redistribute granted by the license, users are provided only with a | |
16 | # limited warranty and the software's author, the holder of the economic rights, | |
17 | # and the successive licensors have only limited liability. | |
13 | # ClusterShell is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # Lesser General Public License for more details. | |
18 | 17 | # |
19 | # In this respect, the user's attention is drawn to the risks associated with | |
20 | # loading, using, modifying and/or developing or reproducing the software by the | |
21 | # user in light of its specific status of free software, that may mean that it | |
22 | # is complicated to manipulate, and that also therefore means that it is | |
23 | # reserved for developers and experienced professionals having in-depth computer | |
24 | # knowledge. Users are therefore encouraged to load and test the software's | |
25 | # suitability as regards their requirements in conditions enabling the security | |
26 | # of their systems and/or data to be ensured and, more generally, to use and | |
27 | # operate it in the same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had knowledge | |
30 | # of the CeCILL-C license and that you accept its terms. | |
18 | # You should have received a copy of the GNU Lesser General Public | |
19 | # License along with ClusterShell; if not, write to the Free Software | |
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 21 | |
32 | 22 | """ |
33 | 23 | ClusterShell inter-nodes communication module |
0 | 0 | # |
1 | # Copyright 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
2 | # | |
3 | # This file is part of the ClusterShell library. | |
4 | # | |
5 | # This software is governed by the CeCILL-C license under French law and | |
6 | # abiding by the rules of distribution of free software. You can use, | |
7 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
8 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
9 | # "http://www.cecill.info". | |
10 | # | |
11 | # As a counterpart to the access to the source code and rights to copy, | |
12 | # modify and redistribute granted by the license, users are provided only | |
13 | # with a limited warranty and the software's author, the holder of the | |
14 | # economic rights, and the successive licensors have only limited | |
15 | # liability. | |
16 | # | |
17 | # In this respect, the user's attention is drawn to the risks associated | |
18 | # with loading, using, modifying and/or developing or reproducing the | |
19 | # software by the user in light of its specific status of free software, | |
20 | # that may mean that it is complicated to manipulate, and that also | |
21 | # therefore means that it is reserved for developers and experienced | |
22 | # professionals having in-depth computer knowledge. Users are therefore | |
23 | # encouraged to load and test the software's suitability as regards their | |
24 | # requirements in conditions enabling the security of their systems and/or | |
25 | # data to be ensured and, more generally, to use and operate it in the | |
26 | # same conditions as regards security. | |
27 | # | |
28 | # The fact that you are presently reading this means that you have had | |
29 | # knowledge of the CeCILL-C license and that you accept its terms. | |
1 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
2 | # | |
3 | # This file is part of ClusterShell. | |
4 | # | |
5 | # ClusterShell is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
9 | # | |
10 | # ClusterShell is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with ClusterShell; if not, write to the Free Software | |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
30 | 18 | |
31 | 19 | """ |
32 | 20 | ClusterShell Defaults module. |
177 | 165 | "command_timeout" : ConfigParser.getfloat} |
178 | 166 | |
179 | 167 | # |
180 | # List of info keys whose values can safely be propagated in tree mode | |
181 | # | |
182 | _TASK_INFO_PKEYS = ['debug', | |
183 | 'fanout', | |
184 | 'grooming_delay', | |
185 | 'connect_timeout', | |
186 | 'command_timeout'] | |
168 | # Black list of info keys whose values cannot safely be propagated | |
169 | # in tree mode | |
170 | # | |
171 | _TASK_INFO_PKEYS_BL = ['engine', 'print_debug'] | |
187 | 172 | |
188 | 173 | def __init__(self, filenames): |
189 | 174 | """Initialize Defaults from config filenames""" |
190 | 175 | |
191 | 176 | self._task_default = self._TASK_DEFAULT.copy() |
192 | 177 | self._task_info = self._TASK_INFO.copy() |
193 | self._task_info_pkeys = list(self._TASK_INFO_PKEYS) | |
178 | self._task_info_pkeys_bl = list(self._TASK_INFO_PKEYS_BL) | |
194 | 179 | |
195 | 180 | config = ConfigParser() |
196 | 181 | parsed = config.read(filenames) |
226 | 211 | |
227 | 212 | def __setattr__(self, name, value): |
228 | 213 | """Defaults attribute assignment""" |
229 | if name in ('_task_default', '_task_info', '_task_info_pkeys'): | |
214 | if name in ('_task_default', '_task_info', '_task_info_pkeys_bl'): | |
230 | 215 | object.__setattr__(self, name, value) |
231 | 216 | elif name in self._task_default: |
232 | 217 | self._task_default[name] = value |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2009-2015) | |
2 | # Contributor: Stephane THIELL <stephane.thiell@cea.fr> | |
1 | # Copyright (C) 2009-2015 CEA/DAM | |
3 | 2 | # |
4 | # This file is part of the ClusterShell library. | |
3 | # This file is part of ClusterShell. | |
5 | 4 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
5 | # ClusterShell is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 9 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
10 | # ClusterShell is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
17 | 14 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with ClusterShell; if not, write to the Free Software | |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 18 | |
32 | 19 | """ |
33 | 20 | A ClusterShell Engine using epoll, an I/O event notification facility. |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | Interface of underlying Task's Engine. |
52 | 40 | |
53 | 41 | # Define epsilon value for time float arithmetic operations |
54 | 42 | EPSILON = 1.0e-3 |
43 | ||
44 | # Special fanout value for unlimited | |
45 | FANOUT_UNLIMITED = -1 | |
46 | # Special fanout value to use default Engine fanout | |
47 | FANOUT_DEFAULT = None | |
55 | 48 | |
56 | 49 | |
57 | 50 | class EngineException(Exception): |
376 | 369 | self._clients = set() |
377 | 370 | self._ports = set() |
378 | 371 | |
379 | # keep track of the number of registered clients (delayable only) | |
380 | self.reg_clients = 0 | |
372 | # keep track of the number of registered clients per worker | |
373 | # (this does not include ports) | |
374 | self._reg_stats = {} | |
381 | 375 | |
382 | 376 | # keep track of registered file descriptors in a dict where keys |
383 | 377 | # are fileno and values are (EngineClient, EngineClientStream) tuples |
384 | 378 | self.reg_clifds = {} |
379 | ||
380 | # fanout cache used to speed up client launch when fanout changed | |
381 | self._prev_fanout = 0 # fanout_diff != 0 the first time | |
385 | 382 | |
386 | 383 | # Current loop iteration counter. It is the number of performed engine |
387 | 384 | # loops in order to keep track of client registration epoch, so we can |
427 | 424 | stream.fd) |
428 | 425 | return (None, None) |
429 | 426 | |
427 | def _can_register(self, client): | |
428 | assert not client.registered | |
429 | ||
430 | if not client.delayable or client.worker._fanout == FANOUT_UNLIMITED: | |
431 | return True | |
432 | elif client.worker._fanout is FANOUT_DEFAULT: | |
433 | return self._reg_stats.get('default', 0) < self.info['fanout'] | |
434 | else: | |
435 | worker = client.worker | |
436 | return self._reg_stats.get(worker, 0) < worker._fanout | |
437 | ||
438 | def _update_reg_stats(self, client, offset): | |
439 | if client.worker._fanout is FANOUT_DEFAULT: | |
440 | key = 'default' | |
441 | else: | |
442 | key = client.worker | |
443 | self._reg_stats.setdefault(key, 0) | |
444 | self._reg_stats[key] += offset | |
445 | ||
430 | 446 | def add(self, client): |
431 | 447 | """Add a client to engine.""" |
432 | 448 | # bind to engine |
439 | 455 | # add to port set (non-delayable) |
440 | 456 | self._ports.add(client) |
441 | 457 | |
442 | if self.running: | |
458 | if self.running and self._can_register(client): | |
443 | 459 | # in-fly add if running |
444 | if not client.delayable: | |
445 | self.register(client) | |
446 | elif self.info["fanout"] > self.reg_clients: | |
447 | self.register(client._start()) | |
460 | self.register(client._start()) | |
461 | ||
448 | 462 | |
449 | 463 | def _remove(self, client, abort, did_timeout=False): |
450 | 464 | """Remove a client from engine (subroutine).""" |
466 | 480 | else: |
467 | 481 | self._ports.remove(client) |
468 | 482 | self._remove(client, abort, did_timeout) |
469 | self.start_all() | |
483 | # we just removed a client, so start pending client(s) | |
484 | self.start_clients() | |
470 | 485 | |
471 | 486 | def remove_stream(self, client, stream): |
472 | 487 | """ |
521 | 536 | client._reg_epoch = self._current_loopcnt |
522 | 537 | |
523 | 538 | if client.delayable: |
524 | self.reg_clients += 1 | |
539 | self._update_reg_stats(client, 1) | |
525 | 540 | |
526 | 541 | # set interest event bits... |
527 | 542 | for streams, ievent in ((client.streams.active_readers, E_READ), |
574 | 589 | |
575 | 590 | client.registered = False |
576 | 591 | if client.delayable: |
577 | self.reg_clients -= 1 | |
592 | self._update_reg_stats(client, -1) | |
578 | 593 | |
579 | 594 | def modify(self, client, sname, setmask, clearmask): |
580 | 595 | """Modify the next loop interest events bitset for a client stream.""" |
660 | 675 | self._debug("START PORT %s" % port) |
661 | 676 | self.register(port) |
662 | 677 | |
663 | def start_all(self): | |
664 | """ | |
665 | Start and register all other possible clients, in respect of task | |
666 | fanout. | |
667 | """ | |
668 | # Get current fanout value | |
669 | fanout = self.info["fanout"] | |
670 | assert fanout > 0 | |
671 | if fanout <= self.reg_clients: | |
672 | return | |
673 | ||
674 | # Register regular engine clients within the fanout limit | |
678 | def start_clients(self): | |
679 | """Start and register regular engine clients in respect of fanout.""" | |
680 | # check if engine fanout has changed | |
681 | # NOTE: worker._fanout live changes not supported (see #323) | |
682 | fanout_diff = self.info['fanout'] - self._prev_fanout | |
683 | if fanout_diff: | |
684 | self._prev_fanout = self.info['fanout'] | |
685 | ||
675 | 686 | for client in self._clients: |
676 | if not client.registered: | |
687 | if not client.registered and self._can_register(client): | |
677 | 688 | self._debug("START CLIENT %s" % client.__class__.__name__) |
678 | 689 | self.register(client._start()) |
679 | if fanout <= self.reg_clients: | |
690 | # if first time or engine fanout has changed, we do a full scan | |
691 | if fanout_diff == 0: | |
692 | # if engine fanout has not changed, we only start 1 client | |
680 | 693 | break |
681 | 694 | |
682 | 695 | def run(self, timeout): |
694 | 707 | # peek in ports for early pending messages |
695 | 708 | self.snoop_ports() |
696 | 709 | # start all other clients |
697 | self.start_all() | |
710 | self.start_clients() | |
698 | 711 | # run loop until all clients and timers are removed |
699 | 712 | self.runloop(timeout) |
700 | 713 | except EngineTimeoutException: |
721 | 734 | # cleanup |
722 | 735 | self.timerq.clear() |
723 | 736 | self.running = False |
737 | self._prev_fanout = 0 | |
724 | 738 | |
725 | 739 | def snoop_ports(self): |
726 | 740 | """ |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2009-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2009-2016 CEA/DAM | |
2 | # Copyright (C) 2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | Engine Factory to select the best working event engine for the current |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # Copyright (C) 2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | A poll() based ClusterShell Engine. |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2009-2016) | |
2 | # Contributors: | |
3 | # Henri DOREAU <henri.doreau@cea.fr> | |
4 | # Aurelien DEGREMONT <aurelien.degremont@cea.fr> | |
5 | # Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2009-2016 CEA/DAM | |
2 | # Copyright (C) 2009-2012 Henri Doreau <henri.doreau@cea.fr> | |
3 | # Copyright (C) 2009-2012 Aurelien Degremont <aurelien.degremont@cea.fr> | |
4 | # Copyright (C) 2016 Stephane Thiell <sthiell@stanford.edu> | |
6 | 5 | # |
7 | # This file is part of the ClusterShell library. | |
6 | # This file is part of ClusterShell. | |
8 | 7 | # |
9 | # This software is governed by the CeCILL-C license under French law and | |
10 | # abiding by the rules of distribution of free software. You can use, | |
11 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
12 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
13 | # "http://www.cecill.info". | |
8 | # ClusterShell is free software; you can redistribute it and/or | |
9 | # modify it under the terms of the GNU Lesser General Public | |
10 | # License as published by the Free Software Foundation; either | |
11 | # version 2.1 of the License, or (at your option) any later version. | |
14 | 12 | # |
15 | # As a counterpart to the access to the source code and rights to copy, | |
16 | # modify and redistribute granted by the license, users are provided only | |
17 | # with a limited warranty and the software's author, the holder of the | |
18 | # economic rights, and the successive licensors have only limited | |
19 | # liability. | |
13 | # ClusterShell is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # Lesser General Public License for more details. | |
20 | 17 | # |
21 | # In this respect, the user's attention is drawn to the risks associated | |
22 | # with loading, using, modifying and/or developing or reproducing the | |
23 | # software by the user in light of its specific status of free software, | |
24 | # that may mean that it is complicated to manipulate, and that also | |
25 | # therefore means that it is reserved for developers and experienced | |
26 | # professionals having in-depth computer knowledge. Users are therefore | |
27 | # encouraged to load and test the software's suitability as regards their | |
28 | # requirements in conditions enabling the security of their systems and/or | |
29 | # data to be ensured and, more generally, to use and operate it in the | |
30 | # same conditions as regards security. | |
31 | # | |
32 | # The fact that you are presently reading this means that you have had | |
33 | # knowledge of the CeCILL-C license and that you accept its terms. | |
18 | # You should have received a copy of the GNU Lesser General Public | |
19 | # License along with ClusterShell; if not, write to the Free Software | |
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
34 | 21 | |
35 | 22 | """ |
36 | 23 | A select() based ClusterShell Engine. |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2015) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2007-2015 CEA/DAM | |
2 | # Copyright (C) 2015 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | ClusterShell Event handling. |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2016) | |
3 | # Contributor: Henri DOREAU <henri.doreau@cea.fr> | |
4 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
5 | # | |
6 | # This file is part of the ClusterShell library. | |
7 | # | |
8 | # This software is governed by the CeCILL-C license under French law and | |
9 | # abiding by the rules of distribution of free software. You can use, | |
10 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
11 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
12 | # "http://www.cecill.info". | |
13 | # | |
14 | # As a counterpart to the access to the source code and rights to copy, | |
15 | # modify and redistribute granted by the license, users are provided only | |
16 | # with a limited warranty and the software's author, the holder of the | |
17 | # economic rights, and the successive licensors have only limited | |
18 | # liability. | |
19 | # | |
20 | # In this respect, the user's attention is drawn to the risks associated | |
21 | # with loading, using, modifying and/or developing or reproducing the | |
22 | # software by the user in light of its specific status of free software, | |
23 | # that may mean that it is complicated to manipulate, and that also | |
24 | # therefore means that it is reserved for developers and experienced | |
25 | # professionals having in-depth computer knowledge. Users are therefore | |
26 | # encouraged to load and test the software's suitability as regards their | |
27 | # requirements in conditions enabling the security of their systems and/or | |
28 | # data to be ensured and, more generally, to use and operate it in the | |
29 | # same conditions as regards security. | |
30 | # | |
31 | # The fact that you are presently reading this means that you have had | |
32 | # knowledge of the CeCILL-C license and that you accept its terms. | |
2 | # Copyright (C) 2010-2016 CEA/DAM | |
3 | # Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr> | |
4 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
5 | # | |
6 | # This file is part of ClusterShell. | |
7 | # | |
8 | # ClusterShell is free software; you can redistribute it and/or | |
9 | # modify it under the terms of the GNU Lesser General Public | |
10 | # License as published by the Free Software Foundation; either | |
11 | # version 2.1 of the License, or (at your option) any later version. | |
12 | # | |
13 | # ClusterShell is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # Lesser General Public License for more details. | |
17 | # | |
18 | # You should have received a copy of the GNU Lesser General Public | |
19 | # License along with ClusterShell; if not, write to the Free Software | |
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
33 | 21 | |
34 | 22 | """ |
35 | 23 | ClusterShell agent launched on remote gateway nodes. This script reads messages |
47 | 35 | from ClusterShell.Task import task_self, _getshorthostname |
48 | 36 | from ClusterShell.Engine.Engine import EngineAbortException |
49 | 37 | from ClusterShell.Worker.fastsubprocess import set_nonblock_flag |
50 | from ClusterShell.Worker.Worker import StreamWorker | |
38 | from ClusterShell.Worker.Worker import StreamWorker, FANOUT_UNLIMITED | |
51 | 39 | from ClusterShell.Worker.Tree import WorkerTree |
52 | 40 | from ClusterShell.Communication import Channel, ConfigurationMessage, \ |
53 | 41 | ControlMessage, ACKMessage, ErrorMessage, StartMessage, EndMessage, \ |
359 | 347 | |
360 | 348 | gateway = GatewayChannel(task) |
361 | 349 | worker = StreamWorker(handler=gateway) |
350 | # Define worker._fanout to not rely on the engine's fanout, and use | |
351 | # the special value FANOUT_UNLIMITED to always allow registration | |
352 | worker._fanout = FANOUT_UNLIMITED | |
362 | 353 | worker.set_reader(gateway.SNAME_READER, sys.stdin) |
363 | 354 | worker.set_writer(gateway.SNAME_WRITER, sys.stdout, retain=False) |
364 | 355 | # must stay disabled for now (see #274) |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2014) | |
2 | # Contributor: Stephane THIELL <stephane.thiell@cea.fr> | |
3 | # | |
4 | # This file is part of the ClusterShell library. | |
5 | # | |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
11 | # | |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
17 | # | |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # Copyright (C) 2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | # | |
4 | # This file is part of ClusterShell. | |
5 | # | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
10 | # | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | MsgTree |
69 | 57 | # content |
70 | 58 | self.msgline = msgline |
71 | 59 | self.keys = None |
72 | ||
60 | ||
73 | 61 | def __len__(self): |
74 | 62 | """Length of whole message string.""" |
75 | 63 | return len(str(self)) |
91 | 79 | shifting = self.keys |
92 | 80 | self.keys = None |
93 | 81 | else: |
94 | shifting = set([ key ]) | |
82 | shifting = set([key]) | |
95 | 83 | if self.keys: |
96 | 84 | self.keys.difference_update(shifting) |
97 | 85 | |
106 | 94 | """Shift one of our key to specified target element (trace |
107 | 95 | mode: keep backtrace of keys).""" |
108 | 96 | if not target_elem.keys: |
109 | target_elem.keys = set([ key ]) | |
97 | target_elem.keys = set([key]) | |
110 | 98 | else: |
111 | 99 | target_elem.keys.add(key) |
112 | 100 | return target_elem |
115 | 103 | return list(self.lines())[i] |
116 | 104 | |
117 | 105 | def __iter__(self): |
118 | """Iterate over message lines starting from this tree element.""" | |
119 | # no msgline in root element | |
120 | if self.msgline is None: | |
121 | return | |
122 | # trace the message path | |
123 | path = [self.msgline] | |
124 | parent = self.parent | |
125 | while parent.msgline is not None: | |
126 | path.append(parent.msgline) | |
127 | parent = parent.parent | |
128 | # rewind path | |
129 | while path: | |
130 | yield path.pop() | |
106 | """Iterate over message lines up to this element.""" | |
107 | bottomtop = [] | |
108 | if self.msgline is not None: | |
109 | bottomtop.append(self.msgline) | |
110 | parent = self.parent | |
111 | while parent.msgline is not None: | |
112 | bottomtop.append(parent.msgline) | |
113 | parent = parent.parent | |
114 | return reversed(bottomtop) | |
131 | 115 | |
132 | 116 | def lines(self): |
133 | """ | |
134 | Get the whole message lines iterator from this tree element. | |
135 | """ | |
117 | """Get an iterator over all message lines up to this element.""" | |
136 | 118 | return iter(self) |
137 | 119 | |
138 | 120 | splitlines = lines |
152 | 134 | optional associated source key. Called by MsgTree.add(). |
153 | 135 | Return corresponding MsgTreeElem (possibly newly created). |
154 | 136 | """ |
137 | # get/create child element | |
138 | elem = self.children.get(msgline) | |
139 | if elem is None: | |
140 | elem = self.__class__(msgline, self, | |
141 | self._shift == self._shift_trace) | |
142 | self.children[msgline] = elem | |
143 | ||
144 | # if no key is given, MsgTree is in MODE_DEFER | |
145 | # shift down the given key otherwise | |
146 | # Note: replace with ternary operator in py2.5+ | |
155 | 147 | if key is None: |
156 | # No key association, MsgTree is in MODE_DEFER | |
157 | return self.children.setdefault(msgline, \ | |
158 | self.__class__(msgline, self, self._shift == self._shift_trace)) | |
159 | else: | |
160 | # key given: get/create new child element and shift down the key | |
161 | return self._shift(key, self.children.setdefault(msgline, \ | |
162 | self.__class__(msgline, self, | |
163 | self._shift == self._shift_trace))) | |
148 | return elem | |
149 | else: | |
150 | return self._shift(key, elem) | |
164 | 151 | |
165 | 152 | |
166 | 153 | class MsgTree(object): |
176 | 163 | |
177 | 164 | def __init__(self, mode=MODE_DEFER): |
178 | 165 | """MsgTree initializer |
179 | ||
166 | ||
180 | 167 | The `mode' parameter should be set to one of the following constant: |
181 | 168 | |
182 | 169 | MODE_DEFER: all messages are processed immediately, saving memory from |
248 | 235 | return self._keys.iterkeys() |
249 | 236 | |
250 | 237 | __iter__ = keys |
251 | ||
238 | ||
252 | 239 | def messages(self, match=None): |
253 | 240 | """Return an iterator over MsgTree's messages.""" |
254 | 241 | return imap(itemgetter(0), self.walk(match)) |
255 | ||
242 | ||
256 | 243 | def items(self, match=None, mapper=None): |
257 | 244 | """ |
258 | 245 | Return (key, message) for each key of the MsgTree. |
270 | 257 | """ |
271 | 258 | depth = 0 |
272 | 259 | # stack of (element, depth) tuples used to walk the tree |
273 | estack = [ (self._root, depth) ] | |
260 | estack = [(self._root, depth)] | |
274 | 261 | |
275 | 262 | while estack: |
276 | 263 | elem, edepth = estack.pop() |
277 | 264 | if len(elem.children) > 0: |
278 | 265 | estack += [(v, edepth + 1) for v in elem.children.values()] |
279 | 266 | depth = max(depth, edepth) |
280 | ||
267 | ||
281 | 268 | return depth |
282 | 269 | |
283 | 270 | def walk(self, match=None, mapper=None): |
290 | 277 | if self.mode == MODE_DEFER: |
291 | 278 | self._update_keys() |
292 | 279 | # stack of elements used to walk the tree (depth-first) |
293 | estack = [ self._root ] | |
280 | estack = [self._root] | |
294 | 281 | while estack: |
295 | 282 | elem = estack.pop() |
296 | 283 | children = elem.children |
312 | 299 | assert self.mode == MODE_TRACE, \ |
313 | 300 | "walk_trace() is only callable in trace mode" |
314 | 301 | # stack of (element, depth) tuples used to walk the tree |
315 | estack = [ (self._root, 0) ] | |
302 | estack = [(self._root, 0)] | |
316 | 303 | while estack: |
317 | 304 | elem, edepth = estack.pop() |
318 | 305 | children = elem.children |
334 | 321 | """ |
335 | 322 | # do not walk tree in MODE_DEFER as no key is associated |
336 | 323 | if self.mode != MODE_DEFER: |
337 | estack = [ self._root ] | |
324 | estack = [self._root] | |
338 | 325 | # walk the tree to keep only matching keys |
339 | 326 | while estack: |
340 | 327 | elem = estack.pop() |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
3 | # Contributor: Aurelien DEGREMONT <aurelien.degremont@cea.fr> | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # Copyright (C) 2007-2016 Aurelien Degremont <aurelien.degremont@cea.fr> | |
3 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
4 | 4 | # |
5 | # This file is part of the ClusterShell library. | |
5 | # This file is part of ClusterShell. | |
6 | 6 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 11 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
18 | 16 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 20 | |
33 | 21 | """ |
34 | 22 | Cluster node set module. |
645 | 633 | |
646 | 634 | def difference_update(self, other, strict=False): |
647 | 635 | """ |
648 | ``s.difference_update(t)`` returns nodeset s after removing | |
649 | elements found in t. | |
636 | ``s.difference_update(t)`` removes from s all the elements found in t. | |
650 | 637 | |
651 | 638 | :raises KeyError: an element cannot be removed (only if strict is |
652 | 639 | True) |
1495 | 1482 | |
1496 | 1483 | def difference_update(self, other, strict=False): |
1497 | 1484 | """ |
1498 | s.difference_update(t) returns nodeset s after removing | |
1499 | elements found in t. If strict is True, raise KeyError | |
1500 | if an element cannot be removed. | |
1485 | s.difference_update(t) removes from s all the elements | |
1486 | found in t. If strict is True, raise KeyError if an | |
1487 | element in t cannot be removed from s. | |
1501 | 1488 | """ |
1502 | 1489 | nodeset = self._parser.parse(other, self._autostep) |
1503 | 1490 | NodeSetBase.difference_update(self, nodeset, strict) |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2010-2016) | |
2 | # Contributors: | |
3 | # Stephane THIELL <sthiell@stanford.edu> | |
4 | # Aurelien DEGREMONT <aurelien.degremont@cea.fr> | |
1 | # Copyright (C) 2010-2016 CEA/DAM | |
2 | # Copyright (C) 2010-2016 Aurelien Degremont <aurelien.degremont@cea.fr> | |
3 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
5 | 4 | # |
6 | # This file is part of the ClusterShell library. | |
5 | # This file is part of ClusterShell. | |
7 | 6 | # |
8 | # This software is governed by the CeCILL-C license under French law and | |
9 | # abiding by the rules of distribution of free software. You can use, | |
10 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
11 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
12 | # "http://www.cecill.info". | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
13 | 11 | # |
14 | # As a counterpart to the access to the source code and rights to copy, | |
15 | # modify and redistribute granted by the license, users are provided only | |
16 | # with a limited warranty and the software's author, the holder of the | |
17 | # economic rights, and the successive licensors have only limited | |
18 | # liability. | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
19 | 16 | # |
20 | # In this respect, the user's attention is drawn to the risks associated | |
21 | # with loading, using, modifying and/or developing or reproducing the | |
22 | # software by the user in light of its specific status of free software, | |
23 | # that may mean that it is complicated to manipulate, and that also | |
24 | # therefore means that it is reserved for developers and experienced | |
25 | # professionals having in-depth computer knowledge. Users are therefore | |
26 | # encouraged to load and test the software's suitability as regards their | |
27 | # requirements in conditions enabling the security of their systems and/or | |
28 | # data to be ensured and, more generally, to use and operate it in the | |
29 | # same conditions as regards security. | |
30 | # | |
31 | # The fact that you are presently reading this means that you have had | |
32 | # knowledge of the CeCILL-C license and that you accept its terms. | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
33 | 20 | |
34 | 21 | """ |
35 | 22 | Cluster nodes utility module |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2016) | |
3 | # Contributor: Henri DOREAU <henri.doreau@cea.fr> | |
4 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
2 | # Copyright (C) 2010-2016 CEA/DAM | |
3 | # Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr> | |
4 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
5 | 5 | # |
6 | # This file is part of the ClusterShell library. | |
6 | # This file is part of ClusterShell. | |
7 | 7 | # |
8 | # This software is governed by the CeCILL-C license under French law and | |
9 | # abiding by the rules of distribution of free software. You can use, | |
10 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
11 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
12 | # "http://www.cecill.info". | |
8 | # ClusterShell is free software; you can redistribute it and/or | |
9 | # modify it under the terms of the GNU Lesser General Public | |
10 | # License as published by the Free Software Foundation; either | |
11 | # version 2.1 of the License, or (at your option) any later version. | |
13 | 12 | # |
14 | # As a counterpart to the access to the source code and rights to copy, | |
15 | # modify and redistribute granted by the license, users are provided only | |
16 | # with a limited warranty and the software's author, the holder of the | |
17 | # economic rights, and the successive licensors have only limited | |
18 | # liability. | |
13 | # ClusterShell is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # Lesser General Public License for more details. | |
19 | 17 | # |
20 | # In this respect, the user's attention is drawn to the risks associated | |
21 | # with loading, using, modifying and/or developing or reproducing the | |
22 | # software by the user in light of its specific status of free software, | |
23 | # that may mean that it is complicated to manipulate, and that also | |
24 | # therefore means that it is reserved for developers and experienced | |
25 | # professionals having in-depth computer knowledge. Users are therefore | |
26 | # encouraged to load and test the software's suitability as regards their | |
27 | # requirements in conditions enabling the security of their systems and/or | |
28 | # data to be ensured and, more generally, to use and operate it in the | |
29 | # same conditions as regards security. | |
30 | # | |
31 | # The fact that you are presently reading this means that you have had | |
32 | # knowledge of the CeCILL-C license and that you accept its terms. | |
18 | # You should have received a copy of the GNU Lesser General Public | |
19 | # License along with ClusterShell; if not, write to the Free Software | |
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
33 | 21 | |
34 | 22 | """ |
35 | 23 | ClusterShell Propagation module. Use the topology tree to send commands |
291 | 279 | ctl.action = 'shell' |
292 | 280 | ctl.target = nodes |
293 | 281 | |
294 | # copy only subset of task info dict | |
295 | info = dict((k, self.task._info[k]) for k in DEFAULTS._task_info_pkeys) | |
282 | # keep only valid task info pairs | |
283 | info = dict((k, v) for k, v in self.task._info.items() | |
284 | if k not in DEFAULTS._task_info_pkeys_bl) | |
296 | 285 | |
297 | 286 | ctl_data = { |
298 | 287 | 'cmd': command, |
299 | 288 | 'invoke_gateway': gw_invoke_cmd, # XXX |
300 | 'taskinfo': info, #self.task._info, | |
289 | 'taskinfo': info, | |
301 | 290 | 'stderr': stderr, |
302 | 291 | 'timeout': timeout, |
303 | 292 | 'remote': remote, |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2012-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
3 | # Contributor: Aurelien DEGREMONT <aurelien.degremont@cea.fr> | |
1 | # Copyright (C) 2012-2016 CEA/DAM | |
2 | # Copyright (C) 2012-2016 Aurelien Degremont <aurelien.degremont@cea.fr> | |
3 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
4 | 4 | # |
5 | # This file is part of the ClusterShell library. | |
5 | # This file is part of ClusterShell. | |
6 | 6 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 11 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
18 | 16 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 20 | |
33 | 21 | """ |
34 | 22 | Cluster range set module. |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2015) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | ClusterShell Task module. |
73 | 61 | from ClusterShell.Worker.EngineClient import EnginePort |
74 | 62 | from ClusterShell.Worker.Popen import WorkerPopen |
75 | 63 | from ClusterShell.Worker.Tree import WorkerTree |
64 | from ClusterShell.Worker.Worker import FANOUT_UNLIMITED | |
76 | 65 | |
77 | 66 | from ClusterShell.Event import EventHandler |
78 | 67 | from ClusterShell.MsgTree import MsgTree |
1308 | 1297 | wrkcls = self.default('distant_worker') |
1309 | 1298 | chanworker = wrkcls(gateway, command=metaworker.invoke_gateway, |
1310 | 1299 | handler=chan, stderr=True, timeout=timeout) |
1300 | # gateway is special! define worker._fanout to not rely on the | |
1301 | # engine's fanout, and use the special value FANOUT_UNLIMITED to | |
1302 | # always allow registration of gateways | |
1303 | chanworker._fanout = FANOUT_UNLIMITED | |
1311 | 1304 | # change default stream names to avoid internal task buffering |
1312 | 1305 | # and conform with channel stream names |
1313 | 1306 | chanworker.SNAME_STDIN = chan.SNAME_WRITER |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2010-2016) | |
3 | # Contributor: Henri DOREAU <henri.doreau@cea.fr> | |
4 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
2 | # Copyright (C) 2010-2016 CEA/DAM | |
3 | # Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr> | |
4 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
5 | 5 | # |
6 | # This file is part of the ClusterShell library. | |
6 | # This file is part of ClusterShell. | |
7 | 7 | # |
8 | # This software is governed by the CeCILL-C license under French law and | |
9 | # abiding by the rules of distribution of free software. You can use, | |
10 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
11 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
12 | # "http://www.cecill.info". | |
8 | # ClusterShell is free software; you can redistribute it and/or | |
9 | # modify it under the terms of the GNU Lesser General Public | |
10 | # License as published by the Free Software Foundation; either | |
11 | # version 2.1 of the License, or (at your option) any later version. | |
13 | 12 | # |
14 | # As a counterpart to the access to the source code and rights to copy, | |
15 | # modify and redistribute granted by the license, users are provided only | |
16 | # with a limited warranty and the software's author, the holder of the | |
17 | # economic rights, and the successive licensors have only limited | |
18 | # liability. | |
13 | # ClusterShell is distributed in the hope that it will be useful, | |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # Lesser General Public License for more details. | |
19 | 17 | # |
20 | # In this respect, the user's attention is drawn to the risks associated | |
21 | # with loading, using, modifying and/or developing or reproducing the | |
22 | # software by the user in light of its specific status of free software, | |
23 | # that may mean that it is complicated to manipulate, and that also | |
24 | # therefore means that it is reserved for developers and experienced | |
25 | # professionals having in-depth computer knowledge. Users are therefore | |
26 | # encouraged to load and test the software's suitability as regards their | |
27 | # requirements in conditions enabling the security of their systems and/or | |
28 | # data to be ensured and, more generally, to use and operate it in the | |
29 | # same conditions as regards security. | |
30 | # | |
31 | # The fact that you are presently reading this means that you have had | |
32 | # knowledge of the CeCILL-C license and that you accept its terms. | |
18 | # You should have received a copy of the GNU Lesser General Public | |
19 | # License along with ClusterShell; if not, write to the Free Software | |
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
33 | 21 | |
34 | 22 | """ |
35 | 23 | ClusterShell topology module |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2009-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2009-2016 CEA/DAM | |
2 | # Copyright (C) 2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | EngineClient |
239 | 227 | |
240 | 228 | # streams associated with this client |
241 | 229 | self.streams = EngineClientStreamDict() |
230 | ||
231 | def __repr__(self): | |
232 | # added repr(self.key) | |
233 | return '<%s.%s instance at 0x%x key %r>' % (self.__module__, | |
234 | self.__class__.__name__, | |
235 | id(self), self.key) | |
242 | 236 | |
243 | 237 | def _fire(self): |
244 | 238 | """ |
329 | 323 | return |
330 | 324 | if exc.errno == errno.EPIPE: |
331 | 325 | # broken pipe: log warning message and do NOT retry |
332 | LOGGER.warning('%s: %s', self, exc) | |
326 | LOGGER.warning('%r: %s', self, exc) | |
333 | 327 | return |
334 | 328 | raise |
335 | 329 | if wcnt > 0: |
411 | 405 | |
412 | 406 | def _set_write_eof(self, sname): |
413 | 407 | """Set EOF on specific writable stream.""" |
408 | if sname not in self.streams: | |
409 | LOGGER.debug("stream %s was already closed on client %s, skipping", | |
410 | sname, self.key) | |
411 | return | |
412 | ||
414 | 413 | wfile = self.streams[sname] |
415 | 414 | wfile.eof = True |
416 | 415 | if self._engine and wfile.fd and not wfile.wbuf: |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2014-2015) | |
2 | # Contributor: Aurelien DEGREMONT <aurelien.degremont@cea.fr> | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of the ClusterShell library. | |
6 | # | |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
12 | # | |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
18 | # | |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
1 | # Copyright (C) 2014-2015 CEA/DAM | |
2 | # Copyright (C) 2014-2015 Aurelien Degremont <aurelien.degremont@cea.fr> | |
3 | # Copyright (C) 2014-2015 Stephane Thiell <sthiell@stanford.edu> | |
4 | # | |
5 | # This file is part of ClusterShell. | |
6 | # | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
11 | # | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 20 | |
33 | 21 | """ |
34 | 22 | ClusterShell base worker for process-based workers. |
67 | 55 | delimiter = '%' |
68 | 56 | try: |
69 | 57 | cmd = Replacer(pattern).substitute(variables) |
70 | except KeyError, error: | |
58 | except (KeyError, ValueError), error: | |
71 | 59 | msg = "%s is not a valid pattern, use '%%%%' to escape '%%'" % error |
72 | 60 | raise WorkerError(msg) |
73 | 61 | return cmd |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
3 | # | |
4 | # This file is part of the ClusterShell library. | |
5 | # | |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
11 | # | |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
17 | # | |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # | |
3 | # This file is part of ClusterShell. | |
4 | # | |
5 | # ClusterShell is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
9 | # | |
10 | # ClusterShell is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with ClusterShell; if not, write to the Free Software | |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 18 | |
32 | 19 | """ |
33 | 20 | WorkerPdsh |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2008-2015) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2008-2015 CEA/DAM | |
2 | # Copyright (C) 2015 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | WorkerPopen |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2013-2015) | |
1 | # Copyright (C) 2013-2015 CEA/DAM | |
2 | 2 | # |
3 | # This file is part of the ClusterShell library. | |
3 | # This file is part of ClusterShell. | |
4 | 4 | # |
5 | # This software is governed by the CeCILL-C license under French law and | |
6 | # abiding by the rules of distribution of free software. You can use, | |
7 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
8 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
9 | # "http://www.cecill.info". | |
5 | # ClusterShell is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
10 | 9 | # |
11 | # As a counterpart to the access to the source code and rights to copy, | |
12 | # modify and redistribute granted by the license, users are provided only | |
13 | # with a limited warranty and the software's author, the holder of the | |
14 | # economic rights, and the successive licensors have only limited | |
15 | # liability. | |
10 | # ClusterShell is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
16 | 14 | # |
17 | # In this respect, the user's attention is drawn to the risks associated | |
18 | # with loading, using, modifying and/or developing or reproducing the | |
19 | # software by the user in light of its specific status of free software, | |
20 | # that may mean that it is complicated to manipulate, and that also | |
21 | # therefore means that it is reserved for developers and experienced | |
22 | # professionals having in-depth computer knowledge. Users are therefore | |
23 | # encouraged to load and test the software's suitability as regards their | |
24 | # requirements in conditions enabling the security of their systems and/or | |
25 | # data to be ensured and, more generally, to use and operate it in the | |
26 | # same conditions as regards security. | |
27 | # | |
28 | # The fact that you are presently reading this means that you have had | |
29 | # knowledge of the CeCILL-C license and that you accept its terms. | |
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with ClusterShell; if not, write to the Free Software | |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
30 | 18 | |
31 | 19 | """ |
32 | 20 | ClusterShell RSH support |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2008-2015) | |
2 | # Contributor: Stephane THIELL <stephane.thiell@cea.fr> | |
1 | # Copyright (C) 2008-2015 CEA/DAM | |
3 | 2 | # |
4 | # This file is part of the ClusterShell library. | |
3 | # This file is part of ClusterShell. | |
5 | 4 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
5 | # ClusterShell is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 9 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
10 | # ClusterShell is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
17 | 14 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with ClusterShell; if not, write to the Free Software | |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 18 | |
32 | 19 | """ |
33 | 20 | ClusterShell Ssh/Scp support |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2011-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2011-2016 CEA/DAM | |
2 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of ClusterShell. | |
5 | # | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
10 | # | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
4 | 19 | # This file is part of the ClusterShell library. |
5 | # | |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
11 | # | |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
17 | # | |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
31 | 20 | |
32 | 21 | """ |
33 | 22 | ClusterShell v2 tree propagation worker |
312 | 301 | tar.add(self.source, arcname=arcname) |
313 | 302 | tar.close() |
314 | 303 | tmptar.flush() |
315 | # read generated tar file and send to worker | |
304 | # read generated tar file | |
316 | 305 | tmptar.seek(0) |
317 | 306 | rbuf = tmptar.read(32768) |
307 | # send tar data to remote targets only | |
318 | 308 | while len(rbuf) > 0: |
319 | self.write(rbuf) | |
309 | self._write_remote(rbuf) | |
320 | 310 | rbuf = tmptar.read(32768) |
321 | 311 | except OSError, exc: |
322 | 312 | raise WorkerError(exc) |
478 | 468 | self.task._pchannel_release(gateway, self) |
479 | 469 | del self.gwtargets[gateway] |
480 | 470 | |
471 | def _write_remote(self, buf): | |
472 | """Write buf to remote clients only.""" | |
473 | for gateway, targets in self.gwtargets.items(): | |
474 | assert len(targets) > 0 | |
475 | self.task._pchannel(gateway, self).write(nodes=targets, buf=buf, | |
476 | worker=self) | |
477 | ||
481 | 478 | def write(self, buf): |
482 | 479 | """Write to worker clients.""" |
483 | 480 | osexc = None |
488 | 485 | except OSError, exc: |
489 | 486 | osexc = exc |
490 | 487 | |
491 | for gateway, targets in self.gwtargets.items(): | |
492 | assert len(targets) > 0 | |
493 | self.task._pchannel(gateway, self).write(nodes=targets, | |
494 | buf=buf, | |
495 | worker=self) | |
488 | self._write_remote(buf) | |
489 | ||
496 | 490 | if osexc: |
497 | 491 | raise osexc |
498 | 492 |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2015) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
2 | # Copyright (C) 2015-2016 Stephane Thiell <sthiell@stanford.edu> | |
3 | 3 | # |
4 | # This file is part of the ClusterShell library. | |
4 | # This file is part of ClusterShell. | |
5 | 5 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
6 | # ClusterShell is free software; you can redistribute it and/or | |
7 | # modify it under the terms of the GNU Lesser General Public | |
8 | # License as published by the Free Software Foundation; either | |
9 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 10 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
11 | # ClusterShell is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
17 | 15 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
16 | # You should have received a copy of the GNU Lesser General Public | |
17 | # License along with ClusterShell; if not, write to the Free Software | |
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
31 | 19 | |
32 | 20 | """ |
33 | 21 | ClusterShell worker interface. |
40 | 28 | |
41 | 29 | from ClusterShell.Worker.EngineClient import EngineClient |
42 | 30 | from ClusterShell.NodeSet import NodeSet |
31 | from ClusterShell.Engine.Engine import FANOUT_UNLIMITED, FANOUT_DEFAULT | |
43 | 32 | |
44 | 33 | |
45 | 34 | class WorkerException(Exception): |
101 | 90 | """Initializer. Should be called from derived classes.""" |
102 | 91 | # Associated EventHandler object |
103 | 92 | self.eh = handler #: associated :class:`.EventHandler` |
93 | ||
94 | # Per Worker fanout value (positive integer). | |
95 | # Default is FANOUT_DEFAULT to use the fanout set at the Task level. | |
96 | # Change to FANOUT_UNLIMITED to always schedule this worker. | |
97 | # NOTE: the fanout value must be set before the Worker starts and | |
98 | # cannot currently be changed afterwards. | |
99 | self._fanout = FANOUT_DEFAULT | |
100 | ||
104 | 101 | # Parent task (once bound) |
105 | 102 | self.task = None #: worker's task when scheduled or None |
106 | 103 | self.started = False #: set to True when worker has started |
107 | 104 | self.metaworker = None |
108 | 105 | self.metarefcnt = 0 |
106 | ||
109 | 107 | # current_x public variables (updated at each event accordingly) |
110 | 108 | self.current_node = None #: set to node in event handler |
111 | 109 | self.current_msg = None #: set to stdout message in event handler |
0 | 0 | # fastsubprocess - POSIX relaxed revision of subprocess.py |
1 | 1 | # Based on Python 2.6.4 subprocess.py |
2 | 2 | # This is a performance oriented version of subprocess module. |
3 | # Modified by Stephane Thiell <stephane.thiell@cea.fr> | |
3 | # Modified by Stephane Thiell | |
4 | 4 | # Changes: |
5 | 5 | # * removed Windows specific code parts |
6 | 6 | # * removed pipe for transferring possible exec failure from child to |
0 | 0 | # |
1 | # Copyright CEA/DAM/DIF (2007-2016) | |
2 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
1 | # Copyright (C) 2007-2016 CEA/DAM | |
3 | 2 | # |
4 | # This file is part of the ClusterShell library. | |
3 | # This file is part of ClusterShell. | |
5 | 4 | # |
6 | # This software is governed by the CeCILL-C license under French law and | |
7 | # abiding by the rules of distribution of free software. You can use, | |
8 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
9 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
10 | # "http://www.cecill.info". | |
5 | # ClusterShell is free software; you can redistribute it and/or | |
6 | # modify it under the terms of the GNU Lesser General Public | |
7 | # License as published by the Free Software Foundation; either | |
8 | # version 2.1 of the License, or (at your option) any later version. | |
11 | 9 | # |
12 | # As a counterpart to the access to the source code and rights to copy, | |
13 | # modify and redistribute granted by the license, users are provided only | |
14 | # with a limited warranty and the software's author, the holder of the | |
15 | # economic rights, and the successive licensors have only limited | |
16 | # liability. | |
10 | # ClusterShell is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
17 | 14 | # |
18 | # In this respect, the user's attention is drawn to the risks associated | |
19 | # with loading, using, modifying and/or developing or reproducing the | |
20 | # software by the user in light of its specific status of free software, | |
21 | # that may mean that it is complicated to manipulate, and that also | |
22 | # therefore means that it is reserved for developers and experienced | |
23 | # professionals having in-depth computer knowledge. Users are therefore | |
24 | # encouraged to load and test the software's suitability as regards their | |
25 | # requirements in conditions enabling the security of their systems and/or | |
26 | # data to be ensured and, more generally, to use and operate it in the | |
27 | # same conditions as regards security. | |
28 | # | |
29 | # The fact that you are presently reading this means that you have had | |
30 | # knowledge of the CeCILL-C license and that you accept its terms. | |
31 | ||
15 | # You should have received a copy of the GNU Lesser General Public | |
16 | # License along with ClusterShell; if not, write to the Free Software | |
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 18 | |
33 | 19 | """ClusterShell Python Library |
34 | 20 | |
47 | 33 | - ClusterShell.Task |
48 | 34 | """ |
49 | 35 | |
50 | __version__ = '1.7.2' | |
36 | __version__ = '1.7.3' | |
51 | 37 | __version_info__ = tuple([ int(_n) for _n in __version__.split('.')]) |
52 | __date__ = '2016/06/18' | |
38 | __date__ = '2016/12/20' | |
53 | 39 | __author__ = 'Stephane Thiell <sthiell@stanford.edu>' |
54 | 40 | __url__ = 'http://clustershell.readthedocs.org/' |
0 | #!/usr/bin/env python | |
1 | ||
2 | """ | |
3 | clubak command-line tool | |
4 | """ | |
5 | ||
6 | from ClusterShell.CLI.Clubak import main | |
7 | ||
8 | if __name__ == '__main__': | |
9 | main() |
0 | #!/usr/bin/env python | |
1 | ||
2 | """ | |
3 | clush command-line tool | |
4 | """ | |
5 | ||
6 | from ClusterShell.CLI.Clush import main | |
7 | ||
8 | if __name__ == '__main__': | |
9 | main() |
0 | #!/usr/bin/env python | |
1 | ||
2 | """ | |
3 | nodeset command-line tool | |
4 | """ | |
5 | ||
6 | from ClusterShell.CLI.Nodeset import main | |
7 | ||
8 | if __name__ == '__main__': | |
9 | main() |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # |
2 | # Copyright CEA/DAM/DIF (2008-2016) | |
3 | # Contributor: Stephane THIELL <sthiell@stanford.edu> | |
2 | # Copyright (C) 2008-2016 CEA/DAM | |
3 | # Copyright (C) 2016 Stephane Thiell <sthiell@stanford.edu> | |
4 | 4 | # |
5 | # This file is part of the ClusterShell library. | |
5 | # This file is part of ClusterShell. | |
6 | 6 | # |
7 | # This software is governed by the CeCILL-C license under French law and | |
8 | # abiding by the rules of distribution of free software. You can use, | |
9 | # modify and/ or redistribute the software under the terms of the CeCILL-C | |
10 | # license as circulated by CEA, CNRS and INRIA at the following URL | |
11 | # "http://www.cecill.info". | |
7 | # ClusterShell is free software; you can redistribute it and/or | |
8 | # modify it under the terms of the GNU Lesser General Public | |
9 | # License as published by the Free Software Foundation; either | |
10 | # version 2.1 of the License, or (at your option) any later version. | |
12 | 11 | # |
13 | # As a counterpart to the access to the source code and rights to copy, | |
14 | # modify and redistribute granted by the license, users are provided only | |
15 | # with a limited warranty and the software's author, the holder of the | |
16 | # economic rights, and the successive licensors have only limited | |
17 | # liability. | |
12 | # ClusterShell is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | # Lesser General Public License for more details. | |
18 | 16 | # |
19 | # In this respect, the user's attention is drawn to the risks associated | |
20 | # with loading, using, modifying and/or developing or reproducing the | |
21 | # software by the user in light of its specific status of free software, | |
22 | # that may mean that it is complicated to manipulate, and that also | |
23 | # therefore means that it is reserved for developers and experienced | |
24 | # professionals having in-depth computer knowledge. Users are therefore | |
25 | # encouraged to load and test the software's suitability as regards their | |
26 | # requirements in conditions enabling the security of their systems and/or | |
27 | # data to be ensured and, more generally, to use and operate it in the | |
28 | # same conditions as regards security. | |
29 | # | |
30 | # The fact that you are presently reading this means that you have had | |
31 | # knowledge of the CeCILL-C license and that you accept its terms. | |
17 | # You should have received a copy of the GNU Lesser General Public | |
18 | # License along with ClusterShell; if not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
32 | 20 | |
33 | 21 | import os |
34 | 22 | from setuptools import setup, find_packages |
35 | 23 | |
36 | ||
37 | if not os.access('scripts/clubak', os.F_OK): | |
38 | os.symlink('clubak.py', 'scripts/clubak') | |
39 | if not os.access('scripts/clush', os.F_OK): | |
40 | os.symlink('clush.py', 'scripts/clush') | |
41 | if not os.access('scripts/nodeset', os.F_OK): | |
42 | os.symlink('nodeset.py', 'scripts/nodeset') | |
43 | 24 | |
44 | 25 | if os.geteuid() == 0: |
45 | 26 | # System-wide, out-of-prefix config install (rpmbuild or pip as root) |
48 | 29 | # User, in-prefix config install (rpmbuild or pip as user) |
49 | 30 | CFGDIR = 'etc/clustershell' |
50 | 31 | |
51 | VERSION='1.7.2' | |
32 | VERSION = '1.7.3' | |
33 | ||
34 | # Dependencies (for pip install) | |
35 | REQUIRES = ['PyYAML'] | |
52 | 36 | |
53 | 37 | setup(name='ClusterShell', |
54 | 38 | version=VERSION, |
55 | 39 | package_dir={'': 'lib'}, |
56 | 40 | packages=find_packages('lib'), |
57 | data_files = [(CFGDIR, | |
58 | ['conf/clush.conf', | |
59 | 'conf/groups.conf', | |
60 | 'conf/topology.conf.example']), | |
61 | (os.path.join(CFGDIR, 'groups.conf.d'), | |
62 | ['conf/groups.conf.d/genders.conf.example', | |
63 | 'conf/groups.conf.d/slurm.conf.example', | |
64 | 'conf/groups.conf.d/README']), | |
65 | (os.path.join(CFGDIR,'groups.d'), | |
66 | ['conf/groups.d/cluster.yaml.example', | |
67 | 'conf/groups.d/local.cfg', | |
68 | 'conf/groups.d/README'])], | |
69 | scripts=['scripts/clubak', | |
70 | 'scripts/clush', | |
71 | 'scripts/nodeset'], | |
41 | data_files=[(CFGDIR, | |
42 | ['conf/clush.conf', | |
43 | 'conf/groups.conf', | |
44 | 'conf/topology.conf.example']), | |
45 | (os.path.join(CFGDIR, 'groups.conf.d'), | |
46 | ['conf/groups.conf.d/genders.conf.example', | |
47 | 'conf/groups.conf.d/slurm.conf.example', | |
48 | 'conf/groups.conf.d/README']), | |
49 | (os.path.join(CFGDIR, 'groups.d'), | |
50 | ['conf/groups.d/cluster.yaml.example', | |
51 | 'conf/groups.d/local.cfg', | |
52 | 'conf/groups.d/README'])], | |
53 | entry_points={'console_scripts': | |
54 | ['clubak=ClusterShell.CLI.Clubak:main', | |
55 | 'cluset=ClusterShell.CLI.Nodeset:main', | |
56 | 'clush=ClusterShell.CLI.Clush:main', | |
57 | 'nodeset=ClusterShell.CLI.Nodeset:main'], | |
58 | }, | |
72 | 59 | author='Stephane Thiell', |
73 | 60 | author_email='sthiell@stanford.edu', |
74 | license='CeCILL-C (French equivalent to LGPLv2+)', | |
61 | license='LGPLv2+', | |
75 | 62 | url='http://clustershell.sourceforge.net/', |
76 | 63 | download_url='http://sourceforge.net/projects/clustershell/files/' |
77 | 'clustershell/%s/' % VERSION, | |
64 | 'clustershell/%s/' % VERSION, | |
78 | 65 | platforms=['GNU/Linux', 'BSD', 'MacOSX'], |
79 | 66 | keywords=['clustershell', 'clush', 'clubak', 'nodeset'], |
80 | 67 | description='ClusterShell library and tools', |
83 | 70 | "Development Status :: 5 - Production/Stable", |
84 | 71 | "Environment :: Console", |
85 | 72 | "Intended Audience :: System Administrators", |
73 | "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", | |
86 | 74 | "Operating System :: MacOS :: MacOS X", |
87 | 75 | "Operating System :: POSIX :: BSD", |
88 | 76 | "Operating System :: POSIX :: Linux", |
89 | 77 | "Programming Language :: Python", |
78 | "Programming Language :: Python :: 2.4", | |
79 | "Programming Language :: Python :: 2.5", | |
80 | "Programming Language :: Python :: 2.6", | |
81 | "Programming Language :: Python :: 2.7", | |
90 | 82 | "Topic :: Software Development :: Libraries :: Python Modules", |
91 | 83 | "Topic :: System :: Clustering", |
92 | 84 | "Topic :: System :: Distributed Computing" |
93 | ] | |
85 | ], | |
86 | install_requires=REQUIRES, | |
94 | 87 | ) |
95 |
0 | 0 | #!/usr/bin/env python |
1 | # scripts/clubak.py tool test suite | |
1 | # ClusterShell.CLI.Clubak test suite | |
2 | 2 | # Written by S. Thiell |
3 | 3 | |
4 | 4 |
0 | 0 | #!/usr/bin/env python |
1 | # scripts/clush.py tool test suite | |
1 | # ClusterShell.CLI.Clush test suite | |
2 | 2 | # Written by S. Thiell |
3 | 3 | |
4 | 4 | |
132 | 132 | |
133 | 133 | def test_006_output_gathering(self): |
134 | 134 | """test clush (output gathering)""" |
135 | self._clush_t(["-w", HOSTNAME, "-L", "echo", "ok"], None, \ | |
136 | "%s: ok\n" % HOSTNAME) | |
137 | 135 | self._clush_t(["-w", HOSTNAME, "-bL", "echo", "ok"], None, \ |
138 | 136 | "%s: ok\n" % HOSTNAME) |
139 | 137 | self._clush_t(["-w", HOSTNAME, "-qbL", "echo", "ok"], None, \ |
345 | 343 | kth = KillerThread() |
346 | 344 | args = ["-w", HOSTNAME, "--worker=exec", "-q", "--nostdin", "-b", |
347 | 345 | "echo start; sleep 10"] |
348 | process = Popen(["../scripts/clush.py"] + args, stderr=PIPE, | |
349 | stdout=PIPE, bufsize=0) | |
346 | process = Popen(["../lib/ClusterShell/CLI/Clush.py"] + args, | |
347 | stderr=PIPE, stdout=PIPE, bufsize=0) | |
350 | 348 | kth.pidkill = process.pid |
351 | 349 | kth.start() |
352 | 350 | stderr = process.communicate()[1] |
488 | 486 | "echo foo"], None, |
489 | 487 | re.compile(r"^((localhost|%s): foo\n){2}$" % HOSTNAME)) |
490 | 488 | |
489 | def test_035_sorted_line_mode(self): | |
490 | """test clush (sorted line mode -L)""" | |
491 | self._clush_t(["-w", HOSTNAME, "-L", "echo", "ok"], None, | |
492 | "%s: ok\n" % HOSTNAME) | |
493 | ||
494 | # Issue #326 | |
495 | cmd = 's=%h; n=${s//[!0-9]/}; if [[ $(expr $n %% 2) == 0 ]]; then ' \ | |
496 | 'echo foo; else echo bar; fi' | |
497 | ||
498 | self._clush_t(["-w", "cs[01-03]", "--worker=exec", "-L", cmd], None, | |
499 | 'cs01: bar\ncs02: foo\ncs03: bar\n', 0) | |
491 | 500 | |
492 | 501 | class CLIClushTest_B_StdinFailure(unittest.TestCase): |
493 | 502 | """Unit test class for testing CLI/Clush.py and stdin failure""" |
0 | 0 | #!/usr/bin/env python |
1 | # scripts/nodeset.py tool test suite | |
1 | # ClusterShell.CLI.Nodeset test suite | |
2 | 2 | # Written by S. Thiell |
3 | 3 | |
4 | 4 |
0 | 0 | #!/usr/bin/env python |
1 | 1 | # ClusterShell test suite |
2 | # Written by S. Thiell 2010-02-03 | |
2 | # Written by S. Thiell | |
3 | 3 | |
4 | 4 | |
5 | 5 | """Unit test for ClusterShell MsgTree Class""" |
179 | 179 | |
180 | 180 | def test_006_scalability(self): |
181 | 181 | """test MsgTree scalability""" |
182 | # build tree... | |
183 | tree = MsgTree() | |
184 | for i in xrange(0, 10000): | |
182 | # test tree of 10k nodes with a single different line each | |
183 | tree = MsgTree() | |
184 | for i in range(10000): | |
185 | 185 | tree.add("node%d" % i, "message%d" % i) |
186 | 186 | self.assertEqual(len(tree), 10000) |
187 | 187 | cnt = 0 |
188 | 188 | for msg, keys in tree.walk(): |
189 | 189 | cnt += 1 |
190 | self.assertEqual(cnt, 10000) | |
191 | ||
192 | # test tree of 1 node with 10k lines | |
193 | tree = MsgTree() | |
194 | for i in range(10000): | |
195 | tree.add("nodeX", "message%d" % i) | |
196 | self.assertEqual(len(tree), 1) | |
197 | cnt = 0 | |
198 | for msg, keys in tree.walk(): | |
199 | testlines = str(msg) # test MsgTreeElem.__iter__() | |
200 | self.assertEqual(len(testlines.splitlines()), 10000) | |
201 | cnt += 1 | |
202 | self.assertEqual(cnt, 1) | |
203 | ||
204 | # test tree of 100 nodes with the same 1000 message lines each | |
205 | tree = MsgTree() | |
206 | for j in range(100): | |
207 | for i in range(1000): | |
208 | tree.add("node%d" % j, "message%d" % i) | |
209 | self.assertEqual(len(tree), 100) | |
210 | cnt = 0 | |
211 | for msg, keys in tree.walk(): | |
212 | testlines = str(msg) # test MsgTreeElem.__iter__() | |
213 | self.assertEqual(len(testlines.splitlines()), 1000) | |
214 | cnt += 1 | |
215 | self.assertEqual(cnt, 1) | |
190 | 216 | |
191 | 217 | def test_007_shift_mode(self): |
192 | 218 | """test MsgTree in shift mode""" |
18 | 18 | from ClusterShell.Task import * |
19 | 19 | from ClusterShell.Worker.Ssh import WorkerSsh |
20 | 20 | from ClusterShell.Worker.EngineClient import * |
21 | from ClusterShell.Worker.Worker import WorkerBadArgumentError | |
21 | from ClusterShell.Worker.Worker import FANOUT_UNLIMITED, WorkerBadArgumentError | |
22 | 22 | |
23 | 23 | import socket |
24 | 24 | |
164 | 164 | handler=None) |
165 | 165 | self._task.schedule(worker) |
166 | 166 | self._task.resume() |
167 | self.assertTrue(os.path.exists( | |
168 | os.path.join(dtmp_dst, | |
169 | os.path.basename(dtmp_src), | |
170 | "lev1_a", "lev2"))) | |
167 | path = os.path.join(dtmp_dst, os.path.basename(dtmp_src), "lev1_a", | |
168 | "lev2") | |
169 | self.assertTrue(os.path.exists(path)) | |
171 | 170 | finally: |
172 | 171 | shutil.rmtree(dtmp_dst, ignore_errors=True) |
173 | 172 | shutil.rmtree(dtmp_src, ignore_errors=True) |
279 | 278 | def testShellEventsWithTimeout(self): |
280 | 279 | # init worker |
281 | 280 | test_eh = self.__class__.TEventHandlerChecker(self) |
282 | worker = self._task.shell("/bin/echo alright && /bin/sleep 10", nodes=HOSTNAME, handler=test_eh, | |
283 | timeout=2) | |
281 | worker = self._task.shell("/bin/echo alright && /bin/sleep 10", | |
282 | nodes=HOSTNAME, handler=test_eh, timeout=2) | |
284 | 283 | self.assertTrue(worker != None) |
285 | 284 | # run task |
286 | 285 | self._task.resume() |
303 | 302 | def testShellEventsWithTimeout2(self): |
304 | 303 | # init worker |
305 | 304 | test_eh1 = self.__class__.TEventHandlerChecker(self) |
306 | worker1 = self._task.shell("/bin/echo alright && /bin/sleep 10", nodes=HOSTNAME, handler=test_eh1, | |
307 | timeout=2) | |
305 | worker1 = self._task.shell("/bin/echo alright && /bin/sleep 10", | |
306 | nodes=HOSTNAME, handler=test_eh1, timeout=2) | |
308 | 307 | self.assert_(worker1 != None) |
309 | 308 | test_eh2 = self.__class__.TEventHandlerChecker(self) |
310 | worker2 = self._task.shell("/bin/echo okay && /bin/sleep 10", nodes=HOSTNAME, handler=test_eh2, | |
311 | timeout=3) | |
309 | worker2 = self._task.shell("/bin/echo okay && /bin/sleep 10", | |
310 | nodes=HOSTNAME, handler=test_eh2, timeout=3) | |
312 | 311 | self.assert_(worker2 != None) |
313 | 312 | # run task |
314 | 313 | self._task.resume() |
501 | 500 | self.assertEqual(cnt, 0) |
502 | 501 | |
503 | 502 | def testEscape(self): |
504 | worker = self._task.shell("export CSTEST=foobar; /bin/echo \$CSTEST | sed 's/\ foo/bar/'", nodes=HOSTNAME) | |
503 | cmd = r"export CSTEST=foobar; /bin/echo \$CSTEST | sed 's/\ foo/bar/'" | |
504 | worker = self._task.shell(cmd, nodes=HOSTNAME) | |
505 | 505 | # execute |
506 | 506 | self._task.resume() |
507 | 507 | # read result |
508 | 508 | self.assertEqual(worker.node_buffer(HOSTNAME), "$CSTEST") |
509 | 509 | |
510 | 510 | def testEscape2(self): |
511 | worker = self._task.shell("export CSTEST=foobar; /bin/echo $CSTEST | sed 's/\ foo/bar/'", nodes=HOSTNAME) | |
511 | cmd = r"export CSTEST=foobar; /bin/echo $CSTEST | sed 's/\ foo/bar/'" | |
512 | worker = self._task.shell(cmd, nodes=HOSTNAME) | |
512 | 513 | # execute |
513 | 514 | self._task.resume() |
514 | 515 | # read result |
610 | 611 | self.assertEqual(reader.node_buffer(HOSTNAME), "%s:foobar" % HOSTNAME) |
611 | 612 | |
612 | 613 | def testSshBadArgumentOption(self): |
613 | # Check code < 1.4 compatibility | |
614 | self.assertRaises(WorkerBadArgumentError, WorkerSsh, HOSTNAME, | |
615 | None, None) | |
616 | # As of 1.4, ValueError is raised for missing parameter | |
617 | self.assertRaises(ValueError, WorkerSsh, HOSTNAME, | |
618 | None, None) # 1.4+ | |
614 | # Check code < 1.4 compatibility | |
615 | self.assertRaises(WorkerBadArgumentError, WorkerSsh, HOSTNAME, None, | |
616 | None) | |
617 | # As of 1.4, ValueError is raised for missing parameter | |
618 | self.assertRaises(ValueError, WorkerSsh, HOSTNAME, None, None) # 1.4+ | |
619 | 619 | |
620 | 620 | def testCopyEvents(self): |
621 | 621 | test_eh = self.__class__.TEventHandlerChecker(self) |
622 | 622 | dest = make_temp_filename('testLocalhostCopyEvents') |
623 | 623 | worker = self._task.copy("/etc/hosts", dest, nodes=HOSTNAME, |
624 | handler=test_eh) | |
624 | handler=test_eh) | |
625 | 625 | self.assert_(worker != None) |
626 | 626 | # run task |
627 | 627 | self._task.resume() |
674 | 674 | def testLocalhostExplicitSshReverseCopy(self): |
675 | 675 | dest = make_temp_dir('testLocalhostExplicitSshRCopy') |
676 | 676 | try: |
677 | worker = WorkerSsh(HOSTNAME, source="/etc/hosts", | |
678 | dest=dest, handler=None, timeout=10, reverse=True) | |
677 | worker = WorkerSsh(HOSTNAME, source="/etc/hosts", dest=dest, | |
678 | handler=None, timeout=10, reverse=True) | |
679 | 679 | self._task.schedule(worker) |
680 | 680 | self._task.resume() |
681 | 681 | self.assertEqual(worker.source, "/etc/hosts") |
691 | 691 | os.mkdir(os.path.join(dtmp_src, "lev1_a")) |
692 | 692 | os.mkdir(os.path.join(dtmp_src, "lev1_b")) |
693 | 693 | os.mkdir(os.path.join(dtmp_src, "lev1_a", "lev2")) |
694 | worker = WorkerSsh(HOSTNAME, source=dtmp_src, | |
695 | dest=dtmp_dst, handler=None, timeout=30, reverse=True) | |
694 | worker = WorkerSsh(HOSTNAME, source=dtmp_src, dest=dtmp_dst, | |
695 | handler=None, timeout=30, reverse=True) | |
696 | 696 | self._task.schedule(worker) |
697 | 697 | self._task.resume() |
698 | 698 | self.assert_(os.path.exists(os.path.join(dtmp_dst, \ |
708 | 708 | os.mkdir(os.path.join(dtmp_src, "lev1_a")) |
709 | 709 | os.mkdir(os.path.join(dtmp_src, "lev1_b")) |
710 | 710 | os.mkdir(os.path.join(dtmp_src, "lev1_a", "lev2")) |
711 | worker = WorkerSsh(HOSTNAME, source=dtmp_src, | |
712 | dest=dtmp_dst, handler=None, timeout=30, reverse=True) | |
711 | worker = WorkerSsh(HOSTNAME, source=dtmp_src, dest=dtmp_dst, | |
712 | handler=None, timeout=30, reverse=True) | |
713 | 713 | self._task.schedule(worker) |
714 | 714 | self._task.resume() |
715 | 715 | self.assert_(os.path.exists(os.path.join(dtmp_dst, \ |
18 | 18 | from ClusterShell.Event import EventHandler |
19 | 19 | from ClusterShell.NodeSet import NodeSet |
20 | 20 | from ClusterShell.Task import * |
21 | from ClusterShell.Worker.Exec import ExecWorker | |
21 | 22 | from ClusterShell.Worker.Worker import WorkerSimple, WorkerError |
22 | 23 | from ClusterShell.Worker.Worker import WorkerBadArgumentError |
24 | from ClusterShell.Worker.Worker import FANOUT_UNLIMITED | |
23 | 25 | |
24 | 26 | # private import |
25 | 27 | from ClusterShell.Engine.Engine import E_READ, E_WRITE |
37 | 39 | class TaskLocalMixin(object): |
38 | 40 | """Mixin test case class: should be overrided and used in multiple |
39 | 41 | inheritance with unittest.TestCase""" |
42 | ||
43 | def setUp(self): | |
44 | # save original fanout value | |
45 | self.fanout_orig = task_self().info("fanout") | |
46 | ||
47 | def tearDown(self): | |
48 | # restore original fanout value | |
49 | task_self().set_info("fanout", self.fanout_orig) | |
40 | 50 | |
41 | 51 | def testSimpleCommand(self): |
42 | 52 | task = task_self() |
762 | 772 | task = task_self() |
763 | 773 | self.assert_(task != None) |
764 | 774 | # init worker |
765 | worker = task.shell("/bin/echo -n okay") | |
775 | worker = task.shell("echo -n okay") | |
766 | 776 | self.assert_(worker != None) |
767 | 777 | # run task |
768 | 778 | task.resume() |
770 | 780 | |
771 | 781 | def testLocalFanout(self): |
772 | 782 | task = task_self() |
773 | self.assert_(task != None) | |
774 | fanout = task.info("fanout") | |
775 | try: | |
776 | task.set_info("fanout", 3) | |
777 | ||
778 | # Test #1: simple | |
779 | for i in range(0, 10): | |
780 | worker = task.shell("/bin/echo test %d" % i) | |
781 | self.assert_(worker != None) | |
782 | task.resume() | |
783 | ||
784 | # Test #2: fanout change during run | |
785 | class TestFanoutChanger(EventHandler): | |
786 | def ev_timer(self, timer): | |
787 | task_self().set_info("fanout", 1) | |
788 | timer = task.timer(2.0, handler=TestFanoutChanger()) | |
789 | for i in range(0, 10): | |
790 | worker = task.shell("sleep 0.5") | |
791 | self.assert_(worker != None) | |
792 | task.resume() | |
793 | finally: | |
794 | # restore original fanout value | |
795 | task.set_info("fanout", fanout) | |
783 | task.set_info("fanout", 3) | |
784 | ||
785 | # Test #1: simple | |
786 | for i in range(0, 10): | |
787 | worker = task.shell("echo test %d" % i) | |
788 | self.assert_(worker != None) | |
789 | task.resume() | |
790 | ||
791 | # Test #2: fanout change during run | |
792 | class TestFanoutChanger(EventHandler): | |
793 | def ev_timer(self, timer): | |
794 | task_self().set_info("fanout", 1) | |
795 | timer = task.timer(2.0, handler=TestFanoutChanger()) | |
796 | for i in range(0, 10): | |
797 | worker = task.shell("sleep 0.5") | |
798 | self.assert_(worker != None) | |
799 | task.resume() | |
800 | ||
801 | def testLocalWorkerFanout(self): | |
802 | ||
803 | class TestRunCountChecker(EventHandler): | |
804 | ||
805 | def __init__(self): | |
806 | self.workers = [] | |
807 | self.max_run_cnt = 0 | |
808 | ||
809 | def ev_start(self, worker): | |
810 | self.workers.append(worker) | |
811 | ||
812 | def ev_read(self, worker): | |
813 | run_cnt = sum(e.registered for w in self.workers | |
814 | for e in w._engine_clients()) | |
815 | self.max_run_cnt = max(self.max_run_cnt, run_cnt) | |
816 | ||
817 | task = task_self() | |
818 | ||
819 | TEST_FANOUT = 3 | |
820 | task.set_info("fanout", TEST_FANOUT) | |
821 | ||
822 | # TEST 1 - default worker fanout | |
823 | eh = TestRunCountChecker() | |
824 | for i in range(10): | |
825 | task.shell("echo foo", handler=eh) | |
826 | task.resume() | |
827 | # Engine fanout should be enforced | |
828 | self.assertTrue(eh.max_run_cnt <= TEST_FANOUT) | |
829 | ||
830 | # TEST 1bis - default worker fanout with ExecWorker | |
831 | eh = TestRunCountChecker() | |
832 | worker = ExecWorker(nodes='foo[0-9]', handler=eh, command='echo bar') | |
833 | task.schedule(worker) | |
834 | task.resume() | |
835 | # Engine fanout should be enforced | |
836 | self.assertTrue(eh.max_run_cnt <= TEST_FANOUT) | |
837 | ||
838 | # TEST 2 - create n x workers using worker.fanout | |
839 | eh = TestRunCountChecker() | |
840 | for i in range(10): | |
841 | task.shell("echo foo", handler=eh)._fanout = 1 | |
842 | task.resume() | |
843 | # max_run_cnt should reach the total number of workers | |
844 | self.assertEqual(eh.max_run_cnt, 10) | |
845 | ||
846 | # TEST 2bis - create ExecWorker with multiple clients [larger fanout] | |
847 | eh = TestRunCountChecker() | |
848 | worker = ExecWorker(nodes='foo[0-9]', handler=eh, command='echo bar') | |
849 | worker._fanout = 5 | |
850 | task.schedule(worker) | |
851 | task.resume() | |
852 | # max_run_cnt should reach worker._fanout | |
853 | self.assertEqual(eh.max_run_cnt, 5) | |
854 | ||
855 | # TEST 2ter - create ExecWorker with multiple clients [smaller fanout] | |
856 | eh = TestRunCountChecker() | |
857 | worker = ExecWorker(nodes='foo[0-9]', handler=eh, command='echo bar') | |
858 | worker._fanout = 1 | |
859 | task.schedule(worker) | |
860 | task.resume() | |
861 | # max_run_cnt should reach worker._fanout | |
862 | self.assertEqual(eh.max_run_cnt, 1) | |
863 | ||
864 | # TEST 4 - create workers using unlimited fanout | |
865 | eh = TestRunCountChecker() | |
866 | for i in range(10): | |
867 | w = task.shell("echo foo", handler=eh) | |
868 | w._fanout = FANOUT_UNLIMITED | |
869 | task.resume() | |
870 | # max_run_cnt should reach the total number of workers | |
871 | self.assertEqual(eh.max_run_cnt, 10) | |
872 | ||
873 | # TEST 4bis - create ExecWorker with unlimited fanout | |
874 | eh = TestRunCountChecker() | |
875 | worker = ExecWorker(nodes='foo[0-9]', handler=eh, command='echo bar') | |
876 | worker._fanout = FANOUT_UNLIMITED | |
877 | task.schedule(worker) | |
878 | task.resume() | |
879 | # max_run_cnt should reach the total number of clients (10) | |
880 | self.assertEqual(eh.max_run_cnt, 10) | |
796 | 881 | |
797 | 882 | def testPopenBadArgumentOption(self): |
798 | 883 | # Check code < 1.4 compatibility |
22 | 22 | class TaskLocalEngineSelectTest(TaskLocalMixin, unittest.TestCase): |
23 | 23 | |
24 | 24 | def setUp(self): |
25 | # switch Engine | |
25 | 26 | task_terminate() |
26 | 27 | self.engine_id_save = DEFAULTS.engine |
27 | 28 | DEFAULTS.engine = ENGINE_SELECT_ID |
28 | 29 | # select should be supported anywhere... |
29 | 30 | self.assertEqual(task_self().info('engine'), ENGINE_SELECT_ID) |
31 | # call base class setUp() | |
32 | TaskLocalMixin.setUp(self) | |
30 | 33 | |
31 | 34 | def tearDown(self): |
35 | # call base class tearDown() | |
36 | TaskLocalMixin.tearDown(self) | |
37 | # restore Engine | |
32 | 38 | DEFAULTS.engine = self.engine_id_save |
33 | 39 | task_terminate() |
34 | 40 | |
35 | 41 | class TaskLocalEnginePollTest(TaskLocalMixin, unittest.TestCase): |
36 | 42 | |
37 | 43 | def setUp(self): |
44 | # switch Engine | |
38 | 45 | task_terminate() |
39 | 46 | self.engine_id_save = DEFAULTS.engine |
40 | 47 | DEFAULTS.engine = ENGINE_POLL_ID |
41 | 48 | if task_self().info('engine') != ENGINE_POLL_ID: |
42 | 49 | self.skipTest("engine %s not supported on this host" |
43 | 50 | % ENGINE_POLL_ID) |
51 | # call base class setUp() | |
52 | TaskLocalMixin.setUp(self) | |
44 | 53 | |
45 | 54 | def tearDown(self): |
55 | # call base class tearDown() | |
56 | TaskLocalMixin.tearDown(self) | |
57 | # restore Engine | |
46 | 58 | DEFAULTS.engine = self.engine_id_save |
47 | 59 | task_terminate() |
48 | 60 | |
53 | 65 | class TaskLocalEngineEPollTest(TaskLocalMixin, unittest.TestCase): |
54 | 66 | |
55 | 67 | def setUp(self): |
68 | # switch Engine | |
56 | 69 | task_terminate() |
57 | 70 | self.engine_id_save = DEFAULTS.engine |
58 | 71 | DEFAULTS.engine = ENGINE_EPOLL_ID |
59 | 72 | if task_self().info('engine') != ENGINE_EPOLL_ID: |
60 | 73 | self.skipTest("engine %s not supported on this host" |
61 | 74 | % ENGINE_EPOLL_ID) |
75 | # call base class setUp() | |
76 | TaskLocalMixin.setUp(self) | |
62 | 77 | |
63 | 78 | def tearDown(self): |
79 | # call base class tearDown() | |
80 | TaskLocalMixin.tearDown(self) | |
81 | # restore Engine | |
64 | 82 | DEFAULTS.engine = self.engine_id_save |
65 | 83 | task_terminate() |
61 | 61 | """test ExecWorker with unknown placeholder pattern""" |
62 | 62 | self.assertRaises(WorkerError, self.execw, |
63 | 63 | nodes="localhost", handler=None, command="echo %x") |
64 | self.assertRaises(WorkerError, self.execw, | |
65 | nodes="localhost", handler=None, command="echo %") | |
64 | 66 | |
65 | 67 | def test_rank_placeholder(self): |
66 | 68 | """test ExecWorker with several nodes and %n (rank)""" |