Overview
Comment: | Fixed remaining fallout from the refactor |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.65-modularization |
Files: | files | file ages | folders |
SHA1: |
5fb5dbfbf78c969ff4590c7d5e6ee60a |
User & Date: | matt on 2018-04-10 01:02:59 |
Other Links: | branch diff | manifest | tags |
Context
2018-04-10
| ||
01:05 | Bumped version check-in: 1519ed155c user: matt tags: v1.65-modularization | |
01:02 | Fixed remaining fallout from the refactor check-in: 5fb5dbfbf7 user: matt tags: v1.65-modularization | |
2018-04-09
| ||
22:31 | Factored out bunch of stuff to mtconfigf and mtcommon in src. check-in: 3200899a59 user: matt tags: v1.65-modularization | |
Changes
Modified mtut.scm from [86a3c3c964] to [910118efa5].
︙ | |||
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 | + | ;; ;; (include "common.scm") ;; (include "megatest-version.scm") ;; fake out readline usage of toplevel-command (define (toplevel-command . a) #f) (define *default-log-port* (current-error-port)) (use srfi-1 posix srfi-69 readline ;; regex regex-case srfi-69 apropos json http-client directory-utils rpc typed-records;; (srfi 18) extras) srfi-18 extras format pkts regex regex-case (prefix dbi dbi:) nanomsg) (declare (uses mtcommon)) |
︙ | |||
457 458 459 460 461 462 463 | 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | - + | (not (or (args:get-arg "-runstep") (args:get-arg "-envcap") (args:get-arg "-envdelta") (member *action* '("db" "tsend" "tlisten")) ;; very loose checks on db and tsend/listen (equal? *action* "show") ;; just keep going if list ))) |
︙ | |||
578 579 580 581 582 583 584 | 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | - + | 'D sched) (if area-path (list 'S area-path) ;; the area-path is mapped to the start-dir '()) (if (list? extra-dat) extra-dat (begin |
︙ | |||
739 740 741 742 743 744 745 | 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | - + - + + | ;; (use trace)(trace create-run-pkt) ;; collect all needed data and create run pkts for contours with changed inputs ;; (define (generate-run-pkts mtconf toppath) (let ((std-runname (conc "sched" (time->string (seconds->local-time (current-seconds)) "%M%H%d"))) |
︙ | |||
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 | 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 1145 | + + + + + + - + - + + | (if pktsdir (with-output-to-file (conc pktsdir "/" uuid ".pkt") (lambda () (print pkt))) (print "ERROR: cannot process commands without a pkts directory"))) (define (get-pkts-dir mtconf toppath-in) (let* ((toppath (or toppath-in (configf:lookup mtconf "scratchdat" "toppath"))) (pktsdirs (or (configf:lookup mtconf "setup" "pktsdirs") toppath))) (common:get-pkts-dirs #t toppath: toppath pktsdirs: pktsdirs))) ;; collect all needed data and create run pkts for contours with changed inputs ;; (define (dispatch-commands mtconf toppath) ;; we are expecting a directory "logs", check and create it, create the log in /tmp if not able to create logs dir (let* ((logdir (if (if (not (directory? "logs")) (handle-exceptions exn #f (create-directory "logs") #t) #t) "logs" "/tmp")) (cpuload (alist-ref 'adj-proc-load (common:get-normalized-cpu-load logdir #f))) (maxload (string->number (or (configf:lookup mtconf "setup" "maxload") (configf:lookup mtconf "jobtools" "maxload") ;; respect value used by Megatest calls "1.1"))) |
︙ | |||
1181 1182 1183 1184 1185 1186 1187 | 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 | - + - + - - - - - - - + - - - - - - - + + + + + + + - + - + - + - + - - - + + + + - + + | (access-list (map (lambda (x) (string-split x ":")) (string-split (or (configf:lookup mtconf "access" area) ;; userid:rightstype userid2:rightstype2 ... (if access-ctrl "*:none" ;; nobody has access by default "*:all"))))) (access-types-dat (configf:get-section mtconf "accesstypes"))) |
︙ |
Modified src/mtcommon.scm from [a31207d0a5] to [933f9e3f12].
︙ | |||
33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | + + + + + + + + + + + + + + + + + + + + + + + + + + - + | debug-mode check-verbosity calc-verbosity ;; pkts stuff load-pkts-to-db get-pkt-alists with-queue-db get-pkts-dirs get-pkt-times ;; unix stuff get-cached-info write-cached-info get-normalized-cpu-load bash-glob get-youngest ;; time hms-string->seconds seconds->hr-min-sec seconds->time-string seconds->work-week/day-time seconds->work-week/day seconds->year-work-week/day seconds->year-work-week/day-time seconds->year-week/day-time seconds->quarter date-time->seconds find-start-mark-and-mark-delta expand-cron-slash cron-expand cron-event extended-cron ;; other get-param-mapping ;; debug debug-print print-error print-info ) (import scheme chicken data-structures extras posix ports) |
︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 | 345 346 347 348 349 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 376 377 378 379 380 381 382 383 384 385 386 387 388 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (proc-rx ( x p ) (loop (car tal)(cdr tal) loads (max-num p proc-num) phys-num core-num)) (phys-rx ( x p ) (loop (car tal)(cdr tal) loads proc-num (max-num p phys-num) core-num)) (core-rx ( x c ) (loop (car tal)(cdr tal) loads proc-num phys-num (max-num c core-num))) (else (begin ;; (print "NO MATCH: " hed) (loop (car tal)(cdr tal) loads proc-num phys-num core-num))))))))))) ;; use bash to expand a glob. Does NOT handle paths with spaces! ;; (define (bash-glob instr) (string-split (with-input-from-pipe (conc "/bin/bash -c \"echo " instr "\"") read-line))) ;; return the youngest timestamp . filename ;; (define (get-youngest glob-list) (let ((all-files (apply append (map (lambda (patt) (handle-exceptions exn '() (glob patt))) glob-list)))) (fold (lambda (fname res) (let ((last-mod (car res)) (curmod (handle-exceptions exn 0 (file-modification-time fname)))) (if (> curmod last-mod) (list curmod fname) res))) '(0 "n/a") all-files))) ;;====================================================================== ;; L O G G I N G D B ;;====================================================================== (define (open-logging-db toppath) (let* ((dbpath (conc (if toppath (conc toppath "/") "") "logging.db")) ;; fname) |
︙ | |||
391 392 393 394 395 396 397 | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | + + - - - + + + + + + | #f (old-file-exists? path-string))) ;;====================================================================== ;; pkts stuff ;;====================================================================== ;; load-pkts-to-db *used* to take a list of pkts dirs and roll them into a single db. This is now broken. ;; |
︙ | |||
424 425 426 427 428 429 430 | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | - - + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (ptype (alist-ref 'T apkt))) (add-to-queue pdb pktdat uuid (or ptype 'cmd) #f 0) (debug-print 4 log-port "Added " uuid " of type " ptype " to queue")) (debug-print 4 log-port "pkt: " uuid " exists, skipping...") ))) pkts))))) pktsdirs)) |