Subversion Repositories DevTools

Rev

Rev 6786 | Rev 6874 | 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
6786 dpurdie 34
Dim canControl
5623 dpurdie 35
'------------ Constants Declaration -----------
36
'------------ Variable Init -------------------
37
parRtagId = Request("rtag_id")
38
objPMod.PersistInQryString("rtag_id")
6786 dpurdie 39
canControl = canActionControlInProject("BuildControl")
6548 dpurdie 40
'-------------------------------------------------
41
' 
42
Sub ShowDaemonStatus
43
%>
44
<table class="embedded_table" style="margin-bottom:20px">
6786 dpurdie 45
    <tr>
46
        <td>
47
            <table class="rounded_box embedded_table">
48
                <caption>
49
                    <table align="center" class="full_table">
50
                       <tr>
51
                          <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
52
                          </td>
53
                          <td  valign="bottom" class="body_rowg">
54
                            Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
55
                          </td>
56
                          <td align="right" valign="bottom">
57
                            <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
58
                          </td>
59
                       </tr>
60
                    </table>
61
                </caption>
62
            <tr>
63
                <td>
64
                    <div class='round_box_pad'>
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 class="body_lcol">Daemon Host</td>
85
                              <td valign="top" nowrap class="body_lcol">Machine Type</td>
86
                              <td valign="top" nowrap class="body_lcol">Mode</td>
87
                              <td valign="top" nowrap class="body_lcol">Run Level</td>
88
                              <td valign="top" nowrap class="body_lcol">Current Package</td>
89
                              <td valign="top" nowrap class="body_lcol">Est Duration<%=Quick_Help("h_buildtime")%></td>
90
                              <td valign="top" nowrap class="body_lcol">Last Change<%=Quick_Help("h_lastchange")%></td>
91
                              <td valign="top" nowrap class="body_lcol">Control State</td>
92
                           </tr>
93
                           <%
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" &_
6873 dpurdie 107
                                "  AND rl.rcon_id(+)       = rc.rcon_id" &_
6786 dpurdie 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
 
6786 dpurdie 113
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
6548 dpurdie 114
 
6786 dpurdie 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
122
                              Dim PkgBuildDelta
123
                              Dim pkgId
124
                              Dim bActive
125
                              Dim estDuration
126
                              Dim daemonMode 
127
                              Dim lastChange
6548 dpurdie 128
 
6786 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
 
6786 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
 
6786 dpurdie 153
                              ' --- Now render HTML for this release configuration ---
154
                              %>
155
                              <tr>
156
                                 <td colspan="8" class=body_line></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>
161
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(daemonMode)%></td>
162
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
163
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, daemonState, bActive)%></td>
164
                                 <td nowrap class="body_rowg"><%=estDuration%></td>
165
                                 <td nowrap class="body_rowg"><%=lastChange%></td>
166
                                 <td nowrap class="body_rowg">
167
                                    <%
168
                                    If NOT indefinitelyPaused  Then
169
                                        If bActive = "U" Then
170
                                        ElseIf bActive = "N" Then
171
                                            Call Action_Buttons ( "Daemon Unavailable" )
172
                                        ElseIf daemonState = 0 Then
173
                                            Call Action_Buttons_State ( "Daemon Pause", canControl )
174
                                        ElseIf daemonState = 1 Then
175
                                            Call Action_Buttons_State ( "Daemon Resume", canControl )
176
                                        ElseIf daemonState = 2 Then
177
                                            Call Action_Buttons_State ( "Daemon Start", canControl )
178
                                        Else
179
                                            Call Action_Buttons_State ( "Daemon Resume", canControl )
180
                                      End If
181
                                    Else
182
                                       %>Unavailable<%
183
                                    End If
184
                                    %>
185
                                 </td>
186
                              </tr>
187
                              <%
188
                              rsQry.MoveNext
189
                           Loop
190
                           %>
191
                           <tr class=form_bg_light>
192
                             <td nowrap class="body_col" colspan=7>
193
                             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
194
                                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
195
                                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
196
                                </a>
197
                             <%End If%>
198
                             </td>
199
                             <td valign="bottom" nowrap class="body_col">
200
                             <%
