4 SITEDIR=/etc/planetlab/configs
6 RPM=$(shell ls -rt /root/myplc*rpm | tail -1)
7 APIDIR=/usr/share/plc_api
9 PLC1=lurch.cs.princeton.edu
10 PLC2=planetlab-devbox.inria.fr
15 PUSH=pclean pplc2 papi2 pplc1 papi1
19 papi: pclean papi1 papi2
20 pplc: pclean pplc1 pplc2
23 -find . '(' -name '*.pyc' -o -name '*~' ')' | xargs rm
25 rsync -a -v -C ./ root@$(PLC1):new_plc_api/
27 rsync -a -v -C ./planetlab4.sql ./PLC root@$(PLC1):$(CHROOT)$(APIDIR)/
29 rsync -a -v -C ./ root@$(PLC2):new_plc_api/
31 rsync -a -v -C ./planetlab4.sql ./PLC root@$(PLC2):$(CHROOT)$(APIDIR)/
34 DB=install-schema stop-clients clean-db restart-db
35 WEB=install-api restart
41 chroot $(CHROOT) pg_dump -U pgsqluser planetlab4 > planetlab4.dump
46 @echo 'installing schema'
47 @rsync -a -v planetlab4.sql $(CHROOT)$(APIDIR)/planetlab4.sql
50 find . -name '*.py' | xargs tar cf - | ( cd $(CHROOT)$(APIDIR) ; tar xf -)
51 -find $(CHROOT)$(APIDIR) -name '*pyc' | xargs rm
56 @echo 'pkilling Shell.py'
59 @chroot $(CHROOT) /etc/plc.d/httpd stop
63 @chroot $(CHROOT) psql -U postgres --port $(PORT) template1 -c 'drop database planetlab4'
67 @chroot $(CHROOT) service plc stop db postgresql httpd
68 @chroot $(CHROOT) service plc start httpd postgresql db
71 @echo 'Restarting PLC'
72 @chroot $(CHROOT) service plc restart
75 @echo 'Restarting httpd'
76 @chroot $(CHROOT) /etc/plc.d/httpd stop ; chroot $(CHROOT) /etc/plc.d/httpd start
79 UPGRADE=down up reconfig restart
84 @echo latest rpm is $(RPM)
87 cp $(SITEDIR)/$(SITE) .
96 (echo w; echo q) | chroot $(CHROOT) plc-config-tty
101 chroot $(CHROOT) /usr/share/plc_api/Shell.py
104 chroot $(CHROOT) psql -U pgsqluser planetlab4
107 emacs /plc/data/var/log/httpd/error_log /plc/data/var/log/boot.log
110 # remove time/delay dependent output
111 normalize = egrep -v "'expires':|^+++.*ellapsed"
113 TEST=run checkpoint diff
114 run: run-only normalize
116 python -u ./TestPeers.py > TestPeers.out 2>&1
118 normalize: TestPeers.out.nor TestPeers.ref.nor
119 TestPeers.out.nor: TestPeers.out
120 $(normalize) TestPeers.out > TestPeers.out.nor
121 TestPeers.ref.nor: TestPeers.ref
122 $(normalize) TestPeers.ref > TestPeers.ref.nor
126 diff TestPeers.ref.nor TestPeers.out.nor
129 @echo adopting latest run as reference
130 cp TestPeers.out TestPeers.ref
131 cp TestPeers.out.nor TestPeers.ref.nor
134 python -u ./TestPeers.py -m > TestPeers.mout 2>&1
136 python -u ./TestPeers.py -b > TestPeers.bout 2>&1
138 python -u ./TestPeers.py -p > TestPeers.pout 2>&1
140 python -u ./TestPeers.py -p -b > TestPeers.pbout 2>&1
142 python -u ./TestPeers.py -p -H > TestPeers.phout 2>&1
145 HELP=rpm db-dump http
152 @echo upgrade: $(UPGRADE)
155 @echo OTHERS: $(HELP)