Subversion Repositories DevTools

Rev

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