Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000592.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: gpdb_add_project cronned</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000590.html" title="UK -&gt; GPDB" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000593.html" title="Sites again/Cron problems" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000590.html">&laquo; UK -> GPDB</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000593.html">Sites again/Cron problems &raquo;</a>
44                      </p>
45
46                      <a id="a000592"></a>
47                      <div class="entry" id="entry-592">
48                         <h3 class="entry-header">gpdb_add_project cronned</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <ul>
52   <li>Looked into sites, site codes and differences between UK projects/domains and the current implementation of GPDB</li>
53
54   <li>Cronned gpdb_add_project</li>
55 </ul>
56                            </div>
57                            <div id="more" class="entry-more">
58                               <h2>Cronned gpdb_add_project</h2>
59
60 <p>Donna Ducharme wrote:</p>
61
62 <blockquote type="cite">
63   <p>GPDB is not current. This project CC2630_DS is in the dallas site registry but is not in GPDB. Have we missed something here?</p>
64 </blockquote>
65
66 <h3>Short answer (AKA Executive Summary)</h3>
67
68 <p>It's there now. gpdb_add_project.pl wasn't regularly run. Now it is</p>
69
70 <h3>Long answer (AKA Engineering Notes)</h3>
71
72 <p>gpdb_add_project.pl, the script that attempts to add any new DesignSync projects to GPDB, is not run on a regular basis. Why is this? Well because in the past this was simply cron'ed into somebody's crontab. Then the guy left and this broke. The right way to do this is to eliminate dependencies to any employee or, as the case was here, contractor. We've been working on that.</p>
73
74 <p>First step was to get gpdb_add_project.pl functioning again. Being as it attempts to do all sites and that it used to do this by using rsh, this broke when the guy left. Why? Well because he was rsh'ing as himself and his account naturally, and rightfully, got disabled when he left. So David Kitch set about to create a generic user, gpdb, and get passwordless rsh login rights to all of the appropriate servers at the sites. Recently that was completed.</p>
75
76 <p>Meantime I was busy recoding gpdb_add_project.pl as was put into Clearcase and use strict and use warnings were strapped on but the code as checked in would not even compile! First task was to resolve the problems use strict and use warnings introduced.</p>
77
78 <p>Next was to resolve the incorrect utilization of rsh that gpdb_add_project.pl was doing It would do an rsh command and check the return status thinking that it was the return states of the command that rsh remotely executed. That is not the case! Rsh returns the status code of the rsh command itself, not the command remotely executed. Additionally it's pretty inefficient to constantly establish communications with another system via rsh, do one single command then tear down the whole remote channel only to do yet another rsh command shortly. Additionally we wish to move to the more secure and better ssh method in the future.</p>
79
80 <p>So I wrote Rexec.pm, a Perl module that creates an object and a connection to a remote system<sup>1</sup>. It has additional functionality to allow not only rsh access, but ssh and even telnet. It can access another username/password to attempt access with. While passwordless login is preferred and passwords are also handled. Expect is utilized to drive this. Also this gracefully degrades in that if a specific protocol is not specified then ssh is first tried, followed by rsh then finally telnet. Also, the connection is held in the object so that multiple command execution is quick and efficient. Finally it reliably returns the output from the remote command as well as it's status. Handles different shell styles (basically csh style shells and sh style shells) but must be informed ahead of time of which shell to expect. Downside, only handles "standard" prompts (generic users should always be configured with a standard/default  prompt).</p>
81
82 <ol>
83   <li><small>Why didn't I use a CPAN module for this? Many reasons: It offered nothing above what gpdb_add_project.pl already did - i.e. it returned the status of rsh not the command rsh did. Also it didn't support being instantiated and remaining active for multiple commands. Finally it didn't support any other protocol than rsh so there was no preference for ssh and graceful degradation.</small></li>
84 </ol>
85
86 <p>With Rexec.pm in place I set out to make gpdb_add_project.pl aware of it and to utilize it. Meantime David was hard at work getting gpdb passwordless login available at all sites. About a week or two ago gpdb_add_project.pl successfully interrogated the final site, Manchester, and updated GPDB of all known DesignSync projects at that time.</p>
87
88 <p>And just today I worked with Michael Tisdel to gain access to a gpdb login to Cashew, the system which will house gpdb's crontab and execute such scripts from there. So, IOW, I just got the ability to automate this and have done so.</p>
89
90 <p>Still we have no official release mechanism for this gpdb_add_project.pl yet so I just copied it to cashew:~gpdb and it's running from there. I had to additionally copy the Rexec.pm module there as well as the gpdb_site_list.txt which drives which sites to explore. This needs to change when we official release gpdb_add_project.pl.</p>
91
92 <p>There is much more work to do with gpdb_add_project.pl. Reporting is poor (it creates logs in ~gpdb/gpdb_add_project_logs), it does not properly handle nor alert people when a server found in DesignSync is not reachable (We have a GPDB CQ request for that one) and from what I can tell it's checking of IP ranges is not correct.</p>
93
94 <p>I've added the following to gpdb's crontab on cashew:</p>
95
96 <div class=code><pre>
97 # <a href="mailto:Andrew@DeFaria.com:">Andrew@DeFaria.com:</a> Run gpdb_add_project.pl. This will add any new projects
98 # from DesignSync to GPDB. Note that this runs from right here (~gpdb).This
99 # is wrong and should be changed to run it from the "standard place".Problem
100 # is - there is no "standard place" (yet).
101 #
102 # Also note that this script logs to ~/gpdb_add_project_logs. I'm not sure
103 # who will read this or clean this up...
104 00 00 * * * gpdb_add_project.pl -s gpdb_site_list.txt
105 </pre></div>
106
107 <p>Again, there's lots of new stuff, enhancements and changes that gpdb_add_project.pl will have to support as we update GPDB to better support Clearcase and the changes to the database that that requires.</p>
108
109 <p><font color="#c0c0c0">End of "everything you wanted to know about gpdb_add_project.pl but were afraid to ask"....</font></p>
110                            </div>
111                         </div>
112                         <p class="entry-footer">
113                            <span class="post-footers">Posted by  on November 14, 2006 10:58 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000592.html">Permalink</a>
114                         </p>
115                      </div>
116
117                      
118
119                      
120                   </div>
121                </div>
122             </div>
123          </div>
124       </div>
125    </div>
126 </body>
127 </html>