Updating vEE to new_base, adding scripts, docker files
Change-Id: I9c8e035a64e0010f120ec1f3ec49c92ba1e05037
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
new file mode 100644
index 0000000..f5e321a
--- /dev/null
+++ b/xos/synchronizer/Dockerfile.synchronizer
@@ -0,0 +1,9 @@
+FROM xosproject/xos-synchronizer-base:candidate
+
+ADD . /opt/xos/synchronizers/vee
+
+ENTRYPOINT []
+
+WORKDIR "/opt/xos/synchronizers/vee"
+
+CMD bash -c "cd /opt/xos/synchronizers/vee; ./run-from-api.sh"
\ No newline at end of file
diff --git a/xos/synchronizer/Makefile b/xos/synchronizer/Makefile
new file mode 100644
index 0000000..9e7dd90
--- /dev/null
+++ b/xos/synchronizer/Makefile
@@ -0,0 +1,5 @@
+synchronizer:
+ sudo docker build --rm -f Dockerfile.synchronizer -t xosproject/vee-synchronizer .
+
+up:
+ docker-compose -p vee up -d
\ No newline at end of file
diff --git a/xos/synchronizer/docker-compose.yml b/xos/synchronizer/docker-compose.yml
new file mode 100644
index 0000000..1566de8
--- /dev/null
+++ b/xos/synchronizer/docker-compose.yml
@@ -0,0 +1,22 @@
+version: '2'
+
+networks:
+ xos:
+ external: true
+
+services:
+ synchronizer:
+ image: xosproject/vee-synchronizer
+ networks:
+ - xos
+ #command: bash -c "sleep 86400"
+ volumes:
+ - /opt/cord_profile/node_key:/opt/cord_profile/node_key:ro
+ - /opt/cord/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/vee/credentials/xosadmin@opencord.org
+ external_links:
+ - rcordbs_xos_redis_1:redis
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "1000k"
+ max-file: "5"
\ No newline at end of file
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
new file mode 100644
index 0000000..10bfbe2
--- /dev/null
+++ b/xos/synchronizer/run-from-api.sh
@@ -0,0 +1,3 @@
+export XOS_DIR=/opt/xos
+python vee-synchronizer.py -C $XOS_DIR/synchronizers/vee/vee_from_api_config
+
diff --git a/xos/synchronizer/steps/sync_vee.py b/xos/synchronizer/steps/sync_vee.py
index c9182fe..c55a514 100644
--- a/xos/synchronizer/steps/sync_vee.py
+++ b/xos/synchronizer/steps/sync_vee.py
@@ -1,6 +1,6 @@
-from synchronizers.base.syncstep import *
-from synchronizers.base.ansible_helper import *
-from services.vee.models import VEEService
+from synchronizers.new_base.ansible_helper import run_template_ssh #if needed
+from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+from synchronizers.new_base.modelaccessor import *
class SyncVEEService(SyncStep):
provides=[VRouterTenant]
diff --git a/xos/synchronizer/vee-synchronizer.py b/xos/synchronizer/vee-synchronizer.py
index 84bec4f..26b44df 100644
--- a/xos/synchronizer/vee-synchronizer.py
+++ b/xos/synchronizer/vee-synchronizer.py
@@ -5,7 +5,7 @@
import importlib
import os
import sys
-observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/base")
+observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
sys.path.append(observer_path)
mod = importlib.import_module("xos-synchronizer")
mod.main()
diff --git a/xos/synchronizer/vee_from_api_config b/xos/synchronizer/vee_from_api_config
new file mode 100644
index 0000000..cdddc09
--- /dev/null
+++ b/xos/synchronizer/vee_from_api_config
@@ -0,0 +1,20 @@
+# Sets options for the synchronizer
+[observer]
+name=vee
+dependency_graph=/opt/xos/synchronizers/vee/model-deps
+steps_dir=/opt/xos/synchronizers/vee/steps
+sys_dir=/opt/xos/synchronizers/vee/sys
+#logfile=/var/log/xos_backend.log
+log_file=console
+log_level=debug
+pretend=False
+backoff_disabled=True
+save_ansible_output=True
+proxy_ssh=True
+proxy_ssh_key=/opt/cord_profile/node_key
+proxy_ssh_user=root
+accessor_kind=api
+accessor_password=@/opt/xos/services/vee/credentials/xosadmin@opencord.org
+
+[networking]
+use_vtn=True
\ No newline at end of file