Create job history execution in database (for TTL estimators)
Using the table below (TTLPredictionHistorySite
), we save information about the execution time of Grid jobs based on (ProductionId, Site, CPUModelName).
The information from this table will be used to adjust the job TTL based on the execution history of jobs with the same (ProductionId, Site, CPUModelName). The updates use Welford's algorithm to compute mean and stddev.
The commits from this PR:
- in
JobAgent
:export PATH=$PATH
in the JobWrapper environment - in
JobAgent
: extract productionId from JDL (LPMJobTypeID
) - in
JobAgent
: addsiteMap
andproductionId
inextrafields
when the JA sends accounting data (when job status is DONE) - in
TaskQueue.history
: addHistoryFactory
to receive data to be consumed byHistoryConsumer
s - in
TaskQueue.history
: addHistoryConsumer
as an abstract class that represents a history data consumer - in
TaskQueue.history
: addJobHistoryStatistics
, aHistoryConsumer
that saves history data inTTLPredictionHistorySite
- in
TaskQueue.history
: addJobHistoryFactor
that created the jobHistoryConsumer
s. - in
TaskQueueUtil
s: add a staticJobHistoryFactory
object that will be notified with accounting data (extrafields
containing thenotifyMap
field) when a job successfully finishes its execution - in
TaskQueue.history
: monitory queue size and db update time forJobHistoryStatistics
.
The table definition:
CREATE TABLE `TTLPredictionHistorySite` (
`prodId` int NOT NULL,
`site` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`cpuModelName` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`jobs` bigint DEFAULT NULL,
`mean` decimal(30,10) DEFAULT NULL,
`stddev` decimal(30,10) DEFAULT NULL,
`welfordM` decimal(30,10) DEFAULT NULL,
`maxTime` bigint DEFAULT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`estimatedTTL` bigint DEFAULT NULL,
`created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`prodId`,`site`,`cpuModelName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
Signed-off-by: Elena Mihailescu maria.mihailescu@upb.ro