[CORD-3022] Splitting config and removing unused files

Change-Id: I7d57b3746010ee0e1d5fda79c7c93fa7276a9869
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 1aeb9bc..6ad3a88 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -37,4 +37,4 @@
       org.opencord.component.xos.vcs-url=$org_opencord_component_xos_vcs_url \
       org.opencord.component.xos.vcs-ref=$org_opencord_component_xos_vcs_ref
 
-CMD bash -c "service filebeat start; cd /opt/xos/synchronizers/epc-service; ./run-from-api.sh"
+CMD ["/usr/bin/python", "/opt/xos/synchronizers/epc-service/vepc-synchronizer.py"]
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
deleted file mode 100644
index c2f56f1..0000000
--- a/xos/synchronizer/Dockerfile.synchronizer
+++ /dev/null
@@ -1,39 +0,0 @@
-# xosproject/epc-service-synchronizer
-FROM xosproject/xos-synchronizer-base:candidate
-
-COPY . /opt/xos/synchronizers/epc-service
-
-ENTRYPOINT []
-
-WORKDIR "/opt/xos/synchronizers/epc-service"
-
-# Label image
-ARG org_label_schema_schema_version=1.0
-ARG org_label_schema_name=epc-service-synchronizer
-ARG org_label_schema_version=unknown
-ARG org_label_schema_vcs_url=unknown
-ARG org_label_schema_vcs_ref=unknown
-ARG org_label_schema_build_date=unknown
-ARG org_opencord_vcs_commit_date=unknown
-ARG org_opencord_component_chameleon_version=unknown
-ARG org_opencord_component_chameleon_vcs_url=unknown
-ARG org_opencord_component_chameleon_vcs_ref=unknown
-ARG org_opencord_component_xos_version=unknown
-ARG org_opencord_component_xos_vcs_url=unknown
-ARG org_opencord_component_xos_vcs_ref=unknown
-
-LABEL org.label-schema.schema-version=$org_label_schema_schema_version \
-      org.label-schema.name=$org_label_schema_name \
-      org.label-schema.version=$org_label_schema_version \
-      org.label-schema.vcs-url=$org_label_schema_vcs_url \
-      org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
-      org.label-schema.build-date=$org_label_schema_build_date \
-      org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
-      org.opencord.component.chameleon.version=$org_opencord_component_chameleon_version \
-      org.opencord.component.chameleon.vcs-url=$org_opencord_component_chameleon_vcs_url \
-      org.opencord.component.chameleon.vcs-ref=$org_opencord_component_chameleon_vcs_ref \
-      org.opencord.component.xos.version=$org_opencord_component_xos_version \
-      org.opencord.component.xos.vcs-url=$org_opencord_component_xos_vcs_url \
-      org.opencord.component.xos.vcs-ref=$org_opencord_component_xos_vcs_ref
-
-CMD bash -c "service filebeat start; cd /opt/xos/synchronizers/epc-service; ./run-from-api.sh"
diff --git a/xos/synchronizer/vepc_config.yaml b/xos/synchronizer/config.yaml
similarity index 85%
rename from xos/synchronizer/vepc_config.yaml
rename to xos/synchronizer/config.yaml
index c4851ee..4195f68 100644
--- a/xos/synchronizer/vepc_config.yaml
+++ b/xos/synchronizer/config.yaml
@@ -1,10 +1,35 @@
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 name: vepc
-accessor:
-  username: xosadmin@opencord.org
-  password: "@/opt/xos/services/vepc/credentials/xosadmin@opencord.org"
 required_models:
   - VEPCService
   - VEPCServiceInstance
+# steps_dir: "/opt/xos/synchronizers/epc-service/steps"
+sys_dir: "/opt/xos/synchronizers/epc-service/sys"
+model_policies_dir: "/opt/xos/synchronizers/epc-service/model_policies"
+models_dir: "/opt/xos/synchronizers/epc-service/models"
+logging:
+  version: 1
+  handlers:
+    console:
+      class: logging.StreamHandler
+  loggers:
+    'multistructlog':
+      handlers:
+          - console
+      level: DEBUG
 blueprints:
   - name: build
     networks:
@@ -192,9 +217,4 @@
         networks:
           - management
           - db_network
-
-dependency_graph: "/opt/xos/synchronizers/epc-service/model-deps"
-#steps_dir: "/opt/xos/synchronizers/epc-service/steps"
-sys_dir: "/opt/xos/synchronizers/epc-service/sys"
-model_policies_dir: "/opt/xos/synchronizers/epc-service/model_policies"
-models_dir: "/opt/xos/synchronizers/epc-service/models"
\ No newline at end of file
+          
\ No newline at end of file
diff --git a/xos/synchronizer/model-deps b/xos/synchronizer/model-deps
deleted file mode 100644
index 0967ef4..0000000
--- a/xos/synchronizer/model-deps
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
deleted file mode 100755
index dc05460..0000000
--- a/xos/synchronizer/run-from-api.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-python vepc-synchronizer.py
diff --git a/xos/synchronizer/vepc-synchronizer.py b/xos/synchronizer/vepc-synchronizer.py
index 84a324d..de418a2 100644
--- a/xos/synchronizer/vepc-synchronizer.py
+++ b/xos/synchronizer/vepc-synchronizer.py
@@ -22,9 +22,13 @@
 import sys
 from xosconfig import Config
 
-config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/vepc_config.yaml')
+base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
+mounted_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/mounted_config.yaml')
 
-Config.init(config_file, 'synchronizer-config-schema.yaml')
+if os.path.isfile(mounted_config_file):
+    Config.init(base_config_file, 'synchronizer-config-schema.yaml', mounted_config_file)
+else:
+    Config.init(base_config_file, 'synchronizer-config-schema.yaml')
 
 observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
 sys.path.append(observer_path)
diff --git a/xos/vepc-synchronizer.py b/xos/vepc-synchronizer.py
deleted file mode 100644
index 84a324d..0000000
--- a/xos/vepc-synchronizer.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/usr/bin/env python
-
-# This imports and runs ../../xos-observer.py
-
-import importlib
-import os
-import sys
-from xosconfig import Config
-
-config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/vepc_config.yaml')
-
-Config.init(config_file, 'synchronizer-config-schema.yaml')
-
-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()
\ No newline at end of file