Subversion Repositories DevTools

Rev

Rev 6623 | Rev 6786 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5670 dpurdie 1
<% @LANGUAGE = VBScript %>
5623 dpurdie 2
<%
3
'=====================================================
4
'
5
'  Build Status and Plan Information
6
'
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0  ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="common/daemon_instructions.asp"-->
6166 dpurdie 22
<!--#include file="common/common_daemon.asp"-->
6048 dpurdie 23
<% '------------ ACCESS CONTROL ------------------ %>
6181 dpurdie 24
<!--#include file="_access_control_login_optional.asp"-->
6070 dpurdie 25
<!--#include file="_access_control_general.asp"-->
6052 dpurdie 26
<!--#include file="_access_control_action_project.asp"-->
5623 dpurdie 27
<% '------------ Scripts -------------------------- %>
28
<%
29
'------------ Variable Definition -------------
30
Dim rsQry
31
Dim parRtagId
32
Dim query_string
33
Dim rcon_id
34
'------------ Constants Declaration -----------
35
'------------ Variable Init -------------------
36
parRtagId = Request("rtag_id")
37
objPMod.PersistInQryString("rtag_id")
6548 dpurdie 38
'-------------------------------------------------
39
' 
40
Sub ShowDaemonStatus
41
%>
42
<table class="embedded_table" style="margin-bottom:20px">
43
  <tr>
44
     <td>
45
        <table width="95%" align="center" class="embedded_table">
46
           <tr>
47
              <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
48
              </td>
49
              <td  valign="bottom" class="body_rowg">
50
                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
51
              </td>
52
              <td align="right" valign="bottom">
53
                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
54
              </td>
55
           </tr>
56
        </table>
57
     </td>
58
  </tr>
59
  <tr>
60
   <td>
61
   <table class="rounded_box embedded_table">
62
  <tr>
63
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
64
     <td bgcolor="#FFFFFF" valign="top">
65
        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
66
        <!--#include file="messages/_msg_inline.asp"-->
67
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
68
        <br>
69
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
70
           <%
71
           Dim bInactiveMachine : bInactiveMachine = false
72
           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
73
           ' Insert a warning into the page if the build daemons are indefintely paused.
74
           If indefinitelyPaused Then %>
75
              <tr>
76
                 <span class='err_alert'>
77
                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
78
                 </span>
79
              </tr>
80
           <%End If
81
           %>
82
           <td width="9%" valign="top"></td>
83
           <tr>
84
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
85
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
86
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
87
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
88
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
89
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
90
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
91
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
92
           </tr>
93
           <%
6566 dpurdie 94
           ' Get Build Information for this Release
95
           query_string = _
96
                "SELECT rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') AS ACTIVE," &_
97
                "       rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) AS delta," &_
98
                "       pk.pkg_name, rl.current_pv_id, pv.build_time, TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) AS build_delta" &_
99
                " FROM release_config rc," &_
100
                "   gbe_machtype gm," &_
101
                "   build_machine_config bm," &_
102
                "   run_level rl," &_
103
                "   packages pk," &_
104
                "   package_versions pv" &_
105
                " WHERE rc.rtag_id     = " & parRtagId &_
106
                "  AND gm.gbe_id        = rc.gbe_id" &_
107
                "  AND rl.rcon_id       = rc.rcon_id" &_
108
                "  AND rc.bmcon_id      =bm.bmcon_id(+)" &_
109
                "  AND pk.pkg_id(+)     = rl.current_pkg_id_being_built" &_
110
                "  AND rl.current_pv_id = pv.pv_id(+)" &_
111
                " ORDER BY bm.display_name, rc.rcon_id"
5623 dpurdie 112
 
6548 dpurdie 113
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
114
 
115
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
116
              Dim pkgName
117
              Dim pkgPvid
118
              Dim pkgBuildTime
119
              Dim currentRunLevel
120
              Dim daemonState
121
              Dim delta
6566 dpurdie 122
              Dim PkgBuildDelta
6548 dpurdie 123
              Dim pkgId
6566 dpurdie 124
              Dim bActive
125
              Dim estDuration
126
              Dim daemonMode 
127
              Dim lastChange
