Subversion Repositories DevTools

Rev

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