Overview
Comment: | Incremental changes to monitor |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | monitor-cleanup |
Files: | files | file ages | folders |
SHA1: |
372abcaa235234fe801abeaec08b23a2 |
User & Date: | matt on 2012-10-28 20:35:08 |
Other Links: | branch diff | manifest | tags |
Context
2012-10-29
| ||
00:09 | Monitor based registration of servers basically working, tests 90% updated check-in: 86bd0de407 user: matt tags: monitor-cleanup | |
2012-10-28
| ||
20:35 | Incremental changes to monitor check-in: 372abcaa23 user: matt tags: monitor-cleanup | |
2012-10-27
| ||
16:52 | interim commit with partial transition to new monitor server support check-in: b6b960aae3 user: matt tags: monitor-cleanup | |
Changes
Modified server.scm from [0823c889a2] to [75421bb641].
︙ | ︙ | |||
28 29 30 31 32 33 34 | (if (null? hostport) #f (conc "tcp://" hostname ":" port))) (define (server:run hostn) (debug:print 0 "Attempting to start the server ...") (let* ((hostport (open-run-close tasks:get-best-server tasks:open-db)) ;; do whe already have a server running? | | | > > > > | 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 | (if (null? hostport) #f (conc "tcp://" hostname ":" port))) (define (server:run hostn) (debug:print 0 "Attempting to start the server ...") (let* ((hostport (open-run-close tasks:get-best-server tasks:open-db)) ;; do whe already have a server running? (host:port (server:make-server-url hostport))) (if host:port (begin (debug:print 0 "NOTE: server already running.") (if (server:client-setup) (begin (debug:print-info 0 "Server is alive, not starting another")) (begin (debug:print-info 0 "Server is dead, removing, deregistering it and trying again") (open-run-close tasks:deregister tasks:open-db (car hostport) port: (cadr port)) ;; (server:run hostn) (debug:print 0 "WOULD NORMALLY START ANOTHER SERVER HERE") ) ) ) (let* ((zmq-socket #f) (hostname (if (string=? "-" hostn) (get-host-name) hostn)) (ipaddrstr (let ((ipstr (if (string=? "-" hostn) (string-intersperse (map number->string (u8vector->list (hostname->ip hostname))) ".") #f))) |
︙ | ︙ | |||
149 150 151 152 153 154 155 | (set! *runremote* zmq-socket) #t) (begin (debug:print-info 2 "Failed to login or connect to " hostinfo) (set! *runremote* #f) #f))))) (begin | > | | | | | | | > | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | (set! *runremote* zmq-socket) #t) (begin (debug:print-info 2 "Failed to login or connect to " hostinfo) (set! *runremote* #f) #f))))) (begin (debug:print-info 0 "NO SERVER RUNNING! PLEASE START ONE! E.g. \"megatest -server - &\"") ;; (debug:print-info 2 "No server available, attempting to start one...") ;; (system (conc (car (argv)) " -server - " (if (args:get-arg "-debug") ;; (conc "-debug " (args:get-arg "-debug")) ;; "") ;; " &")) ;; (sleep 5) ;; (server:client-setup) )))) (define (server:launch) (let* ((toppath (setup-for-run))) (debug:print-info 0 "Starting the standalone server") (if *toppath* (let* ((th2 (make-thread (lambda () (server:run (args:get-arg "-server"))))) |
︙ | ︙ |
Modified tasks.scm from [79b4593089] to [2638394af5].
︙ | ︙ | |||
52 53 54 55 56 57 58 | (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS servers (id INTEGER PRIMARY KEY, pid INTEGER, hostname TEXT, port INTEGER, start_time TIMESTAMP, priority INTEGER, state TEXT, | | | | | 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 | (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS servers (id INTEGER PRIMARY KEY, pid INTEGER, hostname TEXT, port INTEGER, start_time TIMESTAMP, priority INTEGER, state TEXT, CONSTRAINT servers_constraint UNIQUE (pid,hostname));") (sqlite3:execute mdb "CREATE TABLE IF NOT EXISTS clients (id INTEGER PRIMARY KEY, server_id INTEGER, pid INTEGER, hostname TEXT, cmdline TEXT, login_time TIMESTAMP, logout_time TIMESTAMP DEFAULT -1, CONSTRAINT clients_constraint UNIQUE (pid,hostname));") )) mdb)) ;;====================================================================== ;; Server and client management ;;====================================================================== ;; state: 'live, 'shutting-down, 'dead (define (tasks:server-register mdb pid hostname port priority state) (sqlite3:execute mdb "INSERT OR REPLACE INTO servers (pid,hostname,port,start_time,priority,state) VALUES(?,?,?,strftime('%s','now'),?,?);" pid hostname port priority state)) (define (tasks:server-deregister mdb hostname #!key (port #f)(pid #f)) (if pid (sqlite3:execute mdb "DELETE FROM servers WHERE hostname=? AND pid=?;" hostname pid) (if port (sqlite3:execute mdb "DELETE FROM servers WHERE hostname=? AND port=?;" hostname port) |
︙ | ︙ |
Modified tests/Makefile from [7797feb024] to [b40acc53a7].
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # The NEWTARGET causes some tests to fail. Do not use until this is fixed. NEWTARGET = "-target $(OS)/$(FS)/$(VER)" TARGET = "-target ubuntu/nfs/none" all : test1 test2 test3 test4 test5 test1 : cleanprep rm -f simplerun/megatest.db rm -rf simplelinks/ simpleruns/ mkdir -p simplelinks simpleruns cd simplerun;cp ../../*_records.scm .;perl -pi.bak -e 's/define-inline/define/' *_records.scm cd simplerun;echo '(load "../tests.scm")' | $(MEGATEST) -repl -debug $(DEBUG) | > > > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # The NEWTARGET causes some tests to fail. Do not use until this is fixed. NEWTARGET = "-target $(OS)/$(FS)/$(VER)" TARGET = "-target ubuntu/nfs/none" all : test1 test2 test3 test4 test5 test0 : cleanprep cd simplerun ; $(MEGATEST) -server - -debug $(DEBUG)& test1 : cleanprep rm -f simplerun/megatest.db rm -rf simplelinks/ simpleruns/ mkdir -p simplelinks simpleruns cd simplerun;cp ../../*_records.scm .;perl -pi.bak -e 's/define-inline/define/' *_records.scm cd simplerun;echo '(load "../tests.scm")' | $(MEGATEST) -repl -debug $(DEBUG) |
︙ | ︙ | |||
59 60 61 62 63 64 65 | cd fullrun;$(MEGATEST) -rollup :runname newrun -target ubuntu/nfs/none -debug 10 cleanprep : ../*.scm Makefile */*.config # if [ -e fullrun/megatest.db ]; then sqlite3 fullrun/megatest.db "delete from metadat where var='SERVER';";fi mkdir -p /tmp/mt_runs /tmp/mt_links cd ..;make install | | | > > > | 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 | cd fullrun;$(MEGATEST) -rollup :runname newrun -target ubuntu/nfs/none -debug 10 cleanprep : ../*.scm Makefile */*.config # if [ -e fullrun/megatest.db ]; then sqlite3 fullrun/megatest.db "delete from metadat where var='SERVER';";fi mkdir -p /tmp/mt_runs /tmp/mt_links cd ..;make install rm -f */logging.db */monitor.db touch cleanprep fullprep : cleanprep cd fullrun;$(MEGATEST) -server - -debug $(DEBUG) & sleep 5;cd fullrun;$(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt %/% cd fullrun;$(BINPATH)/dboard -rows 15 & dashboard : cleanprep cd fullrun && $(BINPATH)/dashboard -rows 25 & remove : cd fullrun;$(MEGATEST) -remove-runs :runname $(RUN) -testpatt % -itempatt % :sysname % :fsname % :datapath % clean : rm cleanprep kill : killall -v mtest main.sh dboard || true rm -f fullrun/megatest.db fullrun/logging.db || true killall -v mtest dboard || true hardkill : kill sleep 5;killall -v mtest main.sh dboard -9 runforever : while(ls); do runname=`date +%F-%R:%S`;(cd fullrun;$(MEGATEST) -runall -target ubuntu/nfs/none :runname $$runname;/home/matt/data/megatest/megatest -runall -target ubuntu/nfs/none :runname $$runname;/home/matt/data/megatest/megatest -runall -target ubuntu/nfs/none :runname $$runname);done |