6548 dpurdie 128
 
6566 dpurdie 129
              rcon_id = rsQry("rcon_id")
130
              ' = rsQry("display_name")
131
              ' = rsQry("gbe_value")
132
              daemonMode = rsQry("daemon_mode")
133
              bActive = rsQry("ACTIVE")
134
              daemonState = rsQry("pause")
135
              currentRunLevel = rsQry("current_run_level")
136
              pkgId = rsQry("current_pkg_id_being_built")
137
              delta = rsQry("delta")
138
              pkgName = rsQry("pkg_name")
139
              pkgPvid = rsQry("current_pv_id")
140
              pkgBuildTime = rsQry("build_time")
141
              PkgBuildDelta = rsQry("build_delta")
142
              lastChange = NULL
143
              bInactiveMachine = FALSE
144
              estDuration = NULL
6548 dpurdie 145
 
6566 dpurdie 146
              If bActive = "N" Then bInactiveMachine = true
147
              If IsNull(daemonState) Then daemonState = 0
148
              If daemonState = "2" Then pkgId = Null
149
              If IsNull(currentRunLevel) Then currentRunLevel = -1
150
              If daemonMode = "M" AND not IsNull(pkgName) Then estDuration = pkgBuildTime & "[" & PkgBuildDelta & "]"
151
              If bActive <> "U" Then lastChange = PrettyDelta(delta, daemonState,pkgName )
6548 dpurdie 152
 
153
              ' --- Now render HTML for this release configuration ---
154
              %>
155
              <tr>
156
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
157
              </tr>
158
              <tr>
159
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
160
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
6566 dpurdie 161
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(daemonMode)%></td>
6548 dpurdie 162
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
6610 dpurdie 163
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, daemonState, bActive)%></td>
6566 dpurdie 164
                 <td nowrap class="body_rowg"><%=estDuration%></td>
165
                 <td nowrap class="body_rowg"><%=lastChange%></td>
6548 dpurdie 166
                 <td nowrap class="body_rowg">
167
                    <%
6566 dpurdie 168
                    If NOT indefinitelyPaused  Then
6548 dpurdie 169
                       If canActionControlInProject("BuildControl") Then
170
                          If bActive = "U" Then
171
                          ElseIf bActive = "N" Then
172
                             Call Action_Buttons ( "Daemon Unavailable" )
173
                          ElseIf daemonState = 0 Then
174
                             Call Action_Buttons ( "Daemon Pause" )
175
                          ElseIf daemonState = 1 Then
176
                             Call Action_Buttons ( "Daemon Resume" )
177
                          ElseIf daemonState = 2 Then
178
                             Call Action_Buttons ( "Daemon Start" )
179
                          Else
180
                             Call Action_Buttons ( "Daemon Resume" )
181
                          End If
182
                       Else
183
                          If bActive = "U" Then
184
                          ElseIf bActive = "N" Then
185
                             Call Action_Buttons ( "Daemon Unavailable" )
186
                          ElseIf daemonState = 0 Then
187
                             Call Action_Buttons ( "Daemon Pause Disabled" )
188
                          ElseIf daemonState = 1 Then
189
                             Call Action_Buttons ( "Daemon Resume Disabled" )
190
                          ElseIf daemonState = 2 Then
191
                             Call Action_Buttons ( "Daemon Start Disabled" )
192
                          Else
193
                             Call Action_Buttons ( "Daemon Resume Disabled" )
194
                          End If
195
                       End If
196
                    Else
197
                       %>Unavailable<%
198
                    End If
199
                    %>
200
                 </td>
201
              </tr>
202
              <%
203
              rsQry.MoveNext
204
           Loop
205
           %>
206
           <tr>
207
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
208
             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
209
                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
210
                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
211
                </a>
212
             <%End If%>
213
             </td>
214
             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
215
             <%
216
               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
217
                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
218
                   Call Action_Buttons ( "Daemon Control All" )
219
                 Else 
220
                   Call Action_Buttons ( "Daemon Control All Disabled" )
221
                 End If
222
               Else
223
                 %>&nbsp<%
224
               End If
225
             %>
226
             </td>
227
           </tr>
228
           <%
