frontend configuration; add wait_for_xos.sh
diff --git a/xos/configurations/common/wait_for_xos.sh b/xos/configurations/common/wait_for_xos.sh
new file mode 100644
index 0000000..362778b
--- /dev/null
+++ b/xos/configurations/common/wait_for_xos.sh
@@ -0,0 +1,12 @@
+#! /bin/bash
+echo "Waiting for XOS to come up"
+until http 0.0.0.0:9999 &> /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/xos/configurations/develserver/Makefile b/xos/configurations/develserver/Makefile
index cb0d1ad..e2ec5bd 100644
--- a/xos/configurations/develserver/Makefile
+++ b/xos/configurations/develserver/Makefile
@@ -1,10 +1,14 @@
MYIP:=$(shell hostname -i)
+EXISTING_CONTAINER:=$(shell sudo docker ps|grep "xos"|awk '{print $$NF}')
test: common_cloudlab
cat ../common/Dockerfile.common Dockerfile.develserver > Dockerfile
cd ../../..; sudo docker build -t xos -f xos/configurations/develserver/Dockerfile .
- sudo docker run -d --add-host="ctl:$(MYIP)" -p 9999:8000 xos
- echo "devel server should now be running in the background..."
+ sudo docker run -d --add-host="0.0.0.0:$(MYIP)" -p 9999:8000 xos
+ bash ../common/wait_for_xos.sh
common_cloudlab:
make -C ../common -f Makefile.cloudlab
+
+stop:
+ sudo docker stop $(EXISTING_CONTAINER)
diff --git a/xos/configurations/frontend/Dockerfile.frontend b/xos/configurations/frontend/Dockerfile.frontend
new file mode 100644
index 0000000..3c8d283
--- /dev/null
+++ b/xos/configurations/frontend/Dockerfile.frontend
@@ -0,0 +1,5 @@
+RUN mkdir -p /root/setup
+
+RUN echo "autostart=false" >> /etc/supervisor/conf.d/observer.conf
+
+CMD /usr/bin/make -C /opt/xos/configurations/frontend -f Makefile.inside
diff --git a/xos/configurations/frontend/Makefile b/xos/configurations/frontend/Makefile
new file mode 100644
index 0000000..0c1fbc9
--- /dev/null
+++ b/xos/configurations/frontend/Makefile
@@ -0,0 +1,19 @@
+MYIP:=$(shell hostname -i)
+RUNNING_CONTAINER=$(shell sudo docker ps|grep "xos"|awk '{print $$NF}')
+LAST_CONTAINER=$(shell sudo docker ps -l -q)
+
+all: frontend
+
+frontend:
+ sudo apt-get -y install httpie
+ cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
+ cd ../../..; sudo docker build -t xos -f xos/configurations/frontend/Dockerfile .
+ sudo docker run -d --add-host="0.0.0.0:$(MYIP)" -p 9999:8000 xos
+ bash ../common/wait_for_xos.sh
+
+stop:
+ sudo docker stop $(RUNNING_CONTAINER)
+
+showlogs:
+ sudo docker logs $(LAST_CONTAINER)
+
diff --git a/xos/configurations/frontend/Makefile.inside b/xos/configurations/frontend/Makefile.inside
new file mode 100644
index 0000000..0801c7c
--- /dev/null
+++ b/xos/configurations/frontend/Makefile.inside
@@ -0,0 +1,8 @@
+all: setup_xos run_develserver
+
+setup_xos:
+ bash /opt/xos/scripts/docker_setup_xos
+ python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/frontend/sample.yaml
+
+run_develserver:
+ cd /opt/xos; python manage.py runserver 0.0.0.0:8000 --insecure
diff --git a/xos/configurations/frontend/README b/xos/configurations/frontend/README
new file mode 100644
index 0000000..ba8875e
--- /dev/null
+++ b/xos/configurations/frontend/README
@@ -0,0 +1,6 @@
+This configuration launches an XOS container on Cloudlab that runs the XOS develserver. The container is left running
+in the backgorund.
+
+The observer is not started, and there is no openstack backend connected for XOS.
+
+This configuration is intended for developing the XOS GUI.