reorg to use common/tosca/ directory for shared TOSCA files, update of opencloud service-profile
unified config into common/Makedefs, included common/Makefile
strip last path component to get directory
clarify container target names, dependency fixes on service dir
fix test-standalone
converted other configs, added .DEFAULT_GOAL's
immediately set paths, run docker under sudo
port and cleanup fixes
fixes after testing cord-pod
follow log files, fix typo metronetwork/xos.yaml
Change-Id: I3e28d10ffd37a22c4a2927288924db453ed6ec44
diff --git a/devel/Makefile b/devel/Makefile
index 416eb51..da61ea9 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1,46 +1,24 @@
-include ../common/Makedefs
+# opencloud/Makefile
-MYIP:=$(shell hostname -i)
-CONFIG_DIR:=$(shell pwd)
-DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
-BOOTSTRAP_YML=./docker-compose-bootstrap.yml
-DOCKER_PROJECT=devel
-BOOTSTRAP_PROJECT=develbs
-XOS_BOOTSTRAP_PORT=9998
-XOS_UI_PORT=9999
-ADMIN_USERNAME=padmin@vicci.org
-ADMIN_PASSWORD=letmein
-RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
-RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
+CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+COMMON_DIR := $(abspath ../common )
-cloudlab: download_xos common_cloudlab local_containers xos
+.DEFAULT_GOAL := xos
-devstack: download_xos upgrade_pkgs common_devstack local_containers xos
+DOCKER_PROJECT ?= devel
+BOOTSTRAP_PROJECT ?= develbs
-xos: dirs download_services bootstrap onboarding develconfig
+XOS_BOOTSTRAP_PORT ?= 9998
+XOS_UI_PORT ?= 9999
-dirs:
- # if this directory doesn't exist, then docker-compose will create it with root permission
- mkdir -p key_import
- mkdir -p onboarding-docker-compose
+# Include common functions
+include $(COMMON_DIR)/Makefile
-download_xos:
- make -f ../common/Makefile.services xos_core
+cloudlab: xos_download common_cloudlab local_containers xos
-download_services:
- make -f ../common/Makefile.services
+devstack: xos_download upgrade_pkgs common_devstack local_containers xos
-update_services:
- make -f ../common/Makefile.services update
-
-bootstrap: xos.yaml
- echo "[BOOTSTRAP]"
- sudo rm -f onboarding-docker-compose/docker-compose.yml
- sudo CONFIG_DIR=$(CONFIG_DIR) MYIP=$(MYIP) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
- bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
- $(RUN_TOSCA_BOOTSTRAP) xos.yaml
+xos: config_dirs cord_services bootstrap onboarding develconfig
xos.yaml: xos.m4
m4 -D CTLIP=$(MYIP) < xos.m4 > xos.yaml
@@ -48,48 +26,20 @@
onboarding:
echo "[ONBOARDING]"
# on-board any services here
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/openstack
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/openstack
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
develconfig:
- $(RUN_TOSCA) ../common/cloudlab-openstack.yaml
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/cloudlab-openstack.yaml
$(RUN_TOSCA) ../setup/nodes.yaml
common_cloudlab:
- make -C ../common -f Makefile.cloudlab
+ make -C $(COMMON_DIR) -f Makefile.cloudlab
common_devstack:
- make -C ../common -f Makefile.devstack
-
-base:
- make -f ../common/Makefile.containers xos_base
-
-local_containers:
- make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
-
-stop:
- test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
-
-showlogs:
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
-
-rm: stop
- test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
- [ -n "$(shell docker images -f \"dangling=true\" -q)" ] && docker rmi $(shell docker images -f "dangling=true" -q) || true
-
-ps:
- sudo MYIP=$(MYIP) docker-compose ps
-
-upgrade_pkgs:
- sudo pip install httpie --upgrade
-
-rebuild:
- bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ make -C $(COMMON_DIR) -f Makefile.devstack