Subversion Repositories DevTools

Rev

Rev 6877 | Rev 7162 | 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
215
If (rsQry.RecordCount > 0) Then
216
    BuildStart = rsQry("BuildStart")
217
    BuildDelta = rsQry("delta")
218
    BuildPvId  = rsQry("current_pv_id")
219
    BuildNow  = rsQry("SYSDATE")
220
End If
221
rsQry.Close()
222
Set rsQry = nothing
223
%>
6874 dpurdie 224
<!-- Planned Builds Display -->
225
<div>
226
<div class=panel>
227
        <div class=rounded_box_caption>
228
                <table align="center" class="full_table">
6548 dpurdie 229
                   <tr>
6874 dpurdie 230
                      <td nowrap class="form_ttl">DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%></td>
231
                      <td class="body_rowg" align="right" valign="bottom">Now: <%=DisplayShortDateTimeSecs(BuildNow)%> AWST</td>
6548 dpurdie 232
                   </tr>
6874 dpurdie 233
                </table>
234
        </div>
235
        <div class="rounded_box">
236
            <div class='listPanel'>
237
                <table class='embedded_table'>
238
                   <thead>
239
                      <th>Package</th>
240
                      <th>Version</th>
241
                      <th>Duration<%=Quick_Help("h_buildDuration")%></th>
242
                      <th>Build Completion<%=Quick_Help("h_buildEnd")%></th>
243
                   </thead>
6548 dpurdie 244
                   <%
245
                   Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
246
                   Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
247
                                                            "  pv.PKG_VERSION, pv.BUILD_TIME," &_
248
                                                            "  bp.PV_ID" &_
249
                                                            " FROM build_plan bp," &_
250
                                                            "  packages p," &_
251
                                                            "  package_versions pv" &_
252
                                                            " WHERE bp.PV_ID = pv.pv_id" &_
253
                                                            " AND RTAG_ID = " & parRtagId &_
254
                                                            " AND pv.PKG_ID  = p.pkg_id" &_
255
                                                            " ORDER BY build_order" , ORADYN_DEFAULT )
6549 dpurdie 256
                   If rsQry.RecordCount = 0 Then
257
                       %>
258
                       <tr>
259
                        <td nowrap colspan="4" align="center" class="body_txt">No packages to be built </td>
260
                       </tr>
261
                       <%
262
                   End If
6548 dpurdie 263
                   While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
264
                       completionText = ""
265
                       buildDuration = rsQry("BUILD_TIME")
266
                       durationDisplay = buildDuration
267
 
268
                       ' If the current package build it taking longer than expected , then bump the build times
269
                       ' and allow another 30 seconds.
270
                       If BuildPvId = rsQry("PV_ID") Then
271
                           completionText = "&nbsp;<"
272
                           durationDisplay = durationDisplay & " ["& BuildDelta &"]"
273
                           If BuildDelta > buildDuration Then
274
                                buildDuration = BuildDelta + 30
275
                                completionText = "&nbsp;+"
276
                           End If
277
                       End If
278
 
279
                       ' If the duration is not known - guess at 300 sconds
280
                       durationText = ""
281
                       If ISNULL(buildDuration)  OR buildDuration = 0 Then
282
                            buildDuration = 300
283
                            durationText = "&nbsp;~"
284
                      End If
285
 
286
                      BuildStart = DateAdd("s", buildDuration, BuildStart)
287
                      %>
6874 dpurdie 288
                      <tr class=border>
6623 dpurdie 289
                         <td><%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"), 0, "Y")%></td>
6548 dpurdie 290
                         <td><%=rsQry("PKG_VERSION")%></td>
291
                         <td><%=durationDisplay%></td>
292
                         <td><%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%></td>
293
                      </tr>
294
                      <%
295
                      ' Allow for 20 seconds of planning between builds
296
                      BuildStart = DateAdd("s", 20, BuildStart)
297
                      rsQry.MoveNext()
298
                   Wend
299
                   rsQry.Close()
300
                   Set rsQry = nothing
301
                   %>
302
                </table>
6874 dpurdie 303
            </div>
304
        </div>
305
    </div>
306
</div>
6548 dpurdie 307
<%
308
End Sub
309
'-------------------------------------------------
310
'
311
%>
5623 dpurdie 312
<html>
313
   <head>
314
      <title>Release Manager</title>
315
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
316
      <meta http-equiv="Pragma" content="no-cache">
317
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 318
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
319
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
320
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 321
      <!--#include file="_jquery_includes.asp"-->
322
      <!-- TIPS -->
6676 dpurdie 323
      <script type="text/javascript" src="scripts/json2.js?ver=<%=VixVerNum%>"></script>
6579 dpurdie 324
      <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
325
      <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 326
      <script language="JavaScript" type="text/JavaScript">
327
      formTips.tips.h_buildplan       = stdTip(300, 'Build Plan', 'The build plan is a guess as to the order in which packages will be built.' +
328
                                                                  '<p>It will be recalculated before each build.' + 
329
                                                                  '<p>The plan includes test builds, new builds and resultant ripples.' 
330
                                                                  );
5670 dpurdie 331
      formTips.tips.h_buildDuration    = stdTip(300, 'Planned Duration', 'The build duration (seconds) of the last build of this package - if known.' +
5635 dpurdie 332
                                                                  '<p>This is used as a guess as to the duration of the planned build.' 
333
                                                                  );
5670 dpurdie 334
      formTips.tips.h_buildEnd         = stdTip(300, 'Planned Completion', 'An educated guess as to the build completion time of the package.' +
335
                                                                  '<p>It is based on the start time of the current build and the durations of each preceeding builds.' + 
336
                                                                  '<p>If the duration of a build is not known then a time of 300 seconds will be assumed.' +
337
                                                                  ' It also assumes 20 seconds to plan the next build.'
338
                                                                  );
5623 dpurdie 339
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
340
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
341
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
342
                                                                  );
343
      </script>
344
      <!-- DROPDOWN MENUS -->
345
      <!--#include file="_menu_def.asp"-->
6579 dpurdie 346
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5623 dpurdie 347
   </head>
6548 dpurdie 348
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
5623 dpurdie 349
      <!-- HEADER -->
350
      <!--#include file="_header.asp"-->
351
      <!-- BODY ---->
6548 dpurdie 352
      <table class="full_table">
5623 dpurdie 353
         <tr>
6876 dpurdie 354
            <td width="146px" class="bg_panel" valign="top">
6548 dpurdie 355
                <%Call BuildMenuPane%>
356
            </td>
5623 dpurdie 357
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6548 dpurdie 358
                <%Call ShowDaemonStatus%>
359
                <%Call ShowBuildPlan%>
5623 dpurdie 360
            </td>
361
         </tr>
362
         <tr>
6877 dpurdie 363
            <td class="bg_panel_btm" height="350">
6548 dpurdie 364
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
5623 dpurdie 365
         </tr>
366
      </table>
367
      <!-- FOOTER -->
368
      <!--#include file="_footer.asp"-->
369
   </body>
370
</html>
6548 dpurdie 371