From 06ae08c6669e2b380e81ea99398981eabbae2277 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 10 Jun 2009 13:16:23 +0000 Subject: [PATCH 1/1] make sync to push on a work/test plc --- INSTALL.txt | 53 ++++++++++++++++++++++++++++++------------------- Makefile | 36 +++++++++++++++++++++++++++++++++ geni-config-tty | 7 +++++-- 3 files changed, 74 insertions(+), 22 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index 144af0f7..f7478bf2 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,31 +1,44 @@ -Dependencies: -============= -make -gcc -openssl-devel/libssl-dev -pyOpenSSL >= 0.7 -m2crypto - +========== INSTALL +Assuming that you've set up your yum repo like for a myplc install, +you should be abe to just +# yum install geniwrapper + +========== CONFIGURE + +--- +Inspect your plc config: + +[2009.06.09--1l-f8-32-vplc07] / # plc-config-tty +Enter command (u for usual changes, w to save, ? for help) s PLC_ROOT_USER +PLC_ROOT_USER = root@test.onelab.eu +Enter command (u for usual changes, w to save, ? for help) s PLC_ROOT_PASSWORD +PLC_ROOT_PASSWORD = test++ +--- +geni-config-tty -Install: -======== -cd geniwrapper/trunk -make +* set GENI_PLC_USER to PLC_ROOT_USER +* set GENI_PLC_PASSWORD to PLC_ROOT_PASSWORD +write and quit +*NOTE* xxx at this point you get a warning b/c the authorities hierarchy has not been created yet; ignore +--- +run gimport -Configure: -========== -geni-config-tty +[2009.06.09--1l-f8-32-vplc07] / # gimport.py +Import: creating top level authorities +Hierarchy: creating authority: plc +plc : +Import: creating table for authority plc +NOTICE: table "geni$plc" does not exist, skipping + inserting authority record for plc -or - -edit /etc/geni/geni_config -* set GENI_PLC_USER to PLC_MAINTENANCE_USER in /etc/planetlab/plc_config -* set GENI_PLC_PASSWORD to PLC_MAINTENANCE_PASSWORD in /etc/planetlab/plc_config +--- +run geni-config-tty again copy authorities/ple/ple.pkey to geni/server.key + Federation: =========== edit /etc/geni/aggregates.xml and /etc/geni/registries.xml diff --git a/Makefile b/Makefile index 65c91373..5fddce6f 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,8 @@ force: tags: find . -name '*.py' -o -name '*.sh' -o -name '*.ecore' | grep -v '/\.svn/' | xargs etags + + ########## indexes geni/__init__.py: (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@ @@ -70,3 +72,37 @@ ifneq ($(util_now), $(util_files)) geni/util/__init__.py: force endif +########## sync +# 2 forms are supported +# (*) if your plc root context has direct ssh access: +# make sync PLC=private.one-lab.org +# (*) otherwise, entering through the root context +# make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr + +ifdef GUEST +ifdef PLCHOST +SSHURL:=root@$(PLCHOST):/vservers/$(GUEST) +SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) +endif +endif +ifdef PLC +SSHURL:=root@$(PLC):/ +SSHCOMMAND:=ssh root@$(PLC) +endif + +LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' +RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) +RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) +RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) + +sync: +ifeq (,$(SSHURL)) + @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line" + @echo " e.g. make sync PLC=private.one-lab.org" + @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr" + @exit 1 +else + +$(RSYNC) ./geni/ $(SSHURL)/usr/lib/python2.5/site-packages/geni/ + +$(RSYNC) geni-config-tty $(SSHURL)/usr/bin +endif + diff --git a/geni-config-tty b/geni-config-tty index 8d217205..91735d6d 100755 --- a/geni-config-tty +++ b/geni-config-tty @@ -24,7 +24,7 @@ from geni.util.hierarchy import * from geni.util.misc import * -usual_variables = ["GENI_REGISTRY_ROOT_AUTH", +all_variables = ["GENI_REGISTRY_ROOT_AUTH", "GENI_REGISTRY_LEVEL1_AUTH", "GENI_REGISTRY_ENABLED", "GENI_REGISTRY_HOST", @@ -41,6 +41,9 @@ usual_variables = ["GENI_REGISTRY_ROOT_AUTH", "GENI_PLC_PORT", "GENI_PLC_API_PATH" ] +usual_variables = ["GENI_PLC_USER", + "GENI_PLC_PASSWORD", + ] mainloop_usage= """Available commands: @@ -247,7 +250,7 @@ def setup_server_key(config_dict): hrn_leaf = get_leaf(hrn) if not hrn_leaf: hrn_leaf = hrn - new_server_key = os.sep.join([path, auth_path, hrn_leaf]) + new_server_key = os.sep.join([path, auth_path, hrn_leaf]) + ".key" old_server_key = os.sep.join([path, key]) old_server_cert = os.sep.join([path, cert]) -- 2.43.0