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/acord/Makefile b/acord/Makefile
index 07d49b5..51dfbb0 100644
--- a/acord/Makefile
+++ b/acord/Makefile
@@ -1,91 +1,64 @@
-include ../common/Makedefs
+# acord/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=acord
-BOOTSTRAP_PROJECT=acordbs
-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 )
+
+.DEFAULT_GOAL := xos
+
+DOCKER_PROJECT ?= acord
+BOOTSTRAP_PROJECT ?= acordbs
+
+DB_NAME ?= $(BOOTSTRAP_PROJECT)_xos_db_1
+
+XOS_BOOTSTRAP_PORT ?= 9998
+XOS_UI_PORT ?= 9999
+
+# Include common functions
+include $(COMMON_DIR)/Makefile
cloudlab: download_xos common_cloudlab local_containers xos
devstack: download_xos upgrade_pkgs common_devstack local_containers xos devstack_net_fix
-xos: dirs download_services bootstrap onboarding develconfig
-
-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
-
-download_xos:
- make -f ../common/Makefile.services xos_core
-
-download_services:
- make -f ../common/Makefile.services
-
-bootstrap:
- 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: prereqs config_dirs xos_download cord_services bootstrap onboarding develconfig
onboarding:
echo "[ONBOARDING]"
# on-board any services here
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
+ 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
cord-monitoringservice: devstack_ceilometer_custom_images onboard-monitoringservice ceilometer_devstack_cord_plugins
$(RUN_TOSCA) ceilometer.yaml
-onboard-monitoringservice: download-monitoringservice
+onboard-monitoringservice: $(SERVICE_DIR)/monitoring
sudo cp ~/.ssh/id_rsa key_import/monitoringservice_rsa
sudo cp ~/.ssh/id_rsa.pub key_import/monitoringservice_rsa.pub
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
-
-download-monitoringservice:
- make -f ../common/Makefile.services monitoring_services
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
exampleservice:
#Ensure exampleservice is enabled in xos/tools/xos-manage and xos/settings.py file before uncommenting below lines
#sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/acord/acord-exampleservice.yaml
-containers:
- cd ../../../containers/xos; make devel
- cd ../../../containers/synchronizer; make
-
common_cloudlab:
- make -C ../common -f Makefile.cloudlab
+ make -C $(COMMON_DIR) -f Makefile.cloudlab
common_devstack:
- make -C ../common -f Makefile.devstack
-
-local_containers:
- make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
+ make -C $(COMMON_DIR) -f Makefile.devstack
ceilometer_cloudlab_cord_plugins:
if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
git clone https://github.com/srikanthvavila/ceilometer-plugins.git
sudo cp -r ceilometer-plugins/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
sudo cp -r ceilometer-plugins/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
- sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
+ sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
sudo cp ceilometer-plugins/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
echo "Restarting ceilometer-agent-notification"
@@ -105,43 +78,13 @@
if [ -d ./pub-sub ]; then rm -fr ./pub-sub; fi
git clone https://github.com/srikanthvavila/pub-sub.git
echo "Starting Ceilometer PUB/SUB service...Ensure zookeeper and kafka services are launched (if required)"
- cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
+ cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
cd ../..
-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
-
-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
-
-showlogs:
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
-
-showlogs_bootstrap:
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
-
-cleanup: stop rm
- ./cleanup.sh
- bash -c "source ../setup/admin-openrc.sh; nova list --all-tenants; neutron net-list"
-
-ps:
- sudo MYIP=$(MYIP) docker-compose ps
-
devstack_net_fix:
- sudo ../common/devstack/net-fix.sh
+ sudo $(COMMON_DIR)/devstack/net-fix.sh
sudo bash -c "source ../setup/admin-openrc.sh; neutron subnet-update private-subnet --dns-nameservers list=true 8.8.8.8 8.8.4.4"
-upgrade_pkgs:
- sudo pip install httpie --upgrade
-
-rebuild_xos:
- make -C ../../../containers/xos devel
-
-rebuild_synchronizer:
- make -C ../../../containers/synchronizer
-
devstack_ceilometer_custom_images:
#Assuming Openstack Mitaka backend. The glance commands require --os-image-api-version 1 to be passed to use v1 version of glance APIs
bash -c "source ../setup/admin-openrc.sh; glance --os-image-api-version 1 image-show ceilometer-trusty-server-multi-nic || ! mkdir -p /opt/stack/images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P /opt/stack/images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /opt/stack/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
diff --git a/common/Makedefs b/common/Makedefs
index 36602f9..6cc85ab 100644
--- a/common/Makedefs
+++ b/common/Makedefs
@@ -1,10 +1,28 @@
# service-profile/common/Makedefs
-SERVICE_DIR ?= ../../xos_services
-XOS_DIR ?= ../../xos
+COMMON_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+CONFIG_DIR ?= $(COMMON_DIR)
+HOME_DIR ?= $(shell echo ~)
+MYIP ?= $(shell hostname -i)
+
+XOS_DIR ?= $(HOME_DIR)/xos
+SERVICE_DIR ?= $(HOME_DIR)/xos_services
+
+XOS_BOOTSTRAP_PORT ?= 81
+XOS_UI_PORT ?= 80
+
+DOCKER_PROJECT ?= unknown
+BOOTSTRAP_PROJECT ?= $(DOCKER_PROJECT)bs
+
+ADMIN_USERNAME ?= padmin@vicci.org
+ADMIN_PASSWORD ?= letmein
+
+BOOTSTRAP_YML ?= $(CONFIG_DIR)/docker-compose-bootstrap.yml
+DOCKER_COMPOSE_YML ?= $(CONFIG_DIR)/onboarding-docker-compose/docker-compose.yml
+
+# git repos
CORD_BASE_GIT_URL ?= https://gerrit.opencord.org/p
-
DEFAULT_BRANCH ?= master
XOS_BRANCH ?= $(DEFAULT_BRANCH)
@@ -45,3 +63,4 @@
OPENSTACK_BRANCH ?= $(DEFAULT_BRANCH)
OPENSTACK_GIT_URL ?= $(CORD_BASE_GIT_URL)/openstack.git
+
diff --git a/common/Makefile b/common/Makefile
new file mode 100644
index 0000000..de6ffa0
--- /dev/null
+++ b/common/Makefile
@@ -0,0 +1,207 @@
+include $(COMMON_DIR)/Makedefs
+
+# prerequisite software
+prereqs: apt-prereqs /usr/bin/http /usr/bin/docker /usr/bin/curl /usr/local/bin/docker-compose
+
+apt-prereqs:
+ sudo apt-get update
+ sudo apt-get -y install apt-transport-https ca-certificates python-pip
+
+/usr/bin/http:
+ sudo apt-get -y install httpie
+
+/usr/bin/curl:
+ sudo apt-get -y install curl
+
+/usr/bin/docker:
+ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
+ echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /tmp/docker.list
+ sudo mv /tmp/docker.list /etc/apt/sources.list.d/docker.list
+ sudo apt-get update
+ sudo apt-get -y install docker-engine
+ sudo usermod -aG docker $(shell whoami)
+
+/usr/local/bin/docker-compose:
+ sudo pip install docker-compose
+
+
+# configuration
+config_dirs:
+ mkdir -p $(CONFIG_DIR)/key_import
+ mkdir -p $(CONFIG_DIR)/onboarding-docker-compose
+ mkdir -p $(CONFIG_DIR)/images
+
+nodes.yaml:
+ export SETUPDIR=$(CONFIG_DIR); bash $(COMMON_DIR)/make-nodes-yaml.sh
+
+clean_nodes:
+ rm -f $(CONFIG_DIR)/nodes.yaml
+
+images.yaml:
+ export SETUPDIR=$(CONFIG_DIR); bash $(COMMON_DIR)/make-images-yaml.sh
+
+
+# download/clone xos and service repos
+GITOPTS ?= -c advice.detachedHead=false
+
+xos_download: $(XOS_DIR)
+
+$(XOS_DIR):
+ git -C $(HOME_DIR) $(GITOPTS) clone -b $(XOS_BRANCH) $(XOS_GIT_URL)
+
+update_xos:
+ git -C $(XOS_DIR) pull
+
+cord_services: $(SERVICE_DIR) \
+ $(SERVICE_DIR)/exampleservice \
+ $(SERVICE_DIR)/fabric \
+ $(SERVICE_DIR)/hypercache \
+ $(SERVICE_DIR)/olt \
+ $(SERVICE_DIR)/onos-service \
+ $(SERVICE_DIR)/openstack \
+ $(SERVICE_DIR)/vrouter \
+ $(SERVICE_DIR)/vsg \
+ $(SERVICE_DIR)/vtn \
+ $(SERVICE_DIR)/vtr \
+ $(SERVICE_DIR)/metro-net
+
+$(SERVICE_DIR):
+ mkdir -p $(SERVICE_DIR)
+
+$(SERVICE_DIR)/exampleservice:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(EXAMPLESERVICE_BRANCH) $(EXAMPLESERVICE_GIT_URL)
+
+$(SERVICE_DIR)/olt:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(OLT_BRANCH) $(OLT_GIT_URL)
+
+$(SERVICE_DIR)/vsg:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VSG_BRANCH) $(VSG_GIT_URL)
+
+$(SERVICE_DIR)/vtn:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VTN_BRANCH) $(VTN_GIT_URL)
+
+$(SERVICE_DIR)/vrouter:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VROUTER_BRANCH) $(VROUTER_GIT_URL)
+
+$(SERVICE_DIR)/vtr:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VTR_BRANCH) $(VTR_GIT_URL)
+
+$(SERVICE_DIR)/onos-service:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(ONOS_BRANCH) $(ONOS_GIT_URL)
+
+$(SERVICE_DIR)/fabric:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(FABRIC_BRANCH) $(FABRIC_GIT_URL)
+
+$(SERVICE_DIR)/monitoring:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(MONITORING_BRANCH) $(MONITORING_GIT_URL)
+
+$(SERVICE_DIR)/hypercache:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(HYPERCACHE_BRANCH) $(HYPERCACHE_GIT_URL)
+
+$(SERVICE_DIR)/metro-net:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(METRONETWORK_BRANCH) $(METRONETWORK_GIT_URL)
+
+$(SERVICE_DIR)/openstack:
+ git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(OPENSTACK_BRANCH) $(OPENSTACK_GIT_URL)
+
+update_services:
+ git -C $(SERVICE_DIR)/exampleservice pull
+ git -C $(SERVICE_DIR)/olt pull
+ git -C $(SERVICE_DIR)/vsg pull
+ git -C $(SERVICE_DIR)/vtn pull
+ git -C $(SERVICE_DIR)/vrouter pull
+ git -C $(SERVICE_DIR)/vtr pull
+ git -C $(SERVICE_DIR)/onos-service pull
+ git -C $(SERVICE_DIR)/fabric pull
+ git -C $(SERVICE_DIR)/hypercache pull
+ git -C $(SERVICE_DIR)/metro-net pull
+ git -C $(SERVICE_DIR)/openstack pull
+
+# bootstrap the containers
+
+RUN_TOSCA_BOOTSTRAP ?= python $(COMMON_DIR)/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
+RUN_TOSCA ?= python $(COMMON_DIR)/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
+
+bootstrap: $(BOOTSTRAP_YML) $(CONFIG_DIR)/xos.yaml
+ @echo "[BOOTSTRAP]"
+ @echo "XOS Image Build Date: `sudo docker inspect -f '{{ .Created }}' xosproject/xos`"
+ @echo "XOS Image Commit Hash: `sudo docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_HASH }}' xosproject/xos`"
+ @echo "XOS Image Commit Date: `sudo docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_DATE }}' xosproject/xos`"
+ sudo rm -f $(DOCKER_COMPOSE_YML)
+ sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
+ bash $(COMMON_DIR)/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_DIR)/tosca/fixtures.yaml
+ sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < $(COMMON_DIR)/tosca/mydeployment.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(CONFIG_DIR)/xos.yaml
+
+
+# container creation targets
+
+local_containers: prereqs xos_download update_certs xos_base_c xos_devel_c synchronizer_c onboarding_synchronizer_c
+
+update_certs:
+ echo "" > $(XOS_DIR)/containers/xos/local_certs.crt
+ for CRT in $$(ls /usr/local/share/ca-certificates/*) ; do \
+ echo Adding Certificate: $$CRT ;\
+ cat $$CRT >> $(XOS_DIR)/containers/xos/local_certs.crt ;\
+ echo "" >> $(XOS_DIR)/containers/xos/local_certs.crt ;\
+ done
+
+xos_base_c:
+ cd $(XOS_DIR)/containers/xos; make base
+
+xos_devel_c:
+ cd $(XOS_DIR)/containers/xos; make devel
+
+xos_test_c:
+ cd $(XOS_DIR)/containers/xos; make test
+
+synchronizer_c:
+ cd $(XOS_DIR)/containers/synchronizer; make
+
+onboarding_synchronizer_c:
+ cd $(XOS_DIR)/containers/onboarding_synchronizer; make
+
+
+# utilties/convenience targets
+cleanup: stop rm
+ $(CONFIG_DIR)/cleanup.sh
+ bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
+
+cleanup_services: $(SERVICE_DIR)
+ rm -rf $(SERVICE_DIR)/*
+
+rebuild:
+ bash $(COMMON_DIR)/rebuild.sh $(XOS_BOOTSTRAP_PORT)
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+
+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
+
+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 docker ps
+
+showlogs_bootstrap:
+ sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs -f
+
+showlogs:
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs -f
+
+enter-ui:
+ sudo docker exec -ti $(DOCKER_PROJECT)_xos_ui_1 bash
+
+enter-bootstrap-ui:
+ sudo docker exec -ti $(BOOTSTRAP_PROJECT)_xos_bootstrap_ui_1 bash
+
+enter-db:
+ sudo docker exec -ti $(BOOTSTRAP_PROJECT)_xos_db_1 bash
+
+django-restart:
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 touch /opt/xos/xos/settings.py
+
diff --git a/common/Makefile.containers b/common/Makefile.containers
deleted file mode 100644
index 0db49d6..0000000
--- a/common/Makefile.containers
+++ /dev/null
@@ -1,26 +0,0 @@
-include ../common/Makedefs
-
-local_containers: xos_devel synchronizer onboarding_synchronizer
-
-xos_devel:
- cd $(XOS_DIR)/containers/xos; make devel
-
-xos_base:
- cd $(XOS_DIR)/containers/xos; make base
-
-xos_test:
- cd $(XOS_DIR)/containers/xos; make test
-
-synchronizer:
- cd $(XOS_DIR)/containers/synchronizer; make
-
-onboarding_synchronizer:
- cd $(XOS_DIR)/containers/onboarding_synchronizer; make
-
-update_certs:
- echo "" > $(XOS_DIR)/containers/xos/local_certs.crt
- for CRT in $$(ls /usr/local/share/ca-certificates/*) ; do \
- echo Adding Certificate: $$CRT ;\
- cat $$CRT >> $(XOS_DIR)/containers/xos/local_certs.crt ;\
- echo "" >> $(XOS_DIR)/containers/xos/local_certs.crt ;\
- done
diff --git a/common/Makefile.prereqs b/common/Makefile.prereqs
deleted file mode 100644
index cbe047b..0000000
--- a/common/Makefile.prereqs
+++ /dev/null
@@ -1,56 +0,0 @@
-UBUNTU:=$(shell which apt > /dev/null 2>&1; echo $$?)
-
-ifeq ($(UBUNTU),0)
-
-# ******************* apt-based distros ***************************
-prereqs: /usr/bin/http docker /usr/bin/curl /usr/local/bin/docker-compose
-
-/usr/bin/http:
- sudo apt-get -y install httpie
-
-/usr/bin/curl:
- sudo apt-get -y install curl
-
-docker:
- which docker > /dev/null || wget -qO- https://get.docker.com/ | sh
- sudo usermod -aG docker $(shell whoami)
-
-else
-
-# ****************** RPM-based distros ******************
-
-# (untested / work-in-progress)
-
-prereqs: /usr/bin/pip /usr/bin/http docker /usr/local/bin/docker-compose
-
-/usr/bin/pip:
- curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
- sudo python ./get-pip.py
-
-docker:
- which docker > /dev/null || wget -qO- https://get.docker.com/ | sh
- sudo usermod -aG docker $(shell whoami)
-
-/usr/bin/http:
- sudo pip install httpie
-
-endif
-
-/usr/local/bin/docker-compose:
- sudo bash -c "curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
- sudo chmod +x /usr/local/bin/docker-compose
-
-rebuild_docker:
- stat docker_build || git clone https://github.com/dotcloud/docker.git docker_build
- sudo make -C docker_build build
- sudo make -C docker_build binary
- sudo service docker stop
- sudo mv /usr/bin/docker /usr/bin/docker-old
- sudo cp docker_build/bundles/latest/binary-client/docker /usr/bin/
- sudo cp docker_build/bundles/latest/binary-daemon/dockerd /usr/bin/
- sudo cp docker_build/bundles/latest/binary-daemon/docker-containerd /usr/bin/
- sudo cp docker_build/bundles/latest/binary-daemon/docker-containerd-shim /usr/bin/
- sudo cp docker_build/bundles/latest/binary-daemon/docker-containerd-ctr /usr/bin/
- sudo cp docker_build/bundles/latest/binary-daemon/docker-runc /usr/bin/
- sudo cp docker_build/bundles/latest/binary-daemon/docker-proxy /usr/bin/
- sudo service docker start
diff --git a/common/Makefile.services b/common/Makefile.services
deleted file mode 100644
index 89f7631..0000000
--- a/common/Makefile.services
+++ /dev/null
@@ -1,81 +0,0 @@
-include ../common/Makedefs
-
-GITOPTS=-c advice.detachedHead=false
-
-services: $(SERVICE_DIR) \
- $(SERVICE_DIR)/exampleservice \
- $(SERVICE_DIR)/olt \
- $(SERVICE_DIR)/vsg \
- $(SERVICE_DIR)/vtn \
- $(SERVICE_DIR)/vrouter \
- $(SERVICE_DIR)/vtr \
- $(SERVICE_DIR)/onos-service \
- $(SERVICE_DIR)/fabric \
- $(SERVICE_DIR)/hypercache \
- $(SERVICE_DIR)/metro-net \
- $(SERVICE_DIR)/openstack
-
-monitoring_services: $(SERVICE_DIR)/monitoring
-
-xos_core: $(XOS_DIR)
-
-$(XOS_DIR):
- git -C ../.. $(GITOPTS) clone -b $(XOS_BRANCH) $(XOS_GIT_URL)
-
-update_xos:
- git -C $(XOS_DIR) pull
-
-$(SERVICE_DIR):
- mkdir -p $(SERVICE_DIR)
-
-$(SERVICE_DIR)/exampleservice:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(EXAMPLESERVICE_BRANCH) $(EXAMPLESERVICE_GIT_URL)
-
-$(SERVICE_DIR)/olt:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(OLT_BRANCH) $(OLT_GIT_URL)
-
-$(SERVICE_DIR)/vsg:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VSG_BRANCH) $(VSG_GIT_URL)
-
-$(SERVICE_DIR)/vtn:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VTN_BRANCH) $(VTN_GIT_URL)
-
-$(SERVICE_DIR)/vrouter:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VROUTER_BRANCH) $(VROUTER_GIT_URL)
-
-$(SERVICE_DIR)/vtr:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(VTR_BRANCH) $(VTR_GIT_URL)
-
-$(SERVICE_DIR)/onos-service:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(ONOS_BRANCH) $(ONOS_GIT_URL)
-
-$(SERVICE_DIR)/fabric:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(FABRIC_BRANCH) $(FABRIC_GIT_URL)
-
-$(SERVICE_DIR)/monitoring:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(MONITORING_BRANCH) $(MONITORING_GIT_URL)
-
-$(SERVICE_DIR)/hypercache:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(HYPERCACHE_BRANCH) $(HYPERCACHE_GIT_URL)
-
-$(SERVICE_DIR)/metro-net:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(METRONETWORK_BRANCH) $(METRONETWORK_GIT_URL)
-
-$(SERVICE_DIR)/openstack:
- git -C $(SERVICE_DIR) $(GITOPTS) clone -b $(OPENSTACK_BRANCH) $(OPENSTACK_GIT_URL)
-
-cleanup:
- rm -rf $(SERVICE_DIR)/*
-
-update:
- git -C $(SERVICE_DIR)/exampleservice pull
- git -C $(SERVICE_DIR)/olt pull
- git -C $(SERVICE_DIR)/vsg pull
- git -C $(SERVICE_DIR)/vtn pull
- git -C $(SERVICE_DIR)/vrouter pull
- git -C $(SERVICE_DIR)/vtr pull
- git -C $(SERVICE_DIR)/onos-service pull
- git -C $(SERVICE_DIR)/fabric pull
- git -C $(SERVICE_DIR)/hypercache pull
- git -C $(SERVICE_DIR)/metro-net pull
- git -C $(SERVICE_DIR)/openstack pull
diff --git a/common/base.yaml b/common/tosca/base.yaml
similarity index 100%
rename from common/base.yaml
rename to common/tosca/base.yaml
diff --git a/common/cloudlab-openstack.yaml b/common/tosca/cloudlab-openstack.yaml
similarity index 100%
rename from common/cloudlab-openstack.yaml
rename to common/tosca/cloudlab-openstack.yaml
diff --git a/cord-pod/cord-volt-devices.yaml b/common/tosca/cord-volt-devices.yaml
similarity index 100%
rename from cord-pod/cord-volt-devices.yaml
rename to common/tosca/cord-volt-devices.yaml
diff --git a/common/disable-onboarding.yaml b/common/tosca/disable-onboarding.yaml
similarity index 100%
rename from common/disable-onboarding.yaml
rename to common/tosca/disable-onboarding.yaml
diff --git a/common/enable-onboarding.yaml b/common/tosca/enable-onboarding.yaml
similarity index 100%
rename from common/enable-onboarding.yaml
rename to common/tosca/enable-onboarding.yaml
diff --git a/common/fixtures.yaml b/common/tosca/fixtures.yaml
similarity index 100%
rename from common/fixtures.yaml
rename to common/tosca/fixtures.yaml
diff --git a/cord-pod/mgmt-net.yaml b/common/tosca/mgmt-net.yaml
similarity index 100%
rename from cord-pod/mgmt-net.yaml
rename to common/tosca/mgmt-net.yaml
diff --git a/common/mydeployment.yaml b/common/tosca/mydeployment.yaml
similarity index 100%
rename from common/mydeployment.yaml
rename to common/tosca/mydeployment.yaml
diff --git a/cord-pod/setup.yaml b/common/tosca/setup.yaml
similarity index 100%
rename from cord-pod/setup.yaml
rename to common/tosca/setup.yaml
diff --git a/common/wait_for_xos.sh b/common/wait_for_xos.sh
deleted file mode 100644
index afffb86..0000000
--- a/common/wait_for_xos.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#! /bin/bash
-echo "Waiting for XOS to come up"
-until http 0.0.0.0:9999 &> /dev/null
-do
- sleep 1
- echo -ne "."
- RUNNING_CONTAINER=`sudo docker ps|grep "xos"|awk '{print $$NF}'`
- if [[ $RUNNING_CONTAINER == "" ]]; then
- echo Container may have failed. check with \"make showlogs\'
- exit 1
- fi
-done
-echo "XOS is ready"
diff --git a/cord-pod-ansible/Makefile b/cord-pod-ansible/Makefile
index 6bcaff0..18d2bd3 100644
--- a/cord-pod-ansible/Makefile
+++ b/cord-pod-ansible/Makefile
@@ -3,7 +3,7 @@
everything: /usr/bin/ansible
ansible-playbook -i inventory/local --connection=local -e "config_dir=$(CONFIG_DIR)" cord-pod-playbook.yaml
-/usr/bin/ansible:
+/usr/bin/ansible:
sudo apt-get update
sudo apt-get -y install software-properties-common curl git mosh tmux dnsutils python-netaddr
sudo add-apt-repository -y ppa:ansible/ansible
diff --git a/cord-pod-ansible/mgmt-net.yaml b/cord-pod-ansible/mgmt-net.yaml
deleted file mode 100644
index 2bd0173..0000000
--- a/cord-pod-ansible/mgmt-net.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: Set up management network for CORD POD
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
-
- management_template:
- type: tosca.nodes.NetworkTemplate
- properties:
- visibility: private
- translation: none
-
- management:
- type: tosca.nodes.network.Network
- properties:
- ip_version: 4
- cidr: 172.27.0.0/24
- requirements:
- - network_template:
- node: management_template
- relationship: tosca.relationships.UsesNetworkTemplate
- - owner:
- node: mysite_management
- relationship: tosca.relationships.MemberOfSlice
-
- mysite:
- type: tosca.nodes.Site
-
- mysite_management:
- description: This slice exists solely to own the management network
- type: tosca.nodes.Slice
- properties:
- network: noauto
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
diff --git a/cord-pod/Makefile b/cord-pod/Makefile
index 55ab1a4..d0bf779 100644
--- a/cord-pod/Makefile
+++ b/cord-pod/Makefile
@@ -1,57 +1,23 @@
-include ../common/Makedefs
+# cord-pod/Makefile
-CONFIG_DIR:=$(shell pwd)
-DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
-BOOTSTRAP_YML=./docker-compose-bootstrap.yml
-DOCKER_PROJECT=cordpod
-BOOTSTRAP_PROJECT=cordpodbs
-XOS_BOOTSTRAP_PORT=81
-XOS_UI_PORT=80
-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 )
-.PHONY: xos
-xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig
+.DEFAULT_GOAL := xos
-prereqs:
- sudo make -f ../common/Makefile.prereqs
+DOCKER_PROJECT ?= cordpod
+BOOTSTRAP_PROJECT ?= cordpodbs
-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
-bootstrap:
- @echo "[BOOTSTRAP]"
- @echo "XOS Image Build Date: `docker inspect -f '{{ .Created }}' xosproject/xos`"
- @echo "XOS Image Commit Hash: `docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_HASH }}' xosproject/xos`"
- @echo "XOS Image Commit Date: `docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_DATE }}' xosproject/xos`"
- sudo rm -f onboarding-docker-compose/docker-compose.yml
- sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
- bash ../common/wait_for_xos_port.sh 81
- 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: prereqs config_dirs xos_download cord_services bootstrap onboarding podconfig
-download_xos:
- make -f ../common/Makefile.services xos_core
-
-download_services:
- make -f ../common/Makefile.services
-
-update_services:
- make -f ../common/Makefile.services update
-
-update_xos:
- make -f ../common/Makefile.services update_xos
-
-onboarding:
+onboarding: synchronizers.yaml id_rsa id_rsa.pub
@echo "[ONBOARDING]"
# on-board any services here
- bash ../common/wait_for_onboarding_ready.sh 81 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
sudo cp id_rsa key_import/vsg_rsa
sudo cp id_rsa.pub key_import/vsg_rsa.pub
sudo cp id_rsa key_import/volt_rsa
@@ -64,23 +30,23 @@
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
- $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh 81 services/vrouter
- bash ../common/wait_for_onboarding_ready.sh 81 services/volt
- bash ../common/wait_for_onboarding_ready.sh 81 services/vsg
- bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
- bash ../common/wait_for_onboarding_ready.sh 81 services/onos
- bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
- bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
- bash ../common/wait_for_onboarding_ready.sh 81 xos
- bash ../common/wait_for_xos_port.sh 80
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/volt
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vsg
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtn
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtr
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
podconfig: nodes.yaml images.yaml
@echo "[PODCONFIG]"
- $(RUN_TOSCA) setup.yaml
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/setup.yaml
$(RUN_TOSCA) nodes.yaml
$(RUN_TOSCA) images.yaml
@@ -99,113 +65,54 @@
$(RUN_TOSCA) fabric.yaml
cord: vsg_custom_images
- $(RUN_TOSCA) mgmt-net.yaml
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
$(RUN_TOSCA) cord-services.yaml
- $(RUN_TOSCA) cord-volt-devices.yaml
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/cord-volt-devices.yaml
+
+vsg_custom_images: images/vsg-1.1.img
+ bash -c "source ./admin-openrc.sh; glance image-show vsg-1.1 || glance image-create --name vsg-1.1 --disk-format qcow2 --file ./images/vsg-1.1.img --container-format bare"
cord-subscriber:
$(RUN_TOSCA) cord-test-subscriber.yaml
-clean-nodes:
- rm -f nodes.yaml
-
-update-nodes: nodes.yaml
+update_nodes: nodes.yaml
$(RUN_TOSCA) nodes.yaml
-new-nodes: clean-nodes update-nodes vtn
-
-rebuild:
- bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
- bash ../common/wait_for_onboarding_ready.sh 81 xos
+new-nodes: clean_nodes update_nodes vtn
exampleservice: onboard-exampleservice
$(RUN_TOSCA) pod-exampleservice.yaml
-onboard-exampleservice:
+onboard-exampleservice: $(SERVICE_DIR)/exampleservice
sudo cp id_rsa key_import/exampleservice_rsa
sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
- $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
- bash ../common/wait_for_onboarding_ready.sh 81 xos
- bash ../common/wait_for_xos_port.sh 80
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice
$(RUN_TOSCA) monitoringservice.yaml
$(RUN_TOSCA) monitoringtenant.yaml
-onboard-monitoringservice: download-monitoringservice
+onboard-monitoringservice: $(SERVICE_DIR)/monitoring
sudo cp id_rsa key_import/monitoringservice_rsa
sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
- bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
- bash ../common/wait_for_onboarding_ready.sh 81 xos
- bash ../common/wait_for_xos_port.sh 80
-
-download-monitoringservice:
- make -f ../common/Makefile.services monitoring_services
-
-nodes.yaml:
- export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
-
-images.yaml:
- export SETUPDIR=.; bash ../common/make-images-yaml.sh
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
vtn-external.yaml:
- export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
+ export SETUPDIR=$(CONFIG_DIR); bash ./make-vtn-external-yaml.sh
fabric.yaml:
- export SETUPDIR=.; bash ./make-fabric-yaml.sh
+ export SETUPDIR=$(CONFIG_DIR); bash ./make-fabric-yaml.sh
virtualbng_json:
- export SETUPDIR=.; bash ./make-virtualbng-json.sh
-
-vtn_network_cfg_json:
- export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
-
-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
-
-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
-
-showlogs:
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
-
-showlogs_bootstrap:
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
-
-cleanup: stop rm
- ./cleanup.sh
- bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
-
-ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img
- #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic)
- bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
-
-vsg_custom_images: images/vsg-1.1.img
- bash -c "source ./admin-openrc.sh; glance image-show vsg-1.1 || glance image-create --name vsg-1.1 --disk-format qcow2 --file ./images/vsg-1.1.img --container-format bare"
-
-images/ceilometer-trusty-server-multi-nic.img: images
- bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images"
-
-images/ceilometer-service-trusty-server-multi-nic.img: images
- #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal
- #bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-service-trusty-server-multi-nic || wget http://www.vicci.org/cord/ceilometer-service-trusty-server-multi-nic.compressed.qcow2 -P ./images"
-
-images/vsg-1.1.img: images
- [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images
-
-images:
- mkdir -p ./images
-
-.PHONY: local_containers
-local_containers: prereqs download_xos
- make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
+ export SETUPDIR=$(CONFIG_DIR); bash ./make-virtualbng-json.sh
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
diff --git a/frontend/Makefile b/frontend/Makefile
index ed34f2f..c3bbc69 100644
--- a/frontend/Makefile
+++ b/frontend/Makefile
@@ -1,106 +1,26 @@
-include ../common/Makedefs
+# frontend/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=frontend
-BOOTSTRAP_PROJECT=frontendbs
-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 )
-frontend: prereqs dirs download_xos download_services bootstrap onboarding frontendconfig
+.DEFAULT_GOAL := frontend
-prereqs:
- sudo make -f ../common/Makefile.prereqs
+DOCKER_PROJECT ?= frontend
+BOOTSTRAP_PROJECT ?= frontendbs
-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
+XOS_BOOTSTRAP_PORT ?= 9998
+XOS_UI_PORT ?= 9999
-download_xos:
- make -f ../common/Makefile.services xos_core
+# Include common functions
+include $(COMMON_DIR)/Makefile
-download_services:
- make -f ../common/Makefile.services
-
-update_services:
- make -f ../common/Makefile.services update
-
-update_xos:
- make -f ../common/Makefile.services update_xos
-
-bootstrap:
- @echo "[BOOTSTRAP]"
- sudo rm -f onboarding-docker-compose/docker-compose.yml
- sudo CONFIG_DIR=$(CONFIG_DIR) 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
+frontend: prereqs config_dirs xos_download cord_services bootstrap onboarding frontendconfig
onboarding:
@echo "[ONBOARDING]"
# on-board any services here
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
-
-frontendconfig:
- @echo "[FRONTENDCONFIG]"
- $(RUN_TOSCA) sample.yaml
-
-local_containers: prereqs download_xos
- make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
-
-rebuild:
- bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
-
-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 $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
-
-showlogs_bootstrap:
- 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 docker-compose ps
-
-enter-ui:
- sudo docker exec -ti frontend_xos_ui_1 bash
-
-enter-bootstrap-ui:
- sudo docker exec -ti frontendbs_xos_bootstrap_ui_1 bash
-
-enter-db:
- sudo docker exec -ti frontendbs_xos_db_1 bash
-
-django-restart:
- sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
-
-clean-config-folder:
- sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
- sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
-
-mock-cord-pod: onboard-cord-pod
- $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
- $(RUN_TOSCA) mocks/onos.yaml
- $(RUN_TOSCA) ../cord-pod/cord-services.yaml
- $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
- $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
onboard-cord-pod:
sudo bash -c "echo somekey > key_import/vsg_rsa"
@@ -109,7 +29,7 @@
sudo bash -c "echo somekey > key_import/volt_rsa.pub"
sudo bash -c "echo somekey > key_import/onos_rsa"
sudo bash -c "echo somekey > key_import/onos_rsa.pub"
- $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
@@ -117,54 +37,70 @@
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter
- bash ../common/wait_for_onboarding_ready.sh 9998 services/volt
- bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg
- bash ../common/wait_for_onboarding_ready.sh 9998 services/onos
- bash ../common/wait_for_onboarding_ready.sh 9998 services/fabric
- bash ../common/wait_for_onboarding_ready.sh 9998 services/vtr
- 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/vrouter
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/volt
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vsg
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtr
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
+
+frontendconfig: sample.yaml
+ @echo "[FRONTENDCONFIG]"
+ $(RUN_TOSCA) sample.yaml
+
+mock-cord-pod: onboard-cord-pod
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
+ $(RUN_TOSCA) mocks/onos.yaml
+ $(RUN_TOSCA) ../cord-pod/cord-services.yaml
+ $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
+ $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
mock-mcord:
# check this
- $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
$(RUN_TOSCA) mocks/mcord.yaml
- sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
- sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 touch /opt/xos/xos/settings.py
-exampleservice:
+exampleservice: $(SERVICE_DIR)/exampleservice
mkdir -p key_import
# fake keys are fine
sudo bash -c "echo somekey > key_import/exampleservice_rsa"
sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
-hypercache:
+hypercache: $(SERVICE_DIR)/hypercache
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/hypercache/xos/hpc-onboard.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/hpc
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/hpc
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
$(RUN_TOSCA) mocks/cdn.yaml
$(RUN_TOSCA) ../opencloud/cdn-content.yaml
-dashboard:
- $(RUN_TOSCA) ./dashboard.yaml
+dashboard: dashboard.yaml
+ $(RUN_TOSCA) $(CONFIG_DIR)/dashboard.yaml
# before executing this clone the service from: https://github.com/teone/mcord-slicing-ui.git
onboard-mcord-slicing: slicing-ui
# fix ports (now they are set to use the FE config ones
@echo "[ONBOARDING UI SERVICES]"
- bash ../common/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
- $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/disable-onboarding.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord-ui-slicing/xos/mcord-slicing-onboard.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/enable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
slicing-ui:
$(RUN_TOSCA) ./mocks/mcord-slicing-ui.yaml
+
+clean-config-folder:
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
+
diff --git a/mcord/Makefile b/mcord/Makefile
index 341158a..b9da18d 100644
--- a/mcord/Makefile
+++ b/mcord/Makefile
@@ -1,58 +1,20 @@
-include ../common/Makedefs
+# opencloud/Makefile
-CONFIG_DIR:=$(shell pwd)
-DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
-BOOTSTRAP_YML=./docker-compose-bootstrap.yml
-DOCKER_PROJECT=mcord
-BOOTSTRAP_PROJECT=mcordbs
-XOS_BOOTSTRAP_PORT=81
-XOS_UI_PORT=80
-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 )
-.PHONY: xos
-xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig
+.DEFAULT_GOAL := xos
-prereqs:
- sudo make -f ../common/Makefile.prereqs
+DOCKER_PROJECT ?= mcord
+BOOTSTRAP_PROJECT ?= mcordbs
-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
-
-bootstrap:
- @echo "[BOOTSTRAP]"
- @echo "XOS Image Build Date: `docker inspect -f '{{ .Created }}' xosproject/xos`"
- @echo "XOS Image Commit Hash: `docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_HASH }}' xosproject/xos`"
- @echo "XOS Image Commit Date: `docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_DATE }}' xosproject/xos`"
- sudo rm -f onboarding-docker-compose/docker-compose.yml
- sudo CONFIG_DIR=$(CONFIG_DIR) 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
-
-download_xos:
- make -f ../common/Makefile.services xos_core
-
-download_services:
- make -f ../common/Makefile.services
-
-update_services:
- make -f ../common/Makefile.services update
-
-update_xos:
- make -f ../common/Makefile.services update_xos
+xos: prereqs config_dirs xos_download cord_services bootstrap onboarding podconfig
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
sudo cp id_rsa key_import/vBBU_rsa
sudo cp id_rsa.pub key_import/vBBU_rsa.pub
sudo cp id_rsa key_import/vPGWC_rsa
@@ -66,14 +28,14 @@
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
# $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
$(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vbbu
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vpgwc
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtn
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
- # bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
- 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/vbbu
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vpgwc
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtn
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
+ # bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
podconfig: nodes.yaml images.yaml
@echo "[PODCONFIG]"
@@ -84,99 +46,12 @@
vtn: vtn-external.yaml
$(RUN_TOSCA) vtn-external.yaml
-delete_fabric_config:
- http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/
+vtn-external.yaml:
+ export SETUPDIR=$(CONFIG_DIR); bash ./make-vtn-external-yaml.sh
-fabric: fabric.yaml
- cp ../../xos_services/fabric/config/network-cfg-quickstart.json .
- $(RUN_TOSCA) fabric.yaml
-
-#cord: vsg_custom_images
mcord:
$(RUN_TOSCA) mgmt-net.yaml
$(RUN_TOSCA) mcord.yaml
-# $(RUN_TOSCA) cord-volt-devices.yaml
-
-#cord-subscriber:
-# $(RUN_TOSCA) cord-test-subscriber.yaml
-
-clean-nodes:
- rm -f nodes.yaml
-
-update-nodes: nodes.yaml
- $(RUN_TOSCA) nodes.yaml
-
-new-nodes: clean-nodes update-nodes vtn
-
-rebuild:
- bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
-
-exampleservice: onboard-exampleservice
- $(RUN_TOSCA) pod-exampleservice.yaml
-
-onboard-exampleservice:
- sudo cp id_rsa key_import/exampleservice_rsa
- sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
- $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
- $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
- $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
-
-cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice
- $(RUN_TOSCA) monitoringservice.yaml
- $(RUN_TOSCA) monitoringtenant.yaml
-
-onboard-monitoringservice: download-monitoringservice
- sudo cp id_rsa key_import/monitoringservice_rsa
- sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
- $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
- $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
-
-download-monitoringservice:
- make -f ../common/Makefile.services monitoring_services
-
-nodes.yaml:
- export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
-
-images.yaml:
- export SETUPDIR=.; bash ../common/make-images-yaml.sh
-
-vtn-external.yaml:
- export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
-
-fabric.yaml:
- export SETUPDIR=.; bash ./make-fabric-yaml.sh
-
-virtualbng_json:
- export SETUPDIR=.; bash ./make-virtualbng-json.sh
-
-vtn_network_cfg_json:
- export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
-
-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
-
-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
-
-showlogs:
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
-
-showlogs_bootstrap:
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
-
-cleanup: stop rm
- ./cleanup.sh
- bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img
#TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic)
@@ -195,22 +70,15 @@
#images/vsg-1.1.img: images
# [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images
-images:
- mkdir -p ./images
-
-.PHONY: local_containers
-local_containers: prereqs download_xos
- make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
-
onboard-slicing: slicing-ui
@echo "[ONBOARDING]"
# on-board slicing 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)/disable-onboarding.yaml
$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord_slicing_ui/xos/mcord-slicing-onboard.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/mcord_slicing_ui
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
- bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/mcord_slicing_ui
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
slicing-ui:
- $(RUN_TOSCA) ./mcord-slicing-ui.yaml
\ No newline at end of file
+ $(RUN_TOSCA) ./mcord-slicing-ui.yaml
diff --git a/metronetwork/Makefile b/metronetwork/Makefile
index c3b1698..d56ff74 100644
--- a/metronetwork/Makefile
+++ b/metronetwork/Makefile
@@ -1,102 +1,38 @@
-include ../common/Makedefs
+# frontend/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=metronetwork
-BOOTSTRAP_PROJECT=metronetworkdbs
-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 )
-metronetwork: prereqs dirs download_xos download_services bootstrap onboarding services
+.DEFAULT_GOAL := metronetwork
-prereqs:
- sudo make -f ../common/Makefile.prereqs
+DOCKER_PROJECT ?= metronetwork
+BOOTSTRAP_PROJECT ?= metronetworkbs
-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
+XOS_BOOTSTRAP_PORT ?= 9998
+XOS_UI_PORT ?= 9999
-download_xos:
- make -f ../common/Makefile.services xos_core
+# Include common functions
+include $(COMMON_DIR)/Makefile
-download_services:
- make -f ../common/Makefile.services
+metronetwork: prereqs config_dirs xos_download cord_services bootstrap dashboard onboarding ecord_services
-update_services:
- make -f ../common/Makefile.services update
-
-update_xos:
- make -f ../common/Makefile.services update_xos
-
-bootstrap:
- @echo "[BOOTSTRAP]"
- sudo rm -f onboarding-docker-compose/docker-compose.yml
- sudo CONFIG_DIR=$(CONFIG_DIR) 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
+dashboard:
$(RUN_TOSCA_BOOTSTRAP) dashboard.yaml
onboarding:
@echo "[ONBOARDING]"
# on-board the metronetwork service
- 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)/metro-net/xos/metronetworkservice-onboard.yaml
- $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/metronetwork
- 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/metronetwork
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
-services:
+ecord_services:
$(RUN_TOSCA) ecord-services.yaml
-containers: prereqs download_xos
- make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
-
-rebuild:
- bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
-
-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 $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
-
-showlogs_bootstrap:
- 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
-
-ps:
- sudo docker-compose ps
-
-enter-ui:
- sudo docker exec -ti metronetwork_xos_ui_1 bash
-
-enter-bootstrap-ui:
- sudo docker exec -ti metronetworkdbs_xos_bootstrap_ui_1 bash
-
-enter-db:
- sudo docker exec -ti metronetworkdbs_xos_db_1 bash
-
-django-restart:
- sudo docker exec metronetwork_xos_ui_1 touch /opt/xos/xos/settings.py
-
clean-config-folder:
- sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
- sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
-
-
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
diff --git a/metronetwork/xos.yaml b/metronetwork/xos.yaml
index cdf38d0..585458c 100644
--- a/metronetwork/xos.yaml
+++ b/metronetwork/xos.yaml
@@ -13,7 +13,7 @@
ui_port: 9999
bootstrap_ui_port: 9998
docker_project_name: metronetwork
- db_container_name: metronetworkdbs_xos_db_1
+ db_container_name: metronetworkbs_xos_db_1
/opt/xos/xos_configuration/xos_common_config:
type: tosca.nodes.XOSVolume
diff --git a/opencloud/Makefile b/opencloud/Makefile
index 03168ed..0424950 100644
--- a/opencloud/Makefile
+++ b/opencloud/Makefile
@@ -1,36 +1,45 @@
-xos:
- sudo docker-compose up -d
- bash ./wait_for_xos.sh
- sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/fixtures.yaml
- sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/opencloud/opencloud.yaml
+# opencloud/Makefile
-containers:
- cd ../../../containers/xos; make devel
- cd ../../../containers/synchronizer; make
+CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+COMMON_DIR := $(abspath ../common )
-stop:
- sudo docker-compose stop
+.DEFAULT_GOAL := xos
-showlogs:
- sudo docker-compose logs
+DOCKER_PROJECT ?= oc
+BOOTSTRAP_PROJECT ?= ocb
-rm: stop
- sudo docker-compose rm
+# Include common functions
+include $(COMMON_DIR)/Makefile
-ps:
- sudo docker-compose ps
+xos: prereqs config_dirs xos_download opencloud_services bootstrap onboarding podconfig
-enter-xos:
- sudo docker exec -it devel_xos_1 bash
+opencloud_services: $(SERVICE_DIR) \
+ $(SERVICE_DIR)/onos-service \
+ $(SERVICE_DIR)/openstack \
+ $(SERVICE_DIR)/vrouter \
+ $(SERVICE_DIR)/vtn
-enter-synchronizer:
- sudo docker exec -it devel_xos_synchronizer_openstack_1 bash
+onboarding: synchronizers.yaml id_rsa id_rsa.pub
+ @echo "[ONBOARDING]"
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
+ sudo cp id_rsa key_import/onos_rsa
+ sudo cp id_rsa.pub key_import/onos_rsa.pub
+ $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
+ $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
+ $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtn
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
-upgrade_pkgs:
- sudo pip install httpie --upgrade
+podconfig: nodes.yaml images.yaml
+ @echo "[PODCONFIG]"
+ $(RUN_TOSCA) $(COMMON_DIR)/tosca/setup.yaml
+ $(RUN_TOSCA) nodes.yaml
+ $(RUN_TOSCA) images.yaml
-rebuild_xos:
- make -C ../../../containers/xos devel
-
-rebuild_synchronizer:
- make -C ../../../containers/synchronizer
diff --git a/opencloud/docker-compose-bootstrap.yml b/opencloud/docker-compose-bootstrap.yml
new file mode 100644
index 0000000..8a4c7b2
--- /dev/null
+++ b/opencloud/docker-compose-bootstrap.yml
@@ -0,0 +1,48 @@
+xos_db:
+ image: xosproject/xos-postgres
+ expose:
+ - "5432"
+
+xos_redis:
+ image: redis
+ log_driver: "json-file"
+ log_opt:
+ max-size: "100k"
+ max-file: "5"
+
+xos_synchronizer_onboarding:
+ image: xosproject/xos-synchronizer-onboarding
+ command: bash -c "cd /opt/xos/synchronizers/onboarding; ./run.sh"
+ #command: sleep 86400
+ labels:
+ org.xosproject.kind: synchronizer
+ org.xosproject.target: onboarding
+ links:
+ - xos_db
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
+ - ./key_import:/opt/xos/key_import:ro
+ - ./onboarding-docker-compose:/opt/xos/synchronizers/onboarding/docker-compose
+ - ../../xos_services:/opt/xos_services
+ log_driver: "json-file"
+ log_opt:
+ max-size: "100k"
+ max-file: "5"
+
+xos_bootstrap_ui:
+ command: python /opt/xos/manage.py runserver 0.0.0.0:81 --insecure --makemigrations
+ environment:
+ - CONFIG_DIR
+ image: xosproject/xos
+ links:
+ - xos_db
+ ports:
+ - "81:81"
+ volumes:
+ - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
+ - ./files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
+ - ../../xos_services:/opt/xos_services
+ log_driver: "json-file"
+ log_opt:
+ max-size: "100k"
+ max-file: "5"
diff --git a/opencloud/files/xos_vtn_config b/opencloud/files/xos_vtn_config
new file mode 100644
index 0000000..5dfd459
--- /dev/null
+++ b/opencloud/files/xos_vtn_config
@@ -0,0 +1,2 @@
+[networking]
+use_vtn=True
diff --git a/opencloud/images/.gitignore b/opencloud/images/.gitignore
new file mode 100644
index 0000000..6949d1f
--- /dev/null
+++ b/opencloud/images/.gitignore
@@ -0,0 +1,3 @@
+*.img
+*.qcow2
+*.qcow
diff --git a/opencloud/images/README.md b/opencloud/images/README.md
new file mode 100644
index 0000000..aca55a9
--- /dev/null
+++ b/opencloud/images/README.md
@@ -0,0 +1,5 @@
+# VM images for XOS
+
+Any Cloud image files placed in this directory (with suffix .img) will be automatically
+imported by XOS and added to Glance (OpenStack's image repository). For instance, the image
+`trusty-server-multi-nic.img` will be imported with name `trusty-server-multi-nic`.
diff --git a/opencloud/cdn-content.yaml b/opencloud/legacy/cdn-content.yaml
similarity index 100%
rename from opencloud/cdn-content.yaml
rename to opencloud/legacy/cdn-content.yaml
diff --git a/opencloud/cdn-opencloud.yaml b/opencloud/legacy/cdn-opencloud.yaml
similarity index 100%
rename from opencloud/cdn-opencloud.yaml
rename to opencloud/legacy/cdn-opencloud.yaml
diff --git a/opencloud/cdn-syndicate-content.yaml b/opencloud/legacy/cdn-syndicate-content.yaml
similarity index 100%
rename from opencloud/cdn-syndicate-content.yaml
rename to opencloud/legacy/cdn-syndicate-content.yaml
diff --git a/opencloud/docker-compose.yml b/opencloud/legacy/docker-compose.yml
similarity index 100%
rename from opencloud/docker-compose.yml
rename to opencloud/legacy/docker-compose.yml
diff --git a/opencloud/opencloud.yaml b/opencloud/legacy/opencloud.yaml
similarity index 100%
rename from opencloud/opencloud.yaml
rename to opencloud/legacy/opencloud.yaml
diff --git a/opencloud/files/xos_opencloud_config b/opencloud/legacy/xos_opencloud_config
similarity index 100%
rename from opencloud/files/xos_opencloud_config
rename to opencloud/legacy/xos_opencloud_config
diff --git a/opencloud/synchronizers.yaml b/opencloud/synchronizers.yaml
new file mode 100644
index 0000000..b75b0e5
--- /dev/null
+++ b/opencloud/synchronizers.yaml
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: This recipe provides additional configuration for the onboarded services.
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+ servicecontroller#openstack:
+ type: tosca.nodes.ServiceController
+ properties:
+ no-create: true
+ synchronizer_config: /root/setup/files/openstack_synchronizer_config
diff --git a/opencloud/wait_for_xos.sh b/opencloud/wait_for_xos.sh
deleted file mode 100644
index 4f486af..0000000
--- a/opencloud/wait_for_xos.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/bash
-echo "Waiting for XOS to come up"
-until http 0.0.0.0:80 &> /dev/null
-do
- sleep 1
- RUNNING_CONTAINER=`sudo docker ps|grep "xos"|awk '{print $$NF}'`
- if [[ $RUNNING_CONTAINER == "" ]]; then
- echo Container may have failed. check with \"make showlogs\'
- exit 1
- fi
-done
-echo "XOS is ready"
diff --git a/opencloud/xos.yaml b/opencloud/xos.yaml
new file mode 100644
index 0000000..6fd072d
--- /dev/null
+++ b/opencloud/xos.yaml
@@ -0,0 +1,57 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: bootstrap XOS for OpenCloud
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+ xos:
+ type: tosca.nodes.XOS
+ properties:
+ ui_port: 80
+ bootstrap_ui_port: 81
+ docker_project_name: oc
+ db_container_name: ocb_xos_db_1
+
+ /opt/xos/xos_configuration/xos_common_config:
+ type: tosca.nodes.XOSVolume
+ properties:
+ host_path: { path_join: [ SELF, CONFIG_DIR, ../common/xos_common_config, ENV_VAR ] }
+ read_only: true
+ requirements:
+ - xos:
+ node: xos
+ relationship: tosca.relationships.UsedByXOS
+
+ /opt/xos/xos_configuration/xos_vtn_config:
+ type: tosca.nodes.XOSVolume
+ properties:
+ host_path: { path_join: [ SELF, CONFIG_DIR, files/xos_vtn_config, ENV_VAR ] }
+ read_only: true
+ requirements:
+ - xos:
+ node: xos
+ relationship: tosca.relationships.UsedByXOS
+
+ /root/setup:
+ type: tosca.nodes.XOSVolume
+ properties:
+ host_path: { path_join: [ SELF, CONFIG_DIR, ., ENV_VAR ] }
+ read_only: true
+ requirements:
+ - xos:
+ node: xos
+ relationship: tosca.relationships.UsedByXOS
+
+ /opt/xos/images:
+ type: tosca.nodes.XOSVolume
+ properties:
+ host_path: { path_join: [ SELF, CONFIG_DIR, images, ENV_VAR ] }
+ read_only: true
+ requirements:
+ - xos:
+ node: xos
+ relationship: tosca.relationships.UsedByXOS
+
diff --git a/test-standalone/Makefile b/test-standalone/Makefile
index ee3a206..0bd2afe 100644
--- a/test-standalone/Makefile
+++ b/test-standalone/Makefile
@@ -1,14 +1,20 @@
-include ../common/Makedefs
+# test-standalone/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=teststandalone
-BOOTSTRAP_PROJECT=teststandalonebs
-XOS_BOOTSTRAP_PORT=9998
-XOS_UI_PORT=9999
-DB_NAME=$(BOOTSTRAP_PROJECT)_xos_db_1
+CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+COMMON_DIR := $(abspath ../common )
+
+.DEFAULT_GOAL := prepare
+
+DOCKER_PROJECT ?= teststandalone
+BOOTSTRAP_PROJECT ?= teststandalonebs
+
+XOS_BOOTSTRAP_PORT ?= 9998
+XOS_UI_PORT ?= 9999
+
+DB_NAME ?= $(BOOTSTRAP_PROJECT)_xos_db_1
+
+# Include common functions
+include $(COMMON_DIR)/Makefile
define TRUNCATE_FN
CREATE OR REPLACE FUNCTION truncate_tables(username IN VARCHAR) RETURNS void AS $$$$
@@ -26,61 +32,41 @@
export TRUNCATE_FN
prepare: xos
- sudo docker exec -i teststandalone_xos_ui_1 bash -c "cd /opt/xos/tests/api; npm install --production"
- sudo docker exec teststandalone_xos_ui_1 pip install dredd_hooks
+ sudo docker exec -i $(DOCKER_PROJECT)_xos_ui_1 bash -c "cd /opt/xos/tests/api; npm install --production"
+ sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 pip install dredd_hooks
-xos: prereqs dirs download_xos download_services bootstrap onboarding
+xos: prereqs config_dirs xos_download cord_services test_bootstrap onboarding
-prereqs:
- sudo make -f ../common/Makefile.prereqs
-
-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
-
-bootstrap:
- @echo "[BOOTSTRAP]"
+test_bootstrap:
+ @echo "[TEST_BOOTSTRAP]"
sudo rm -f onboarding-docker-compose/docker-compose.yml
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
- bash ../common/wait_for_xos_port.sh 9998
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run -e CONFIG_DIR=$(CONFIG_DIR) xos_bootstrap_ui python /opt/xos/tosca/run.py none - < xos.yaml
-download_xos:
- make -f ../common/Makefile.services xos_core
-
-download_services:
- make -f ../common/Makefile.services
-
-update_services:
- make -f ../common/Makefile.services update
-
-update_xos:
- make -f ../common/Makefile.services update_xos
-
onboarding:
@echo "[ONBOARDING]"
- bash ../common/wait_for_onboarding_ready.sh 9998 xos
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
bash -c "echo somekey > key_import/vsg_rsa"
bash -c "echo somekey > key_import/vsg_rsa.pub"
bash -c "echo somekey > key_import/volt_rsa"
bash -c "echo somekey > key_import/volt_rsa.pub"
bash -c "echo somekey > key_import/onos_rsa"
bash -c "echo somekey > key_import/onos_rsa.pub"
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < ../common/disable-onboarding.yaml
+ sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(COMMON_DIR)/tosca/disable-onboarding.yaml
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < ../common/enable-onboarding.yaml
- bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter
- bash ../common/wait_for_onboarding_ready.sh 9998 services/volt
- bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg
- bash ../common/wait_for_onboarding_ready.sh 9998 services/vtr
- bash ../common/wait_for_onboarding_ready.sh 9998 services/onos
- bash ../common/wait_for_onboarding_ready.sh 9998 xos
- bash ../common/wait_for_xos_port.sh 9999
+ sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None - < $(COMMON_DIR)/tosca/enable-onboarding.yaml
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/volt
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vsg
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtr
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
+ bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
+ bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
restore-initial-db-status:
sudo docker exec $(DB_NAME) psql -U postgres -d xos -c "$$TRUNCATE_FN" >/dev/null 2>&1
@@ -90,62 +76,24 @@
sudo docker exec $(DB_NAME) psql -U postgres -d xos -c "SELECT setval('core_flavor_id_seq', 1)" >/dev/null 2>&1
sudo docker exec $(DB_NAME) psql -U postgres -d xos -c "SELECT setval('core_service_id_seq', 1)" >/dev/null 2>&1
sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/manage.py --noobserver loaddata /opt/xos/core/fixtures/core_initial_data.json
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org - < ../frontend/sample.yaml
-
- # sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord-pod/setup.yaml
- # sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord-pod/nodes.yaml
- # sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord-pod/images.yaml
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org - < ../cord-pod/mgmt-net.yaml
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org - < services.yaml
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org - < ../cord-pod/cord-volt-devices.yaml
-
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none - < $(COMMON_DIR)/tosca/fixtures.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none - < $(COMMON_DIR)/tosca/mydeployment.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py $(ADMIN_USERNAME) - < ../frontend/sample.yaml
+ # sudo docker-compose run xos python /opt/xos/tosca/run.py $(ADMIN_USERNAME) /opt/xos/configurations/cord-pod/setup.yaml
+ # sudo docker-compose run xos python /opt/xos/tosca/run.py $(ADMIN_USERNAME) /opt/xos/configurations/cord-pod/nodes.yaml
+ # sudo docker-compose run xos python /opt/xos/tosca/run.py $(ADMIN_USERNAME) /opt/xos/configurations/cord-pod/images.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py $(ADMIN_USERNAME) - < $(COMMON_DIR)/tosca/mgmt-net.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py $(ADMIN_USERNAME) - < services.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py $(ADMIN_USERNAME) - < $(COMMON_DIR)/tosca/cord-volt-devices.yaml
test: restore-initial-db-status
# RUN TESTS
- sudo docker cp $(XOS_DIR)/apiary.apib teststandalone_xos_ui_1:/opt/xos/tests/api/apiary.apib
- sudo docker exec -i teststandalone_xos_ui_1 bash -c "cd /opt/xos/tests/api; npm test"
+ sudo docker cp $(XOS_DIR)/apiary.apib $(DOCKER_PROJECT)_xos_ui_1:/opt/xos/tests/api/apiary.apib
+ sudo docker exec -i $(DOCKER_PROJECT)_xos_ui_1 bash -c "cd /opt/xos/tests/api; npm test"
test-tosca: restore-initial-db-status
sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui bash -c "cd /opt/xos/tosca/tests; python ./alltests.py"
test-ui: restore-initial-db-status
- sudo docker exec -u root -i teststandalone_xos_1 bash -c "cd /opt/xos/tests/ui-e2e; python xos-e2e-test.py"
+ sudo docker exec -u root -i $(DOCKER_PROJECT)_xos_1 bash -c "cd /opt/xos/tests/ui-e2e; python xos-e2e-test.py"
-base-container:
- make -f ../common/Makefile.containers xos_base
-
-devel-container: base-container
- make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
-
-containers: prereqs download_xos devel-container
- make -f ../common/Makefile.containers xos_test
-
-rebuild:
- bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
- bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
-
-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 $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
-
-showlogs_bootstrap:
- 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
-
-docker-clean:
- sudo docker rm -f $(shell sudo docker ps -aq)
-
-enter-xos:
- sudo docker exec -ti teststandalone_xos_ui_1 bash
-
-enter-xos-db:
- sudo docker exec -ti $(DB_NAME) bash