gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Simons (JIRA)" <gene...@gump.apache.org>
Subject [jira] Created: (GUMP-126) Simple scheduling support using a "gump run queue"
Date Sun, 01 May 2005 11:37:06 GMT
Simple scheduling support using a "gump run queue"
--------------------------------------------------

         Key: GUMP-126
         URL: http://issues.apache.org/jira/browse/GUMP-126
     Project: Gump
        Type: New Feature
  Components: Python-based Gump  
    Versions: Gump3-alpha-6    
    Reporter: Leo Simons
     Fix For: Gump3-alpha-6


As discussed on the mailing list:

http://mail-archives.apache.org/mod_mbox/gump-general/200504.mbox/%3cBE93DE74.26EDD%25mail@leosimons.com%3e

Naïve line-based schedule file using simple commands together with cron could be real nice.

Creating schedules
------------------
We should have something like

  gump schedule-run --profile=public --official
  gump schedule-run --profile=public
  gump schedule-run --profile=kaffe

Which writes a file $GUMP_HOME/schedule looking like this

  gump run --profile=public --official
  gump run --profile=public
  gump run --profile=kaffe

The code would be along the lines of

 schedule_run()
 {
   local schedulefile="$GUMP_HOME/schedule"
   echo gump run $* >> $schedulefile
 }

You would also want to schedule runs immediately

 gump schedule-run-first --profile=custom --debug

Which would be something like

 schedule_run_first()
 {
   local schedulefile="$GUMP_HOME/schedule"
   echo gump run $* >> $schedulefile.new
   cat $schedulefile >> $schedulefile.new
   rm $schedulefile
   mv $schedulefile.new $schedulefile
 }

And of course there's more options like

 schedule_run_when_idle()
 {
   local pidfile="$GUMP_HOME/pygump/pygump.pid"
   if [[ ! -f "$pidfile" ]]; then
    schedule_run
   fi
 }

The next bit is to have calls to those "schedule-run" commands in the
crontab:

# the next run after midnight will be the "official" one
0 0 * * * . /home/gump/.bash_profile; gump schedule-run-first \
  --profile=public --official
0 6 * * * . /home/gump/.bash_profile; gump schedule-run \
  --profile=kaffe
0 12 * * * . /home/gump/.bash_profile; gump schedule-run \
  --profile=jdk15
0 3,9,15,18 * * * . /home/gump/.bash_profile; gump schedule-run-when-idle \
  --profile=public

Keeping schedules
-----------------
And then have something like

  gump try-to-invoke-run

Which checks to see if gump is running, and if not, takes a line from
$GUMP_HOME/schedule and executes it. Along the lines of

 try_to_invoke_run()
 {
  local pidfile="$GUMP_HOME/pygump/pygump.pid"
  if [[ ! -f "$pidfile" ]]; then
    line=remove_first_line_from_schedule
    `$line`
  fi
 }

And we run that real often from the crontab:

60/12 * * * * . /home/gump/.bash_profile; gump try-to-invoke-run

Why
---
This would ensure gump would be running just about continuously, but you
could also easily interrupt using

 gump kill
 gump schedule-run-first --profile=custom --debug

To manually change the schedule if you wanted to try something.





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message