201
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
202
                                   Call Action_Buttons_State ( "Daemon Control All", objAccessControl.UserLogedIn AND canControl )
203
                               Else
204
                                 %>&nbsp<%
205
                               End If
206
                             %>
207
                             </td>
208
                           </tr>
209
                           <%
210
                             rsQry.Close()
211
                             Set rsQry = nothing
212
                           %>
213
                        </table>
214
                    </div>
215
                </td>
216
            </tr>
6548 dpurdie 217
        </table>
6786 dpurdie 218
    </td>
6548 dpurdie 219
</table>
220
<%
221
End Sub
222
'-------------------------------------------------
223
' 
224
Sub ShowBuildPlan
5623 dpurdie 225
%>
6548 dpurdie 226
<!-- Planned Builds Display -->
6549 dpurdie 227
<table class="embedded_table" style="margin-bottom:20px;min-width:470px">
6548 dpurdie 228
<%
229
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta, rl.LAST_BUILD as BuildStart, rl.current_pv_id, SYSDATE" &_
230
                                        " FROM release_config rc,  run_level rl " &_
231
                                        " WHERE rc.rtag_id   = " & parRtagId &_
6873 dpurdie 232
                                        " AND rc.daemon_mode = 'M' AND rl.rcon_id(+) = rc.rcon_id", ORADYN_DEFAULT )
6548 dpurdie 233
Dim BuildStart
234
Dim BuildDelta
235
Dim BuildPvId
236
Dim BuildNow
237
If (rsQry.RecordCount > 0) Then
238
    BuildStart = rsQry("BuildStart")
239
    BuildDelta = rsQry("delta")
240
    BuildPvId  = rsQry("current_pv_id")
241
    BuildNow  = rsQry("SYSDATE")
242
End If
243
rsQry.Close()
244
Set rsQry = nothing
245
%>
246
  <tr>
247
    <td>
248
        <table  class="rounded_box embedded_table" width="100%">
6873 dpurdie 249
            <caption>
250
                DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%>
251
                <span class="body_txt_gray nowrap tright">Now: <%=DisplayShortDateTimeSecs(BuildNow)%> AWST</span>
252
            </caption>
6548 dpurdie 253
             <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
254
             <td bgcolor="#FFFFFF" valign="top">
255
                <table width="100%" border="0" cellspacing="2" cellpadding="0">
256
                   <tr>
257
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
258
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
259
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Duration<%=Quick_Help("h_buildDuration")%></td>
260
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Build Completion<%=Quick_Help("h_buildEnd")%></td>
261
                   </tr>
262
                   <%
263
                   Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
264
                   Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
265
                                                            "  pv.PKG_VERSION, pv.BUILD_TIME," &_
266
                                                            "  bp.PV_ID" &_
267
                                                            " FROM build_plan bp," &_
268
                                                            "  packages p," &_
269
                                                            "  package_versions pv" &_
270
                                                            " WHERE bp.PV_ID = pv.pv_id" &_
271
                                                            " AND RTAG_ID = " & parRtagId &_
272
                                                            " AND pv.PKG_ID  = p.pkg_id" &_
273
                                                            " ORDER BY build_order" , ORADYN_DEFAULT )
6549 dpurdie 274
                   If rsQry.RecordCount = 0 Then
275
                       %>
276
                       <tr>
277
                        <td nowrap colspan="4" align="center" class="body_txt">No packages to be built </td>
278
                       </tr>
279
                       <%
280
                   End If
6548 dpurdie 281
                   While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
282
                       completionText = ""
283
                       buildDuration = rsQry("BUILD_TIME")
284
                       durationDisplay = buildDuration
285
 
286
                       ' If the current package build it taking longer than expected , then bump the build times
287
                       ' and allow another 30 seconds.
288
                       If BuildPvId = rsQry("PV_ID") Then
289
                           completionText = "&nbsp;<"
290
                           durationDisplay = durationDisplay & " ["& BuildDelta &"]"
291
                           If BuildDelta > buildDuration Then
292
                                buildDuration = BuildDelta + 30
293
                                completionText = "&nbsp;+"
294
                           End If
295
                       End If
296
 
