i use callbacks to create jobs that are specified as Nightjobs with start and end times. So a night job is submitted as blocked, unblocks itself at 7pm and pending until 5am. At 5am if the job is still pending, it blocks itself. If it is running, it is allowed to finish.
might as well show my hardwork, hehe
my entire job submission is done using a custom perl script and qube perl api, i do not use the qube gui for job submission.
in general, setting up the callback
use Time::Local;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); # Grabs current local time
my $qubetimeepoch = timelocal(0,0,0,1,0,2000); # Sets Qube Time Epoch shift
# Night callback
my $onedayrepeat = 24*60*60;
my $nightbegin = timelocal(0, 0, 19, $mday, $mon, $year) - $qubetimeepoch; # Set Night start to 7:00pm
my $nightend = timelocal(0, 0, 5, $mday, $mon, $year) + $onedayrepeat - $qubetimeepoch; # Set Night reblock time 5:00am
my $cbnightbegin = {
"triggers" => "dummy-repeat-$job_label_slave-$nightbegin-$onedayrepeat or dummy-time-$job_label_slave-$nightbegin and not running-job-$job_label_slave and not done-job-$job_label_slave and not killed-job-$job_label_slave",
"language" => "qube",
"code" => "unblock-self"
};
my $cbnightend = {
"triggers" => "dummy-repeat-$job_label_slave-$nightend-$onedayrepeat or dummy-time-$job_label_slave-$nightend and not running-job-$job_label_slave and not done-job-$job_label_slave and not killed-job-$job_label_slave",
"language" => "qube",
"code" => "block-self"
};
# Program Conditional Callbacks here....
if (defined $night and length($night))
{
push(@job_callbacks, $cbnightbegin);
push(@job_callbacks, $cbnightend);
}
# End Program Conditional Callbacks
$job->{callbacks} = [ @job_callbacks ];
I still can no believe Pipelinefx has not published this in the FAQ. I worked for a few days figuring this out, the qube epoch is critical.