Overview
Comment: | Completed generalized open db proc given area. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.64-areas-dashboard |
Files: | files | file ages | folders |
SHA1: |
79525ab1feebc97ab563a52a58be9365 |
User & Date: | matt on 2017-08-09 23:24:22 |
Other Links: | branch diff | manifest | tags |
Context
2017-08-13
| ||
23:07 | Remove *db-keys* as global. Fixed typo in common:simple-setup Changed hh:get to hh:get-value and hh:get-subhash Ripped out guts of Run Areas (derived from Run Summary) and put in some stubs. Primed dashboard.scm to use areas based dbstucts. The rmt: calls have not being eliminated yet. Disabled ro db handling in dashboard. Added tab for pivot controls. Added couple missing bits for the db:dashboard-open-db multi-area support. Tested and working now. check-in: 9b83825da5 user: matt tags: v1.64-areas-dashboard | |
2017-08-09
| ||
23:24 | Completed generalized open db proc given area. check-in: 79525ab1fe user: matt tags: v1.64-areas-dashboard | |
2017-08-08
| ||
22:21 | Added hier-hash and nm server starting point check-in: 380af52b9c user: matt tags: v1.64-areas-dashboard | |
Changes
Modified common.scm from [4932effef8] to [bc7da1c8f9].
︙ | |||
961 962 963 964 965 966 967 | 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 | - + - - + + + + + - - + - - + + + + + - | (define (common:false-on-exception thunk #!key (message #f)) (handle-exceptions exn (begin (if message (debug:print-info 0 *default-log-port* message)) #f) (thunk) )) |
︙ | |||
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 | 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #f)))))) (at-home (or (equal? homehost currhost) (equal? homehost bestadrs)))) (set! *home-host* (cons homehost at-home)) (mutex-unlock! *homehost-mutex*) *home-host*)))) ;; get homehost info for a given area - but only if .homehost file already exists (define (common:minimal-get-homehost toppath) (let ((hh-file (conc toppath "/.homehost"))) (if (common:file-exists? hh-file quiet-mode: #t) (with-input-from-file hh-file read-line) #f))) ;; are we on the given host? (define (common:on-host? hh) (let* ((currhost (get-host-name)) (bestadrs (server:get-best-guess-address currhost))) (or (equal? hh currhost) (equal? hh bestadrs)))) ;; am I on the homehost? ;; (define (common:on-homehost?) (let ((hh (common:get-homehost))) (if hh (cdr hh) #f))) ;; minimal loading of megatest.config ;; (define (common:simple-setup toppath #!key (cfgf-ovrd #f)) (let* ((mtconfigf (or cfgf-ovrd "megatest.config")) (mtconfdat (find-and-read-config mtconfigf ;; environ-patt: "env-override" given-toppath: toppath ;; pathenvvar: "MT_RUN_AREA_HOME" )) (mtconf (if mtconfdat (car mtconfdat) #f))) (if mtconf (configf:section-var-set! mtconf "dyndat" "toppath" start-dir)) mtconfdat)) ;; do we honor the caches of the config files? ;; (define (common:use-cache?) (let ((res #t)) ;; priority by order of evaluation (if *configdat* ;; sillyness here. can't use setup/use-cache to know if we can use the cached files! (if (equal? (configf:lookup *configdat* "setup" "use-cache") "no") |
︙ |
Modified dashboard-areas.scm from [2d0c769b51] to [686be016f0].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - + | ;;====================================================================== ;; AREAS ;;====================================================================== (define (dashboard:areas-summary-updater commondat tabdat tb cell-lookup run-matrix) (dashboard:areas-do-update-rundat tabdat) ;; ) (dboard:areas-summary-control-panel-updater tabdat) (let* ((last-runs-update (dboard:tabdat-last-runs-update tabdat)) |
︙ | |||
127 128 129 130 131 132 133 | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | - - + + - + - + - + | (debug:print-info 13 *default-log-port* "click-cb: obj="obj" lin="lin" col="col" status="status) ;; status is corrupted on Brandon's home machine. will have to wait until after shutdown to see if it is still broken in PDX SLES (let* ((toolpath (car (argv))) (key (conc lin ":" col)) (test-id (hash-table-ref/default cell-lookup key -1)) (run-id (dboard:tabdat-curr-run-id tabdat)) |
︙ | |||
230 231 232 233 234 235 236 | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | - - - + + + | ;; create a virtual table of all the tests ;; keypatts: ( (KEY1 "abc%def")(KEY2 "%") ) ;; (define (dboard:areas-update-rundat tabdat runnamepatt numruns testnamepatt keypatts) (let* ((access-mode (dboard:tabdat-access-mode tabdat)) (keys (dboard:tabdat-keys tabdat)) (last-runs-update (- (dboard:tabdat-last-runs-update tabdat) 2)) |
︙ | |||
261 262 263 264 265 266 267 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - + | (let loop ((run (car runs)) (tal (cdr runs)) (res '()) (maxtests 0)) (let* ((run-id (db:get-value-by-header run header "id")) (run-struct (hash-table-ref/default (dboard:tabdat-allruns-by-id tabdat) run-id #f)) ;; (last-update (if run-struct (dboard:rundat-last-update run-struct) 0)) |
︙ | |||
337 338 339 340 341 342 343 | 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | - + | dbkeys) res)))) fres)))) (define (dashboard:areas-get-runs-hash tabdat) (let* ((access-mode (dboard:tabdat-access-mode tabdat)) (last-runs-update 0);;(dboard:tabdat-last-runs-update tabdat)) |
︙ | |||
374 375 376 377 378 379 380 | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | - + | (let* ((record-a (hash-table-ref runs-hash a)) (record-b (hash-table-ref runs-hash b)) (time-a (db:get-value-by-header record-a runs-header "event_time")) (time-b (db:get-value-by-header record-b runs-header "event_time"))) (< time-a time-b))))) (changed #f) (last-runs-update (dboard:tabdat-last-runs-update tabdat)) |
︙ | |||
417 418 419 420 421 422 423 | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | - + | (hash-table-set! (dboard:tabdat-path-run-ids tabdat) run-path run-id) ;; (set! colnum (+ colnum 1)) )))) (append new-run-ids run-ids)))) ;; for-each run-id (define (dashboard:areas-run-id->tests-mindat run-id tabdat runs-hash) (let* ((run (hash-table-ref/default runs-hash run-id #f)) |
︙ | |||
501 502 503 504 505 506 507 | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | - + | (lambda (obj) (dcommon:examine-xterm run-id test-id))) (iup:menu-item (conc "Kill " item-test-path) #:action (lambda (obj) |
︙ | |||
574 575 576 577 578 579 580 | 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - + | " -runname " runname " -testpatt " item-test-path " -preclean -clean-cache")))) (iup:menu-item (conc "Kill " item-test-path) #:action (lambda (obj) |
︙ | |||
690 691 692 693 694 695 696 | 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | - + - + | (mode (dboard:tabdat-runs-summary-mode tabdat))) (when (and source-runname-label dest-runname-label) (case mode ((xor-two-runs xor-two-runs-hide-clean) (let* ((curr-run-id (dboard:tabdat-curr-run-id tabdat)) (prev-run-id (dboard:tabdat-prev-run-id tabdat)) (curr-runname (if curr-run-id |
︙ |
Modified db.scm from [4bb0d1ff30] to [ab18972644].
︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + + + | (tmpdb #f) (dbstack #f) ;; stack for tmp db handles, do not initialize with a stack (mtdb #f) (refndb #f) (homehost #f) ;; not used yet (on-homehost #f) ;; not used yet (read-only #f) (configdat #f) (keys #f) (area-path #f) ) ;; goal is to converge on one struct for an area but for now it is too confusing ;; record for keeping state,status and count for doing roll-ups in ;; iterated tests ;; (defstruct dbr:counts |
︙ | |||
71 72 73 74 75 76 77 78 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | + + + + + + + + + + + + + + + + + + + + + + + + - + | ;; tmpdb - local to this machine, all reads to this ;; mtdb - full db from mtrah ;; no-sync-db - ;; on-homehost - enable reading from other users /tmp db if files are readable ;; ;; areas is hash of areas => dbstruct, the dashboard-open-db will register the dbstruct in that hash ;; ;; NOTE: This returns the tmpdb path/handle pair. ;; NOTE: This does do a sync (the db:open-db proc only does an initial sync if called with do-sync: #t ;; NOTE: Longer term consider replacing db:open-db with this ;; (define (db:dashboard-open-db areas area-path) ;; 0. check for already existing dbstruct in areas hash, return it if found ;; 1. do minimal read of megatest.config, store configdat, keys in dbstruct ;; 2. get homehost ;; 3. create /tmp db area (if needed) ;; 4. sync data to /tmp db (or update if exists) ;; 5. return dbstruct (if (hash-table-exists? areas area-path) (hash-table-ref areas area-path) (if (common:file-exists? (conc area-path "/megatest.config") quiet-mode: #t) (let* ((homehost (common:minimal-get-homehost toppath)) (on-hh (common:on-host? homehost)) (mtconfig (common:simple-setup area-path)) ;; returns ( configdat toppath configfile configf-name ) (dbstruct (make-dbr:dbstruct area-path: area-path homehost: homehost configdat: (car mtconfig))) (tmpdb (db:open-db dbstruct area-path: area-path do-sync: #t))) tmpdb) (begin (debug:print-info 0 *default-log-port* "attempt to open megatest.db in " area-path " but no megatest.config found.") |
︙ | |||
323 324 325 326 327 328 329 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | - + + - + - + - + | ;; (dbr:dbstruct-olddb-set! dbstruct olddb) ;; ;;; (mutex-unlock! *rundb-mutex*) ;;; why did we need a mutex on opening db's? ;; (db:sync-tables db:sync-tests-only *megatest-db* db) ;; db)) ;; This routine creates the db if not already present. It is only called if the db is not already opened ;; |
︙ |
Modified mtut.scm from [de23d29c54] to [1a4e185888].
︙ | |||
437 438 439 440 441 442 443 444 445 446 | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | + - + | '()))) (filter cdr args-data))))) ;; (print "Alldat: " alldat ;; " args-data: " args-data) (add-z-card (apply construct-sdat alldat)))) ;; merge/consolidate with common:simple-setup (define (simple-setup start-dir-in) (let* ((start-dir (or start-dir-in ".")) (mtconfig (or (args:get-arg "-config") "megatest.config")) |
︙ |