297
                       ' If the duration is not known - guess at 300 sconds
298
                       durationText = ""
299
                       If ISNULL(buildDuration)  OR buildDuration = 0 Then
300
                            buildDuration = 300
301
                            durationText = "&nbsp;~"
302
                      End If
303
 
304
                      BuildStart = DateAdd("s", buildDuration, BuildStart)
305
                      %>
306
                      <tr align="left" valign="top" class="body_txt">
6623 dpurdie 307
                         <td><%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"), 0, "Y")%></td>
6548 dpurdie 308
                         <td><%=rsQry("PKG_VERSION")%></td>
309
                         <td><%=durationDisplay%></td>
310
                         <td><%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%></td>
311
                      </tr>
312
                      <tr>
313
                         <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
314
                      </tr>
315
                      <%
316
                      ' Allow for 20 seconds of planning between builds
317
                      BuildStart = DateAdd("s", 20, BuildStart)
318
                      rsQry.MoveNext()
319
                   Wend
320
                   rsQry.Close()
321
                   Set rsQry = nothing
322
                   %>
323
                </table>
324
            </td>
325
            <td background="images/lbox_bgside_white.gif">&nbsp;</td>
326
        </table>
327
    </td>
328
  </tr>
329
</table>
330
<%
331
End Sub
332
'-------------------------------------------------
333
'
334
%>
5623 dpurdie 335
<html>
336
   <head>
337
      <title>Release Manager</title>
338
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
339
      <meta http-equiv="Pragma" content="no-cache">
340
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 341
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
342
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
343
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 344
      <!--#include file="_jquery_includes.asp"-->
345
      <!-- TIPS -->
6676 dpurdie 346
      <script type="text/javascript" src="scripts/json2.js?ver=<%=VixVerNum%>"></script>
6579 dpurdie 347
      <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
348
      <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 349
      <script language="JavaScript" type="text/JavaScript">
350
      formTips.tips.h_buildplan       = stdTip(300, 'Build Plan', 'The build plan is a guess as to the order in which packages will be built.' +
351
                                                                  '<p>It will be recalculated before each build.' + 
352
                                                                  '<p>The plan includes test builds, new builds and resultant ripples.' 
353
                                                                  );
5670 dpurdie 354
      formTips.tips.h_buildDuration    = stdTip(300, 'Planned Duration', 'The build duration (seconds) of the last build of this package - if known.' +
5635 dpurdie 355
                                                                  '<p>This is used as a guess as to the duration of the planned build.' 
356
                                                                  );
5670 dpurdie 357
      formTips.tips.h_buildEnd         = stdTip(300, 'Planned Completion', 'An educated guess as to the build completion time of the package.' +
358
                                                                  '<p>It is based on the start time of the current build and the durations of each preceeding builds.' + 
359
                                                                  '<p>If the duration of a build is not known then a time of 300 seconds will be assumed.' +
360
                                                                  ' It also assumes 20 seconds to plan the next build.'
361
                                                                  );
5623 dpurdie 362
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
363
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
364
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
365
                                                                  );
366
      </script>
367
      <!-- DROPDOWN MENUS -->
368
      <!--#include file="_menu_def.asp"-->
6579 dpurdie 369
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 370
   </head>
6548 dpurdie 371
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
5623 dpurdie 372
      <!-- HEADER -->
373
      <!--#include file="_header.asp"-->
374
      <!-- BODY ---->
6548 dpurdie 375
      <table class="full_table">
5623 dpurdie 376
         <tr>
6548 dpurdie 377
            <td width="146px" class="panel_bg" valign="top">
378
                <%Call BuildMenuPane%>
379
            </td>
5623 dpurdie 380
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6548 dpurdie 381
                <%Call ShowDaemonStatus%>
382
                <%Call ShowBuildPlan%>
5623 dpurdie 383
            </td>
384
         </tr>
385
         <tr>
6548 dpurdie 386
            <td class="panel_bg" valign="bottom" align="center" height="350">
387
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
5623 dpurdie 388
         </tr>
389
      </table>
390
      <!-- FOOTER -->
391
      <!--#include file="_footer.asp"-->
392
   </body>
393
</html>
6548 dpurdie 394