Repository: dmwm/wmcore
Issue: MSUnmerged: Fix imports on a MicroService basis for the MSManager

**Impact of the bug**
MSUnmerged

**Describe the bug**
In the process  of developing MSUnmerged we had to introduce the dependency from the `gfal2` library, which is installed ont by the regular `rpm` based methods we use for the rest of our services and not from the cmsrepository, but it is using the standard OS `yum` based deployment mechanisms. This implies a requirement to add some more extra and dangerous sources to the `$PYTHONPATH`, like the OS path, for the running service. In order to isolate this only for this micro service  we created a separate image called `reqmgr2ms-unmerged` in docker hub, which inherits from `reqmgr2ms` and has the required (dangerous) change. A consequence we did overlook was that MSManager imports all the micro services definitions at the very beginning,  and is actually breaking all the rest of the micro services, which do not have the `gfal` library installed. All details and some log dumps from the installation process and suggested solutions are preserved in the following few comments: 
* https://github.com/dmwm/WMCore/issues/10682#issuecomment-888466001
* https://github.com/dmwm/WMCore/issues/10682#issuecomment-888511296


**How to reproduce it**
Try to deploy any micro service in K8 

**Expected behavior**
To have isolated dependencies for every 

**Additional context and error message**



Changed files:
src/python/WMCore/MicroService/MSManager.py

diff --git a/src/python/WMCore/MicroService/MSManager.py b/src/python/WMCore/MicroService/MSManager.py
index 1acf6eff4..4d257061e 100644
--- a/src/python/WMCore/MicroService/MSManager.py
+++ b/src/python/WMCore/MicroService/MSManager.py
@@ -32,11 +32,6 @@ from collections import deque
 
 # WMCore modules
 from WMCore.MicroService.Tools.Common import getMSLogger
-from WMCore.MicroService.MSTransferor.MSTransferor import MSTransferor
-from WMCore.MicroService.MSMonitor.MSMonitor import MSMonitor
-from WMCore.MicroService.MSOutput.MSOutput import MSOutput
-from WMCore.MicroService.MSRuleCleaner.MSRuleCleaner import MSRuleCleaner
-from WMCore.MicroService.MSUnmerged.MSUnmerged import MSUnmerged
 from WMCore.MicroService.TaskManager import start_new_thread
 
 
@@ -86,6 +81,7 @@ class MSManager(object):
 
         # initialize transferor module
         if 'transferor' in self.services:
+            from WMCore.MicroService.MSTransferor.MSTransferor import MSTransferor
             self.msTransferor = MSTransferor(self.msConfig, logger=self.logger)
             thname = 'MSTransferor'
             self.transfThread = start_new_thread(thname, daemon,
@@ -97,6 +93,7 @@ class MSManager(object):
 
         # initialize monitoring module
         if 'monitor' in self.services:
+            from WMCore.MicroService.MSMonitor.MSMonitor import MSMonitor
             self.msMonitor = MSMonitor(self.msConfig, logger=self.logger)
             thname = 'MSMonitor'
             self.monitThread = start_new_thread(thname, daemon,
@@ -108,6 +105,7 @@ class MSManager(object):
 
         # initialize output module
         if 'output' in self.services:
+            from WMCore.MicroService.MSOutput.MSOutput import MSOutput
             reqStatus = ['closed-out', 'announced']
             # thread safe cache to keep the last X requests processed in MSOutput
             requestNamesCached = deque(maxlen=self.msConfig.get("cacheRequestSize", 10000))
@@ -136,6 +134,7 @@ class MSManager(object):
 
         # initialize rule cleaner module
         if 'ruleCleaner' in self.services:
+            from WMCore.MicroService.MSRuleCleaner.MSRuleCleaner import MSRuleCleaner
             reqStatus = ['announced', 'aborted-completed', 'rejected']
             self.msRuleCleaner = MSRuleCleaner(self.msConfig, logger=self.logger)
             thname = 'MSRuleCleaner'
@@ -148,6 +147,7 @@ class MSManager(object):
 
         # initialize unmerged module
         if 'unmerged' in self.services:
+            from WMCore.MicroService.MSUnmerged.MSUnmerged import MSUnmerged
             self.msUnmerged = MSUnmerged(self.msConfig, logger=self.logger)
             thname = 'MSUnmerged'
             self.unmergedThread = start_new_thread(thname, daemonOpt,