Merge "Fixed path to shared static folders"
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..275d16f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+## Service Profiles
+
+This repository contains service profiles. Each service profile specifies a graph of services that will be instantiated.
+
+Notable service profiles include:
+
+* `cord-pod`: Standard R-CORD service stack, for both single-node-pod and multiple node pod installs.
+* `frontend`: Designed for frontend development, this profile starts XOS, but does not start any synchronizers other than the onboarding synchronizer.
+* `test-standalone`: Runs a test suite that tests the REST API and Tosca API.
+
+The directory `common` is not a service profile, but contains various common files and tools that are used by the other service profiles.
diff --git a/common/rebuild.sh b/common/rebuild.sh
new file mode 100755
index 0000000..dbca3c8
--- /dev/null
+++ b/common/rebuild.sh
@@ -0,0 +1,21 @@
+#! /bin/bash
+
+display_usage() {
+ echo -e "\nUsage:\n$0 [xos-listen-port] \n"
+}
+
+if [ $# -lt 1 ]
+then
+ display_usage
+ exit 1
+fi
+
+echo "Sending rebuild request to XOS"
+STATUS=`curl -X POST 0.0.0.0:$1/api/utility/onboarding/xos/rebuild/ 2> /dev/null`
+if [[ "$STATUS" != "true" ]]; then
+ echo "Rebuild request failed"
+ exit -1
+fi
+
+echo "Rebuild request accepted"
+
diff --git a/cord-pod/Makefile b/cord-pod/Makefile
index cea341e..fce354b 100644
--- a/cord-pod/Makefile
+++ b/cord-pod/Makefile
@@ -41,6 +41,9 @@
update_services:
make -f ../common/Makefile.services update
+update_xos:
+ make -f ../common/Makefile.services update_xos
+
onboarding:
echo "[ONBOARDING]"
# on-board any services here
@@ -85,9 +88,12 @@
cord: vsg_custom_images
$(RUN_TOSCA) mgmt-net.yaml
- $(RUN_TOSCA) cord-vtn-vsg.yaml
+ $(RUN_TOSCA) cord-services.yaml
$(RUN_TOSCA) cord-volt-devices.yaml
+cord-subscriber:
+ $(RUN_TOSCA) cord-test-subscriber.yaml
+
clean-nodes:
rm -f nodes.yaml
@@ -96,6 +102,10 @@
new-nodes: clean-nodes update-nodes vtn
+rebuild:
+ bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
+ bash ../common/wait_for_onboarding_ready.sh 81 xos
+
exampleservice: onboard-exampleservice
$(RUN_TOSCA) pod-exampleservice.yaml
@@ -114,6 +124,7 @@
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
@@ -143,12 +154,15 @@
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:
- test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm
+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 MYIP=$(MYIP) docker-compose logs
+ 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
@@ -172,5 +186,5 @@
.PHONY: local_containers
local_containers: prereqs download_xos
- make -f ../common/Makefile.containers update_certs xos_devel synchronizer onboarding_synchronizer
+ make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
diff --git a/cord-pod/cord-fabric-vr.json b/cord-pod/base-config-2x2
similarity index 61%
rename from cord-pod/cord-fabric-vr.json
rename to cord-pod/base-config-2x2
index 7420cb9..bc6c95b 100644
--- a/cord-pod/cord-fabric-vr.json
+++ b/cord-pod/base-config-2x2
@@ -1,27 +1,20 @@
{
"ports" : {
- "of:0000000000000001/5" : {
+ "of:0000cc37ab6180ca/5" : {
"interfaces" : [
{
- "ips" : [ "10.0.1.254/24" ]
+ "ips" : [ "10.6.1.254/24" ]
}
]
},
- "of:0000000000000001/7" : {
+ "of:0000cc37ab6182d2/5" : {
"interfaces" : [
{
- "ips" : [ "10.0.1.254/24" ]
+ "ips" : [ "10.6.2.254/24" ]
}
]
},
- "of:0000000000000002/5" : {
- "interfaces" : [
- {
- "ips" : [ "10.0.2.254/24" ]
- }
- ]
- },
- "of:0000000000000002/32" : {
+ "of:0000cc37ab6182d2/32" : {
"interfaces" : [
{
"name" : "internet-router",
@@ -40,71 +33,70 @@
}
},
"devices" : {
- "of:0000000000000001" : {
+ "of:0000cc37ab6180ca" : {
"segmentrouting" : {
"name" : "Leaf-R1",
"nodeSid" : 101,
- "routerIp" : "10.0.1.254",
+ "routerIp" : "10.6.0.8",
"routerMac" : "00:00:00:00:01:80",
"isEdgeRouter" : true,
"adjacencySids" : []
}
},
- "of:0000000000000002" : {
+ "of:0000cc37ab6182d2" : {
"segmentrouting" : {
"name" : "Leaf-R2",
"nodeSid" : 102,
- "routerIp" : "10.0.2.254",
+ "routerIp" : "10.6.0.11",
"routerMac" : "00:00:00:00:02:80",
"isEdgeRouter" : true,
"adjacencySids" : []
}
},
- "of:0000000000000191" : {
+ "of:0000cc37ab618048" : {
"segmentrouting" : {
"name" : "Spine-R1",
"nodeSid" : 103,
- "routerIp" : "192.168.0.11",
+ "routerIp" : "10.6.0.18",
"routerMac" : "00:00:01:00:11:80",
"isEdgeRouter" : false,
"adjacencySids" : []
}
},
- "of:0000000000000192" : {
+ "of:0000cc37ab617ec2" : {
"segmentrouting" : {
"name" : "Spine-R2",
"nodeSid" : 104,
- "routerIp" : "192.168.0.22",
+ "routerIp" : "10.6.0.17",
"routerMac" : "00:00:01:00:22:80",
"isEdgeRouter" : false,
"adjacencySids" : []
}
}
},
- "hosts" : {},
"links" : {
- "of:0000000000000001/1-of:0000000000000191/1" : {
+ "of:0000cc37ab6180ca/1-of:0000cc37ab618048/1" : {
"basic" : {}
},
- "of:0000000000000001/3-of:0000000000000192/1" : {
+ "of:0000cc37ab6180ca/3-of:0000cc37ab617ec2/1" : {
"basic" : {}
},
- "of:0000000000000002/1-of:0000000000000191/3" : {
+ "of:0000cc37ab6182d2/1-of:0000cc37ab618048/3" : {
"basic" : {}
},
- "of:0000000000000002/3-of:0000000000000192/3" : {
+ "of:0000cc37ab6182d2/3-of:0000cc37ab617ec2/3" : {
"basic" : {}
},
- "of:0000000000000191/1-of:0000000000000001/1" : {
+ "of:0000cc37ab618048/1-of:0000cc37ab6180ca/1" : {
"basic" : {}
},
- "of:0000000000000192/1-of:0000000000000001/3" : {
+ "of:0000cc37ab617ec2/1-of:0000cc37ab6180ca/3" : {
"basic" : {}
},
- "of:0000000000000191/3-of:0000000000000002/1" : {
+ "of:0000cc37ab618048/3-of:0000cc37ab6182d2/1" : {
"basic" : {}
},
- "of:0000000000000192/3-of:0000000000000002/3" : {
+ "of:0000cc37ab617ec2/3-of:0000cc37ab6182d2/3" : {
"basic" : {}
}
},
@@ -123,35 +115,21 @@
"vRouterMacs" : [
"a4:23:05:34:56:78", "a4:23:05:34:56:79"
],
- "vRouterId" : "of:0000000000000002",
+ "vRouterId" : "of:0000cc37ab6182d2",
"suppressSubnet" : [
- "of:0000000000000002/31", "of:0000000000000002/32"
+ "of:0000cc37ab6182d2/31", "of:0000cc37ab6182d2/32"
],
"suppressHostByProvider" : [
"org.onosproject.provider.host"
],
"suppressHostByPort" : [
- "of:0000000000000002/31", "of:0000000000000002/32"
- ]
- },
- "xconnect": {
- "of:0000000000000001": [
- {
- "vlan": 10,
- "ports": [5, 73],
- "name": "OLT1"
- },
- {
- "vlan": 20,
- "ports": [5, 89],
- "name": "OLT2"
- }
+ "of:0000cc37ab6182d2/31", "of:0000cc37ab6182d2/32"
]
}
},
"org.onosproject.router" : {
"router" : {
- "controlPlaneConnectPoint" : "of:0000000000000002/31",
+ "controlPlaneConnectPoint" : "of:0000cc37ab6182d2/31",
"ospfEnabled" : "true",
"pimEnabled" : "true",
"interfaces" : [ "internet-router" ]
diff --git a/cord-pod/cord-vtn-vsg.yaml b/cord-pod/cord-services.yaml
similarity index 67%
rename from cord-pod/cord-vtn-vsg.yaml
rename to cord-pod/cord-services.yaml
index 8bfacce..66b69ff 100644
--- a/cord-pod/cord-vtn-vsg.yaml
+++ b/cord-pod/cord-services.yaml
@@ -170,89 +170,3 @@
- image:
node: image#vsg-1.0
relationship: tosca.relationships.DefaultImage
-
- # Let's add a user who can be administrator of the household
- johndoe@myhouse.com:
- type: tosca.nodes.User
- properties:
- password: letmein
- firstname: john
- lastname: doe
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
- - dependency:
- node: mysite_vsg
- relationship: tosca.relationships.DependsOn
-
- # A subscriber
- My House:
- type: tosca.nodes.CORDSubscriber
- properties:
- service_specific_id: 123
- firewall_enable: false
- cdn_enable: false
- url_filter_enable: false
- url_filter_level: R
- requirements:
- - house_admin:
- node: johndoe@myhouse.com
- relationship: tosca.relationships.AdminPrivilege
-
- Mom's PC:
- type: tosca.nodes.CORDUser
- properties:
- mac: 01:02:03:04:05:06
- level: PG_13
- requirements:
- - household:
- node: My House
- relationship: tosca.relationships.SubscriberDevice
-
- Dad's PC:
- type: tosca.nodes.CORDUser
- properties:
- mac: 90:E2:BA:82:F9:75
- level: PG_13
- requirements:
- - household:
- node: My House
- relationship: tosca.relationships.SubscriberDevice
-
- Jack's Laptop:
- type: tosca.nodes.CORDUser
- properties:
- mac: 68:5B:35:9D:91:D5
- level: PG_13
- requirements:
- - household:
- node: My House
- relationship: tosca.relationships.SubscriberDevice
-
- Jill's Laptop:
- type: tosca.nodes.CORDUser
- properties:
- mac: 34:36:3B:C9:B6:A6
- level: PG_13
- requirements:
- - household:
- node: My House
- relationship: tosca.relationships.SubscriberDevice
-
- My Volt:
- type: tosca.nodes.VOLTTenant
- properties:
- service_specific_id: 123
- s_tag: 222
- c_tag: 111
- requirements:
- - provider_service:
- node: service#volt
- relationship: tosca.relationships.MemberOfService
- - subscriber:
- node: My House
- relationship: tosca.relationships.BelongsToSubscriber
- - dependency:
- node: mysite_vsg
- relationship: tosca.relationships.DependsOn
diff --git a/cord-pod/cord-test-subscriber.yaml b/cord-pod/cord-test-subscriber.yaml
new file mode 100644
index 0000000..29a5d87
--- /dev/null
+++ b/cord-pod/cord-test-subscriber.yaml
@@ -0,0 +1,117 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Just enough Tosca to get the vSG slice running on the CORD POD
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+
+ service#volt:
+ type: tosca.nodes.VOLTService
+ properties:
+ no-delete: true
+ no-create: true
+ no-update: true
+
+ mysite:
+ type: tosca.nodes.Site
+ properties:
+ no-delete: true
+ no-create: true
+ no-update: true
+
+ # CORD Slices
+ mysite_vsg:
+ type: tosca.nodes.Slice
+ properties:
+ no-delete: true
+ no-create: true
+ no-update: true
+
+ # Let's add a user who can be administrator of the household
+ johndoe@myhouse.com:
+ type: tosca.nodes.User
+ properties:
+ password: letmein
+ firstname: john
+ lastname: doe
+ requirements:
+ - site:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+ - dependency:
+ node: mysite_vsg
+ relationship: tosca.relationships.DependsOn
+
+ # A subscriber
+ My House:
+ type: tosca.nodes.CORDSubscriber
+ properties:
+ service_specific_id: 123
+ firewall_enable: false
+ cdn_enable: false
+ url_filter_enable: false
+ url_filter_level: R
+ requirements:
+ - house_admin:
+ node: johndoe@myhouse.com
+ relationship: tosca.relationships.AdminPrivilege
+
+ Mom's PC:
+ type: tosca.nodes.CORDUser
+ properties:
+ mac: 01:02:03:04:05:06
+ level: PG_13
+ requirements:
+ - household:
+ node: My House
+ relationship: tosca.relationships.SubscriberDevice
+
+ Dad's PC:
+ type: tosca.nodes.CORDUser
+ properties:
+ mac: 90:E2:BA:82:F9:75
+ level: PG_13
+ requirements:
+ - household:
+ node: My House
+ relationship: tosca.relationships.SubscriberDevice
+
+ Jack's Laptop:
+ type: tosca.nodes.CORDUser
+ properties:
+ mac: 68:5B:35:9D:91:D5
+ level: PG_13
+ requirements:
+ - household:
+ node: My House
+ relationship: tosca.relationships.SubscriberDevice
+
+ Jill's Laptop:
+ type: tosca.nodes.CORDUser
+ properties:
+ mac: 34:36:3B:C9:B6:A6
+ level: PG_13
+ requirements:
+ - household:
+ node: My House
+ relationship: tosca.relationships.SubscriberDevice
+
+ My Volt:
+ type: tosca.nodes.VOLTTenant
+ properties:
+ service_specific_id: 123
+ s_tag: 222
+ c_tag: 111
+ requirements:
+ - provider_service:
+ node: service#volt
+ relationship: tosca.relationships.MemberOfService
+ - subscriber:
+ node: My House
+ relationship: tosca.relationships.BelongsToSubscriber
+ - dependency:
+ node: mysite_vsg
+ relationship: tosca.relationships.DependsOn
diff --git a/cord-pod/files/monitoring_channel_synchronizer_config b/cord-pod/files/monitoring_synchronizer_config
similarity index 68%
rename from cord-pod/files/monitoring_channel_synchronizer_config
rename to cord-pod/files/monitoring_synchronizer_config
index fb3f22a..1ee96f0 100644
--- a/cord-pod/files/monitoring_channel_synchronizer_config
+++ b/cord-pod/files/monitoring_synchronizer_config
@@ -22,11 +22,11 @@
nova_enabled=True
[observer]
-name=monitoring_channel
-dependency_graph=/opt/xos/synchronizers/monitoring_channel/model-deps
-steps_dir=/opt/xos/synchronizers/monitoring_channel/steps
-sys_dir=/opt/xos/synchronizers/monitoring_channel/sys
-deleters_dir=/opt/xos/synchronizers/monitoring_channel/deleters
+name=monitoring_service
+dependency_graph=/opt/xos/synchronizers/monitoring/model-deps
+steps_dir=/opt/xos/synchronizers/monitoring/steps
+sys_dir=/opt/xos/synchronizers/monitoring/sys
+deleters_dir=/opt/xos/synchronizers/monitoring/deleters
log_file=console
driver=None
pretend=False
diff --git a/cord-pod/make-fabric-yaml.sh b/cord-pod/make-fabric-yaml.sh
index c65156b..7c4cfd7 100644
--- a/cord-pod/make-fabric-yaml.sh
+++ b/cord-pod/make-fabric-yaml.sh
@@ -24,7 +24,7 @@
replaces: service_ONOS_Fabric
rest_onos/v1/network/configuration/: { get_artifact: [ SELF, fabric_network_cfg_json, LOCAL_FILE ] }
artifacts:
- fabric_network_cfg_json: /root/setup/cord-fabric-vr.json
+ fabric_network_cfg_json: /root/setup/base-config-2x2
service#fabric:
type: tosca.nodes.FabricService
diff --git a/cord-pod/monitoring_synchronizer.yaml b/cord-pod/monitoring_synchronizer.yaml
new file mode 100644
index 0000000..5b248a9
--- /dev/null
+++ b/cord-pod/monitoring_synchronizer.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#monitoring:
+ type: tosca.nodes.ServiceController
+ properties:
+ no-create: true
+ synchronizer_config: /root/setup/files/monitoring_synchronizer_config
diff --git a/frontend/Makefile b/frontend/Makefile
index bac183a..1409530 100644
--- a/frontend/Makefile
+++ b/frontend/Makefile
@@ -32,6 +32,9 @@
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
@@ -54,16 +57,23 @@
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
- sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm
+ 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
@@ -80,7 +90,8 @@
mock-cord-pod: onboard-cord-pod
$(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
- $(RUN_TOSCA) ../cord-pod/cord-vtn-vsg.yaml
+ $(RUN_TOSCA) ../cord-pod/cord-services.yaml
+ $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
$(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
onboard-cord-pod:
@@ -111,5 +122,5 @@
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 9998 services/exampleservice
- bash ../common/wait_for_onboarding_ready.sh 9998 xos
+ bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
+ bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
diff --git a/test-standalone/Makefile b/test-standalone/Makefile
index 42e21f7..44a5363 100644
--- a/test-standalone/Makefile
+++ b/test-standalone/Makefile
@@ -55,6 +55,9 @@
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
@@ -119,12 +122,19 @@
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 logs
+ 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