Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/configurations/cord-pod/disable-onboarding.yaml b/xos/configurations/common/disable-onboarding.yaml
similarity index 92%
rename from xos/configurations/cord-pod/disable-onboarding.yaml
rename to xos/configurations/common/disable-onboarding.yaml
index 0dd1ded..acb75c8 100644
--- a/xos/configurations/cord-pod/disable-onboarding.yaml
+++ b/xos/configurations/common/disable-onboarding.yaml
@@ -12,6 +12,5 @@
properties:
no-create: true
no-delete: true
- no-update: true
enable_build: false
diff --git a/xos/configurations/cord-pod/enable-onboarding.yaml b/xos/configurations/common/enable-onboarding.yaml
similarity index 92%
rename from xos/configurations/cord-pod/enable-onboarding.yaml
rename to xos/configurations/common/enable-onboarding.yaml
index b31ac1d..98e433c 100644
--- a/xos/configurations/cord-pod/enable-onboarding.yaml
+++ b/xos/configurations/common/enable-onboarding.yaml
@@ -12,6 +12,5 @@
properties:
no-create: true
no-delete: true
- no-update: true
enable_build: true
diff --git a/xos/configurations/cord-pod/Makefile b/xos/configurations/cord-pod/Makefile
index f3d6a7e..1d5f68c 100644
--- a/xos/configurations/cord-pod/Makefile
+++ b/xos/configurations/cord-pod/Makefile
@@ -20,7 +20,7 @@
echo "[ONBOARDING]"
# on-board any services here
bash ../common/wait_for_onboarding_ready.sh 81 xos
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/cord-pod/disable-onboarding.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/common/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
@@ -35,7 +35,7 @@
sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/fabric/fabric-onboard.yaml
sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vtr/vtr-onboard.yaml
sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/cord-pod/synchronizers.yaml
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/cord-pod/enable-onboarding.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/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
@@ -73,16 +73,27 @@
new-nodes: clean-nodes update-nodes vtn
-exampleservice:
- sudo cp id_rsa key_import/exampleservice_rsa
- sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
- sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/onboard/exampleservice/exampleservice-onboard.yaml
- bash ../common/wait_for_onboarding_ready.sh 81 xos
- bash ../common/wait_for_xos_port.sh 80
+exampleservice: onboard-exampleservice
sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/pod-exampleservice.yaml
-cord-ceilometer: ceilometer_custom_images cord
- sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/ceilometer.yaml
+onboard-exampleservice:
+ sudo cp id_rsa key_import/exampleservice_rsa
+ sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/exampleservice/exampleservice-onboard.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
+
+cord-ceilometer: ceilometer_custom_images cord onboard-ceilometer
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/ceilometer.yaml
+
+onboard-ceilometer:
+ sudo cp id_rsa key_import/monitoring_channel_rsa
+ sudo cp id_rsa.pub key_import/monitoring_channel_rsa.pub
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/ceilometer/ceilometer-onboard.yaml
+ bash ../common/wait_for_onboarding_ready.sh 81 services/ceilometer
+ bash ../common/wait_for_onboarding_ready.sh 81 xos
+ bash ../common/wait_for_xos_port.sh 80
nodes.yaml:
export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
diff --git a/xos/configurations/test-standalone/Makefile b/xos/configurations/test-standalone/Makefile
index 9eafa61..9807e5d 100644
--- a/xos/configurations/test-standalone/Makefile
+++ b/xos/configurations/test-standalone/Makefile
@@ -1,4 +1,10 @@
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
+XOS_BOOTSTRAP_PORT=9998
+XOS_UI_PORT=9999
define TRUNCATE_FN
CREATE OR REPLACE FUNCTION truncate_tables(username IN VARCHAR) RETURNS void AS $$$$
@@ -16,13 +22,40 @@
export TRUNCATE_FN
prepare: xos
- sudo docker exec -i teststandalone_xos_1 bash -c "cd /opt/xos/tests/api; npm install --production"
- sudo docker exec teststandalone_xos_1 pip install dredd_hooks
+ 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
-xos:
+xos: prereqs bootstrap onboarding
+
+prereqs:
sudo make -f ../common/Makefile.prereqs
- sudo docker-compose up -d
- bash ../common/wait_for_xos.sh
+
+bootstrap:
+ echo "[BOOTSTRAP]"
+ sudo rm -f onboarding-docker-compose/docker-compose.yml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f docker-compose-bootstrap.yml up -d
+ bash ../common/wait_for_xos_port.sh 9998
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run -e CONFIG_DIR=$(CONFIG_DIR) xos_bootstrap_ui python /opt/xos/tosca/run.py none /opt/xos/configurations/test-standalone/xos.yaml
+
+onboarding:
+ echo "[ONBOARDING]"
+ bash ../common/wait_for_onboarding_ready.sh 9998 xos
+ sudo bash -c "echo somekey > key_import/vsg_rsa"
+ sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
+ sudo bash -c "echo somekey > key_import/volt_rsa"
+ sudo bash -c "echo somekey > key_import/volt_rsa.pub"
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/common/disable-onboarding.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vrouter/vrouter-onboard.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/volt/volt-onboard.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vsg/vsg-onboard.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vtr/vtr-onboard.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/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 xos
+ bash ../common/wait_for_xos_port.sh 9999
restore-initial-db-status:
sudo docker exec teststandalone_xos_db_1 psql -U postgres -d xos -c "$$TRUNCATE_FN" >/dev/null 2>&1
@@ -31,43 +64,47 @@
sudo docker exec teststandalone_xos_db_1 psql -U postgres -d xos -c "SELECT setval('core_deployment_id_seq', 1)" >/dev/null 2>&1
sudo docker exec teststandalone_xos_db_1 psql -U postgres -d xos -c "SELECT setval('core_flavor_id_seq', 1)" >/dev/null 2>&1
sudo docker exec teststandalone_xos_db_1 psql -U postgres -d xos -c "SELECT setval('core_service_id_seq', 1)" >/dev/null 2>&1
- sudo docker-compose run xos python /opt/xos/manage.py --noobserver --nomodelpolicy loaddata /opt/xos/core/fixtures/core_initial_data.json
- 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 none /opt/xos/configurations/common/mydeployment.yaml
- sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/frontend/sample.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/manage.py --noobserver --nomodelpolicy 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 /opt/xos/configurations/common/fixtures.yaml
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none /opt/xos/configurations/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 /opt/xos/configurations/frontend/sample.yaml
test: restore-initial-db-status
# RUN TESTS
- sudo docker cp ../../../apiary.apib teststandalone_xos_1:/opt/xos/tests/api/apiary.apib
- sudo docker exec -i teststandalone_xos_1 bash -c "cd /opt/xos/tests/api; npm test"
+ sudo docker cp ../../../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"
test-tosca: restore-initial-db-status
- sudo docker-compose run xos bash -c "cd /opt/xos/tosca/tests; python ./alltests.py"
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui bash -c "cd /opt/xos/tosca/tests; python ./alltests.py"
base-container:
cd ../../../containers/xos; make base
devel-container: base-container
cd ../../../containers/xos; make devel
+ cd ../../../containers/synchronizer; make
+ cd ../../../containers/onboarding_synchronizer; make
containers: devel-container
cd ../../../containers/xos; make test
stop:
- sudo docker-compose stop
+ test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
+ sudo docker-compose -f $(BOOTSTRAP_YML) stop
showlogs:
sudo docker-compose logs
rm: stop
- sudo docker-compose rm -f
+ test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
+ sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) rm
docker-clean:
sudo docker rm -f $(shell sudo docker ps -aq)
enter-xos:
- sudo docker exec -ti teststandalone_xos_1 bash
+ sudo docker exec -ti teststandalone_xos_ui_1 bash
enter-xos-db:
sudo docker exec -ti teststandalone_xos_db_1 bash
diff --git a/xos/configurations/test-standalone/docker-compose-bootstrap.yml b/xos/configurations/test-standalone/docker-compose-bootstrap.yml
new file mode 100644
index 0000000..00a43f3
--- /dev/null
+++ b/xos/configurations/test-standalone/docker-compose-bootstrap.yml
@@ -0,0 +1,34 @@
+xos_db:
+ image: xosproject/xos-postgres
+ expose:
+ - "5432"
+
+xos_bootstrap_ui:
+ image: xosproject/xos
+ command: python /opt/xos/manage.py runserver 0.0.0.0:9998 --insecure --makemigrations
+ ports:
+ - "9998:9998"
+ links:
+ - xos_db
+ volumes:
+ - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config
+ - ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
+
+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:
+# - .:/root/setup:ro
+ - /var/run/docker.sock:/var/run/docker.sock
+ - ./key_import:/opt/xos/key_import:ro
+ - ./onboarding-docker-compose:/opt/xos/synchronizers/onboarding/docker-compose
+ log_driver: "json-file"
+ log_opt:
+ max-size: "100k"
+ max-file: "5"
diff --git a/xos/configurations/test-standalone/docker-compose.yml b/xos/configurations/test-standalone/docker-compose.yml
deleted file mode 100644
index a0b87ed..0000000
--- a/xos/configurations/test-standalone/docker-compose.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-xos_db:
- image: xosproject/xos-postgres
- expose:
- - "5432"
-
-# FUTURE
-#xos_swarm_synchronizer:
-# image: xosproject/xos-swarm-synchronizer
-# labels:
-# org.xosproject.kind: synchronizer
-# org.xosproject.target: swarm
-
-xos:
- image: xosproject/xos-test
- command: python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
- #command: sleep 86400 # For interactive session
- ports:
- - "9999:8000"
- links:
- - xos_db
- volumes:
- - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config
- - ../../core/xoslib:/opt/xos/core/xoslib
- - ../../core/static:/opt/xos/core/static
- - ../../templates/admin:/opt/xos/templates/admin
- - ../../configurations:/opt/xos/configurations
- - ../../tests:/opt/xos/tests
- - ../../api:/opt/xos/api
diff --git a/xos/configurations/test-standalone/xos.yaml b/xos/configurations/test-standalone/xos.yaml
new file mode 100644
index 0000000..62331d0
--- /dev/null
+++ b/xos/configurations/test-standalone/xos.yaml
@@ -0,0 +1,27 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Onboard the exampleservice
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+ xos:
+ type: tosca.nodes.XOS
+ properties:
+ ui_port: 9999
+ bootstrap_ui_port: 9998
+ docker_project_name: teststandalone
+ frontend_only: true
+ source_ui_image: xosproject/xos-test
+
+ /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: false
+ requirements:
+ - xos:
+ node: xos
+ relationship: tosca.relationships.UsedByXOS
diff --git a/xos/core/models/xosmodel.py b/xos/core/models/xosmodel.py
index 01c9514..ea53bd1 100644
--- a/xos/core/models/xosmodel.py
+++ b/xos/core/models/xosmodel.py
@@ -15,6 +15,7 @@
docker_project_name = StrippedCharField(max_length=200, help_text="docker project name")
enable_build = models.BooleanField(help_text="True if Onboarding Synchronizer should build XOS as necessary", default=True)
frontend_only = models.BooleanField(help_text="If True, XOS will not start synchronizer containers", default=False)
+ source_ui_image = StrippedCharField(max_length=200, default="xosproject/xos")
def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/services/ceilometer/__init__.py b/xos/services/ceilometer/__init__.py
deleted file mode 100644
index 8b13789..0000000
--- a/xos/services/ceilometer/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/xos/services/ceilometer/migrations/0001_initial.py b/xos/services/ceilometer/migrations/0001_initial.py
deleted file mode 100644
index 6a3dd15..0000000
--- a/xos/services/ceilometer/migrations/0001_initial.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('core', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='CeilometerService',
- fields=[
- ],
- options={
- 'verbose_name': 'Ceilometer Service',
- 'proxy': True,
- },
- bases=('core.service',),
- ),
- migrations.CreateModel(
- name='MonitoringChannel',
- fields=[
- ],
- options={
- 'proxy': True,
- },
- bases=('core.tenantwithcontainer',),
- ),
- migrations.CreateModel(
- name='SFlowService',
- fields=[
- ],
- options={
- 'verbose_name': 'sFlow Collection Service',
- 'proxy': True,
- },
- bases=('core.service',),
- ),
- migrations.CreateModel(
- name='SFlowTenant',
- fields=[
- ],
- options={
- 'proxy': True,
- },
- bases=('core.tenant',),
- ),
- ]
diff --git a/xos/services/ceilometer/migrations/__init__.py b/xos/services/ceilometer/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/xos/services/ceilometer/migrations/__init__.py
+++ /dev/null
diff --git a/xos/services/fabric/__init__.py b/xos/services/fabric/__init__.py
deleted file mode 100644
index 8b13789..0000000
--- a/xos/services/fabric/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/xos/services/onos/__init__.py b/xos/services/onos/__init__.py
deleted file mode 100644
index 8b13789..0000000
--- a/xos/services/onos/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/xos/services/onos/migrations/0001_initial.py b/xos/services/onos/migrations/0001_initial.py
deleted file mode 100644
index 1df9da7..0000000
--- a/xos/services/onos/migrations/0001_initial.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('core', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='ONOSApp',
- fields=[
- ],
- options={
- 'proxy': True,
- },
- bases=('core.tenant',),
- ),
- migrations.CreateModel(
- name='ONOSService',
- fields=[
- ],
- options={
- 'verbose_name': 'ONOS Service',
- 'proxy': True,
- },
- bases=('core.service',),
- ),
- ]
diff --git a/xos/services/onos/migrations/__init__.py b/xos/services/onos/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/xos/services/onos/migrations/__init__.py
+++ /dev/null
diff --git a/xos/services/vrouter/__init__.py b/xos/services/vrouter/__init__.py
deleted file mode 100644
index 8b13789..0000000
--- a/xos/services/vrouter/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/xos/services/vrouter/migrations/0001_initial.py b/xos/services/vrouter/migrations/0001_initial.py
deleted file mode 100644
index f11fc91..0000000
--- a/xos/services/vrouter/migrations/0001_initial.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('core', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='VRouterService',
- fields=[
- ],
- options={
- 'verbose_name': 'vRouter Service',
- 'proxy': True,
- },
- bases=('core.service',),
- ),
- migrations.CreateModel(
- name='VRouterTenant',
- fields=[
- ],
- options={
- 'proxy': True,
- },
- bases=('core.tenant',),
- ),
- ]
diff --git a/xos/services/vrouter/migrations/__init__.py b/xos/services/vrouter/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/xos/services/vrouter/migrations/__init__.py
+++ /dev/null
diff --git a/xos/services/vtn/__init__.py b/xos/services/vtn/__init__.py
deleted file mode 100644
index 8b13789..0000000
--- a/xos/services/vtn/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/xos/services/vtn/migrations/0001_initial.py b/xos/services/vtn/migrations/0001_initial.py
deleted file mode 100644
index 90bf43f..0000000
--- a/xos/services/vtn/migrations/0001_initial.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('core', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='VTNService',
- fields=[
- ],
- options={
- 'verbose_name': 'VTN Service',
- 'proxy': True,
- },
- bases=('core.service',),
- ),
- ]
diff --git a/xos/services/vtn/migrations/__init__.py b/xos/services/vtn/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/xos/services/vtn/migrations/__init__.py
+++ /dev/null
diff --git a/xos/services/vtr_old/__init__.py b/xos/services/vtr_old/__init__.py
deleted file mode 100644
index 8b13789..0000000
--- a/xos/services/vtr_old/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/xos/services/vtr_old/migrations/0001_initial.py b/xos/services/vtr_old/migrations/0001_initial.py
deleted file mode 100644
index 540eccb..0000000
--- a/xos/services/vtr_old/migrations/0001_initial.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
-from django.db import models, migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('core', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='VTRService',
- fields=[
- ],
- options={
- 'verbose_name': 'vTR Service',
- 'proxy': True,
- },
- bases=('core.service',),
- ),
- migrations.CreateModel(
- name='VTRTenant',
- fields=[
- ],
- options={
- 'proxy': True,
- },
- bases=('core.tenant',),
- ),
- ]
diff --git a/xos/services/vtr_old/migrations/__init__.py b/xos/services/vtr_old/migrations/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/xos/services/vtr_old/migrations/__init__.py
+++ /dev/null
diff --git a/xos/synchronizers/onboarding/steps/sync_xos.py b/xos/synchronizers/onboarding/steps/sync_xos.py
index dec7a34..567e0ad 100644
--- a/xos/synchronizers/onboarding/steps/sync_xos.py
+++ b/xos/synchronizers/onboarding/steps/sync_xos.py
@@ -29,6 +29,9 @@
def sync_record(self, xos):
logger.info("Sync'ing XOS %s" % xos)
+ if not xos.docker_project_name:
+ raise Exception("xos.docker_project_name is not set")
+
if (not xos.enable_build):
raise DeferredException("XOS build is currently disabled")
diff --git a/xos/synchronizers/onboarding/xosbuilder.py b/xos/synchronizers/onboarding/xosbuilder.py
index e7a3e1c..51499bd 100644
--- a/xos/synchronizers/onboarding/xosbuilder.py
+++ b/xos/synchronizers/onboarding/xosbuilder.py
@@ -19,7 +19,6 @@
SYNC_ALLCONTROLLER_KINDS=["models", "django_library"]
def __init__(self):
- self.source_ui_image = "xosproject/xos"
self.source_sync_image = "xosproject/xos-synchronizer-openstack"
self.build_dir = "/opt/xos/BUILD/"
@@ -183,12 +182,13 @@
file(os.path.join(self.build_dir, "opt/xos/xos/%s_xosbuilder_migration_list") % name, "w").write("\n".join(migration_list)+"\n")
def create_ui_dockerfile(self):
+ xos = XOS.objects.all()[0]
dockerfile_fn = "Dockerfile.UI"
app_list = []
migration_list = []
- dockerfile = ["FROM %s" % self.source_ui_image]
+ dockerfile = ["FROM %s" % xos.source_ui_image]
script = []
for controller in ServiceController.objects.all():
if self.check_controller_unready(controller):
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index ef852af..04d7641 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -23,6 +23,10 @@
type: string
required: false
description: Docker project name
+ source_ui_image:
+ type: string
+ required: false
+ description: Source UI docker image name
enable_build:
type: boolean
required: false
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 93dad18..e52c0e1 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -53,6 +53,10 @@
type: string
required: false
description: Docker project name
+ source_ui_image:
+ type: string
+ required: false
+ description: Source UI docker image name
enable_build:
type: boolean
required: false
diff --git a/xos/tosca/resources/xosmodel.py b/xos/tosca/resources/xosmodel.py
index b397686..86aa8a8 100644
--- a/xos/tosca/resources/xosmodel.py
+++ b/xos/tosca/resources/xosmodel.py
@@ -12,7 +12,7 @@
class XOSXOS(XOSResource):
provides = "tosca.nodes.XOS"
xos_model = XOS
- copyin_props = ["ui_port", "bootstrap_ui_port", "docker_project_name", "enable_build", "frontend_only"]
+ copyin_props = ["ui_port", "bootstrap_ui_port", "docker_project_name", "enable_build", "frontend_only", "source_ui_image"]
class XOSVolume(XOSResource):
provides = "tosca.nodes.XOSVolume"