Overview
Comment: | Removed ability to switch transports. Streamlined calls to http send-receive so that a ping-like call can be made |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | re-re-factor-server |
Files: | files | file ages | folders |
SHA1: |
a776e42a6b580e3600e70b513013f158 |
User & Date: | matt on 2014-02-16 21:02:00 |
Other Links: | branch diff | manifest | tags |
Context
2014-02-16
| ||
22:26 | Removed check for megatest version on connecting to server. Can't have more than one server and api should be tolerant to minor version differences. check-in: b6474c4a62 user: matt tags: re-re-factor-server | |
21:02 | Removed ability to switch transports. Streamlined calls to http send-receive so that a ping-like call can be made check-in: a776e42a6b user: matt tags: re-re-factor-server | |
2014-02-15
| ||
23:01 | Removed heartbeat check, fixed typo check-in: d21a137b36 user: matt tags: re-re-factor-server | |
Changes
Modified client.scm from [52a055740a] to [20000f46f9].
︙ | |||
52 53 54 55 56 57 58 | 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 81 82 83 84 85 86 87 | - - - - - - - - - - - - - + - - - - - + - + - - - - - - - + + + + - - - - - - - | ;; *transport-type* and *runremote* from the monitor.db ;; ;; client:setup ;; ;; lookup_server, need to remove *runremote* stuff ;; (define (client:setup run-id #!key (remaining-tries 3)) |
︙ |
Modified db.scm from [42d3ed003f] to [00935888f7].
︙ | |||
1810 1811 1812 1813 1814 1815 1816 | 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 | - - - - - - + + + + + + + + + + + - | immediate flush sync set-verbosity killserver )) |
︙ |
Modified http-transport.scm from [7f3beca95c] to [c086471463].
︙ | |||
231 232 233 234 235 236 237 | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | - + + - + + | (debug:print 0 "FATAL ERROR: http-transport:client-send-receive called with no server info") (exit 1)))) ;; (conc url "/ctrl")) ;; (conc url "/?dat=" msg))) (res #f)) (handle-exceptions exn (begin (print "ERROR IN http-transport:client-send-receive " ((condition-property-accessor 'exn 'message) exn)) |
︙ | |||
291 292 293 294 295 296 297 | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - + + - + + - + | (debug:print 0 "FATAL ERROR: http-transport:client-send-receive called with no server info") (exit 1)))) (res #f)) (handle-exceptions exn (begin ;; TODO: Send this output to a log file so it isn't lost when running as daemon |
︙ | |||
362 363 364 365 366 367 368 | 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | - - + - + + - | (debug:print-info 11 "got res=" res) res))))) ;; ;; connect ;; (define (http-transport:client-connect run-id iface port) |
︙ | |||
446 447 448 449 450 451 452 | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | - - - - - - - - - - | (if (or (not (equal? sdat (list iface port))) (not server-id)) (begin (debug:print-info 0 "interface changed, refreshing iface and port info") (set! iface (car sdat)) (set! port (cadr sdat)))) |
︙ | |||
508 509 510 511 512 513 514 | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | - - - + | ;; ;; start_server? ;; (define (http-transport:launch run-id) (set! *run-id* run-id) (if (args:get-arg "-daemonize") (daemon:ize)) |
︙ |
Modified megatest.scm from [20b3d11528] to [9958005d06].
︙ | |||
119 120 121 122 123 124 125 | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | - | -cleanup-db : remove any orphan records, vacuum the db -update-meta : update the tests metadata for all tests -env2file fname : write the environment to fname.csh and fname.sh -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are overwritten by values set in config files. -server -|hostname : start the server (reduces contention on megatest.db), use - to automatically figure out hostname |
︙ | |||
186 187 188 189 190 191 192 | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | - | ":variable" ":value" ":expected" ":tol" ":units" ;; misc "-server" |
︙ | |||
288 289 290 291 292 293 294 | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | - - - - - - | (eq? pid-val 0)) (begin (printf "Sending signal/term to ~A\n" pid) (process-signal pid signal/term)))))) (process:children #f)) (original-exit exit-code))))) |
︙ | |||
342 343 344 345 346 347 348 | 334 335 336 337 338 339 340 341 342 343 344 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 | - - - - + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - + + | ;;====================================================================== (if (args:get-arg "-server") ;; Server? Start up here. ;; (let ((tl (setup-for-run)) |
︙ | |||
759 760 761 762 763 764 765 | 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 | - - | ;; Get test paths matching target, runname, and testpatt (if (or (args:get-arg "-test-files")(args:get-arg "-test-paths")) ;; if we are in a test use the MT_CMDINFO data (if (getenv "MT_CMDINFO") (let* ((startingdir (current-directory)) (cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) ;; (runremote (assoc/default 'runremote cmdinfo)) |
︙ | |||
810 811 812 813 814 815 816 | 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 | - - | ;; Archive tests matching target, runname, and testpatt (if (args:get-arg "-archive") ;; if we are in a test use the MT_CMDINFO data (if (getenv "MT_CMDINFO") (let* ((startingdir (current-directory)) (cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) ;; (runremote (assoc/default 'runremote cmdinfo)) |
︙ | |||
892 893 894 895 896 897 898 | 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | - - - | (define (megatest:step step state status logfile msg) (if (not (getenv "MT_CMDINFO")) (begin (debug:print 0 "ERROR: MT_CMDINFO env var not set, -step must be called *inside* a megatest invoked environment!") (exit 5)) (let* ((cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) ;; (runremote (assoc/default 'runremote cmdinfo)) |
︙ | |||
943 944 945 946 947 948 949 | 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 | - - | (if (not (getenv "MT_CMDINFO")) (begin (debug:print 0 "ERROR: MT_CMDINFO env var not set, commands -test-status, -runstep and -setlog must be called *inside* a megatest environment!") (exit 5)) (let* ((startingdir (current-directory)) (cmdinfo (read (open-input-string (base64:base64-decode (getenv "MT_CMDINFO"))))) ;; (runremote (assoc/default 'runremote cmdinfo)) |
︙ |
Modified rmt.scm from [c7c7b5a349] to [0c6c337631].
︙ | |||
34 35 36 37 38 39 40 | 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 | - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + | ;; S U P P O R T F U N C T I O N S ;;====================================================================== ;; cmd is a symbol ;; vars is a json string encoding the parameters for the call ;; (define (rmt:send-receive cmd run-id params) |
︙ | |||
75 76 77 78 79 80 81 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + + + + + + | ;;====================================================================== ;;====================================================================== ;; M I S C ;;====================================================================== (define (rmt:login run-id) |
︙ |
Modified server.scm from [ba9371a66f] to [dad483fccb].
︙ | |||
43 44 45 46 47 48 49 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - - + + - - - + + - - + - - - - | ;; Call this to start the actual server ;; ;; all routes though here end in exit ... ;; ;; start_server ;; |
︙ | |||
100 101 102 103 104 105 106 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | - - - - - - + - - - - - - - - + - + - - - - - + - - + + + + - + | (argv))))))) ;; When using zmq this would send the message back (two step process) ;; with spiffy or rpc this simply returns the return data to be returned ;; (define (server:reply return-addr query-sig success/fail result) |
Modified tasks.scm from [c92f244886] to [7086ef6c82].
︙ | |||
92 93 94 95 96 97 98 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | + - + + + + + + + + + + + + - + - - | (define (tasks:hostinfo-get-pid vec) (vector-ref vec 5)) (define (tasks:hostinfo-get-hostname vec) (vector-ref vec 6)) (define (tasks:server-lock-slot mdb run-id) (let ((res '()) (best #f)) (tasks:server-clean-out-old-records-for-run-id mdb run-id) (if (tasks:less-than-two-available mdb run-id) |
︙ | |||
189 190 191 192 193 194 195 | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 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 250 251 252 253 254 255 256 257 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - | (lambda (a . b) (set! res (cons (apply vector a b) res))) mdb (conc "SELECT " selstr " FROM servers WHERE run_id=? ORDER BY start_time DESC;") run-id) (vector header res))) |
︙ |