Overview
Comment: | Lots of little bugs fixed related to monitor. Note that now multiple runs must be accomodated from the same launcher |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
98de2c2f8db5b033bbca22d41629ed42 |
User & Date: | matt on 2011-10-23 20:42:46 |
Other Links: | manifest | tags |
Context
2011-10-23
| ||
23:03 | Monitor based runs working well check-in: a1371db27a user: matt tags: trunk | |
20:42 | Lots of little bugs fixed related to monitor. Note that now multiple runs must be accomodated from the same launcher check-in: 98de2c2f8d user: matt tags: trunk | |
19:10 | Monitor based runs partially working check-in: 59034f6b4d user: matt tags: trunk | |
Changes
Modified db.scm from [7df6739618] to [a288398d2a].
︙ | |||
124 125 126 127 128 129 130 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + - + | expected REAL, tol REAL, units TEXT, comment TEXT DEFAULT '', status TEXT DEFAULT 'n/a', type TEXT DEFAULT '', CONSTRAINT test_data_constraint UNIQUE (test_id,category,variable));") |
︙ | |||
188 189 190 191 192 193 194 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - - - - - - - + + + + + + + | (patch-db)) ((< mver 1.21) (sqlite3:execute db "DROP TABLE IF EXISTS metadat;") (sqlite3:execute db "CREATE TABLE IF NOT EXISTS metadat (id INTEGER, var TEXT, val TEXT, CONSTRAINT metadat_constraint UNIQUE (var));") (db:set-var db "MEGATEST_VERSION" 1.21) ;; set before, just in case the changes are already applied (sqlite3:execute db test-meta-def) |
︙ | |||
280 281 282 283 284 285 286 287 288 289 290 291 292 293 | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | + | "SELECT fieldname,fieldtype FROM keys ORDER BY id DESC;") (set! *db-keys* res) res))) (define db:get-keys db-get-keys) (define (db:get-value-by-header row header field) (debug:print 0 "db:get-value-by-header row: " row " header: " header " field: " field) (if (null? header) #f (let loop ((hed (car header)) (tal (cdr header)) (n 0)) (if (equal? hed field) (vector-ref row n) (if (null? tal) #f (loop (car tal)(cdr tal)(+ n 1))))))) |
︙ | |||
362 363 364 365 366 367 368 369 370 371 372 373 374 375 | 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | + | (let* ((res #f) (keys (db-get-keys db)) (remfields (list "id" "runname" "state" "status" "owner" "event_time")) (header (append (map key:get-fieldname keys) remfields)) (keystr (conc (keys->keystr keys) "," (string-intersperse remfields ",")))) (debug:print 0 "db:get-run-info run-id: " run-id " header: " header " keystr: " keystr) (sqlite3:for-each-row (lambda (a . x) (set! res (apply vector a x))) db (conc "SELECT " keystr " FROM runs WHERE id=?;") run-id) (vector header res))) |
︙ | |||
393 394 395 396 397 398 399 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | - - + + - + | ;; states and statuses are required to be lists, empty is ok (define (db-get-tests-for-run db run-id testpatt itempatt states statuses) (let ((res '()) (states-str (conc "('" (string-intersperse states "','") "')")) (statuses-str (conc "('" (string-intersperse statuses "','") "')")) ) (sqlite3:for-each-row |
︙ | |||
460 461 462 463 464 465 466 | 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - - + + - + - - + + - + | "SELECT count(id) FROM tests WHERE state in ('LAUNCHED','NOT_STARTED','REMOTEHOSTSTART','RUNNING','KILLREQ') AND run_id=?;" run-id) res)) ;; NB// Sync this with runs:get-test-info (define (db:get-test-info db run-id testname item-path) (let ((res #f)) (sqlite3:for-each-row |
︙ | |||
755 756 757 758 759 760 761 | 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | - - + | "Test Owner" ; 14 "Reviewed" ; 15 "Diskfree" ; 16 "Uname" ; 17 "Rundir" ; 18 "Host" ; 19 "Cpu Load" ; 20 |
︙ | |||
807 808 809 810 811 812 813 | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 | - + | t.item_path,tm.description,t.state,t.status, final_logf,run_duration, strftime('%m/%d/%Y %H:%M:%S',datetime(t.event_time,'unixepoch'),'localtime'), tm.tags,r.owner,t.comment, author, tm.owner,reviewed, diskfree,uname,rundir, |
︙ |
Modified key_records.scm from [5eff3cef18] to [46a3b150ea].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + + + | (define-inline (key:get-fieldname key)(vector-ref key 0)) (define-inline (key:get-fieldtype key)(vector-ref key 1)) (define-inline (keys->valslots keys) ;; => ?,?,? .... (string-intersperse (map (lambda (x) "?") keys) ",")) (define-inline (keys->key/field keys . additional) |
Modified launch.scm from [aa7b36aced] to [3863edda57].
︙ | |||
352 353 354 355 356 357 358 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | - + | ;; 1. look though disks list for disk with most space ;; 2. create run dir on disk, path name is meaningful ;; 3. create link from run dir to megatest runs area ;; 4. remotely run the test on allocated host ;; - could be ssh to host from hosts table (update regularly with load) ;; - could be netbatch ;; (launch-test db (cadr status) test-conf)) |
︙ | |||
403 404 405 406 407 408 409 | 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | - + | (list 'test-name test-name) (list 'runscript runscript) (list 'run-id run-id ) (list 'itemdat itemdat ) (list 'megatest remote-megatest) (list 'ezsteps ezsteps) (list 'env-ovrd (hash-table-ref/default *configdat* "env-override" '())) |
︙ | |||
429 430 431 432 433 434 435 | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | - + | (let* ((commonprevvals (alist->env-vars (hash-table-ref/default *configdat* "env-override" '()))) (testprevvals (alist->env-vars (hash-table-ref/default test-conf "pre-launch-env-overrides" '()))) (miscprevvals (alist->env-vars ;; consolidate this code with the code in megatest.scm for "-execute" (append (list (list "MT_TEST_NAME" test-name) (list "MT_ITEM_INFO" (conc itemdat)) |
︙ |
Modified runs.scm from [28791daf01] to [9af3e39a19].
︙ | |||
707 708 709 710 711 712 713 | 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | - + | (debug:print 6 "RUNNING => runflag: " runflag " STATE: " (test:get-state testdat) " STATUS: " (test:get-status testdat)) (if (not runflag) (if (not parent-test) (debug:print 1 "NOTE: Not starting test " new-test-name " as it is state \"COMPLETED\" and status \"" (test:get-status testdat) "\", use -force to override")) (let* ((get-prereqs-cmd (lambda () (db-get-prereqs-not-met db run-id waiton))) ;; check before running .... (launch-cmd (lambda () |
︙ | |||
1016 1017 1018 1019 1020 1021 1022 | 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 | - + | (debug:print 6 "RUNNING => runflag: " runflag " STATE: " (test:get-state testdat) " STATUS: " (test:get-status testdat)) (if (not runflag) (if (not parent-test) (debug:print 1 "NOTE: Not starting test " new-test-name " as it is state \"COMPLETED\" and status \"" (test:get-status testdat) "\", use -force to override")) (let* ((get-prereqs-cmd (lambda () (db-get-prereqs-not-met db run-id waiton))) ;; check before running .... (launch-cmd (lambda () |
︙ |
Modified task_records.scm from [185f9a1436] to [44007a614c].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + + | (define-inline (tasks:task-get-state vec) (vector-ref vec 3)) (define-inline (tasks:task-get-target vec) (vector-ref vec 4)) (define-inline (tasks:task-get-name vec) (vector-ref vec 5)) (define-inline (tasks:task-get-test vec) (vector-ref vec 6)) (define-inline (tasks:task-get-item vec) (vector-ref vec 7)) (define-inline (tasks:task-get-creation_time vec) (vector-ref vec 8)) (define-inline (tasks:task-get-execution_time vec) (vector-ref vec 9)) (define-inline (tasks:task-set-state! vec val)(vector-set! vec 3 val)) ;; make-vector-record tasks monitor id pid start_time last_update hostname username (define (make-tasks:monitor)(make-vector 5)) (define-inline (tasks:monitor-get-id vec) (vector-ref vec 0)) (define-inline (tasks:monitor-get-pid vec) (vector-ref vec 1)) (define-inline (tasks:monitor-get-start_time vec) (vector-ref vec 2)) |
︙ |
Modified tasks.scm from [3e542e1d23] to [cdc34b2110].
︙ | |||
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | + + + + + + | (sqlite3:execute db (conc "DELETE FROM monitors WHERE id IN ('" (string-intersperse (map conc deadlist) "','") "');"))) ) (define (tasks:remove-monitor-record db) (sqlite3:execute db "DELETE FROM monitors WHERE pid=? AND hostname=?;" (current-process-id) (get-host-name))) (define (tasks:set-state db task-id state) (sqlite3:execute db "UPDATE tasks_queue SET state=? WHERE id=?;" state task-id)) (define (tasks:start-run db task) ;; Starting run #(3 run matt reset ubuntu/afs/tmp ww44 % % 1319368208.0 1319386680.0) ;; Starting run #(5 run matt reset centos/nfs/nada ww42 all all 1319371306.0 1319386801.0) (print "Starting run " task) ;; sillyness, just call the damn routine with the task vector and be done with it. FIXME SOMEDAY (runs:run-tests db (tasks:task-get-target task) (tasks:task-get-name task) (tasks:task-get-test task) (tasks:task-get-item task) (tasks:task-get-owner task) (make-hash-table)) (tasks:set-state db (tasks:task-get-id task) "waiting") ) |
Modified tests/megatest.config from [6d5060d736] to [afd6a74f3f].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + | [fields] sysname TEXT fsname TEXT datapath TEXT [setup] # exectutable /path/to/megatest # max_concurrent_jobs 4 runsdir /tmp/runs [jobtools] |
︙ |