2 # Node Manager Makefile
4 # David Eisenstat <deisenst@cs.princeton.edu>
5 # Mark Huang <mlhuang@cs.princeton.edu>
6 # Copyright (C) 2006 The Trustees of Princeton University
9 # autoconf compatible variables
13 install: install-lib install-lxc install-planetstack install-scripts
16 python setup-lib.py build
19 python setup-lxc.py build
22 python setup-planetstack.py build
25 python setup-lib.py install \
26 --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
27 --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
28 --install-scripts=$(DESTDIR)/$(bindir)
29 install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
32 python setup-lxc.py install \
33 --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
34 --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
35 --install-scripts=$(DESTDIR)/$(bindir)
36 install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
39 python setup-planetstack.py install \
40 --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
41 --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
42 --install-scripts=$(DESTDIR)/$(bindir)
45 mkdir -p $(DESTDIR)/$(datadir)/NodeManager/sliver-initscripts
46 rsync -av sliver-initscripts/ $(DESTDIR)/$(datadir)/sliver-initscripts/
47 chmod 755 $(DESTDIR)/$(datadir)/sliver-initscripts/
49 mkdir -p $(DESTDIR)/etc/init.d
50 chmod 755 initscripts/*
51 rsync -av initscripts/ $(DESTDIR)/etc/init.d/
53 install -d -m 755 $(DESTDIR)/var/lib/nodemanager
55 install -D -m 644 logrotate/nodemanager $(DESTDIR)/etc/logrotate.d/nodemanager
56 install -D -m 755 sshsh $(DESTDIR)/bin/sshsh
60 python setup-lib.py clean
61 python setup-vs.py clean
62 python setup-lxc.py clean
63 python setup-planetstack.py clean
64 rm -f forward_api_calls *.pyc build
66 .PHONY: all install clean
70 (find . '(' -name '*.py' -o -name '*.c' -o -name '*.spec' ')' ; ls initscripts/*) | xargs etags
75 # for use with the test framework; push local stuff on a test node
76 # howto use: go on testmaster in the build you want to use and just run
78 # cut'n paste the result in a terminal in your working dir, e.g. (although all are not required)
79 # $ export BUILD=2013.07.02--lxc18
80 # $ export PLCHOSTLXC=gotan.pl.sophia.inria.fr
81 # $ export GUESTNAME=2013.07.02--lxc18-1-vplc01
82 # $ export GUESTHOSTNAME=vplc01.pl.sophia.inria.fr
83 # $ export KVMHOST=kvm64-6.pl.sophia.inria.fr
84 # $ export NODE=vnode01.pl.sophia.inria.fr
88 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
89 RSYNC_EXCLUDES := --exclude .git --exclude .svn --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
90 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
91 RSYNC := rsync -e "ssh -i $(NODE).key.rsa" -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
94 NODEURL:=root@$(NODE):/
99 @echo "sync: You must define NODE on the command line"
100 @echo " e.g. make sync NODE=vnode01.inria.fr"
103 +$(RSYNC) --exclude sshsh ./ $(NODEURL)/usr/share/NodeManager/
104 +$(RSYNC) ./sshsh $(NODEURL)/bin/
105 +$(RSYNC) ./initscripts/nm $(NODEURL)/etc/init.d/nm
106 ssh -i $(NODE).key.rsa root@$(NODE) service nm restart
111 TESTMASTER ?= testmaster.onelab.eu
114 KEYURL:=root@$(TESTMASTER):$(BUILD)/keys/key_admin.rsa
121 @echo "sync: fetching $@ - You must define TESTMASTER, BUILD and NODE on the command line"
122 @echo " e.g. make sync TESTMASTER=testmaster.onelab.eu BUILD=2010.01.22--1l-f8-32 NODE=vnode01.inria.fr"
123 @echo " note that for now all test builds use the same key, so any BUILD would do"