229
             rsQry.Close()
230
             Set rsQry = nothing
231
           %>
232
        </table>
233
     </td>
234
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
235
  </tr>
236
  <tr>
237
     <input type="hidden" name="action" value="true">
238
     <%=objPMod.ComposeHiddenTags()%>
239
  </tr>
240
</table>
241
</td>
242
</table>
243
<%
244
End Sub
245
'-------------------------------------------------
246
' 
247
Sub ShowBuildPlan
5623 dpurdie 248
%>
6548 dpurdie 249
<!-- Planned Builds Display -->
6549 dpurdie 250
<table class="embedded_table" style="margin-bottom:20px;min-width:470px">
6548 dpurdie 251
<%
252
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta, rl.LAST_BUILD as BuildStart, rl.current_pv_id, SYSDATE" &_
253
                                        " FROM release_config rc,  run_level rl " &_
254
                                        " WHERE rc.rtag_id   = " & parRtagId &_
255
                                        " AND rc.daemon_mode = 'M' AND rl.rcon_id = rc.rcon_id", ORADYN_DEFAULT )
256
Dim BuildStart
257
Dim BuildDelta
258
Dim BuildPvId
259
Dim BuildNow
260
If (rsQry.RecordCount > 0) Then
261
    BuildStart = rsQry("BuildStart")
262
    BuildDelta = rsQry("delta")
263
    BuildPvId  = rsQry("current_pv_id")
264
    BuildNow  = rsQry("SYSDATE")
265
End If
266
rsQry.Close()
267
Set rsQry = nothing
268
%>
269
  <tr>
270
     <td>
271
        <table width="95%" class="embedded_table" align="center">
272
           <tr>
273
              <td nowrap class="form_ttl">DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%>
274
              </td>
6549 dpurdie 275
              <td  valign="bottom" align="right" class="body_txt_gray nowrap">
6548 dpurdie 276
                Now: <%=DisplayShortDateTimeSecs(BuildNow)%> AWST
277
              </td>
278
           </tr>
279
        </table>
280
     </td>
281
  </tr>
282
  <tr>
283
    <td>
284
        <table  class="rounded_box embedded_table" width="100%">
285
             <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
286
             <td bgcolor="#FFFFFF" valign="top">
287
                <table width="100%" border="0" cellspacing="2" cellpadding="0">
288
 
289
                   <tr>
290
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
291
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
292
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Duration<%=Quick_Help("h_buildDuration")%></td>
293
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Build Completion<%=Quick_Help("h_buildEnd")%></td>
294
                   </tr>
295
                   <%
296
                   Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
297
                   Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
298
                                                            "  pv.PKG_VERSION, pv.BUILD_TIME," &_
299
                                                            "  bp.PV_ID" &_
300
                                                            " FROM build_plan bp," &_
301
                                                            "  packages p," &_
302
                                                            "  package_versions pv" &_
303
                                                            " WHERE bp.PV_ID = pv.pv_id" &_
304
                                                            " AND RTAG_ID = " & parRtagId &_
305
                                                            " AND pv.PKG_ID  = p.pkg_id" &_
306
                                                            " ORDER BY build_order" , ORADYN_DEFAULT )
6549 dpurdie 307
                   If rsQry.RecordCount = 0 Then
308
                       %>
309
                       <tr>
310
                        <td nowrap colspan="4" align="center" class="body_txt">No packages to be built </td>
311
                       </tr>
312
                       <%
313
                   End If
6548 dpurdie 314
                   While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
315
                       completionText = ""
316
                       buildDuration = rsQry("BUILD_TIME")
317
                       durationDisplay = buildDuration
318
 
319
                       ' If the current package build it taking longer than expected , then bump the build times
320
                       ' and allow another 30 seconds.
321
                       If BuildPvId = rsQry("PV_ID") Then
322
                           completionText = "&nbsp;<"
323
                           durationDisplay = durationDisplay & " ["& BuildDelta &"]"
324
                           If BuildDelta > buildDuration Then
325
                                buildDuration = BuildDelta + 30
326
                                completionText = "&nbsp;+"
327
                           End If
328
                       End If
329
 
