Merge branch 'master' of github.com:open-cloud/xos
diff --git a/containers/README.md b/containers/README.md
index 0bdc74b..fb53887 100644
--- a/containers/README.md
+++ b/containers/README.md
@@ -73,5 +73,5 @@
using a single command. To start the instance you can use the command:
```
-$ docker-compose -f xos-compose.yml up -d
+$ docker-compose up -d
```
diff --git a/containers/xos-compose.yml b/containers/docker-compose.yml
similarity index 100%
rename from containers/xos-compose.yml
rename to containers/docker-compose.yml
diff --git a/containers/xos/Dockerfile b/containers/xos/Dockerfile
index 639cbd5..46e88b3 100644
--- a/containers/xos/Dockerfile
+++ b/containers/xos/Dockerfile
@@ -29,7 +29,7 @@
python-setuptools \
tar \
wget \
-##### observer dependencies
+##### observer dependencies
python-keystoneclient \
python-novaclient \
python-neutronclient \
@@ -50,11 +50,11 @@
django-timezones \
djangorestframework==2.4.4 \
dnslib \
- lxml \
+ lxml \
markdown \
netaddr \
pyOpenSSL \
- psycopg2 \
+ psycopg2 \
python-ceilometerclient \
python-dateutil \
python-keyczar \
@@ -66,7 +66,6 @@
RUN easy_install --upgrade httplib2
RUN easy_install \
- django_evolution \
python_gflags \
google_api_python_client \
httplib2.ca_certs_locater
diff --git a/xos/configurations/bash/Dockerfile.bash b/xos/configurations/bash/Dockerfile.bash
index a9c224d..fc7177b 100644
--- a/xos/configurations/bash/Dockerfile.bash
+++ b/xos/configurations/bash/Dockerfile.bash
@@ -2,7 +2,7 @@
ADD xos/configurations/common/admin-openrc.sh /root/setup/
ADD xos/configurations/common/controller_settings /root/setup/
ADD xos/configurations/common/flat_net_name /root/setup/
-ADD xos/configurations/common/cloudlab-nodes.yaml /opt/xos/configurations/commmon/
+ADD xos/configurations/common/nodes.yaml /opt/xos/configurations/commmon/
ADD xos/configurations/common/id_rsa.pub /root/setup/padmin_public_key
ADD xos/configurations/common/node_key.pub /root/setup/node_key.pub
ADD xos/configurations/common/node_key /root/setup/node_key
diff --git a/xos/configurations/bash/Makefile.inside b/xos/configurations/bash/Makefile.inside
index 176ef47..4ec8328 100644
--- a/xos/configurations/bash/Makefile.inside
+++ b/xos/configurations/bash/Makefile.inside
@@ -3,5 +3,5 @@
setup_xos:
bash /opt/xos/scripts/docker_setup_xos
python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/fixtures.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab-nodes.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/base.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/nodes.yaml
diff --git a/xos/configurations/common/Makefile.cloudlab b/xos/configurations/common/Makefile.cloudlab
index 6e609d7..af2ec58 100644
--- a/xos/configurations/common/Makefile.cloudlab
+++ b/xos/configurations/common/Makefile.cloudlab
@@ -16,7 +16,7 @@
[ -s flat_net_name ] # throw error if flat_net_name is empty
nodes_yaml:
- bash ./make-cloudlab-nodes-yaml.sh
+ bash ./make-nodes-yaml.sh
ceilometer_url:
echo http://`hostname -i`/xosmetering/ > ceilometer_url
diff --git a/xos/configurations/common/Makefile.devstack b/xos/configurations/common/Makefile.devstack
index 2f31696..f969b3d 100644
--- a/xos/configurations/common/Makefile.devstack
+++ b/xos/configurations/common/Makefile.devstack
@@ -1,10 +1,11 @@
# This shouldn't be hardcoded
DEVSTACK_ROOT:=~/devstack
-all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key
+all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key net_fix
prereqs:
make -f Makefile.prereqs
+ sudo pip install httpie --upgrade
admin-openrc:
bash ./devstack-creds.sh $(DEVSTACK_ROOT) > admin-openrc.sh
@@ -15,7 +16,7 @@
bash -c "source admin-openrc.sh; openstack network set --share private"
nodes_yaml:
- bash ./make-cloudlab-nodes-yaml.sh
+ bash ./make-nodes-yaml.sh
ceilometer_url:
echo http://`hostname -i`/xosmetering/ > ceilometer_url
@@ -32,3 +33,7 @@
node_key:
sudo cat ~/.ssh/id_rsa > node_key
sudo cat ~/.ssh/id_rsa.pub > node_key.pub
+
+net_fix:
+ sudo devstack/net-fix.sh
+ bash -c "source admin-openrc.sh; neutron subnet-update private-subnet --dns-nameservers list=true 8.8.8.8 8.8.4.4"
diff --git a/xos/configurations/common/Makefile.opencloud b/xos/configurations/common/Makefile.opencloud
new file mode 100644
index 0000000..8bc5b93
--- /dev/null
+++ b/xos/configurations/common/Makefile.opencloud
@@ -0,0 +1,36 @@
+MYFLATLANIP:=$(shell hostname -i)
+
+all: prereqs admin-openrc flat_name nodes_yaml public_key private_key ceilometer_url node_key images
+
+prereqs:
+ make -f Makefile.prereqs
+
+admin-openrc:
+ sudo cat /root/setup/admin-openrc.sh > admin-openrc.sh
+ sudo cat /root/setup/settings > controller_settings
+ echo 'CONTROLLER_FLAT_LAN_IP=$(MYFLATLANIP)' >> controller_settings
+
+flat_name:
+ echo nat-net|tr -d '\n' > flat_net_name
+
+nodes_yaml:
+ bash ./make-nodes-yaml.sh
+
+ceilometer_url:
+ echo http://`hostname -i`/xosmetering/ > ceilometer_url
+
+public_key: ~/.ssh/id_rsa.pub
+ cp ~/.ssh/id_rsa.pub .
+
+private_key: ~/.ssh/id_rsa
+ cp ~/.ssh/id_rsa .
+
+~/.ssh/id_rsa.pub:
+ cat /dev/zero | ssh-keygen -q -N ""
+
+node_key:
+ sudo cat /root/setup/id_rsa > node_key
+ sudo cat /root/setup/id_rsa.pub > node_key.pub
+
+images:
+ source admin-openrc.sh; glance image-show trusty-server-multi-nic || glance image-create --name trusty-server-multi-nic --disk-format qcow2 --file /proj/xos-PG0/acb/images/trusty-server-multi-nic.img --container-format bare
diff --git a/xos/configurations/common/cloudlab.yaml b/xos/configurations/common/base.yaml
similarity index 97%
rename from xos/configurations/common/cloudlab.yaml
rename to xos/configurations/common/base.yaml
index a0beeeb..6b6ae34 100644
--- a/xos/configurations/common/cloudlab.yaml
+++ b/xos/configurations/common/base.yaml
@@ -29,7 +29,7 @@
node: trusty-server-multi-nic
relationship: tosca.relationships.SupportsImage
- CloudLab:
+ Backend:
type: tosca.nodes.Controller
requirements:
- deployment:
@@ -37,7 +37,7 @@
relationship: tosca.relationships.ControllerDeployment
properties:
backend_type: OpenStack
- version: Juno
+ version: Kilo
auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
@@ -61,7 +61,7 @@
relationship: tosca.relationships.SiteDeployment
requirements:
- controller:
- node: CloudLab
+ node: Backend
relationship: tosca.relationships.UsesController
Public shared IPv4:
diff --git a/xos/configurations/common/devstack.yaml b/xos/configurations/common/devstack.yaml
deleted file mode 100644
index cd17b1c..0000000
--- a/xos/configurations/common/devstack.yaml
+++ /dev/null
@@ -1,87 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-# Note:
-# assumes the following have been created and filled with appropriate data:
-# /root/setup/admin_openrc
-# /root/setup/flat_net_name
-# /root/setup/padmin_public_key
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
- cirros-0.3.4-x86_64-uec:
- type: tosca.nodes.Image
- properties:
- disk_format: RAW
- container_format: BARE
-
- MyDeployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
- requirements:
- - image:
- node: cirros-0.3.4-x86_64-uec
- relationship: tosca.relationships.SupportsImage
-
- CloudLab:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Kilo
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- rabbit_user: { get_script_env: [ SELF, controller_settings, RABBIT_USER, LOCAL_FILE] }
- rabbit_password: { get_script_env: [ SELF, controller_settings, RABBIT_PASS, LOCAL_FILE] }
- rabbit_host: { get_script_env: [ SELF, controller_settings, CONTROLLER_IP, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
- controller_settings: /root/setup/controller_settings
-
- mysite:
- type: tosca.nodes.Site
- properties:
- display_name: MySite
- site_url: http://opencloud.us/
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: CloudLab
- relationship: tosca.relationships.UsesController
-
- Public shared IPv4:
- type: tosca.nodes.NetworkTemplate
- properties:
- visibility: private
- translation: NAT
- shared_network_name: private
-
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
- properties:
- public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE ] }
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- artifacts:
- pubkey: /root/setup/padmin_public_key
diff --git a/xos/configurations/devstack/local.conf b/xos/configurations/common/devstack/local.conf
similarity index 100%
rename from xos/configurations/devstack/local.conf
rename to xos/configurations/common/devstack/local.conf
diff --git a/xos/configurations/devstack/net-fix.sh b/xos/configurations/common/devstack/net-fix.sh
similarity index 100%
rename from xos/configurations/devstack/net-fix.sh
rename to xos/configurations/common/devstack/net-fix.sh
diff --git a/xos/configurations/common/make-cloudlab-nodes-yaml.sh b/xos/configurations/common/make-nodes-yaml.sh
similarity index 84%
rename from xos/configurations/common/make-cloudlab-nodes-yaml.sh
rename to xos/configurations/common/make-nodes-yaml.sh
index f2555a4..eafab4a 100644
--- a/xos/configurations/common/make-cloudlab-nodes-yaml.sh
+++ b/xos/configurations/common/make-nodes-yaml.sh
@@ -1,5 +1,4 @@
-#FN=/opt/xos/configurations/common/cloudlab-nodes.yaml
-FN=cloudlab-nodes.yaml
+FN=nodes.yaml
rm -f $FN
@@ -9,7 +8,7 @@
imports:
- custom_types/xos.yaml
-description: autogenerated cloudlab nodes file
+description: autogenerated nodes file
topology_template:
node_templates:
diff --git a/xos/configurations/cord/Dockerfile.cord b/xos/configurations/cord/Dockerfile.cord
index a436871..9fde1b0 100644
--- a/xos/configurations/cord/Dockerfile.cord
+++ b/xos/configurations/cord/Dockerfile.cord
@@ -2,7 +2,7 @@
ADD xos/configurations/common/admin-openrc.sh /root/setup/
ADD xos/configurations/common/controller_settings /root/setup/
ADD xos/configurations/common/flat_net_name /root/setup/
-ADD xos/configurations/common/cloudlab-nodes.yaml /opt/xos/configurations/commmon/
+ADD xos/configurations/common/nodes.yaml /opt/xos/configurations/commmon/
ADD xos/configurations/common/id_rsa.pub /root/setup/padmin_public_key
ADD xos/configurations/common/id_rsa.pub /opt/xos/observers/vcpe/vcpe_public_key
ADD xos/configurations/common/id_rsa /opt/xos/observers/vcpe/vcpe_private_key
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord/Makefile
index 9c11927..755f704 100644
--- a/xos/configurations/cord/Makefile
+++ b/xos/configurations/cord/Makefile
@@ -16,7 +16,7 @@
make -C ../common -f Makefile.cloudlab
ceilometer_dashboard:
- #NOTE: The below dashboard install scripts assume
+ #NOTE: The below dashboard install scripts assume
#clouldlab openstack environment created using "OpenStack" profile
#bash install_xos_ceilometer_dashboard.sh
bash install_ceilometer_patch.sh
@@ -55,7 +55,7 @@
# reboot the vBNG ONOS
cd dataplane; ansible -i hosts onos_vbng -m shell -s -a "docker restart ONOS"
-cleanup: stop
+cleanup:
cd dataplane; ./cleanup.sh
bash -c "source ../common/admin-openrc.sh; nova list --all-tenants; neutron net-list"
echo "Don't forget to clean up containers"
diff --git a/xos/configurations/cord/Makefile.inside b/xos/configurations/cord/Makefile.inside
index b8e23f8..1b4fb97 100644
--- a/xos/configurations/cord/Makefile.inside
+++ b/xos/configurations/cord/Makefile.inside
@@ -3,8 +3,8 @@
setup_xos:
bash /opt/xos/scripts/docker_setup_xos
python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/fixtures.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab-nodes.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/base.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/nodes.yaml
python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord/cord.yaml
python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/cord/ceilometer.yaml
diff --git a/xos/configurations/cord/README-VTN.md b/xos/configurations/cord/README-VTN.md
index c923dbb..2b7d5e1 100644
--- a/xos/configurations/cord/README-VTN.md
+++ b/xos/configurations/cord/README-VTN.md
@@ -44,7 +44,7 @@
service openvswitch-switch restart
ovs-vsctl del-br br-int
-VTN doesn't seem to like cloudlab's networks (flat-net-1, ext-net, etc). You might have to delete them all.
+VTN doesn't seem to like cloudlab's networks (flat-net-1, ext-net, etc). You might have to delete them all. I've placed a script in xos/scripts/ called destroy-all-networks.sh that will automate tearing down all of cloudlab's neutron networks.
For development, I suggest using the bash configuration (remember to start the ONOS observer manually) so that
there aren't a bunch of preexisting Neutron networks and nova instances to get in the way.
diff --git a/xos/configurations/cord/make-virtualbng-json.sh b/xos/configurations/cord/make-virtualbng-json.sh
index 0e1d350..2d6501d 100644
--- a/xos/configurations/cord/make-virtualbng-json.sh
+++ b/xos/configurations/cord/make-virtualbng-json.sh
@@ -1,4 +1,3 @@
-#FN=/opt/xos/configurations/common/cloudlab-nodes.yaml
FN=virtualbng.json
rm -f $FN
@@ -15,7 +14,7 @@
"hosts" : {
EOF
-NODES=$( sudo bash -c "source /root/setup/admin-openrc.sh ; nova hypervisor-list" |grep cloudlab|awk '{print $4}' )
+NODES=$( sudo bash -c "source /root/setup/admin-openrc.sh ; nova hypervisor-list" |grep enabled|awk '{print $4}' )
NODECOUNT=0
for NODE in $NODES; do
diff --git a/xos/configurations/devel/Dockerfile.devel b/xos/configurations/devel/Dockerfile.devel
index 60c0143..85b661d 100644
--- a/xos/configurations/devel/Dockerfile.devel
+++ b/xos/configurations/devel/Dockerfile.devel
@@ -2,7 +2,7 @@
ADD xos/configurations/common/admin-openrc.sh /root/setup/
ADD xos/configurations/common/controller_settings /root/setup/
ADD xos/configurations/common/flat_net_name /root/setup/
-ADD xos/configurations/common/cloudlab-nodes.yaml /opt/xos/configurations/commmon/
+ADD xos/configurations/common/nodes.yaml /opt/xos/configurations/commmon/
ADD xos/configurations/common/id_rsa.pub /root/setup/padmin_public_key
ADD xos/configurations/common/id_rsa /opt/xos/observers/helloworldservice_complete/helloworldservice_private_key
ADD xos/configurations/common/node_key.pub /root/setup/node_key.pub
diff --git a/xos/configurations/devel/Makefile b/xos/configurations/devel/Makefile
index eb5802a..f33479f 100644
--- a/xos/configurations/devel/Makefile
+++ b/xos/configurations/devel/Makefile
@@ -4,7 +4,9 @@
cloudlab: common_cloudlab xos
-devstack: upgrade_pkgs common_devstack devstack_net_fix xos
+devstack: common_devstack xos
+
+opencloud: common_opencloud xos
xos:
rm ../../xos_configuration/*
@@ -21,6 +23,9 @@
common_devstack:
make -C ../common -f Makefile.devstack
+common_opencloud:
+ make -C ../common -f Makefile.opencloud
+
stop:
sudo docker stop $(RUNNING_CONTAINER)
@@ -29,10 +34,3 @@
enter:
sudo docker exec -t -i $(RUNNING_CONTAINER) bash
-
-devstack_net_fix:
- sudo ../devstack/net-fix.sh
- sudo bash -c "source ../common/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
diff --git a/xos/configurations/devel/Makefile.inside b/xos/configurations/devel/Makefile.inside
index 57cde4c..fb9433c 100644
--- a/xos/configurations/devel/Makefile.inside
+++ b/xos/configurations/devel/Makefile.inside
@@ -2,8 +2,8 @@
setup_xos:
bash /opt/xos/scripts/docker_setup_xos
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab-nodes.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/base.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/nodes.yaml
run_develserver:
cd /opt/xos; python manage.py runserver 0.0.0.0:8000 --insecure
diff --git a/xos/configurations/devel/README.md b/xos/configurations/devel/README.md
index 54a51a8..d877a39 100644
--- a/xos/configurations/devel/README.md
+++ b/xos/configurations/devel/README.md
@@ -42,7 +42,7 @@
~$ git clone https://github.com/open-cloud/xos.git
~$ git clone https://git.openstack.org/openstack-dev/devstack
~$ cd devstack
-~/devstack$ cp ../xos/xos/configurations/devstack/local.conf .
+~/devstack$ cp ../xos/xos/configurations/common/devstack/local.conf .
~/devstack$ ./stack.sh
~/devstack$ cd ../xos/xos/configurations/devel/
~/xos/xos/configurations/devel$ make devstack
diff --git a/xos/configurations/kilo-install/Dockerfile b/xos/configurations/kilo-install/Dockerfile
deleted file mode 100644
index f0ced90..0000000
--- a/xos/configurations/kilo-install/Dockerfile
+++ /dev/null
@@ -1,154 +0,0 @@
-# Autogenerated -- do not edit
-FROM ubuntu:14.04.2
-MAINTAINER Andy Bavier <acb@cs.princeton.edu>
-
-# XXX Workaround for docker bug:
-# https://github.com/docker/docker/issues/6345
-# Kernel 3.15 breaks docker, uss the line below as a workaround
-# until there is a fix
-RUN ln -s -f /bin/true /usr/bin/chfn
-# XXX End workaround
-
-# Install.
-RUN apt-get update && apt-get install -y \
- git \
- postgresql \
- python-psycopg2 \
- graphviz \
- graphviz-dev \
- libxslt1.1 \
- libxslt1-dev \
- python-pip \
- tar \
- gcc \
- python-httplib2 \
- geoip-database \
- libgeoip1 \
- wget \
- curl \
- python-dev \
- libyaml-dev \
- pkg-config \
- python-pycurl
-
-RUN pip install django==1.7
-RUN pip install djangorestframework==2.4.4
-RUN pip install markdown # Markdown support for the browseable API.
-RUN pip install pyyaml # YAML content-type support.
-RUN pip install django-filter # Filtering support
-RUN pip install lxml # XML manipulation library
-RUN pip install netaddr # IP Addr library
-RUN pip install pytz
-RUN pip install django-timezones
-RUN pip install requests
-RUN pip install django-crispy-forms
-RUN pip install django-geoposition
-RUN pip install django-extensions
-RUN pip install django-suit
-RUN pip install django-bitfield
-RUN pip install django-ipware
-RUN pip install django-encrypted-fields
-RUN pip install python-keyczar
-RUN pip install pygraphviz
-RUN pip install dnslib
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient
-
-RUN pip install django_rest_swagger
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools
-RUN easy_install django_evolution
-RUN easy_install python_gflags
-RUN easy_install --upgrade httplib2
-RUN easy_install google_api_python_client
-RUN easy_install httplib2.ca_certs_locater
-
-# Install custom Ansible
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
-ADD ansible-hosts /etc/ansible/hosts
-
-ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
-
-# For Observer
-RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
-RUN cd /tmp/fofum; python setup.py install
-RUN rm -rf /tmp/fofum
-
-RUN mkdir -p /usr/local/share /bin
-ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
-RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
-RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
-RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
-RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
-
-# Supervisor
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor
-ADD observer.conf /etc/supervisor/conf.d/
-
-# Get XOS
-ADD xos /opt/xos
-
-# Initscript is broken in Ubuntu
-#ADD observer-initscript /etc/init.d/xosobserver
-
-RUN chmod +x /opt/xos/scripts/opencloud
-RUN /opt/xos/scripts/opencloud genkeys
-
-# Workaround for AUFS issue
-# https://github.com/docker/docker/issues/783#issuecomment-56013588
-RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
-
-# Set postgres password to match default value in settings.py
-RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';"
-
-# Turn DEBUG on so that devel server will serve static files
-# (not necessary if --insecure is passed to 'manage.py runserver')
-# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
-
-# Cruft to workaround problems with migrations, should go away...
-RUN /opt/xos/scripts/opencloud remigrate
-
-# git clone uses cached copy, doesn't pick up latest
-RUN git -C /opt/ansible pull
-RUN git -C /opt/ansible/lib/ansible/modules/core pull
-RUN git -C /opt/ansible/v2/ansible/modules/core pull
-
-# install Tosca engine
-RUN apt-get install -y m4
-RUN pip install python-dateutil
-RUN bash /opt/xos/tosca/install_tosca.sh
-
-EXPOSE 8000
-
-# Set environment variables.
-ENV HOME /root
-
-# Define working directory.
-WORKDIR /root
-
-# Define default command.
-#CMD ["/bin/bash"]
-#CMD /opt/xos/scripts/docker_start_xos
-RUN mkdir -p /root/setup
-ADD xos/configurations/common/admin-openrc.sh /root/setup/
-RUN bash -c 'echo "nat-net" > /root/setup/flat_net_name'
-ADD xos/configurations/common/cloudlab-nodes.yaml /opt/xos/configurations/commmon/
-ADD xos/configurations/common/id_rsa.pub /root/setup/padmin_public_key
-
-CMD /usr/bin/make -C /opt/xos/configurations/kilo-install -f Makefile.inside; /bin/bash
-
-#CMD ["/bin/bash"]
diff --git a/xos/configurations/kilo-install/Dockerfile.kilo-install b/xos/configurations/kilo-install/Dockerfile.kilo-install
deleted file mode 100644
index fabfcd8..0000000
--- a/xos/configurations/kilo-install/Dockerfile.kilo-install
+++ /dev/null
@@ -1,8 +0,0 @@
-RUN mkdir -p /root/setup
-ADD xos/configurations/common/admin-openrc.sh /root/setup/
-ADD xos/configurations/common/cloudlab-nodes.yaml /opt/xos/configurations/commmon/
-ADD xos/configurations/common/id_rsa.pub /root/setup/padmin_public_key
-
-CMD /usr/bin/make -C /opt/xos/configurations/kilo-install -f Makefile.inside; /bin/bash
-
-#CMD ["/bin/bash"]
diff --git a/xos/configurations/kilo-install/Makefile b/xos/configurations/kilo-install/Makefile
deleted file mode 100644
index 108df7a..0000000
--- a/xos/configurations/kilo-install/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-MYIP:=$(shell hostname -i)
-RUNNING_CONTAINER:=$(shell sudo docker ps|grep "xos"|awk '{print $$NF}')
-LAST_CONTAINER=$(shell sudo docker ps -l -q)
-
-# For installing XOS on a node that is not the OpenStack head node
-MGMT_SUBNET="192.168.122.0/24"
-HEAD_NODE_IP="130.127.133.61"
-
-test: common_cloudlab images
- echo "# Autogenerated -- do not edit" > Dockerfile
- cat ../common/Dockerfile.common Dockerfile.kilo-install >> Dockerfile
- cd ../../..; sudo docker build -t xos -f xos/configurations/kilo-install/Dockerfile .
- sudo docker run -d -p 9999:8000 -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro xos
- bash ../common/wait_for_xos.sh
-
-common_cloudlab:
- make -C ../common -f Makefile.cloudlab
-
-stop:
- sudo docker stop $(RUNNING_CONTAINER)
-
-showlogs:
- sudo docker logs $(LAST_CONTAINER)
-
-enter:
- sudo docker exec -t -i $(RUNNING_CONTAINER) bash
-
-images:
- sudo bash -c "source /root/setup/admin-openrc.sh; \
- glance image-show trusty-server-multi-nic || \
- glance image-create --name trusty-server-multi-nic \
- --disk-format qcow2 \
- --file /proj/xos-PG0/acb/images/trusty-server-multi-nic.img \
- --container-format bare"
-
-remote_head_node:
- sudo iptables -t nat -A OUTPUT -p tcp -d $MGMT_SUBNET -j DNAT --to-destination $HEAD_NODE_IP
- sudo iptables -t nat -A PREROUTING -p tcp -d $MGMT_SUBNET -j DNAT --to-destination $HEAD_NODE_IP
diff --git a/xos/configurations/kilo-install/Makefile.inside b/xos/configurations/kilo-install/Makefile.inside
deleted file mode 100644
index c49841a..0000000
--- a/xos/configurations/kilo-install/Makefile.inside
+++ /dev/null
@@ -1,12 +0,0 @@
-all: setup_xos update_certificates run_develserver
-
-setup_xos:
- bash /opt/xos/scripts/docker_setup_xos
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/kilo-install/cloudlab.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab-nodes.yaml
-
-update_certificates:
- update-ca-certificates
-
-run_develserver:
- cd /opt/xos; python manage.py runserver 0.0.0.0:8000 --insecure
diff --git a/xos/configurations/kilo-install/README b/xos/configurations/kilo-install/README
deleted file mode 100644
index 2ff7549..0000000
--- a/xos/configurations/kilo-install/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This configuration is based on the "devel" configuration for CloudLab. It is
-meant to work with an OpenStack Kilo cluster installed on CloudLab using the
-procedure documented here:
-
-https://github.com/andybavier/opencloud-cluster-setup
-
-It launches an XOS container on Cloudlab that runs the XOS develserver. The
-container is left running in the background.
diff --git a/xos/configurations/kilo-install/cloudlab.yaml b/xos/configurations/kilo-install/cloudlab.yaml
deleted file mode 100644
index f92442c..0000000
--- a/xos/configurations/kilo-install/cloudlab.yaml
+++ /dev/null
@@ -1,76 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-# Note:
-# assumes the following have been created and filled with appropriate data:
-# /root/setup/admin_openrc
-# /root/setup/flat_net_name
-# /root/setup/padmin_public_key
-
-description: >
- * Adds OpenCloud Sites, Deployments, and Controllers.
-
-imports:
- - custom_types/xos.yaml
-
-topology_template:
- node_templates:
- trusty-server-multi-nic:
- type: tosca.nodes.Image
- properties:
- disk_format: QCOW2
- container_format: BARE
-
- MyDeployment:
- type: tosca.nodes.Deployment
- properties:
- flavors: m1.large, m1.medium, m1.small
- requirements:
- - image:
- node: trusty-server-multi-nic
- relationship: tosca.relationships.SupportsImage
-
- CloudLab:
- type: tosca.nodes.Controller
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.ControllerDeployment
- properties:
- backend_type: OpenStack
- version: Juno
- auth_url: { get_script_env: [ SELF, adminrc, OS_AUTH_URL, LOCAL_FILE] }
- admin_user: { get_script_env: [ SELF, adminrc, OS_USERNAME, LOCAL_FILE] }
- admin_password: { get_script_env: [ SELF, adminrc, OS_PASSWORD, LOCAL_FILE] }
- admin_tenant: { get_script_env: [ SELF, adminrc, OS_TENANT_NAME, LOCAL_FILE] }
- domain: Default
- artifacts:
- adminrc: /root/setup/admin-openrc.sh
-
- mysite:
- type: tosca.nodes.Site
- properties:
- display_name: MySite
- site_url: http://opencloud.us/
- requirements:
- - deployment:
- node: MyDeployment
- relationship: tosca.relationships.SiteDeployment
- requirements:
- - controller:
- node: CloudLab
- relationship: tosca.relationships.UsesController
-
- padmin@vicci.org:
- type: tosca.nodes.User
- requirements:
- - site:
- node: mysite
- relationship: tosca.relationships.MemberOfSite
- properties:
- public_key: { get_artifact: [ SELF, pubkey, LOCAL_FILE ] }
- is_admin: true
- is_active: true
- firstname: XOS
- lastname: admin
- artifacts:
- pubkey: /root/setup/padmin_public_key
diff --git a/xos/configurations/test/Dockerfile.test b/xos/configurations/test/Dockerfile.test
index eb39645..5c2c717 100644
--- a/xos/configurations/test/Dockerfile.test
+++ b/xos/configurations/test/Dockerfile.test
@@ -1,7 +1,8 @@
RUN mkdir -p /root/setup
ADD xos/configurations/common/admin-openrc.sh /root/setup/
+ADD xos/configurations/common/controller_settings /root/setup/
ADD xos/configurations/common/flat_net_name /root/setup/
-ADD xos/configurations/common/cloudlab-nodes.yaml /opt/xos/configurations/commmon/
+ADD xos/configurations/common/nodes.yaml /opt/xos/configurations/commmon/
ADD xos/configurations/common/id_rsa.pub /root/setup/padmin_public_key
CMD ["/usr/bin/make", "-C", "/opt/xos/configurations/test", "-f", "Makefile.inside"]
diff --git a/xos/configurations/test/Makefile.inside b/xos/configurations/test/Makefile.inside
index d6c6de1..168f671 100644
--- a/xos/configurations/test/Makefile.inside
+++ b/xos/configurations/test/Makefile.inside
@@ -2,8 +2,8 @@
setup_xos:
bash /opt/xos/scripts/docker_setup_xos
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab.yaml
- python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/cloudlab-nodes.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/base.yaml
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/nodes.yaml
echo sleeping 30 seconds
sleep 30
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 97e76ff..675b8c2 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -34,10 +34,41 @@
def backend_icon(obj):
(icon, tooltip) = obj.get_backend_icon()
+
icon_url = ICON_URLS.get(icon, "unknown")
+ (exponent,last_success,last_failure,failures) = obj.get_backend_details()
+
+ # FIXME: Need to clean this up by separating Javascript from Python
+ if (obj.pk):
+ script = """
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $("#show_details_%d").click(function () {
+ $("#status%d").dialog({modal: true, height: 200, width: 200 });
+ });
+ });
+ </script>
+ """%(obj.pk,obj.pk)
+
+ div = """
+ <div style="display:none;" id="status%d" title="Details">
+ <p>Backoff Exponent: %r</p>
+ <p>Last Success: %r</p>
+ <p>Failures: %r</p>
+ <p>Last Failure: %r</p>
+ </div>
+ """%(obj.pk,exponent,last_success,failures,last_failure)
+ a = '<a id="show_details_%d" href="#">'%obj.pk
+ astop = '</a>'
+ else:
+ div = ''
+ script = ''
+ a = ''
+ astop = ''
+
if tooltip:
- return '<span style="min-width:16px;" title="%s"><img src="%s"></span>' % (tooltip, icon_url)
+ return '%s %s <span style="min-width:16px;" title="%s">%s<img src="%s">%s</span>' % (script, div, tooltip, a, icon_url, astop)
else:
return '<span style="min-width:16px;"><img src="%s"></span>' % icon_url
diff --git a/xos/core/models/plcorebase.py b/xos/core/models/plcorebase.py
index 360792f..9f7aa4c 100644
--- a/xos/core/models/plcorebase.py
+++ b/xos/core/models/plcorebase.py
@@ -1,4 +1,5 @@
import datetime
+import json
import os
import sys
from django import db
@@ -118,6 +119,38 @@
validators[field.name] = l
return validators
+ def get_backend_details(self):
+ try:
+ scratchpad = json.loads(self.backend_register)
+ except AttributeError:
+ return (None, None, None, None)
+
+ try:
+ exponent = scratchpad['exponent']
+ except KeyError:
+ exponent = None
+
+ try:
+ last_success_time = scratchpad['last_success']
+ dt = datetime.datetime.fromtimestamp(last_success_time)
+ last_success = dt.strftime("%Y-%m-%d %H:%M")
+ except KeyError:
+ last_success = None
+
+ try:
+ failures = scratchpad['failures']
+ except KeyError:
+ failures=None
+
+ try:
+ last_failure_time = scratchpad['last_failure']
+ dt = datetime.datetime.fromtimestamp(last_failure_time)
+ last_failure = dt.strftime("%Y-%m-%d %H:%M")
+ except KeyError:
+ last_failure = None
+
+ return (exponent, last_success, last_failure, failures)
+
def get_backend_icon(self):
is_perfect = (self.backend_status is not None) and self.backend_status.startswith("1 -")
is_good = (self.backend_status is not None) and (self.backend_status.startswith("0 -") or self.backend_status.startswith("1 -"))
diff --git a/xos/model_policies/model_policy_ControllerSlice.py b/xos/model_policies/model_policy_ControllerSlice.py
index 1861c66..bfe7995 100644
--- a/xos/model_policies/model_policy_ControllerSlice.py
+++ b/xos/model_policies/model_policy_ControllerSlice.py
@@ -8,9 +8,18 @@
except:
his_status_code = 0
+ fields = []
if (my_status_code not in [0,his_status_code]):
controller_slice.slice.backend_status = controller_slice.backend_status
- controller_slice.slice.save(update_fields = ['backend_status'])
+ fields+=['backend_status']
+
+ if (controller_slice.backend_register != controller_slice.slice.backend_register):
+ controller_slice.slice.backend_register = controller_slice.backend_register
+ fields+=['backend_register']
+
+ controller_slice.slice.save(update_fields = fields)
+
+
except Exception,e:
print str(e)
pass
diff --git a/xos/openstack_observer/syncstep.py b/xos/openstack_observer/syncstep.py
index 21327d7..0a25c58 100644
--- a/xos/openstack_observer/syncstep.py
+++ b/xos/openstack_observer/syncstep.py
@@ -10,6 +10,7 @@
from observer.ansible import *
from dependency_walker import *
+from time import time
import json
import time
import pdb
@@ -228,7 +229,7 @@
else:
self.sync_record(o)
o.enacted = datetime.now() # Is this the same timezone? XXX
- scratchpad = {'next_run':0, 'exponent':0}
+ scratchpad = {'next_run':0, 'exponent':0, 'last_success':time.time()}
o.backend_register = json.dumps(scratchpad)
o.backend_status = "1 - OK"
o.save(update_fields=['enacted','backend_status','backend_register'])
@@ -258,7 +259,7 @@
scratchpad['exponent']
except:
logger.log_exc("Exception while updating scratchpad")
- scratchpad = {'next_run':0, 'exponent':0}
+ scratchpad = {'next_run':0, 'exponent':0, 'last_success':time.time(),'failures':0}
# Second failure
if (scratchpad['exponent']):
@@ -271,7 +272,17 @@
delay=8*60*60
scratchpad['next_run'] = time.time() + delay
- scratchpad['exponent']+=1
+ try:
+ scratchpad['exponent']+=1
+ except:
+ scratchpad['exponent']=1
+
+ try:
+ scratchpad['failures']+=1
+ except KeyError:
+ scratchpad['failures']=1
+
+ scratchpad['last_failure']=time.time()
o.backend_register = json.dumps(scratchpad)