Moving metronet-local to be compliand with masted, adding .sh, docker and compose files

Change-Id: I31cf7d476e0c09bedbe9934cd52cf419ac16a7cf
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
new file mode 100644
index 0000000..4cf8223
--- /dev/null
+++ b/xos/synchronizer/Dockerfile.synchronizer
@@ -0,0 +1,9 @@
+FROM xosproject/xos-synchronizer-base:candidate
+
+ADD . /opt/xos/synchronizers/metronet-local
+
+ENTRYPOINT []
+
+WORKDIR "/opt/xos/synchronizers/metronet-local"
+
+CMD bash -c "cd /opt/xos/synchronizers/metronet-local; ./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..1e78820
--- /dev/null
+++ b/xos/synchronizer/Makefile
@@ -0,0 +1,5 @@
+synchronizer:
+	sudo docker build --rm -f Dockerfile.synchronizer -t xosproject/vnodlocal-synchronizer .
+
+up:
+	docker-compose -p vnodlocal 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..9d88e7f
--- /dev/null
+++ b/xos/synchronizer/docker-compose.yml
@@ -0,0 +1,22 @@
+version: '2'
+
+networks:
+  xos:
+    external: true
+
+services:
+  synchronizer:
+    image: xosproject/vnodlocal-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/metronet-local/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..c8e7fe3
--- /dev/null
+++ b/xos/synchronizer/run-from-api.sh
@@ -0,0 +1,2 @@
+export XOS_DIR=/opt/xos
+python vnodlocal-synchronizer.py  -C $XOS_DIR/synchronizers/metronet-local/vnodlocal_from_api_config
\ No newline at end of file
diff --git a/xos/synchronizer/steps/sync_vnodlocalservice.py b/xos/synchronizer/steps/sync_vnodlocalservice.py
index 90e2ded..77d62b4 100644
--- a/xos/synchronizer/steps/sync_vnodlocalservice.py
+++ b/xos/synchronizer/steps/sync_vnodlocalservice.py
@@ -1,8 +1,9 @@
 import os
 import sys
 
-from synchronizers.base.syncstep import SyncStep
-from services.vnodlocal.models import *
+from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible #if needed
+from synchronizers.new_base.ansible_helper import run_template_ssh #if needed
+from synchronizers.new_base.modelaccessor import *
 import requests, json
 from requests.auth import HTTPBasicAuth
 
diff --git a/xos/synchronizer/vnodlocal-synchronizer.py b/xos/synchronizer/vnodlocal-synchronizer.py
index 64d0b08..a60c758 100755
--- a/xos/synchronizer/vnodlocal-synchronizer.py
+++ b/xos/synchronizer/vnodlocal-synchronizer.py
@@ -6,7 +6,7 @@
 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/vnodlocal_from_api_config b/xos/synchronizer/vnodlocal_from_api_config
new file mode 100644
index 0000000..835969d
--- /dev/null
+++ b/xos/synchronizer/vnodlocal_from_api_config
@@ -0,0 +1,20 @@
+# Sets options for the synchronizer
+[observer]
+name=vnodlocal
+dependency_graph=/opt/xos/synchronizers/metronet-local/model-deps
+steps_dir=/opt/xos/synchronizers/metronet-local/steps
+sys_dir=/opt/xos/synchronizers/metronet-local/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/metronet-local/credentials/xosadmin@opencord.org
+
+[networking]
+use_vtn=True
\ No newline at end of file