330
                       ' If the duration is not known - guess at 300 sconds
331
                       durationText = ""
332
                       If ISNULL(buildDuration)  OR buildDuration = 0 Then
333
                            buildDuration = 300
334
                            durationText = "&nbsp;~"
335
                      End If
336
 
337
                      BuildStart = DateAdd("s", buildDuration, BuildStart)
338
                      %>
339
                      <tr align="left" valign="top" class="body_txt">
6623 dpurdie 340
                         <td><%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"), 0, "Y")%></td>
6548 dpurdie 341
                         <td><%=rsQry("PKG_VERSION")%></td>
342
                         <td><%=durationDisplay%></td>
343
                         <td><%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%></td>
344
                      </tr>
345
                      <tr>
346
                         <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
347
                      </tr>
348
                      <%
349
                      ' Allow for 20 seconds of planning between builds
350
                      BuildStart = DateAdd("s", 20, BuildStart)
351
                      rsQry.MoveNext()
352
                   Wend
353
                   rsQry.Close()
354
                   Set rsQry = nothing
355
                   %>
356
                </table>
357
            </td>
358
            <td background="images/lbox_bgside_white.gif">&nbsp;</td>
359
        </table>
360
    </td>
361
  </tr>
362
</table>
363
<%
364
End Sub
365
'-------------------------------------------------
366
'
367
%>
5623 dpurdie 368
<html>
369
   <head>
370
      <title>Release Manager</title>
371
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
372
      <meta http-equiv="Pragma" content="no-cache">
373
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 374
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
375
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
376
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 377
      <!--#include file="_jquery_includes.asp"-->
378
      <!-- TIPS -->
6676 dpurdie 379
      <script type="text/javascript" src="scripts/json2.js?ver=<%=VixVerNum%>"></script>
6579 dpurdie 380
      <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
381
      <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 382
      <script language="JavaScript" type="text/JavaScript">
383
      formTips.tips.h_buildplan       = stdTip(300, 'Build Plan', 'The build plan is a guess as to the order in which packages will be built.' +
384
                                                                  '<p>It will be recalculated before each build.' + 
385
                                                                  '<p>The plan includes test builds, new builds and resultant ripples.' 
386
                                                                  );
5670 dpurdie 387
      formTips.tips.h_buildDuration    = stdTip(300, 'Planned Duration', 'The build duration (seconds) of the last build of this package - if known.' +
5635 dpurdie 388
                                                                  '<p>This is used as a guess as to the duration of the planned build.' 
389
                                                                  );
5670 dpurdie 390
      formTips.tips.h_buildEnd         = stdTip(300, 'Planned Completion', 'An educated guess as to the build completion time of the package.' +
391
                                                                  '<p>It is based on the start time of the current build and the durations of each preceeding builds.' + 
392
                                                                  '<p>If the duration of a build is not known then a time of 300 seconds will be assumed.' +
393
                                                                  ' It also assumes 20 seconds to plan the next build.'
394
                                                                  );
5623 dpurdie 395
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
396
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
397
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
398
                                                                  );
399
      </script>
400
      <!-- DROPDOWN MENUS -->
401
      <!--#include file="_menu_def.asp"-->
6579 dpurdie 402
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 403
   </head>
6548 dpurdie 404
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
5623 dpurdie 405
      <!-- HEADER -->
406
      <!--#include file="_header.asp"-->
407
      <!-- BODY ---->
6548 dpurdie 408
      <table class="full_table">
5623 dpurdie 409
         <tr>
6548 dpurdie 410
            <td width="146px" class="panel_bg" valign="top">
411
                <%Call BuildMenuPane%>
412
            </td>
5623 dpurdie 413
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6548 dpurdie 414
                <%Call ShowDaemonStatus%>
415
                <%Call ShowBuildPlan%>
5623 dpurdie 416
            </td>
417
         </tr>
418
         <tr>
6548 dpurdie 419
            <td class="panel_bg" valign="bottom" align="center" height="350">
420
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
5623 dpurdie 421
         </tr>
422
      </table>
423
      <!-- FOOTER -->
424
      <!--#include file="_footer.asp"-->
425
   </body>
426
</html>
6548 dpurdie 427