add frontend_only option
diff --git a/xos/configurations/frontend/xos.yaml b/xos/configurations/frontend/xos.yaml
index 8b286cd..3153e95 100644
--- a/xos/configurations/frontend/xos.yaml
+++ b/xos/configurations/frontend/xos.yaml
@@ -13,6 +13,7 @@
ui_port: 9999
bootstrap_ui_port: 9998
docker_project_name: frontend
+ frontend_only: true
/opt/xos/xos_configuration/xos_common_config:
type: tosca.nodes.XOSVolume
diff --git a/xos/core/models/xosmodel.py b/xos/core/models/xosmodel.py
index 4942241..01c9514 100644
--- a/xos/core/models/xosmodel.py
+++ b/xos/core/models/xosmodel.py
@@ -14,6 +14,7 @@
db_container_name = StrippedCharField(max_length=200, help_text="name of XOS db container", default="xos_db")
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)
def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/synchronizers/onboarding/xosbuilder.py b/xos/synchronizers/onboarding/xosbuilder.py
index 56019ce..60ed485 100644
--- a/xos/synchronizers/onboarding/xosbuilder.py
+++ b/xos/synchronizers/onboarding/xosbuilder.py
@@ -224,17 +224,18 @@
# "links": ["xos_db"],
# "volumes": volume_list}
- for c in ServiceController.objects.all():
- if self.check_controller_unready(c):
- logger.warning("Controller %s has unready resources" % str(c))
- continue
+ if not xos.frontend_only:
+ for c in ServiceController.objects.all():
+ if self.check_controller_unready(c):
+ logger.warning("Controller %s has unready resources" % str(c))
+ continue
- containers["xos_synchronizer_%s" % c.name] = \
- {"image": "xosproject/xos-synchronizer-%s" % c.name,
- "command": 'bash -c "sleep 120; cd /opt/xos/synchronizers/%s; bash ./run.sh"' % c.name,
- #"external_links": [db_container_name],
- "links": ["xos_db"],
- "volumes": volume_list}
+ containers["xos_synchronizer_%s" % c.name] = \
+ {"image": "xosproject/xos-synchronizer-%s" % c.name,
+ "command": 'bash -c "sleep 120; cd /opt/xos/synchronizers/%s; bash ./run.sh"' % c.name,
+ #"external_links": [db_container_name],
+ "links": ["xos_db"],
+ "volumes": volume_list}
vars = { "containers": containers }
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 20b7381..9ed62ed 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -27,6 +27,10 @@
type: boolean
required: false
description: True if XOS build should be enabled
+ frontend_only:
+ type: boolean
+ required: false
+ description: True if XOS should not start synchronizer containers
tosca.nodes.XOSVolume:
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index cc541ae..79e637b 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -57,6 +57,10 @@
type: boolean
required: false
description: True if XOS build should be enabled
+ frontend_only:
+ type: boolean
+ required: false
+ description: True if XOS should not start synchronizer containers
tosca.nodes.XOSVolume:
diff --git a/xos/tosca/resources/xosmodel.py b/xos/tosca/resources/xosmodel.py
index 188bb4f..b397686 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"]
+ copyin_props = ["ui_port", "bootstrap_ui_port", "docker_project_name", "enable_build", "frontend_only"]
class XOSVolume(XOSResource):
provides = "tosca.nodes.XOSVolume"