Release Automation

  • 1.  Notify if one deployment run more than predefined duration

    Broadcom Employee
    Posted Dec 28, 2016 01:40 AM

    Hi,

     

    My customer has a requirement to get notification if one deployment runs more than a predefined duration, like 2 hours.

    A typical deployment runs less than half an hour in current environment, but sometimes the deployment keeps running there because of environment issue. The actions status is not pause, nor failure. Customer hopes to get notification in this case so that they can look into the root cause.

    The "Notifications" feature in the environment tab can't meet this requirement.

    Any idea?

     

    Thanks

    Yang 



  • 2.  Re: Notify if one deployment run more than predefined duration

    Posted Dec 28, 2016 03:39 AM

    Currently you will need to design your deployment to track the execution time (e.g create while loop that check if execution time reach certain time) 



  • 3.  Re: Notify if one deployment run more than predefined duration

    Broadcom Employee
    Posted Dec 28, 2016 09:08 PM

    Hi Jacky,

     

    Thanks. Is there a table that I can query to get all running deployments and their duration time?

     

    Yang



  • 4.  Re: Notify if one deployment run more than predefined duration
    Best Answer

    Posted Dec 29, 2016 09:29 AM

    Hi

     

    This query will give you deployment step start time and total time it is running (I use MySQL )

    select rcbm.name as step_name,oej.start_time as start_time ,
    sec_to_time(unix_timestamp(now())-unix_timestamp(oej.start_time)) as duration_time_in_hour from rc_stages rcs
    inner join rc_releases rcr on rcr.id=rcs.release_id
    inner join rc_modules rcm on rcm.stage_id=rcs.id
    inner join rc_basic_modules rcbm on rcbm.id=rcm.id
    inner join execution_jobs oej on oej.id=rcm.job_id
    where oej.major like 'Running'

     

    e.g

     

     

     

    Thanks

    Jacky 



  • 5.  Re: Notify if one deployment run more than predefined duration

    Posted Jan 03, 2017 09:22 AM

    We use a loop that has a pause built in with a specific time interval, say 1 minute.  So every minute an iteration occurs, and it checks to see if the deployment activity is complete.  If not, it compares the iteration count to a value (say 120 in your case).  If the iteration count exceeds the value, then a notification is sent, and the deployment is put is a fail-pause state.  

     

    Using this technique, we don't need to query RA for deployment time.  

     

    You can extend on this by adding an outer loop that allows for the user to elect "Continue to wait" when fail-pause is reached.  This basically just increases the iteration check value by a set amount (say 30) so that if you know it's close, or you can correct the environment issue, your deployment does not need to fail.  



  • 6.  Re: Notify if one deployment run more than predefined duration

    Broadcom Employee
    Posted Jan 04, 2017 08:27 PM

    Hi Timothy,

     

    Thanks. Your solution is the correct answer also.

     

    Yang



  • 7.  Re: Notify if one deployment run more than predefined duration

    Broadcom Employee
    Posted Jan 04, 2017 06:58 AM

    Hi,

     Did above answer from Jacky and Timothy answered your question. If yes please mark the answer.

     

    Thx