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 lib: forward_api_calls
14 python setup-lib.py build
17 python setup-vs.py build
20 python setup-lxc.py build
22 forward_api_calls: forward_api_calls.c
23 $(CC) -Wall -Os -o $@ $?
27 python setup-lib.py install \
28 --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
29 --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
30 --install-scripts=$(DESTDIR)/$(bindir)
31 install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
34 python setup-vs.py install \
35 --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
36 --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
37 --install-scripts=$(DESTDIR)/$(bindir)
38 install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
41 python setup-lxc.py install \
42 --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
43 --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
44 --install-scripts=$(DESTDIR)/$(bindir)
45 install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
48 mkdir -p $(DESTDIR)/$(datadir)/NodeManager/sliver-initscripts
49 rsync -av sliver-initscripts/ $(DESTDIR)/$(datadir)/sliver-initscripts/
50 chmod 755 $(DESTDIR)/$(datadir)/sliver-initscripts/
52 mkdir -p $(DESTDIR)/etc/init.d
53 chmod 755 initscripts/*
54 rsync -av initscripts/ $(DESTDIR)/etc/init.d/
56 install -d -m 755 $(DESTDIR)/var/lib/nodemanager
58 install -D -m 644 logrotate/nodemanager $(DESTDIR)/etc/logrotate.d/nodemanager
59 install -D -m 755 sshsh $(DESTDIR)/bin/sshsh
63 python setup-lib.py clean
64 python setup-vs.py clean
65 python setup-lxc.py clean
66 rm -f forward_api_calls *.pyc build
68 .PHONY: all install clean
72 (find . '(' -name '*.py' -o -name '*.c' -o -name '*.spec' ')' ; ls initscripts/*) | xargs etags
77 # for use with the test framework; push local stuff on a test node
78 # howto use: go on testmaster in the build you want to use and just run
80 # cut'n paste the result in a terminal in your working dir, e.g. (although all are not required)
81 # $ export BUILD=2013.07.02--lxc18
82 # $ export PLCHOSTLXC=gotan.pl.sophia.inria.fr
83 # $ export GUESTNAME=2013.07.02--lxc18-1-vplc01
84 # $ export GUESTHOSTNAME=vplc01.pl.sophia.inria.fr
85 # $ export KVMHOST=kvm64-6.pl.sophia.inria.fr
86 # $ export NODE=vnode01.pl.sophia.inria.fr
90 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
91 RSYNC_EXCLUDES := --exclude .git --exclude .svn --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
92 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
93 RSYNC := rsync -e "ssh -i $(NODE).key.rsa" -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
96 NODEURL:=root@$(NODE):/
99 # this is for lxc only, we need to exclude the vs stuff that otherwise messes up everything on node
100 # keep this in sync with setup-vs.spec
101 LXC_EXCLUDES= --exclude sliver_vs.py --exclude coresched_vs.py
105 synclxc: $(NODE).key.rsa
107 @echo "sync: You must define NODE on the command line"
108 @echo " e.g. make sync NODE=vnode01.inria.fr"
111 @echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
112 @echo WARNING : this target might not be very reliable - use with care
113 @echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
114 +$(RSYNC) --exclude sshsh $(LXC_EXCLUDES) --delete-excluded ./ $(NODEURL)/usr/share/NodeManager/
115 +$(RSYNC) ./sshsh $(NODEURL)/bin/
116 +$(RSYNC) ./initscripts/nm $(NODEURL)/etc/init.d/nm
117 # ssh -i $(NODE).key.rsa root@$(NODE) service nm restart
122 TESTMASTER ?= testmaster.onelab.eu
125 KEYURL:=root@$(TESTMASTER):$(BUILD)/keys/key_admin.rsa
132 @echo "sync: fetching $@ - You must define TESTMASTER, BUILD and NODE on the command line"
133 @echo " e.g. make sync TESTMASTER=testmaster.onelab.eu BUILD=2010.01.22--1l-f8-32 NODE=vnode01.inria.fr"
134 @echo " note that for now all test builds use the same key, so any BUILD would do"