Overview
Comment: | pass 2 on nmsg transport setup |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.65-multi-db |
Files: | files | file ages | folders |
SHA1: |
6899c9d176819ece27b00273876bea06 |
User & Date: | matt on 2019-02-02 22:04:01 |
Other Links: | branch diff | manifest | tags |
Context
2019-02-02
| ||
22:35 | nmsg server start working check-in: 959864784f user: matt tags: v1.65-multi-db | |
22:04 | pass 2 on nmsg transport setup check-in: 6899c9d176 user: matt tags: v1.65-multi-db | |
20:48 | Added first pass on nmsg transport check-in: 723893d25c user: matt tags: v1.65-multi-db | |
Changes
Modified Makefile from [2a0e7a8735] to [26b3308328].
︙ | ︙ | |||
157 158 159 160 161 162 163 | rmt.scm client.scm common.scm configf.scm dashboard-guimonitor.scm dashboard-tests.scm dashboard.scm db.scm dcommon.scm ezsteps.scm fs-transport.scm http-transport.scm index-tree.scm items.scm keys.scm launch.scm megatest.scm monitor.scm mt.scm newdashboard.scm runconfig.scm runs.scm server.scm tdb.scm tests.scm tree.scm : common_records.scm common_records.scm : altdb.scm vg.o dashboard.o : vg_records.scm dcommon.o : run_records.scm # module deps http-transport.o : mofiles/portlogger.o | | | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | rmt.scm client.scm common.scm configf.scm dashboard-guimonitor.scm dashboard-tests.scm dashboard.scm db.scm dcommon.scm ezsteps.scm fs-transport.scm http-transport.scm index-tree.scm items.scm keys.scm launch.scm megatest.scm monitor.scm mt.scm newdashboard.scm runconfig.scm runs.scm server.scm tdb.scm tests.scm tree.scm : common_records.scm common_records.scm : altdb.scm vg.o dashboard.o : vg_records.scm dcommon.o : run_records.scm # module deps http-transport.o : mofiles/portlogger.o megatest.o rnt.o : mofiles/nmsg-transport.o # Temporary while transitioning to new routine # runs.o : run-tests-queue-classic.scm run-tests-queue-new.scm megatest-fossil-hash.scm : $(SRCFILES) megatest.scm *_records.scm echo "(define megatest-fossil-hash \"$(MTESTHASH)\")" > megatest-fossil-hash.new if ! diff -q megatest-fossil-hash.new megatest-fossil-hash.scm ; then echo copying .new to .scm;cp -f megatest-fossil-hash.new megatest-fossil-hash.scm;fi |
︙ | ︙ |
Modified rmt.scm from [0a05f35135] to [5c2483726b].
︙ | ︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | (use format typed-records) ;; RADT => purpose of json format?? (declare (unit rmt)) (declare (uses api)) (declare (uses http-transport)) (include "common_records.scm") ;; ;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!! ;; ;; generate entries for ~/.megatestrc with the following ;; ;; grep define ../rmt.scm | grep rmt: |perl -pi -e 's/\(define\s+\((\S+)\W.*$/\1/'|sort -u ;;====================================================================== ;; S U P P O R T F U N C T I O N S ;;====================================================================== ;; if a server is either running or in the process of starting call client:setup ;; else return #f to let the calling proc know that there is no server available ;; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 21 22 23 24 25 26 27 28 29 30 31 32 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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | (use format typed-records) ;; RADT => purpose of json format?? (declare (unit rmt)) (declare (uses api)) (declare (uses http-transport)) (include "common_records.scm") (declare (uses portlogger)) (import portlogger) (declare (uses nmsg-transport)) (import (prefix nmsg-transport nmsg:)) (use (prefix pkts pkts:) srfi-18) ;; ;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!! ;; ;; generate entries for ~/.megatestrc with the following ;; ;; grep define ../rmt.scm | grep rmt: |perl -pi -e 's/\(define\s+\((\S+)\W.*$/\1/'|sort -u ;;====================================================================== ;; N A N O M S G S E R V E R ;;====================================================================== (defstruct nmsg (conn #f) (hosts (make-hash-table)) pkt (pktspec '((server (hostname . h) (port . p) (pid . i) ))) (mutex (make-mutex)) ) ;; make it a global (define *nmsg-conndat* (make-nmsg)) ;; get a port ;; start the nmsg server ;; look for other servers ;; contact other servers and compile list of servers ;; there are two types of server ;; main servers - dashboards, runners and dedicated servers - need pkt ;; passive servers - test executers, step calls, list-runs - no pkt ;; (define (rmt:start-nmsg #!key (force-server-type #f)) (mutex-lock! (nmsg-mutex *nmsg-conndat*)) (let* ((server-type (or force-server-type (if (args:any? "-run" "-server") 'main 'passive))) (port-num (portlogger:open-run-close portlogger:find-port)) (nmsg-conn (nmsg:start-server port-num)) (pktspec (nmsg-pktspec *nmsg-conndat*)) (pktdir (conc (get-environment-variable "MT_RUN_AREA_HOME") "/.server-pkts"))) ;; server is started, now create pkt if needed (if (eq? server-type 'main) (nmsg-pkt-set! *nmsg-conndat* (pkts:write-alist-pkt pktdir `((hostname . ,(get-host-name)) (port . ,port-num) (pid . ,(current-process-id))) pktspec))) (nmsg-conn-set! *nmsg-conndat* nmsg-conn) )) ;;====================================================================== ;; S U P P O R T F U N C T I O N S ;;====================================================================== ;; if a server is either running or in the process of starting call client:setup ;; else return #f to let the calling proc know that there is no server available ;; |
︙ | ︙ |