Browse Source

HPCC-25821 Remove all dependencies on environment in container build

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 4 years ago
parent
commit
adef7a318f
85 changed files with 1324 additions and 406 deletions
  1. 3 1
      common/CMakeLists.txt
  2. 1 2
      common/environment/CMakeLists.txt
  3. 8 2
      common/environment/dalienv.hpp
  4. 13 1
      common/environment/environment.hpp
  5. 3 1
      common/fileview2/CMakeLists.txt
  6. 3 1
      dali/dalidiag/CMakeLists.txt
  7. 2 0
      dali/dalidiag/dalidiag.cpp
  8. 3 1
      dali/datest/dfuwutest.cmake
  9. 6 0
      dali/dfu/dfurun.cpp
  10. 4 0
      dali/dfu/dfurunkdp.cpp
  11. 4 1
      dali/dfu/dfuserver.cmake
  12. 3 1
      dali/dfuXRefLib/CMakeLists.txt
  13. 4 0
      dali/dfuXRefLib/dfuxreflib.cpp
  14. 3 1
      dali/dfuxref/CMakeLists.txt
  15. 3 1
      dali/ft/dalift.cmake
  16. 22 0
      dali/ft/filecopy.cpp
  17. 3 1
      dali/ft/ftslave.cmake
  18. 4 1
      dali/sasha/CMakeLists.txt
  19. 4 2
      dali/sasha/saqmon.cpp
  20. 4 0
      deployment/configgen/CMakeLists.txt
  21. 4 1
      ecl/agentexec/CMakeLists.txt
  22. 4 1
      ecl/eclagent/eclagent.cpp
  23. 1 1
      ecl/eclcc/CMakeLists.txt
  24. 3 1
      ecl/eclscheduler/CMakeLists.txt
  25. 4 1
      ecl/hthor/CMakeLists.txt
  26. 0 3
      ecl/scheduleadmin/CMakeLists.txt
  27. 0 1
      ecl/schedulectrl/CMakeLists.txt
  28. 3 1
      esp/clients/wsdfuaccess/CMakeLists.txt
  29. 5 1
      esp/clients/wsdfuaccess/wsdfuaccess.cpp
  30. 4 1
      esp/platform/CMakeLists.txt
  31. 4 1
      esp/services/WsDeploy/CMakeLists.txt
  32. 4 1
      esp/services/ws_codesign/CMakeLists.txt
  33. 5 3
      esp/services/ws_config/CMakeLists.txt
  34. 4 1
      esp/services/ws_configmgr/CMakeLists.txt
  35. 4 1
      esp/services/ws_dfu/CMakeLists.txt
  36. 30 0
      esp/services/ws_dfu/ws_dfuService.cpp
  37. 8 0
      esp/services/ws_dfu/ws_dfuXRefService.cpp
  38. 4 1
      esp/services/ws_ecl/CMakeLists.txt
  39. 7 0
      esp/services/ws_ecl/ws_ecl_service.cpp
  40. 0 3
      esp/services/ws_elk/CMakeLists.txt
  41. 4 1
      esp/services/ws_esdlconfig/CMakeLists.txt
  42. 4 1
      esp/services/ws_fileio/CMakeLists.txt
  43. 4 0
      esp/services/ws_fileio/ws_fileioservice.cpp
  44. 4 1
      esp/services/ws_fs/CMakeLists.txt
  45. 5 1
      esp/services/ws_fs/ws_fsBinding.cpp
  46. 31 1
      esp/services/ws_fs/ws_fsService.cpp
  47. 1 1
      esp/services/ws_machine/CMakeLists.txt
  48. 4 2
      esp/services/ws_machine/ws_machineServiceMetrics.cpp
  49. 6 0
      esp/services/ws_machine/ws_machineServiceRexec.cpp
  50. 4 0
      esp/services/ws_packageprocess/ws_packageprocessService.cpp
  51. 1 1
      esp/services/ws_smc/CMakeLists.txt
  52. 4 3
      esp/services/ws_topology/CMakeLists.txt
  53. 8 0
      esp/services/ws_topology/ws_topologyService.cpp
  54. 4 1
      esp/services/ws_workunits/CMakeLists.txt
  55. 19 0
      esp/services/ws_workunits/ws_workunitsHelpers.cpp
  56. 17 0
      esp/services/ws_workunits/ws_workunitsQuerySets.cpp
  57. 7 3
      esp/services/ws_workunits/ws_workunitsService.cpp
  58. 4 0
      esp/services/ws_workunits/ws_workunitsService.hpp
  59. 12 2
      esp/smc/SMCLib/CMakeLists.txt
  60. 99 0
      esp/smc/SMCLib/TpCommon.cpp
  61. 804 0
      esp/smc/SMCLib/TpContainer.cpp
  62. 3 325
      esp/smc/SMCLib/TpWrapper.cpp
  63. 4 5
      esp/smc/SMCLib/TpWrapper.hpp
  64. 3 1
      fs/dafscontrol/CMakeLists.txt
  65. 3 1
      plugins/fileservices/CMakeLists.txt
  66. 14 0
      plugins/fileservices/fileservices.cpp
  67. 3 1
      plugins/workunitservices/CMakeLists.txt
  68. 4 0
      plugins/workunitservices/workunitservices.cpp
  69. 4 1
      roxie/ccd/CMakeLists.txt
  70. 2 1
      roxie/ccd/ccdcontext.cpp
  71. 2 0
      roxie/ccd/ccdmain.cpp
  72. 11 0
      system/jlib/jutil.cpp
  73. 3 1
      thorlcr/activities/activitymasters_lcr.cmake
  74. 3 2
      thorlcr/activities/activityslaves_lcr.cmake
  75. 0 1
      thorlcr/graph/graph_lcr.cmake
  76. 0 1
      thorlcr/graph/graphmaster_lcr.cmake
  77. 0 1
      thorlcr/graph/graphslave_lcr.cmake
  78. 5 1
      thorlcr/master/CMakeLists.txt
  79. 4 1
      thorlcr/master/thgraphmanager.cpp
  80. 5 0
      thorlcr/master/thmastermain.cpp
  81. 3 1
      thorlcr/mfilemanager/CMakeLists.txt
  82. 4 1
      thorlcr/slave/CMakeLists.txt
  83. 0 1
      thorlcr/thorcodectx/CMakeLists.txt
  84. 0 1
      tools/swapnode/swapnodelib.cmake
  85. 0 1
      tools/wutool/CMakeLists.txt

+ 3 - 1
common/CMakeLists.txt

@@ -15,7 +15,9 @@
 ################################################################################
 HPCC_ADD_SUBDIRECTORY (deftype)
 HPCC_ADD_SUBDIRECTORY (dllserver)
-HPCC_ADD_SUBDIRECTORY (environment)
+if (NOT CONTAINERIZED)
+    HPCC_ADD_SUBDIRECTORY (environment)
+ENDIF()
 if ("${BUILD_LEVEL}" STREQUAL "INTERNAL")
     HPCC_ADD_SUBDIRECTORY (fileview2)
 else ()

+ 1 - 2
common/environment/CMakeLists.txt

@@ -22,7 +22,7 @@
 #    Cmake Input File for environment
 #####################################################
 
-project( environment ) 
+project( environment )
 
 set (    SRCS 
          dalienv.cpp 
@@ -53,4 +53,3 @@ target_link_libraries ( environment
          remote 
          dalibase 
     )
-

+ 8 - 2
common/environment/dalienv.hpp

@@ -26,12 +26,12 @@
 
 #include "environment.hpp"
 
+#ifndef _CONTAINERIZED
+
 interface IFile;
 class RemoteFilename;
 
 extern ENVIRONMENT_API EnvMachineOS queryOS(const IpAddress & ip);
-
-
 extern ENVIRONMENT_API bool canAccessFilesDirectly(const RemoteFilename & file);
 extern ENVIRONMENT_API bool canAccessFilesDirectly(const IpAddress & ip);
 extern ENVIRONMENT_API bool canAccessFilesDirectly(const char * ipText);
@@ -53,4 +53,10 @@ extern ENVIRONMENT_API void envInstallNASHooks(IPropertyTree *nasPTree, SocketEn
 extern ENVIRONMENT_API IPropertyTree *envGetInstallNASHooks(SocketEndpoint *myEp=NULL);
 extern ENVIRONMENT_API IPropertyTree *envGetInstallNASHooks(IPropertyTree *nasPTree, SocketEndpoint *myEp=NULL);
 
+#else
+
+inline bool canSpawnChildProcess(const IpAddress & ip) { return true; }
+inline EnvMachineOS queryOS(const IpAddress & ip) { return MachineOsLinux; }
+
+#endif
 #endif

+ 13 - 1
common/environment/environment.hpp

@@ -226,12 +226,19 @@ interface IEnvironmentFactory : extends IInterface
     virtual void validateCache() = 0;
 };
 
+#ifndef _CONTAINERIZED
+
 class StringBuffer;
 extern "C" ENVIRONMENT_API IEnvironmentFactory * getEnvironmentFactory(bool update);
 extern "C" ENVIRONMENT_API void closeEnvironment();
 
 extern ENVIRONMENT_API unsigned getAccessibleServiceURLList(const char *serviceType, std::vector<std::string> &list);
 
+#else
+inline void closeEnvironment() {}
+
+#endif
+
 //------------------- Moved from workunit.hpp -------------
 
 // This enumeration is currently duplicated in workunit.hpp and environment.hpp.  They must stay in sync.
@@ -269,6 +276,10 @@ interface IConstWUClusterInfo : extends IInterface
     virtual const char *getAlias() const = 0;
 };
 
+typedef IArrayOf<IConstWUClusterInfo> CConstWUClusterInfoArray;
+
+#ifndef _CONTAINERIZED
+
 extern ENVIRONMENT_API void getDFUServerQueueNames(StringArray &ret, const char *process);
 extern ENVIRONMENT_API IStringVal &getEclCCServerQueueNames(IStringVal &ret, const char *process);
 extern ENVIRONMENT_API IStringVal &getEclServerQueueNames(IStringVal &ret, const char *process);
@@ -282,7 +293,6 @@ extern ENVIRONMENT_API StringBuffer &getClusterThorGroupName(StringBuffer &ret,
 extern ENVIRONMENT_API IStringIterator *getTargetClusters(const char *processType, const char *processName);
 extern ENVIRONMENT_API bool validateTargetClusterName(const char *clustname);
 extern ENVIRONMENT_API IConstWUClusterInfo* getTargetClusterInfo(const char *clustname);
-typedef IArrayOf<IConstWUClusterInfo> CConstWUClusterInfoArray;
 extern ENVIRONMENT_API unsigned getEnvironmentClusterInfo(CConstWUClusterInfoArray &clusters);
 extern ENVIRONMENT_API unsigned getEnvironmentClusterInfo(IPropertyTree* environmentRoot, CConstWUClusterInfoArray &clusters);
 extern ENVIRONMENT_API void getRoxieProcessServers(const char *process, SocketEndpointArray &servers);
@@ -290,5 +300,7 @@ extern ENVIRONMENT_API bool isProcessCluster(const char *remoteDali, const char
 extern ENVIRONMENT_API bool isProcessCluster(const char *process);
 extern ENVIRONMENT_API unsigned getEnvironmentThorClusterNames(StringArray &thorNames, StringArray &groupNames, StringArray &targetNames, StringArray &queueNames);
 
+#endif // !_CONTAINERIZED
+
 #endif // _ENVIRONMENT_INCL
 //end

+ 3 - 1
common/fileview2/CMakeLists.txt

@@ -92,7 +92,6 @@ target_link_libraries ( fileview2
          eclrtl 
          jhtree 
          dalibase 
-         environment 
          dllserver 
          deftype 
          workunit 
@@ -100,3 +99,6 @@ target_link_libraries ( fileview2
          hql 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( fileview2 environment )
+endif()

+ 3 - 1
dali/dalidiag/CMakeLists.txt

@@ -48,7 +48,9 @@ target_link_libraries ( dalidiag
          mp 
          hrpc 
          remote 
-         environment 
          dalibase 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dalidiag environment )
+endif()

+ 2 - 0
dali/dalidiag/dalidiag.cpp

@@ -302,6 +302,7 @@ void partInfo(const char *name,unsigned copy)
 
 void nodeInfo(const char *ip)
 {
+#ifndef _CONTAINERIZED
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory(false);
     Owned<IConstEnvironment> env = factory->openEnvironment();
 
@@ -331,6 +332,7 @@ void nodeInfo(const char *ip)
     }
     else
         printf("ERROR: cannot find '%s' in Dali Environment\n",ip);
+#endif
 }
 
 void slaveNode(const char *thor,unsigned n)

+ 3 - 1
dali/datest/dfuwutest.cmake

@@ -50,6 +50,8 @@ target_link_libraries ( dfuwutest
          dafsclient 
          dalibase 
          dfuwu 
-         environment 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dfuwutest environment )
+endif()

+ 6 - 0
dali/dfu/dfurun.cpp

@@ -1075,9 +1075,11 @@ public:
                 : running(_running)
             {
                 if (--running == 0) {
+#ifndef _CONTAINERIZED
                     Owned<IEnvironmentFactory> envf = getEnvironmentFactory(false);
                     Owned<IConstEnvironment> env = envf->openEnvironment();
                     env->clearCache();
+#endif
                 }
             }
             ~CenvClear()
@@ -1263,6 +1265,9 @@ public:
                     {
                         if (options->getPush())
                         {
+#ifdef _CONTAINERIZED
+                            UNIMPLEMENTED_X("CONTAINERIZED(ForeignFileCopy:push)");
+#else
                             // need to set ftslave location
                             StringBuffer progpath;
                             StringBuffer workdir;
@@ -1271,6 +1276,7 @@ public:
                             {
                                 opttree->setProp("@slave",progpath.str());
                             }
+#endif
                         }
                     }
                     if (destination->getMultiCopy()&&!destination->getWrap())

+ 4 - 0
dali/dfu/dfurunkdp.cpp

@@ -42,7 +42,11 @@ class CDKDPitem : public CInterface
     StringBuffer &getExePath(const char *tail,StringBuffer &ret,StringBuffer &workdir)
     {
         StringBuffer p;
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(dkc)");
+#else
         querySlaveExecutable("DKCSlaveProcess", "dkcslave", NULL, ep, p, workdir);
+#endif
         splitDirTail(p.str(),ret);
         addPathSepChar(ret).append(tail);
         if (getPathSepChar(ret.str())=='\\') {

+ 4 - 1
dali/dfu/dfuserver.cmake

@@ -59,7 +59,6 @@ target_link_libraries ( dfuserver
          hrpc 
          dafsclient 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 
@@ -70,3 +69,7 @@ target_link_libraries ( dfuserver
          jhtree 
          dfuwu 
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dfuserver environment )
+endif()

+ 3 - 1
dali/dfuXRefLib/CMakeLists.txt

@@ -58,6 +58,8 @@ target_link_libraries ( dfuXRefLib
          hrpc 
          dafsclient 
          dalibase 
-         environment 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dfuXRefLib environment )
+endif()

+ 4 - 0
dali/dfuXRefLib/dfuxreflib.cpp

@@ -2678,8 +2678,12 @@ IPropertyTree *  runXRef(unsigned nclusters,const char **clusters,IXRefProgressC
 #endif
     // assume all nodes same OS
     Owned<IGroup> group = queryNamedGroupStore().lookup(clusters[0]);
+#ifdef _CONTAINERIZED
+    WARNLOG("CONTAINERIZED(runXRef calls queryOS())");
+#else
     if (group)
         islinux = queryOS(group->queryNode(0).endpoint())==MachineOsLinux;
+#endif
     dirs[0] = queryBaseDirectory(grp_unknown, 0,islinux?DFD_OSunix:DFD_OSwindows);  // MORE - should use the info from the group store
     dirs[1] = queryBaseDirectory(grp_unknown, 1,islinux?DFD_OSunix:DFD_OSwindows);
     numdirs = 2;

+ 3 - 1
dali/dfuxref/CMakeLists.txt

@@ -52,8 +52,10 @@ target_link_libraries ( dfuxref
          hrpc 
          dafsclient
          dalibase 
-         environment 
          dfuXRefLib 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dfuxref environment )
+endif()
 

+ 3 - 1
dali/ft/dalift.cmake

@@ -58,6 +58,8 @@ target_link_libraries ( dalift
          hrpc 
          dafsclient
          dalibase 
-         environment 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dalift environment )
+endif()

+ 22 - 0
dali/ft/filecopy.cpp

@@ -43,6 +43,25 @@
 #include "dalienv.hpp"
 #include "ftbase.ipp"
 
+#ifdef _CONTAINERIZED
+//Temporary see HPCC-25822
+inline bool canAccessFilesDirectly(const RemoteFilename & file)
+{
+    if (file.queryEndpoint().port!=0)
+        return false;
+    const IpAddress & ip = file.queryIP();
+    if (ip.isLocal()||ip.isNull())  // the isNull check is probably an error but saves time
+        return true;                // I think usually already checked, but another can't harm
+    return false;
+}
+
+inline void setCanAccessDirectly(RemoteFilename & file)
+{
+    setCanAccessDirectly(file,canAccessFilesDirectly(file));
+}
+
+#endif
+
 #define DEFAULT_MAX_CONNECTIONS 800
 #define PARTITION_RECOVERY_LIMIT 1000
 #define EXPECTED_RESPONSE_TIME          (60 * 1000)
@@ -935,6 +954,8 @@ void FileSprayer::beforeTransfer()
     }
 
     throttleNicSpeed = options->getPropInt(ANthrottle, 0);
+#ifndef _CONTAINERIZED
+    //MORE: This is very old windows support code.  We could add support for per-plane throttling if it is required.
     if (throttleNicSpeed == 0 && !usePullOperation() && targets.ordinality() == 1 && sources.ordinality() > 1)
     {
         Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
@@ -951,6 +972,7 @@ void FileSprayer::beforeTransfer()
             }
         }
     }
+#endif
 }
 
 

+ 3 - 1
dali/ft/ftslave.cmake

@@ -46,7 +46,9 @@ target_link_libraries ( ftslave
          hrpc 
          remote 
          dalibase 
-         environment 
          dalift 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ftslave environment )
+endif()

+ 4 - 1
dali/sasha/CMakeLists.txt

@@ -80,7 +80,6 @@ target_link_libraries ( saserver
          jlib 
          dafsclient 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 
@@ -88,6 +87,10 @@ target_link_libraries ( saserver
          workunit 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( saserver environment )
+endif()
+
 set (    SRCS 
          sacmd.cpp 
          sasha.cpp 

+ 4 - 2
dali/sasha/saqmon.cpp

@@ -13,6 +13,9 @@
 #include "wujobq.hpp"
 #include "environment.hpp"
 
+#ifndef _CONTAINERIZED
+//not currently created or used in the containerized version
+
 //#define TESTING
 
 #define DEFAULT_QMONITOR_INTERVAL       1  // minutes
@@ -294,5 +297,4 @@ ISashaServer *createSashaQMonitorServer()
     return sashaQMonitorServer;
 }
 
-
-
+#endif // !_CONTAINERIZED

+ 4 - 0
deployment/configgen/CMakeLists.txt

@@ -48,6 +48,10 @@ target_link_libraries ( configgen
         environment 
         )
 
+if (CONTAINERIZED)
+    message(FATAL_ERROR "Configgen is not included in container builds")
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( configgen
     	securesocket

+ 4 - 1
ecl/agentexec/CMakeLists.txt

@@ -49,6 +49,9 @@ target_link_libraries ( agentexec
          jlib 
          dalibase 
          eclrtl 
-         environment
          workunit
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( agentexec environment )
+endif()

+ 4 - 1
ecl/eclagent/eclagent.cpp

@@ -3060,7 +3060,7 @@ char * EclAgent::getGroupName()
 #ifdef _CONTAINERIZED
     // in a containerized setup, the group is moving..
     return strdup("unknown");
-#endif
+#else
     StringBuffer groupName;
     if (!isStandAloneExe)
     {
@@ -3104,6 +3104,7 @@ char * EclAgent::getGroupName()
         }
     }
     return groupName.detach();
+#endif
 }
 
 char * EclAgent::queryIndexMetaData(char const * lfn, char const * xpath)
@@ -3664,8 +3665,10 @@ extern int HTHOR_API eclagent_main(int argc, const char *argv[], StringBuffer *
             if (getConfigurationDirectory(agentTopology->queryPropTree("Directories"),"mirror","eclagent",agentTopology->queryProp("@name"),baseDir.clear()))
                 setBaseDirectory(baseDir.str(), true);
 
+#ifndef _CONTAINERIZED
             if (agentTopology->getPropBool("@useNASTranslation", true))
                 envInstallNASHooks();
+#endif
 
             if (standAloneWorkUnit)
             {

+ 1 - 1
ecl/eclcc/CMakeLists.txt

@@ -74,7 +74,7 @@ target_link_libraries ( eclcc
          dllserver
     )
 
-if (CONTAINERIZED)
+if (NOT CONTAINERIZED)
   target_link_libraries ( eclcc environment )
 endif()
 

+ 3 - 1
ecl/eclscheduler/CMakeLists.txt

@@ -51,7 +51,9 @@ install ( TARGETS eclscheduler RUNTIME DESTINATION ${EXEC_DIR} )
 target_link_libraries ( eclscheduler 
          jlib
          schedulectrl
-         environment
          workunit
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( eclscheduler environment )
+endif()

+ 4 - 1
ecl/hthor/CMakeLists.txt

@@ -87,7 +87,6 @@ target_link_libraries ( hthorlib
          hrpc
          dafsclient
          dalibase
-         environment
          dllserver
          nbcd
          eclrtl
@@ -100,6 +99,10 @@ target_link_libraries ( hthorlib
          wuanalysis
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( hthorlib environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( hthorlib
     	securesocket

+ 0 - 3
ecl/scheduleadmin/CMakeLists.txt

@@ -47,7 +47,6 @@ target_link_libraries ( scheduleadmin
          jlib
          remote 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 
@@ -55,5 +54,3 @@ target_link_libraries ( scheduleadmin
          workunit 
          schedulectrl 
     )
-
-

+ 0 - 1
ecl/schedulectrl/CMakeLists.txt

@@ -50,7 +50,6 @@ target_link_libraries ( schedulectrl
          jlib
          remote 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 

+ 3 - 1
esp/clients/wsdfuaccess/CMakeLists.txt

@@ -73,8 +73,10 @@ target_link_libraries ( wsdfuaccess
          dafsstream
          thorhelper
          dalibase
-         environment
          ${CPPUNIT_LIBRARIES}
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( wsdfuaccess environment )
+endif()
 

+ 5 - 1
esp/clients/wsdfuaccess/wsdfuaccess.cpp

@@ -50,8 +50,11 @@ static CriticalSection dfuServiceUrlCrit;
 static std::atomic<unsigned> currentDfuServiceUrl{0};
 static std::atomic<bool> dfuServiceUrlsDiscovered{false};
 
-void ensureAccessibleDfuServiceURLList()
+static void ensureAccessibleDfuServiceURLList()
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(ensureAccessibleDfuServiceURLList)");
+#else
     bool expected = false;
     if (dfuServiceUrlsDiscovered.compare_exchange_strong(expected, true))
     {
@@ -62,6 +65,7 @@ void ensureAccessibleDfuServiceURLList()
         for (auto &s: dfuServiceUrls)
             s = s + "/WsDfu/";
     }
+#endif
 }
 
 static unsigned getNumDfuServiceURL()

+ 4 - 1
esp/platform/CMakeLists.txt

@@ -61,5 +61,8 @@ target_link_libraries ( esp
          hrpc 
          remote 
          dalibase 
-         environment 
     ) 
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( esp environment )
+endif()

+ 4 - 1
esp/services/WsDeploy/CMakeLists.txt

@@ -72,7 +72,6 @@ target_link_libraries ( WsDeploy
          xmllib 
          esphttp 
          dalibase 
-         environment 
          dllserver 
          eclrtl 
          hql 
@@ -81,6 +80,10 @@ target_link_libraries ( WsDeploy
          configutils
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( WsDeploy environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( WsDeploy
     	securesocket

+ 4 - 1
esp/services/ws_codesign/CMakeLists.txt

@@ -71,6 +71,9 @@ target_link_libraries ( ws_codesign
          xmllib
          esphttp
          dalibase
-         environment
          SMCLib
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_codesign environment )
+endif()

+ 5 - 3
esp/services/ws_config/CMakeLists.txt

@@ -22,6 +22,10 @@
 #    Cmake Input File for ws_config
 #####################################################
 
+if (CONTAINERIZED)
+    message(FATAL_ERROR "Configgen is not included in container builds")
+endif()
+
 project( ws_config ) 
 
 include(${HPCC_SOURCE_DIR}/esp/scm/additional.cmake)
@@ -62,10 +66,8 @@ target_link_libraries ( ws_config
          hrpc 
          remote 
          dalibase 
-         environment 
+         environment
          ${XALAN_LIBRARIES} ${XERCES_LIBRARIES}
          xmllib 
          esphttp 
     )
-
-

+ 4 - 1
esp/services/ws_configmgr/CMakeLists.txt

@@ -69,11 +69,14 @@ target_link_libraries(ws_configmgr
     jlib
     xmllib
     esphttp
-    environment
     dllserver
     configmgr
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_configmgr environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( ws_configmgr
         securesocket

+ 4 - 1
esp/services/ws_dfu/CMakeLists.txt

@@ -95,7 +95,6 @@ target_link_libraries ( ws_dfu
          eclrtl 
          jhtree 
          dalibase 
-         environment 
          dllserver 
          deftype 
          workunit 
@@ -111,6 +110,10 @@ target_link_libraries ( ws_dfu
          wsdfuaccess
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_dfu environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( ws_dfu
     	securesocket

+ 30 - 0
esp/services/ws_dfu/ws_dfuService.cpp

@@ -101,6 +101,7 @@ short days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
 CThorNodeGroup* CThorNodeGroupCache::readNodeGroup(const char* _groupName)
 {
+#ifndef _CONTAINERIZED
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> env = factory->openEnvironment();
     Owned<IPropertyTree> root = &env->getPTree();
@@ -113,6 +114,7 @@ CThorNodeGroup* CThorNodeGroupCache::readNodeGroup(const char* _groupName)
         if (groupName.length() && strieq(groupName.str(), _groupName))
             return new CThorNodeGroup(_groupName, cluster.getCount("ThorSlaveProcess"), cluster.getPropBool("@replicateOutputs", false));
     }
+#endif
 
     return NULL;
 }
@@ -183,8 +185,13 @@ void CWsDfuEx::init(IPropertyTree *cfg, const char *process, const char *service
 
     setDaliServixSocketCaching(true);
 
+#ifdef _CONTAINERIZED
+    IERRLOG("CONTAINERIZED(CWsDfuEx::init)");
+    maxFileAccessExpirySeconds = defaultMaxFileAccessExpirySeconds;
+#else
     factory.setown(getEnvironmentFactory(true));
     env.setown(factory->openEnvironment());
+#endif
     maxFileAccessExpirySeconds = serviceTree->getPropInt("@maxFileAccessExpirySeconds", defaultMaxFileAccessExpirySeconds);
 }
 
@@ -2108,9 +2115,11 @@ void CWsDfuEx::getFilePartsOnClusters(IEspContext &context, const char *clusterR
             if (clusterInfo) //Should be valid. But, check it just in case.
             {
                 partsOnCluster->setReplicate(clusterInfo->queryPartDiskMapping().isReplicated());
+#ifndef _CONTAINERIZED
                 Owned<CThorNodeGroup> nodeGroup = thorNodeGroupCache->lookup(clusterName, nodeGroupCacheTimeout);
                 if (nodeGroup)
                     partsOnCluster->setCanReplicate(nodeGroup->queryCanReplicate());
+#endif
                 const char *defaultDir = fdesc->queryDefaultDir();
                 if (!isEmptyString(defaultDir))
                 {
@@ -5928,6 +5937,9 @@ void CWsDfuEx::getFileDafilesrvConfiguration(StringBuffer &keyPairName, unsigned
 {
     port = DEFAULT_ROWSERVICE_PORT;
     secure = false;
+#ifdef _CONTAINERIZED
+    IERRLOG("CONTAINERIZED(CWsDfuEx::getFileDafilesrvConfiguration)");
+#else
     keyPairName.set(env->getClusterGroupKeyPairName(group));
     Owned<IConstDaFileSrvInfo> daFileSrvInfo = env->getDaFileSrvGroupInfo(group);
     if (daFileSrvInfo)
@@ -5935,6 +5947,7 @@ void CWsDfuEx::getFileDafilesrvConfiguration(StringBuffer &keyPairName, unsigned
         port = daFileSrvInfo->getPort();
         secure = daFileSrvInfo->getSecure();
     }
+#endif
 }
 
 void CWsDfuEx::getFileDafilesrvConfiguration(StringBuffer &keyPairName, unsigned &retPort, bool &retSecure, const char *fileName, std::vector<std::string> &groups)
@@ -6136,6 +6149,9 @@ bool CWsDfuEx::onDFUFileAccessV2(IEspContext &context, IEspDFUFileAccessV2Reques
 // NB: deprecated from ver >= 1.50
 static IGroup *getDFUFileIGroup(const char *clusterName, ClusterType clusterType, const char *clusterTypeEx, StringArray &locations, StringBuffer &groupName)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(getDFUFileIGroup)"); // call to getClusterGroupName() is not available.
+#else
     GroupType groupType;
     StringBuffer basedir;
     getClusterGroupName(groupName, clusterName);
@@ -6201,6 +6217,7 @@ static IGroup *getDFUFileIGroup(const char *clusterName, ClusterType clusterType
         ESPLOG(LogMin, "DFUFileIGroup %s added", groupName.str());
     }
     return group.getClear();
+#endif
 }
 
 void CWsDfuEx::exportRecordDefinitionBinaryType(const char *recordDefinition, MemoryBuffer &layoutBin)
@@ -6224,6 +6241,9 @@ bool CWsDfuEx::onDFUFileCreate(IEspContext &context, IEspDFUFileCreateRequest &r
 {
     try
     {
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CWsDfuEx::onDFUFileCreate)");
+#else
         IConstDFUFileAccessRequestBase &requestBase = req.getRequestBase();
         const char *fileName = requestBase.getName();
         const char *clusterName = requestBase.getCluster();
@@ -6309,6 +6329,7 @@ bool CWsDfuEx::onDFUFileCreate(IEspContext &context, IEspDFUFileCreateRequest &r
         accessInfo.setExpiryTime(metaInfo->queryProp("expiryTime"));
         accessInfo.setFileAccessPort(metaInfo->getPropInt("port"));
         accessInfo.setFileAccessSSL(metaInfo->getPropBool("secure"));
+#endif
     }
     catch (IException *e)
     {
@@ -6321,6 +6342,9 @@ bool CWsDfuEx::onDFUFileCreateV2(IEspContext &context, IEspDFUFileCreateV2Reques
 {
     try
     {
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CWsDfuEx::onDFUFileCreateV2)");
+#else
         const char *fileName = req.getName();
         const char *clusterName = req.getCluster();
         const char *recordDefinition = req.getECLRecordDefinition();
@@ -6440,6 +6464,7 @@ bool CWsDfuEx::onDFUFileCreateV2(IEspContext &context, IEspDFUFileCreateV2Reques
             accessInfo.setFileAccessPort(metaInfo->getPropInt("port"));
             accessInfo.setFileAccessSSL(metaInfo->getPropBool("secure"));
         }
+#endif
     }
     catch (IException *e)
     {
@@ -6494,7 +6519,12 @@ bool CWsDfuEx::onDFUFilePublish(IEspContext &context, IEspDFUFilePublishRequest
             if (isEmptyString(recordDefinition))
                  throw makeStringException(ECLWATCH_INVALID_INPUT, "DFUFilePublish: No ECLRecordDefinition defined.");
 
+#ifdef _CONTAINERIZED
+            IERRLOG("CONTAINERIZED(CWsDfuEx::onDFUFilePublish)");
+            ClusterType clusterType = NoCluster;
+#else
             ClusterType clusterType = getClusterTypeByClusterName(clusterName);
+#endif
             const char *clusterTypeEx = clusterTypeString(clusterType, false);
             GroupType groupType;
             StringBuffer basedir;

+ 8 - 0
esp/services/ws_dfu/ws_dfuXRefService.cpp

@@ -553,6 +553,9 @@ bool CWsDfuXRefEx::onDFUXRefList(IEspContext &context, IEspDFUXRefListRequest &r
 {
     try
     {
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(CWsDfuXRefEx::onDFUXRefList)");
+#else
         context.ensureFeatureAccess(FEATURE_URL, SecAccess_Read, ECLWATCH_DFU_XREF_ACCESS_DENIED, "WsDfuXRef::DFUXRefList: Permission denied.");
 
         CConstWUClusterInfoArray clusters;
@@ -582,6 +585,7 @@ bool CWsDfuXRefEx::onDFUXRefList(IEspContext &context, IEspDFUXRefListRequest &r
 
         StringBuffer buf;
         resp.setDFUXRefListResult(formatResult(context, xrefNodeTree, buf));
+#endif
     }
     catch(IException *e)
     {   
@@ -699,6 +703,9 @@ void CWsDfuXRefEx::findUnusedFilesWithDetailsInDFS(IEspContext &context, const c
 
 bool CWsDfuXRefEx::onDFUXRefUnusedFiles(IEspContext &context, IEspDFUXRefUnusedFilesRequest &req, IEspDFUXRefUnusedFilesResponse &resp)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(CWsDfuXRefEx::onDFUXRefUnusedFiles)");
+#else
     const char *process = req.getProcessCluster();
     if (isEmptyString(process))
         throw MakeStringExceptionDirect(ECLWATCH_INVALID_INPUT, "process cluster not specified.");
@@ -734,6 +741,7 @@ bool CWsDfuXRefEx::onDFUXRefUnusedFiles(IEspContext &context, IEspDFUXRefUnusedF
         resp.setUnusedFilesWithDetails(unusedLFs);
     }
     return true;
+#endif
 }
 
 IXRefNode *CWsDfuXRefEx::getXRefNodeByCluster(const char* cluster)

+ 4 - 1
esp/services/ws_ecl/CMakeLists.txt

@@ -67,7 +67,6 @@ target_link_libraries ( ws_ecl
          hrpc 
          remote 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 
@@ -80,6 +79,10 @@ target_link_libraries ( ws_ecl
          xmllib 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_ecl environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( ws_ecl
     	securesocket

+ 7 - 0
esp/services/ws_ecl/ws_ecl_service.cpp

@@ -216,6 +216,7 @@ void initContainerRoxieTargets(MapStringToMyClass<ISmartSocketFactory> &connMap)
     }
 }
 
+#ifndef _CONTAINERIZED
 void initBareMetalRoxieTargets(MapStringToMyClass<ISmartSocketFactory> &connMap, IPropertyTree *serviceTree, const char *daliAddress)
 {
     IPropertyTree *vips = serviceTree->queryPropTree("VIPS");
@@ -281,6 +282,8 @@ void initBareMetalRoxieTargets(MapStringToMyClass<ISmartSocketFactory> &connMap,
         }
     }
 }
+#endif
+
 bool CWsEclService::init(const char * name, const char * type, IPropertyTree * cfg, const char * process)
 {
     StringBuffer xpath;
@@ -1533,9 +1536,13 @@ int CWsEclBinding::getGenForm(IEspContext &context, CHttpRequest* request, CHttp
     xform->setParameter("includeSoapTest", "1");
     xform->setParameter("useTextareaForStringArray", "1");
 
+#ifdef _CONTAINERIZED
+    WARNLOG("CONTAINERIZED(CWsEclBinding::getGenForm) not fully implemented");
+#else
     Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(wuinfo.qsetname);
     bool isRoxie = clusterInfo && (clusterInfo->getPlatform() == RoxieCluster);
     xform->setParameter("includeRoxieOptions", isRoxie ? "1" : "0");
+#endif
 
     // set the prop noDefaultValue param
     IProperties* props = context.queryRequestParameters();

+ 0 - 3
esp/services/ws_elk/CMakeLists.txt

@@ -38,7 +38,6 @@ include_directories (
          ${HPCC_SOURCE_DIR}/esp/esplib
          ${HPCC_SOURCE_DIR}/esp/platform
          ${HPCC_SOURCE_DIR}/system/jlib
-         ${HPCC_SOURCE_DIR}/common/environment
          ${HPCC_SOURCE_DIR}/esp/services
          ${HPCC_SOURCE_DIR}/common
          ${HPCC_SOURCE_DIR}/system/security/securesocket
@@ -70,7 +69,5 @@ target_link_libraries ( ws_elk
          xmllib
          esphttp
          dalibase
-         environment
          dllserver
-         SMCLib
     )

+ 4 - 1
esp/services/ws_esdlconfig/CMakeLists.txt

@@ -67,9 +67,12 @@ install ( TARGETS ws_esdlconfig RUNTIME DESTINATION bin LIBRARY DESTINATION lib
 target_link_libraries ( ws_esdlconfig
          jlib
          esphttp
-         environment
          dllserver
          SMCLib
          esdl_svc_engine
          dalibase
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_esdlconfig environment )
+endif()

+ 4 - 1
esp/services/ws_fileio/CMakeLists.txt

@@ -71,8 +71,11 @@ target_link_libraries ( ws_fileio
          hrpc 
          remote 
          dalibase 
-         environment 
          ${XALAN_LIBRARIES} ${XERCES_LIBRARIES}
          xmllib 
          esphttp 
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_fileio environment )
+endif()

+ 4 - 0
esp/services/ws_fileio/ws_fileioservice.cpp

@@ -37,6 +37,9 @@ bool CWsFileIOEx::CheckServerAccess(const char* targetDZNameOrAddress, const cha
     if (!targetDZNameOrAddress || (targetDZNameOrAddress[0] == 0) || !relPath || (relPath[0] == 0))
         return false;
 
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(CWsFileIOEx::CheckServerAccess)");
+#else
     netAddr.clear();
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> env = factory->openEnvironment();
@@ -119,6 +122,7 @@ bool CWsFileIOEx::CheckServerAccess(const char* targetDZNameOrAddress, const cha
     }
 
     return false;
+#endif
 }
 
 bool CWsFileIOEx::onCreateFile(IEspContext &context, IEspCreateFileRequest &req, IEspCreateFileResponse &resp)

+ 4 - 1
esp/services/ws_fs/CMakeLists.txt

@@ -71,8 +71,11 @@ target_link_libraries ( ws_fs
          jlib
          esphttp 
          dalibase 
-         environment 
          workunit
          SMCLib 
          dfuwu 
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_fs environment )
+endif()

+ 5 - 1
esp/services/ws_fs/ws_fsBinding.cpp

@@ -198,12 +198,15 @@ int CFileSpraySoapBindingEx::onGetInstantQuery(IEspContext &context, CHttpReques
 
 IPropertyTree* CFileSpraySoapBindingEx::createPTreeForXslt(double clientVersion, const char* method, const char* dfuwuid)
 {
+    Owned<IPropertyTree> pRoot = createPTreeFromXMLString("<Environment/>");
+#ifdef _CONTAINERIZED
+    IERRLOG("CONTAINERIZED(CFileSpraySoapBindingEx::createPTreeForXslt)");
+#else
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> constEnv = factory->openEnvironment();
     Owned<IPropertyTree> pEnvRoot = &constEnv->getPTree();
     IPropertyTree* pEnvSoftware = pEnvRoot->queryPropTree("Software");
 
-    Owned<IPropertyTree> pRoot = createPTreeFromXMLString("<Environment/>");
     IPropertyTree* pSoftware = pRoot->addPropTree("Software", createPTree("Software"));
 
     if (pEnvSoftware)
@@ -295,6 +298,7 @@ IPropertyTree* CFileSpraySoapBindingEx::createPTreeForXslt(double clientVersion,
         if (wuxml.length() > 0)
             pSoftware->addPropTree("DfuWorkunit", createPTreeFromXMLString(wuxml.str()));
     }
+#endif
     return pRoot.getClear();
 }
 

+ 31 - 1
esp/services/ws_fs/ws_fsService.cpp

@@ -611,6 +611,9 @@ bool CFileSprayEx::ParseLogicalPath(const char * pLogicalPath, StringBuffer &tit
 void setRoxieClusterPartDiskMapping(const char *clusterName, const char *defaultFolder, const char *defaultReplicateFolder,
                                bool supercopy, IDFUfileSpec *wuFSpecDest, IDFUoptions *wuOptions)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(setRoxieClusterPartDiskMapping)");
+#else
     Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> constEnv = envFactory->openEnvironment();
 
@@ -664,6 +667,7 @@ void setRoxieClusterPartDiskMapping(const char *clusterName, const char *default
         spec.setRepeatedCopies(CPDMSRP_lastRepeated,false);
     wuFSpecDest->setClusterPartDiskMapSpec(clusterName,spec);
     wuOptions->setReplicate(replicate);
+#endif
 }
 
 StringBuffer& constructFileMask(const char* filename, StringBuffer& filemask)
@@ -676,6 +680,9 @@ bool CFileSprayEx::onDFUWUSearch(IEspContext &context, IEspDFUWUSearchRequest &
 {
     try
     {
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CFileSprayEx::onDFUWUSearch)");
+#else
         context.ensureFeatureAccess(DFU_WU_URL, SecAccess_Read, ECLWATCH_DFU_WU_ACCESS_DENIED, "Access to DFU workunit is denied.");
 
         Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
@@ -697,6 +704,7 @@ bool CFileSprayEx::onDFUWUSearch(IEspContext &context, IEspDFUWUSearchRequest &
         }
 
         resp.setClusterNames(dfuclusters);
+#endif
     }
     catch(IException* e)
     {
@@ -956,11 +964,14 @@ bool CFileSprayEx::onGetDFUWorkunits(IEspContext &context, IEspGetDFUWorkunits &
             clusterReq.append(clusterName);
         }
 
+        StringArray targetClusters, clusterProcesses;
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(CFileSprayEx::onGetDFUWorkunits)");
+#else
         Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
         Owned<IConstEnvironment> constEnv = envFactory->openEnvironment();
         Owned<IPropertyTree> root = &constEnv->getPTree();
 
-        StringArray targetClusters, clusterProcesses;
         Owned<IPropertyTreeIterator> clusters= root->getElements("Software/Topology/Cluster");
         if (clusters->first())
         {
@@ -1007,6 +1018,7 @@ bool CFileSprayEx::onGetDFUWorkunits(IEspContext &context, IEspGetDFUWorkunits &
                 }
             } while (clusters->next());
         }
+#endif
 
         __int64 pagesize = req.getPageSize();
         __int64 pagefrom = req.getPageStartFrom();
@@ -2940,6 +2952,10 @@ bool CFileSprayEx::onFileList(IEspContext &context, IEspFileListRequest &req, IE
 
 bool CFileSprayEx::checkDropZoneIPAndPath(double clientVersion, const char* dropZoneName, const char* netAddr, const char* path)
 {
+#ifdef _CONTAINERIZED
+    IERRLOG("CONTAINERIZED(CFileSprayEx::checkDropZoneIPAndPath)");
+    return false;
+#else
     if (isEmptyString(netAddr) || isEmptyString(path))
         throw MakeStringException(ECLWATCH_INVALID_INPUT, "NetworkAddress or Path not defined.");
 
@@ -2962,6 +2978,7 @@ bool CFileSprayEx::checkDropZoneIPAndPath(double clientVersion, const char* drop
         }
     }
     return false;
+#endif
 }
 
 void CFileSprayEx::addDropZoneFile(IEspContext& context, IDirectoryIterator* di, const char* name, const char pathSep, IArrayOf<IEspPhysicalFileStruct>& files)
@@ -3051,6 +3068,9 @@ bool CFileSprayEx::onDropZoneFileSearch(IEspContext &context, IEspDropZoneFileSe
         if (!validNameFilter)
             throw MakeStringException(ECLWATCH_INVALID_INPUT, "Invalid Name Filter '*'");
 
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CFileSprayEx::onDropZoneFileSearch)");
+#else
         Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
         Owned<IConstEnvironment> constEnv = envFactory->openEnvironment();
         Owned<IConstDropZoneInfo> dropZoneInfo = constEnv->getDropZone(dropZoneName);
@@ -3098,6 +3118,7 @@ bool CFileSprayEx::onDropZoneFileSearch(IEspContext &context, IEspDropZoneFileSe
             resp.setWarning(msg.str());
         }
         resp.setFiles(files);
+#endif
     }
     catch(IException* e)
     {
@@ -3274,6 +3295,10 @@ bool CFileSprayEx::onDropZoneFiles(IEspContext &context, IEspDropZoneFilesReques
         bool filesFromALinux = false;
         IArrayOf<IEspDropZone> dropZoneList;
         bool ECLWatchVisibleOnly = req.getECLWatchVisibleOnly();
+
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(CFileSprayEx::onDropZoneFileSearch)");
+#else
         Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
         Owned<IConstEnvironment> constEnv = envFactory->openEnvironment();
         Owned<IConstDropZoneInfoIterator> dropZoneItr = constEnv->getDropZoneIterator();
@@ -3316,6 +3341,7 @@ bool CFileSprayEx::onDropZoneFiles(IEspContext &context, IEspDropZoneFilesReques
                 dropZoneList.append(*aDropZone.getClear());
             }
         }
+#endif
 
         if (dropZoneList.ordinality())
             resp.setDropZones(dropZoneList);
@@ -3550,11 +3576,15 @@ bool CFileSprayEx::onGetDFUServerQueues(IEspContext &context, IEspGetDFUServerQu
 {
     try
     {
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CFileSprayEx::onGetDFUServerQueues)");
+#else
         context.ensureFeatureAccess(FILE_SPRAY_URL, SecAccess_Read, ECLWATCH_FILE_SPRAY_ACCESS_DENIED, "Permission denied.");
 
         StringArray qlist;
         getDFUServerQueueNames(qlist, req.getDFUServerName());
         resp.setNames(qlist);
+#endif
     }
     catch(IException* e)
     {

+ 1 - 1
esp/services/ws_machine/CMakeLists.txt

@@ -73,7 +73,7 @@ target_link_libraries ( ws_machine
          hrpc 
          remote 
          dalibase 
-         environment 
+         environment
          workunit
          SMCLib
     )

+ 4 - 2
esp/services/ws_machine/ws_machineServiceMetrics.cpp

@@ -322,6 +322,9 @@ void Cws_machineEx::doGetMetrics(CMetricsThreadParam* pParam)
 //-------------------------------------------------METRICS------------------------------------------------------
 void Cws_machineEx::getRoxieClusterConfig(char const * clusterType, char const * clusterName, char const * processName, StringBuffer& netAddress, int& port)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(Cws_machineEx::getRoxieClusterConfig)");
+#else
 #if 0
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory();
     Owned<IConstEnvironment> environment = factory->openEnvironment();
@@ -373,8 +376,7 @@ void Cws_machineEx::getRoxieClusterConfig(char const * clusterType, char const *
             netAddress.append(addr);
     }
 #endif
-    
-    return;
+#endif
 }
 
 void Cws_machineEx::processValue(const char *oid, const char *value, const bool bShow, CFieldInfoMap& myfieldInfoMap, CFieldMap&  myfieldMap)

+ 6 - 0
esp/services/ws_machine/ws_machineServiceRexec.cpp

@@ -153,6 +153,7 @@ public:
 #endif
     }//doWork()
 };
+#ifndef _CONTAINERIZED
 
 //-------------------------------------------------StartStop--------------------------------------------------
 
@@ -497,10 +498,14 @@ void Cws_machineEx::ConvertAddress( const char* originalAddress, StringBuffer& n
 #endif
     return;
 }
+#endif
 
 bool Cws_machineEx::doStartStop(IEspContext &context, StringArray& addresses, char* userName, char* password, bool bStop,
                                                      IEspStartStopResponse &resp)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(Cws_machineEx::doStartStop)");
+#else
     bool containCluster = false;
     double version = context.getClientVersion();
     const int ordinality= addresses.ordinality();
@@ -637,6 +642,7 @@ bool Cws_machineEx::doStartStop(IEspContext &context, StringArray& addresses, ch
         resp.setContainCluster(containCluster);
     }
     return true;
+#endif
 }
 
 bool Cws_machineEx::onStartStop( IEspContext &context, IEspStartStopRequest &req, 

+ 4 - 0
esp/services/ws_packageprocess/ws_packageprocessService.cpp

@@ -325,11 +325,15 @@ public:
     {
         splitDerivedDfsLocation(dfsLocation, srcCluster, daliIP, prefix, srcProcess, srcProcess, NULL, NULL);
 
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(PackageMapUpdater::setDerivedDfsLocation) not fully implemented");
+#else
         if (srcCluster.length())
         {
             if (!isProcessCluster(daliIP, srcCluster))
                 throw MakeStringException(PKG_INVALID_CLUSTER_TYPE, "Process cluster %s not found on %s DALI", srcCluster.str(), daliIP.length() ? daliIP.str() : "local");
         }
+#endif
     }
     void convertExisting()
     {

+ 1 - 1
esp/services/ws_smc/CMakeLists.txt

@@ -82,7 +82,6 @@ target_link_libraries ( ws_smc
          hrpc 
          remote 
          dalibase 
-         environment 
          dalift 
          dllserver 
          nbcd 
@@ -106,6 +105,7 @@ target_link_libraries ( ws_smc
 if (NOT CONTAINERIZED)
     target_link_libraries ( ws_smc
         ws_machine
+        environment
     )
 endif()
 

+ 4 - 3
esp/services/ws_topology/CMakeLists.txt

@@ -70,7 +70,6 @@ target_link_libraries ( ws_topology
          xmllib 
          esphttp 
          dalibase 
-         environment 
          dalift 
          dllserver 
          nbcd 
@@ -81,6 +80,10 @@ target_link_libraries ( ws_topology
          swapnodelib
          )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_topology environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( ws_topology
     	securesocket
@@ -93,5 +96,3 @@ IF (USE_ZLIB)
       zcrypt
       )
 ENDIF()
-
-

+ 8 - 0
esp/services/ws_topology/ws_topologyService.cpp

@@ -1181,6 +1181,9 @@ bool CWsTopologyEx::onTpListTargetClusters(IEspContext &context, IEspTpListTarge
     {
         context.ensureFeatureAccess(FEATURE_URL, SecAccess_Read, ECLWATCH_TOPOLOGY_ACCESS_DENIED, "WsTopology::TpListTargetClusters: Permission denied.");
 
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CWsTopologyEx::onTpListTargetClusters)");
+#else
         Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
         Owned<IConstEnvironment> env = factory->openEnvironment();
         Owned<IPropertyTree> root = &env->getPTree();
@@ -1256,6 +1259,7 @@ bool CWsTopologyEx::onTpListTargetClusters(IEspContext &context, IEspTpListTarge
             }
         }
         resp.setTargetClusters(clusters);
+#endif
     }
     catch(IException* e)
     {
@@ -1666,6 +1670,9 @@ bool CWsTopologyEx::onTpGetComponentFile(IEspContext &context, IEspTpGetComponen
         StringAttr      sDirectory;
         if (bCluster && !(netAddress && *netAddress))
         {
+#ifdef _CONTAINERIZED
+            UNIMPLEMENTED_X("CONTAINERIZED(CWsTopologyEx::onTpGetComponentFile)");
+#else
             Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
             Owned<IConstEnvironment> constEnv = factory->openEnvironment();
             Owned<IPropertyTree> pRoot = &constEnv->getPTree();
@@ -1713,6 +1720,7 @@ bool CWsTopologyEx::onTpGetComponentFile(IEspContext &context, IEspTpGetComponen
                     }
                 }
             }
+#endif
         }
 
         if (netAddressStr.length() > 0)

+ 4 - 1
esp/services/ws_workunits/CMakeLists.txt

@@ -107,7 +107,6 @@ target_link_libraries ( ws_workunits
          xmllib
          esphttp
          dalibase
-         environment
          dalift
          dllserver
          nbcd
@@ -126,6 +125,10 @@ target_link_libraries ( ws_workunits
          ${CPPUNIT_LIBRARIES}
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ws_workunits environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( ws_workunits
     	securesocket

+ 19 - 0
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -1070,6 +1070,10 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
     IArrayOf<IConstThorLogInfo> thorLogList;
     if (cw->getWuidVersion() > 0)
     {
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(WsWuInfo::getWorkunitThorLogInfo) not fully implemented");
+        return countThorLog;
+#else
         StringAttr clusterName(cw->queryClusterName());
         if (!clusterName.length()) //Cluster name may not be set yet
             return countThorLog;
@@ -1155,9 +1159,14 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
                 thorLogList.append(*thorLog.getLink());
             }
         }
+#endif
     }
     else //legacy wuid
     {
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(WsWuInfo::getWorkunitThorLogInfo) not fully implemented");
+        return countThorLog;
+#else
         Owned<IStringIterator> thorLogs = cw->getLogs("Thor");
         ForEach (*thorLogs)
         {
@@ -1241,6 +1250,7 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
                 thorLogList.append(*thorLog.getLink());
             }
         }
+#endif
     }
 
     if (thorLogList.length() > 0)
@@ -2040,6 +2050,9 @@ void WsWuInfo::getWorkunitThorSlaveLog(IPropertyTree* directories, const char *p
     const char* instanceName, const char *ipAddress, const char* logDate, int slaveNum,
     MemoryBuffer& buf, const char* outFile, bool forDownload)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(WsWuInfo::getWorkunitThorLogInfo)");
+#else
     StringBuffer logDir, groupName;
     getConfigurationDirectory(directories, "log", "thor", process, logDir);
     getClusterThorGroupName(groupName, instanceName);
@@ -2051,6 +2064,7 @@ void WsWuInfo::getWorkunitThorSlaveLog(IPropertyTree* directories, const char *p
         throw MakeStringException(ECLWATCH_INVALID_INPUT, "Node group %s not found", groupName.str());
 
     getWorkunitThorSlaveLog(nodeGroup, ipAddress, process, logDate, logDir.str(), slaveNum, buf, outFile, forDownload);
+#endif
 }
 
 void WsWuInfo::readWorkunitThorLog(const char* processName, const char* log, const char* slaveIPAddress, unsigned slaveNum, MemoryBuffer& buf, const char* outFile)
@@ -3534,6 +3548,10 @@ void CWsWuFileHelper::createThorSlaveLogfile(IConstWorkUnit* cwu, WsWuInfo& winf
     const char* clusterName = cwu->queryClusterName();
     if (isEmptyString(clusterName)) //Cluster name may not be set yet
         return;
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(CWsWuFileHelper::createThorSlaveLogfile)");
+    return;
+#else
     Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(clusterName);
     if (!clusterInfo)
     {
@@ -3579,6 +3597,7 @@ void CWsWuFileHelper::createThorSlaveLogfile(IConstWorkUnit* cwu, WsWuInfo& winf
         }
     }
     threadPool->joinAll();
+#endif
 }
 
 void CWsWuFileHelper::createZAPInfoFile(const char* url, const char* espIP, const char* thorIP, const char* problemDesc,

+ 17 - 0
esp/services/ws_workunits/ws_workunitsQuerySets.cpp

@@ -49,6 +49,10 @@ static const char *QuerySetAliasActionTypes[] = { "Deactivate", NULL };
 
 bool isRoxieProcess(const char *process)
 {
+#ifdef _CONTAINERIZED
+    IERRLOG("CONTAINERIZED(isRoxieProcess) not fully implemented");
+    return false;
+#else
     if (!process)
         return false;
 
@@ -57,6 +61,7 @@ bool isRoxieProcess(const char *process)
     Owned<IPropertyTree> root = &env->getPTree();
     VStringBuffer xpath("Software/RoxieCluster[@name=\"%s\"]", process);
     return root->hasProp(xpath.str());
+#endif
 }
 
 void checkUseEspOrDaliIP(SocketEndpoint &ep, const char *ip, const char *esp)
@@ -900,8 +905,12 @@ bool CWsWorkunitsEx::onWUPublishWorkunit(IEspContext &context, IEspWUPublishWork
 
     if (srcCluster.length())
     {
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(CWsWorkunitsEx::onWUPublishWorkunit) not fully implemented");
+#else
         if (!isProcessCluster(daliIP, srcCluster))
             throw MakeStringException(ECLWATCH_INVALID_CLUSTER_NAME, "Process cluster %s not found on %s DALI", srcCluster.str(), daliIP.length() ? daliIP.str() : "local");
+#endif
     }
     unsigned updateFlags = 0;
     if (req.getUpdateDfs())
@@ -1985,8 +1994,12 @@ bool CWsWorkunitsEx::onWURecreateQuery(IEspContext &context, IEspWURecreateQuery
 
                 if (srcCluster.length())
                 {
+#ifdef _CONTAINERIZED
+                    IERRLOG("CONTAINERIZED(CWsWorkunitsEx::onWURecreateQuery) not fully implemented");
+#else
                     if (!isProcessCluster(daliIP, srcCluster))
                         throw MakeStringException(ECLWATCH_INVALID_CLUSTER_NAME, "Process cluster %s not found on %s DALI", srcCluster.str(), daliIP.length() ? daliIP.str() : "local");
+#endif
                 }
                 unsigned updateFlags = 0;
                 if (req.getUpdateDfs())
@@ -2212,6 +2225,9 @@ void CWsWorkunitsEx::getWUQueryDetails(IEspContext &context, CWUQueryDetailsReq
 
     if (req.getIncludeWsEclAddresses())
     {
+#ifdef _CONTAINERIZED
+        UNIMPLEMENTED_X("CONTAINERIZED(CWsWorkunitsEx::onWURecreateQuery)");
+#else
         StringArray wseclAddresses;
         Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
         Owned<IConstEnvironment> env = factory->openEnvironment();
@@ -2261,6 +2277,7 @@ void CWsWorkunitsEx::getWUQueryDetails(IEspContext &context, CWUQueryDetailsReq
             }
         }
         resp.setWsEclAddresses(wseclAddresses);
+#endif
     }
 }
 

+ 7 - 3
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -4438,11 +4438,14 @@ int CWsWorkunitsSoapBindingEx::onGetForm(IEspContext &context, CHttpRequest* req
         StringBuffer xslt;
         if(strieq(method,"WUQuery") || strieq(method,"WUJobList"))
         {
-            Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
-            Owned<IConstEnvironment> environment = factory->openEnvironment();
-            Owned<IPropertyTree> root = &environment->getPTree();
             if(strieq(method,"WUQuery"))
             {
+#ifdef _CONTAINERIZED
+                UNIMPLEMENTED_X("CONTAINERIZED(CWsWorkunitsSoapBindingEx::onGetForm)");
+#else
+                Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
+                Owned<IConstEnvironment> environment = factory->openEnvironment();
+                Owned<IPropertyTree> root = &environment->getPTree();
                 SecAccessFlags accessOwn;
                 SecAccessFlags accessOthers;
                 getUserWuAccessFlags(context, accessOwn, accessOthers, false);
@@ -4469,6 +4472,7 @@ int CWsWorkunitsSoapBindingEx::onGetForm(IEspContext &context, CHttpRequest* req
                 }
                 xml.append("</WUQuery>");
                 xslt.append(getCFD()).append("./smc_xslt/wuid_search.xslt");
+#endif
             }
             else if (strieq(method,"WUJobList"))
             {

+ 4 - 0
esp/services/ws_workunits/ws_workunitsService.hpp

@@ -63,6 +63,9 @@ private:
 
     void updateUsers()
     {
+#ifdef _CONTAINERIZED
+        IERRLOG("CONTAINERIZED(QueryFilesInUse::updateUsers)");
+#else
         Owned<IStringIterator> clusters = getTargetClusters("RoxieCluster", NULL);
         ForEach(*clusters)
         {
@@ -75,6 +78,7 @@ private:
             roxieUserMap.setValue(target.str(), user);
             roxieUsers.append(*user.getClear());
         }
+#endif
     }
 
 public:

+ 12 - 2
esp/smc/SMCLib/CMakeLists.txt

@@ -31,11 +31,18 @@ set (    SRCS
          ${ESPSCM_GENERATED_DIR}/ws_topology_esp.cpp
          ${ESPSCM_GENERATED_DIR}/ws_resources_esp.cpp
          LogicFileWrapper.cpp 
-         TpWrapper.cpp 
+         TpCommon.cpp
          WUXMLInfo.cpp
          InfoCacheReader.cpp
     )
 
+if (CONTAINERIZED)
+    set (SRCS  ${SRCS}  TpContainer.cpp)
+else ()
+    set (SRCS  ${SRCS}  TpWrapper.cpp)
+endif()
+
+
 include_directories ( 
          ./../../../system/mp 
          ./../../platform 
@@ -72,7 +79,6 @@ target_link_libraries ( SMCLib
          xmllib 
          esphttp 
          dalibase 
-         environment 
          dalift 
          dllserver 
          nbcd 
@@ -80,3 +86,7 @@ target_link_libraries ( SMCLib
          deftype 
          workunit 
     )
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( SMCLib environment )
+endif()

+ 99 - 0
esp/smc/SMCLib/TpCommon.cpp

@@ -0,0 +1,99 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2021 HPCC Systems®.
+
+    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.
+############################################################################## */
+
+#pragma warning (disable : 4786)
+// TpWrapper.cpp: implementation of the CTpWrapper class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "TpWrapper.hpp"
+#include <stdio.h>
+#include "workunit.hpp"
+#include "exception_util.hpp"
+#include "portlist.h"
+#include "daqueue.hpp"
+#include "dautils.hpp"
+#include "dameta.hpp"
+
+extern TPWRAPPER_API ISashaCommand* archiveOrRestoreWorkunits(StringArray& wuids, IProperties* params, bool archive, bool dfu)
+{
+    StringBuffer sashaAddress;
+    if (params && params->hasProp("sashaServerIP"))
+    {
+        sashaAddress.set(params->queryProp("sashaServerIP"));
+        sashaAddress.append(':').append(params->getPropInt("sashaServerPort", DEFAULT_SASHA_PORT));
+    }
+    else
+        getSashaService(sashaAddress, "sasha-wu-archiver", true);
+
+    SocketEndpoint ep(sashaAddress);
+    Owned<INode> node = createINode(ep);
+    Owned<ISashaCommand> cmd = createSashaCommand();
+    cmd->setAction(archive ? SCA_ARCHIVE : SCA_RESTORE);
+    if (dfu)
+        cmd->setDFU(true);
+
+    ForEachItemIn(i, wuids)
+        cmd->addId(wuids.item(i));
+
+    if (!cmd->send(node, 1*60*1000))
+        throw MakeStringException(ECLWATCH_CANNOT_CONNECT_ARCHIVE_SERVER,
+            "Sasha (%s) took too long to respond for Archive/restore workunit.",
+            sashaAddress.str());
+    return cmd.getClear();
+}
+
+extern TPWRAPPER_API IStringIterator* getContainerTargetClusters(const char* processType, const char* processName)
+{
+    Owned<CStringArrayIterator> ret = new CStringArrayIterator;
+    Owned<IPropertyTreeIterator> queues = getComponentConfigSP()->getElements("queues");
+    ForEach(*queues)
+    {
+        IPropertyTree& queue = queues->query();
+        if (!isEmptyString(processType))
+        {
+            const char* type = queue.queryProp("@type");
+            if (isEmptyString(type) || !strieq(type, processType))
+                continue;
+        }
+        const char* qName = queue.queryProp("@name");
+        if (isEmptyString(qName))
+            continue;
+
+        if (!isEmptyString(processName) && !strieq(qName, processName))
+            continue;
+
+        ret->append_unique(qName);
+    }
+    if (!isEmptyString(processType) && !strieq("roxie", processType))
+        return ret.getClear();
+
+    Owned<IPropertyTreeIterator> services = getComponentConfigSP()->getElements("services[@type='roxie']");
+    ForEach(*services)
+    {
+        IPropertyTree& service = services->query();
+        const char* targetName = service.queryProp("@target");
+        if (isEmptyString(targetName))
+            continue;
+
+        if (!isEmptyString(processName) && !strieq(targetName, processName))
+            continue;
+
+        ret->append_unique(targetName);
+    }
+    return ret.getClear();
+}

+ 804 - 0
esp/smc/SMCLib/TpContainer.cpp

@@ -0,0 +1,804 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2021 HPCC Systems®.
+
+    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.
+############################################################################## */
+
+#pragma warning (disable : 4786)
+// TpWrapper.cpp: implementation of the CTpWrapper class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "TpWrapper.hpp"
+#include <stdio.h>
+#include "workunit.hpp"
+#include "exception_util.hpp"
+#include "portlist.h"
+#include "daqueue.hpp"
+#include "dautils.hpp"
+#include "dameta.hpp"
+
+static CConfigUpdateHook configUpdateHook;
+
+const char* MSG_FAILED_GET_ENVIRONMENT_INFO = "Failed to get environment information.";
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+void CTpWrapper::getClusterMachineList(double clientVersion,
+                                       const char* ClusterType,
+                                       const char* ClusterPath,
+                                       const char* ClusterDirectory,
+                                       IArrayOf<IEspTpMachine> &MachineList,
+                                       bool& hasThorSpareProcess,
+                                       const char* ClusterName)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::getClusterMachineList)");
+}
+
+void CTpWrapper::getTpDaliServers(double clientVersion, IArrayOf<IConstTpDali>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpEclServers(IArrayOf<IConstTpEclServer>& list, const char* serverName)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpEclCCServers(IArrayOf<IConstTpEclServer>& list, const char* serverName)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpEclCCServers(IPropertyTree* environmentSoftware, IArrayOf<IConstTpEclServer>& list, const char* serverName)
+{
+}
+
+void CTpWrapper::getTpEclAgents(IArrayOf<IConstTpEclAgent>& list, const char* agentName)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpEclSchedulers(IArrayOf<IConstTpEclScheduler>& list, const char* serverName)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpEspServers(IArrayOf<IConstTpEspServer>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+static IEspTpMachine * createHostTpMachine(const char * hostname, const char *path)
+{
+    Owned<IEspTpMachine> machine = createTpMachine();
+    IpAddress ipAddr;
+    ipAddr.ipset(hostname);
+    StringBuffer localHost;
+    ipAddr.getIpText(localHost);
+    machine->setName(localHost.str());
+    machine->setNetaddress(localHost.str());
+    machine->setConfigNetaddress(hostname);
+    machine->setDirectory(path);
+    machine->setOS(getPathSepChar(path) == '/' ? MachineOsLinux : MachineOsW2K);
+    return machine.getClear();
+}
+
+static void gatherDropZoneMachinesFromHosts(IArrayOf<IEspTpMachine> & tpMachines, IPropertyTree & planeOrGroup, const char * prefix)
+{
+    Owned<IPropertyTreeIterator> iter = planeOrGroup.getElements("hosts");
+    ForEach(*iter)
+    {
+        const char * host = iter->query().queryProp(nullptr);
+        tpMachines.append(*createHostTpMachine(host, prefix));
+    }
+}
+
+static void gatherDropZoneMachines(IArrayOf<IEspTpMachine> & tpMachines, IPropertyTree & plane)
+{
+    const char * prefix = plane.queryProp("@prefix");
+    if (plane.hasProp("hosts"))
+    {
+        gatherDropZoneMachinesFromHosts(tpMachines, plane, prefix);
+    }
+    else if (plane.hasProp("@hostGroup"))
+    {
+        Owned<IPropertyTree> hostGroup = getHostGroup(plane.queryProp("@hostGroup"), true);
+        gatherDropZoneMachinesFromHosts(tpMachines, *hostGroup, prefix);
+    }
+    else
+        tpMachines.append(*createHostTpMachine("localhost", prefix));
+}
+
+
+void CTpWrapper::getTpDfuServers(IArrayOf<IConstTpDfuServer>& list)
+{
+    Owned<IPropertyTreeIterator> dfuQueues = getComponentConfigSP()->getElements("dfuQueues");
+    ForEach(*dfuQueues)
+    {
+        IPropertyTree & dfuQueue = dfuQueues->query();
+        const char * dfuName = dfuQueue.queryProp("@name");
+        StringBuffer queue;
+        getDfuQueueName(queue, dfuName);
+        Owned<IEspTpDfuServer> pService = createTpDfuServer("","");
+        pService->setName(dfuName);
+        pService->setDescription(dfuName);
+        pService->setBuild("");
+        pService->setQueue(queue);
+        pService->setType(eqDfu);
+        IArrayOf<IEspTpMachine> tpMachines;
+        //MORE: The ip and directory don't make any sense on the cloud version
+        tpMachines.append(*createHostTpMachine("localhost", "/var/lib/HPCCSystems"));
+        pService->setTpMachines(tpMachines);
+        list.append(*pService.getClear());
+    }
+}
+
+
+void CTpWrapper::getTpSashaServers(IArrayOf<IConstTpSashaServer>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpLdapServers(IArrayOf<IConstTpLdapServer>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpFTSlaves(IArrayOf<IConstTpFTSlave>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpDkcSlaves(IArrayOf<IConstTpDkcSlave>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTpGenesisServers(IArrayOf<IConstTpGenesisServer>& list)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::getTargetClusterList(IArrayOf<IEspTpLogicalCluster>& clusters, const char* clusterType, const char* clusterName)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::queryTargetClusterProcess(double version, const char* processName, const char* clusterType, IArrayOf<IConstTpCluster>& clusterList)
+{
+    throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+}
+
+void CTpWrapper::queryTargetClusters(double version, const char* clusterType, const char* clusterName, IArrayOf<IEspTpTargetCluster>& targetClusterList)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::queryTargetClusters)");
+}
+
+void CTpWrapper::getClusterProcessList(const char* ClusterType, IArrayOf<IEspTpCluster>& clusterList, bool ignoreduplicatqueues, bool ignoreduplicategroups)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::getClusterProcessList)");
+}
+
+void CTpWrapper::getHthorClusterList(IArrayOf<IEspTpCluster>& clusterList)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::getHthorClusterList)");
+}
+
+
+void CTpWrapper::getGroupList(double espVersion, const char* kindReq, IArrayOf<IEspTpGroup> &GroupList)
+{
+    try
+    {
+        Owned<IPropertyTreeIterator> dataPlanes = getGlobalConfigSP()->getElements("storage/planes[labels='data']");
+        ForEach(*dataPlanes)
+        {
+            IPropertyTree & plane = dataPlanes->query();
+            const char * name = plane.queryProp("@name");
+            IEspTpGroup* pGroup = createTpGroup("","");
+            pGroup->setName(name);
+            if (espVersion >= 1.21)
+            {
+                pGroup->setKind("Plane");
+                pGroup->setReplicateOutputs(false);
+            }
+            GroupList.append(*pGroup);
+        }
+    }
+    catch(IException* e)
+    {
+        StringBuffer msg;
+        e->errorMessage(msg);
+        IWARNLOG("%s", msg.str());
+        e->Release();
+    }
+    catch(...)
+    {
+        IWARNLOG("Unknown Exception caught within CTpWrapper::getGroupList");
+    }
+}
+
+bool CTpWrapper::checkGroupReplicateOutputs(const char* groupName, const char* kind)
+{
+    return false;
+}
+
+void CTpWrapper::getMachineInfo(double clientVersion, const char* name, const char* netAddress, IEspTpMachine& machineInfo)
+{
+    UNIMPLEMENTED_X("CONTAINERIZED(CTpWrapper::getMachineInfo)");
+}
+
+void CTpWrapper::setTpMachine(IConstMachineInfo* machine, IEspTpMachine& tpMachine)
+{
+    if (!machine)
+        return;
+
+    SCMStringBuffer machineName, netAddress;
+    machine->getName(machineName);
+    machine->getNetAddress(netAddress);
+    tpMachine.setName(machineName.str());
+    tpMachine.setNetaddress(netAddress.str());
+    tpMachine.setOS(machine->getOS());
+
+    switch(machine->getState())
+    {
+        case MachineStateAvailable:
+            tpMachine.setAvailable("Available");
+            break;
+        case MachineStateUnavailable:
+            tpMachine.setAvailable("Unavailable");
+            break;
+        case MachineStateUnknown:
+            tpMachine.setAvailable("Unknown");
+            break;
+    }
+    Owned<IConstDomainInfo> pDomain = machine->getDomain();
+    if (pDomain != 0)
+    {
+        SCMStringBuffer sName;
+        tpMachine.setDomain(pDomain->getName(sName).str());
+    }
+}
+
+void CTpWrapper::appendThorMachineList(double clientVersion, IConstEnvironment* constEnv, INode& node, const char* clusterName,
+    const char* machineType, unsigned& processNumber, unsigned channels, const char* directory, IArrayOf<IEspTpMachine>& machineList)
+{
+    StringBuffer netAddress;
+    node.endpoint().getIpText(netAddress);
+    if (netAddress.length() == 0)
+    {
+        OWARNLOG("Net address not found for a node of %s", clusterName);
+        return;
+    }
+
+    processNumber++;
+
+    Owned<IEspTpMachine> machineInfo = createTpMachine("","");
+    machineInfo->setType(machineType);
+    machineInfo->setNetaddress(netAddress.str());
+    if (!isEmptyString(directory))
+        machineInfo->setDirectory(directory);
+
+    Owned<IConstMachineInfo> pMachineInfo =  constEnv->getMachineByAddress(netAddress.str());
+    if (pMachineInfo.get())
+    {
+        setTpMachine(pMachineInfo, *machineInfo);
+        if (clientVersion > 1.17)
+        {
+            machineInfo->setProcessNumber(processNumber);
+        }
+    }
+    else
+    {
+        machineInfo->setName("external");
+        machineInfo->setOS(MachineOsUnknown);
+    }
+
+    if (clientVersion >= 1.30)
+        machineInfo->setChannels(channels);
+
+    machineList.append(*machineInfo.getLink());
+}
+
+void CTpWrapper::getThorSlaveMachineList(double clientVersion, const char* clusterName, const char* directory, IArrayOf<IEspTpMachine>& machineList)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::getThorSlaveMachineList)");
+}
+
+void CTpWrapper::getThorSpareMachineList(double clientVersion, const char* clusterName, const char* directory, IArrayOf<IEspTpMachine>& machineList)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::getThorSpareMachineList)");
+}
+
+void CTpWrapper::getMachineList(double clientVersion, const char* MachineType, const char* ParentPath,
+    const char* Status, const char* Directory, IArrayOf<IEspTpMachine>& MachineList, set<string>* pMachineNames/*=NULL*/)
+{
+    IWARNLOG("UNIMPLEMENTED: CONTAINERIZED(CTpWrapper::getMachineList)");
+}
+
+const char* CTpWrapper::getNodeNameTag(const char* MachineType)
+{
+    if (strcmp(MachineType,"Computer")==0)
+        return "@name";
+    else
+        return "@computer";
+}
+
+void CTpWrapper::getDropZoneMachineList(double clientVersion, bool ECLWatchVisibleOnly, IArrayOf<IEspTpMachine> &MachineList)
+{
+    try
+    {
+        IArrayOf<IConstTpDropZone> list;
+        getTpDropZones(clientVersion, nullptr, ECLWatchVisibleOnly, list);
+        ForEachItemIn(i, list)
+        {
+            IConstTpDropZone& dropZone = list.item(i);
+
+            IArrayOf<IConstTpMachine>& tpMachines = dropZone.getTpMachines();
+            ForEachItemIn(ii, tpMachines)
+            {
+                IConstTpMachine& tpMachine = tpMachines.item(ii);
+                Owned<IEspTpMachine> machine = createTpMachine();
+                machine->copy(tpMachine);
+
+                MachineList.append(*machine.getLink());
+            }
+        }
+    }
+    catch(IException* e)
+    {
+        EXCLOG(e);
+        e->Release();
+    }
+    catch(...)
+    {
+        IWARNLOG("Unknown Exception caught within CTpWrapper::getDropZoneMachineList");
+    }
+}
+
+//For a given dropzone or every dropzones (check ECLWatchVisible if needed), read: "@name",
+// "@description", "@build", "@directory", "@ECLWatchVisible" into an IEspTpDropZone object.
+//For each ServerList, read "@name" and "@server" (hostname or IP) into an IEspTpMachine object.
+//Add the IEspTpMachine object into the IEspTpDropZone.
+
+void CTpWrapper::getTpDropZones(double clientVersion, const char* name, bool ECLWatchVisibleOnly, IArrayOf<IConstTpDropZone>& list)
+{
+    Owned<IPropertyTreeIterator> planes = getDropZonePlanesIterator(name);
+    ForEach(*planes)
+    {
+        IPropertyTree & plane = planes->query();
+        const char * dropzonename = plane.queryProp("@name");
+        const char * path = plane.queryProp("@prefix");
+        Owned<IEspTpDropZone> dropZone = createTpDropZone();
+        dropZone->setName(dropzonename);
+        dropZone->setDescription("");
+        dropZone->setPath(path);
+        dropZone->setBuild("");
+        dropZone->setECLWatchVisible(true);
+        IArrayOf<IEspTpMachine> tpMachines;
+        gatherDropZoneMachines(tpMachines, plane);
+        dropZone->setTpMachines(tpMachines);
+        list.append(*dropZone.getClear());
+    }
+}
+
+void CTpWrapper::getTpSparkThors(double clientVersion, const char* name, IArrayOf<IConstTpSparkThor>& list)
+{
+    UNIMPLEMENTED_X("CONTAINERIZED(CTpWrapper::getTpSparkThors)");
+}
+
+void CTpWrapper::appendTpMachine(double clientVersion, IConstEnvironment* constEnv, IConstInstanceInfo& instanceInfo, IArrayOf<IConstTpMachine>& machines)
+{
+    SCMStringBuffer name, networkAddress, description, directory;
+    Owned<IConstMachineInfo> machineInfo = instanceInfo.getMachine();
+    machineInfo->getName(name);
+    machineInfo->getNetAddress(networkAddress);
+    instanceInfo.getDirectory(directory);
+
+    Owned<IEspTpMachine> machine = createTpMachine();
+    machine->setName(name.str());
+
+    if (networkAddress.length() > 0)
+    {
+        IpAddress ipAddr;
+        ipAddr.ipset(networkAddress.str());
+
+        StringBuffer networkAddressStr;
+        ipAddr.getIpText(networkAddressStr);
+        machine->setNetaddress(networkAddressStr);
+    }
+    machine->setPort(instanceInfo.getPort());
+    machine->setOS(machineInfo->getOS());
+    machine->setDirectory(directory.str());
+    machine->setType(eqSparkThorProcess);
+    machines.append(*machine.getLink());
+}
+
+IEspTpMachine* CTpWrapper::createTpMachineEx(const char* name, const char* type, IConstMachineInfo* machineInfo)
+{
+    if (!machineInfo)
+        return nullptr;
+
+    Owned<IEspTpMachine> machine = createTpMachine();
+    machine->setName(name);
+    machine->setType(type);
+    machine->setOS(machineInfo->getOS());
+
+    Owned<IConstDomainInfo> domain = machineInfo->getDomain();
+    if (domain)
+    {
+        SCMStringBuffer sName;
+        machine->setDomain(domain->getName(sName).str());
+    }
+
+    SCMStringBuffer netAddr;
+    machineInfo->getNetAddress(netAddr);
+    if (netAddr.length() > 0)
+    {
+        StringBuffer networkAddress;
+        IpAddress ipAddr;
+        ipAddr.ipset(netAddr.str());
+        ipAddr.getIpText(networkAddress);
+        machine->setNetaddress(networkAddress.str());
+    }
+
+    switch(machineInfo->getState())
+    {
+        case MachineStateAvailable:
+            machine->setAvailable("Available");
+            break;
+        case MachineStateUnavailable:
+            machine->setAvailable("Unavailable");
+            break;
+        default:
+            machine->setAvailable("Unknown");
+            break;
+    }
+    return machine.getClear();
+}
+
+
+void CTpWrapper::setAttPath(StringBuffer& Path,const char* PathToAppend,const char* AttName,const char* AttValue,StringBuffer& returnStr)
+{
+    Path.append("/");
+    Path.append(PathToAppend);
+    Path.append("[@");
+    Path.append(AttName);
+    Path.append("=\"");
+    Path.append(AttValue);
+    Path.append("\"]");
+    StringBuffer rawPath;
+    const void* buff = (void*)Path.str();
+    JBASE64_Encode(buff,Path.length(),rawPath, false);
+    returnStr.append(rawPath.str());
+}
+
+void CTpWrapper::getAttPath(const char* Path,StringBuffer& returnStr)
+{
+    StringBuffer decodedStr;
+    JBASE64_Decode(Path, returnStr);
+}
+
+void CTpWrapper::getServices(double version, const char* serviceType, const char* serviceName, IArrayOf<IConstHPCCService>& services)
+{
+    Owned<IPropertyTreeIterator> itr = getComponentConfigSP()->getElements("services");
+    ForEach(*itr)
+    {
+        IPropertyTree& service = itr->query();
+        //Only show the public services for now
+        if (!service.getPropBool("@public"))
+            continue;
+
+        const char* type = service.queryProp("@type");
+        if (isEmptyString(type) || (!isEmptyString(serviceType) && !strieq(serviceType, type)))
+            continue;
+
+        const char* name = service.queryProp("@name");
+        if (isEmptyString(name) || (!isEmptyString(serviceName) && !strieq(serviceName, name)))
+            continue;
+
+        Owned<IEspHPCCService> svc = createHPCCService();
+        svc->setName(name);
+        svc->setType(type);
+        svc->setPort(service.getPropInt("@port"));
+        if (service.getPropBool("@tls"))
+            svc->setTLSSecure(true);
+        services.append(*svc.getLink());
+        if (!isEmptyString(serviceName))
+            break;
+    }
+}
+
+class CContainerWUClusterInfo : public CSimpleInterfaceOf<IConstWUClusterInfo>
+{
+    StringAttr name;
+    StringAttr serverQueue;
+    StringAttr agentQueue;
+    StringAttr thorQueue;
+    ClusterType platform;
+    unsigned clusterWidth;
+    StringArray thorProcesses;
+
+public:
+    CContainerWUClusterInfo(const char* _name, const char* type, unsigned _clusterWidth)
+        : name(_name), clusterWidth(_clusterWidth)
+    {
+        StringBuffer queue;
+        if (strieq(type, "thor"))
+        {
+            thorQueue.set(getClusterThorQueueName(queue.clear(), name));
+            platform = ThorLCRCluster;
+            thorProcesses.append(name);
+        }
+        else if (strieq(type, "roxie"))
+        {
+            agentQueue.set(getClusterEclAgentQueueName(queue.clear(), name));
+            platform = RoxieCluster;
+        }
+        else
+        {
+            agentQueue.set(getClusterEclAgentQueueName(queue.clear(), name));
+            platform = HThorCluster;
+        }
+
+        serverQueue.set(getClusterEclCCServerQueueName(queue.clear(), name));
+    }
+
+    virtual IStringVal& getName(IStringVal& str) const override
+    {
+        str.set(name.get());
+        return str;
+    }
+    virtual IStringVal& getAgentQueue(IStringVal& str) const override
+    {
+        str.set(agentQueue);
+        return str;
+    }
+    virtual IStringVal& getServerQueue(IStringVal& str) const override
+    {
+        str.set(serverQueue);
+        return str;
+    }
+    virtual IStringVal& getThorQueue(IStringVal& str) const override
+    {
+        str.set(thorQueue);
+        return str;
+    }
+    virtual ClusterType getPlatform() const override
+    {
+        return platform;
+    }
+    virtual unsigned getSize() const override
+    {
+        return clusterWidth;
+    }
+    virtual bool isLegacyEclServer() const override
+    {
+        return false;
+    }
+    virtual IStringVal& getScope(IStringVal& str) const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual unsigned getNumberOfSlaveLogs() const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual IStringVal & getAgentName(IStringVal & str) const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual IStringVal & getECLSchedulerName(IStringVal & str) const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual const StringArray & getECLServerNames() const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual IStringVal & getRoxieProcess(IStringVal & str) const override
+    {
+        str.set(name.get());
+        return str;
+    }
+    virtual const StringArray & getThorProcesses() const override
+    {
+        return thorProcesses;
+    }
+    virtual const StringArray & getPrimaryThorProcesses() const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual const SocketEndpointArray & getRoxieServers() const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual const char *getLdapUser() const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual const char *getLdapPassword() const override
+    {
+        UNIMPLEMENTED;
+    }
+    virtual unsigned getRoxieRedundancy() const override
+    {
+        return 1;
+    }
+    virtual unsigned getChannelsPerNode() const override
+    {
+        return 1;
+    }
+    virtual int getRoxieReplicateOffset() const override
+    {
+        return 0;
+    }
+    virtual const char *getAlias() const override
+    {
+        UNIMPLEMENTED;
+    }
+};
+
+extern TPWRAPPER_API unsigned getContainerWUClusterInfo(CConstWUClusterInfoArray& clusters)
+{
+    Owned<IPropertyTreeIterator> queues = getComponentConfigSP()->getElements("queues");
+    ForEach(*queues)
+    {
+        IPropertyTree& queue = queues->query();
+        Owned<IConstWUClusterInfo> cluster = new CContainerWUClusterInfo(queue.queryProp("@name"),
+            queue.queryProp("@type"), (unsigned) queue.getPropInt("@width", 1));
+        clusters.append(*cluster.getClear());
+    }
+
+    return clusters.ordinality();
+}
+
+extern TPWRAPPER_API unsigned getWUClusterInfo(CConstWUClusterInfoArray& clusters)
+{
+    return getContainerWUClusterInfo(clusters);
+}
+
+static IPropertyTree * getContainerClusterConfig(const char * clusterName)
+{
+    VStringBuffer xpath("queues[@name='%s']", clusterName);
+    return getComponentConfigSP()->getPropTree(xpath);
+}
+
+extern TPWRAPPER_API IConstWUClusterInfo* getWUClusterInfoByName(const char* clusterName)
+{
+    Owned<IPropertyTree> queue = getContainerClusterConfig(clusterName);
+    if (!queue)
+        return nullptr;
+
+    return new CContainerWUClusterInfo(queue->queryProp("@name"), queue->queryProp("@type"),
+        (unsigned) queue->getPropInt("@width", 1));
+}
+
+extern TPWRAPPER_API void initContainerRoxieTargets(MapStringToMyClass<ISmartSocketFactory>& connMap)
+{
+    Owned<IPropertyTreeIterator> services = getComponentConfigSP()->getElements("services[@type='roxie']");
+    ForEach(*services)
+    {
+        IPropertyTree& service = services->query();
+        const char* name = service.queryProp("@name");
+        const char* target = service.queryProp("@target");
+        const char* port = service.queryProp("@port");
+
+        if (isEmptyString(target) || isEmptyString(name)) //bad config?
+            continue;
+
+        StringBuffer s;
+        s.append(name).append(':').append(port ? port : "9876");
+        Owned<ISmartSocketFactory> sf = new CSmartSocketFactory(s.str(), false, 60, (unsigned) -1);
+        connMap.setValue(target, sf.get());
+    }
+}
+
+extern TPWRAPPER_API unsigned getThorClusterNames(StringArray& targetNames, StringArray& queueNames)
+{
+    Owned<IStringIterator> targets = getContainerTargetClusters("thor", nullptr);
+    ForEach(*targets)
+    {
+        SCMStringBuffer target;
+        targets->str(target);
+        targetNames.append(target.str());
+
+        StringBuffer qName;
+        queueNames.append(getClusterThorQueueName(qName, target.str()));
+    }
+    return targetNames.ordinality();
+}
+
+static std::set<std::string> validTargets;
+static CriticalSection validTargetSect;
+static bool targetsDirty = true;
+
+static void refreshValidTargets()
+{
+    validTargets.clear();
+    Owned<IStringIterator> it = getContainerTargetClusters(nullptr, nullptr);
+    ForEach(*it)
+    {
+        SCMStringBuffer s;
+        IStringVal& val = it->str(s);
+        if (validTargets.find(val.str()) == validTargets.end())
+        {
+            validTargets.insert(val.str());
+            PROGLOG("adding valid target: %s", val.str());
+        }
+    }
+}
+
+static void configUpdate(const IPropertyTree *oldComponentConfiguration, const IPropertyTree *oldGlobalConfiguration)
+{
+    CriticalBlock block(validTargetSect);
+    // as much as effort [small] to check if different as to refresh
+    refreshValidTargets();
+    PROGLOG("Valid targets updated");
+}
+
+extern TPWRAPPER_API void validateTargetName(const char* target)
+{
+    if (isEmptyString(target))
+        throw makeStringException(ECLWATCH_INVALID_CLUSTER_NAME, "Empty target name.");
+
+    CriticalBlock block(validTargetSect);
+    configUpdateHook.installOnce(configUpdate, true);
+    if (validTargets.find(target) == validTargets.end())
+        throw makeStringExceptionV(ECLWATCH_INVALID_CLUSTER_NAME, "Invalid target name: %s", target);
+}
+
+bool getSashaService(StringBuffer &serviceAddress, const char *serviceName, bool failIfNotFound)
+{
+    if (!isEmptyString(serviceName))
+    {
+        VStringBuffer serviceQualifier("services[@type='sasha'][@name='%s']", serviceName);
+        Owned<IPropertyTree> serviceTree = getComponentConfigSP()->getPropTree(serviceQualifier);
+        if (serviceTree)
+        {
+            serviceAddress.append(serviceName).append(':').append(serviceTree->queryProp("@port"));
+            return true;
+        }
+    }
+    if (failIfNotFound)
+        throw makeStringExceptionV(ECLWATCH_ARCHIVE_SERVER_NOT_FOUND, "Sasha '%s' server not found", serviceName);
+    return false;
+}
+
+bool getSashaServiceEP(SocketEndpoint &serviceEndpoint, const char *service, bool failIfNotFound)
+{
+    StringBuffer serviceAddress;
+    if (!getSashaService(serviceAddress, service, failIfNotFound))
+        return false;
+    serviceEndpoint.set(serviceAddress);
+    return true;
+}
+
+StringBuffer & getRoxieDefaultPlane(StringBuffer & plane, const char * roxieName)
+{
+    Owned<IPropertyTree> queue = getContainerClusterConfig(roxieName);
+    if (!queue)
+        throw makeStringExceptionV(ECLWATCH_INVALID_CLUSTER_NAME, "Unknown queue name %s", roxieName);
+
+    if (queue->getProp("@storagePlane", plane))
+        return plane;
+
+    //Find the first data plane - better if it was retrieved from roxie config
+    Owned<IPropertyTreeIterator> dataPlanes = getGlobalConfigSP()->getElements("storage/planes[labels='data']");
+    if (!dataPlanes->first())
+        throwUnexpectedX("No default data plane defined");
+    return plane.append(dataPlanes->query().queryProp("@name"));
+}

+ 3 - 325
esp/smc/SMCLib/TpWrapper.cpp

@@ -29,7 +29,9 @@
 #include "dautils.hpp"
 #include "dameta.hpp"
 
-static CConfigUpdateHook configUpdateHook;
+#ifdef _CONTAINERIZED
+#error "Should not be compiled in the container build"
+#endif
 
 const char* MSG_FAILED_GET_ENVIRONMENT_INFO = "Failed to get environment information.";
 
@@ -51,27 +53,6 @@ IPropertyTree* CTpWrapper::getEnvironment(const char* xpath)
     return NULL;
 }
 
-bool CTpWrapper::getClusterLCR(const char* clusterType, const char* clusterName)
-{
-    bool bLCR = false;
-    if (!clusterType || !*clusterType || !clusterName || !*clusterName)
-        return bLCR;
-
-    Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
-    Owned<IConstEnvironment> constEnv = envFactory->openEnvironment();
-    Owned<IPropertyTree> root = &constEnv->getPTree();
-
-    StringBuffer xpath;
-    xpath.appendf("Software/%s[@name='%s']", clusterType, clusterName);
-    IPropertyTree* pCluster = root->queryPropTree( xpath.str() );
-    if (!pCluster)
-        throw MakeStringException(ECLWATCH_CLUSTER_NOT_IN_ENV_INFO, "'%s %s' is not defined.", clusterType, clusterName);
-
-    bLCR = !pCluster->getPropBool("@Legacy");
-
-    return bLCR;
-}
-
 void CTpWrapper::getClusterMachineList(double clientVersion,
                                        const char* ClusterType,
                                        const char* ClusterPath,
@@ -467,73 +448,8 @@ void CTpWrapper::getTpEspServers(IArrayOf<IConstTpEspServer>& list)
     }
 }
 
-#ifdef _CONTAINERIZED
-static IEspTpMachine * createHostTpMachine(const char * hostname, const char *path)
-{
-    Owned<IEspTpMachine> machine = createTpMachine();
-    IpAddress ipAddr;
-    ipAddr.ipset(hostname);
-    StringBuffer localHost;
-    ipAddr.getIpText(localHost);
-    machine->setName(localHost.str());
-    machine->setNetaddress(localHost.str());
-    machine->setConfigNetaddress(hostname);
-    machine->setDirectory(path);
-    machine->setOS(getPathSepChar(path) == '/' ? MachineOsLinux : MachineOsW2K);
-    return machine.getClear();
-}
-
-static void gatherDropZoneMachinesFromHosts(IArrayOf<IEspTpMachine> & tpMachines, IPropertyTree & planeOrGroup, const char * prefix)
-{
-    Owned<IPropertyTreeIterator> iter = planeOrGroup.getElements("hosts");
-    ForEach(*iter)
-    {
-        const char * host = iter->query().queryProp(nullptr);
-        tpMachines.append(*createHostTpMachine(host, prefix));
-    }
-}
-
-static void gatherDropZoneMachines(IArrayOf<IEspTpMachine> & tpMachines, IPropertyTree & plane)
-{
-    const char * prefix = plane.queryProp("@prefix");
-    if (plane.hasProp("hosts"))
-    {
-        gatherDropZoneMachinesFromHosts(tpMachines, plane, prefix);
-    }
-    else if (plane.hasProp("@hostGroup"))
-    {
-        Owned<IPropertyTree> hostGroup = getHostGroup(plane.queryProp("@hostGroup"), true);
-        gatherDropZoneMachinesFromHosts(tpMachines, *hostGroup, prefix);
-    }
-    else
-        tpMachines.append(*createHostTpMachine("localhost", prefix));
-}
-#endif
-
-
 void CTpWrapper::getTpDfuServers(IArrayOf<IConstTpDfuServer>& list)
 {
-#ifdef _CONTAINERIZED
-    Owned<IPropertyTreeIterator> dfuQueues = getComponentConfigSP()->getElements("dfuQueues");
-    ForEach(*dfuQueues)
-    {
-        IPropertyTree & dfuQueue = dfuQueues->query();
-        const char * dfuName = dfuQueue.queryProp("@name");
-        StringBuffer queue;
-        getDfuQueueName(queue, dfuName);
-        Owned<IEspTpDfuServer> pService = createTpDfuServer("","");
-        pService->setName(dfuName);
-        pService->setDescription(dfuName);
-        pService->setBuild("");
-        pService->setQueue(queue);
-        pService->setType(eqDfu);
-        IArrayOf<IEspTpMachine> tpMachines;
-        //MORE: The ip and directory don't make any sense on the cloud version
-        tpMachines.append(*createHostTpMachine("localhost", "/var/lib/HPCCSystems"));
-        pService->setTpMachines(tpMachines);
-        list.append(*pService.getClear());
-    }
-#else
     Owned<IPropertyTree> root = getEnvironment("Software");
     if (!root)
         throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
@@ -567,7 +483,6 @@ void CTpWrapper::getTpDfuServers(IArrayOf<IConstTpDfuServer>& list)
 
         list.append(*pService.getClear());
     }
-#endif
 }
 
 
@@ -1317,22 +1232,6 @@ void CTpWrapper::getGroupList(double espVersion, const char* kindReq, IArrayOf<I
 {
     try
     {
-#ifdef _CONTAINERIZED
-        Owned<IPropertyTreeIterator> dataPlanes = getGlobalConfigSP()->getElements("storage/planes[labels='data']");
-        ForEach(*dataPlanes)
-        {
-            IPropertyTree & plane = dataPlanes->query();
-            const char * name = plane.queryProp("@name");
-            IEspTpGroup* pGroup = createTpGroup("","");
-            pGroup->setName(name);
-            if (espVersion >= 1.21)
-            {
-                pGroup->setKind("Plane");
-                pGroup->setReplicateOutputs(false);
-            }
-            GroupList.append(*pGroup);
-        }
-#else
         Owned<IRemoteConnection> conn = querySDS().connect("/Groups", myProcessSession(), RTM_LOCK_READ, SDS_LOCK_TIMEOUT);
         Owned<IPropertyTreeIterator> groups= conn->queryRoot()->getElements("Group");
         if (groups->first())
@@ -1340,11 +1239,7 @@ void CTpWrapper::getGroupList(double espVersion, const char* kindReq, IArrayOf<I
             do
             {
                 IPropertyTree &group = groups->query();
-#ifdef _CONTAINERIZED
-                const char * kind = "Plane";
-#else
                 const char* kind = group.queryProp("@kind");
-#endif
                 if (kindReq && *kindReq && !strieq(kindReq, kind))
                     continue;
 
@@ -1359,7 +1254,6 @@ void CTpWrapper::getGroupList(double espVersion, const char* kindReq, IArrayOf<I
                 GroupList.append(*pGroup);
             } while (groups->next());
         }
-#endif
     }
     catch(IException* e)
     {
@@ -1395,64 +1289,6 @@ bool CTpWrapper::checkGroupReplicateOutputs(const char* groupName, const char* k
     return false;
 }
 
-void CTpWrapper::resolveGroupInfo(const char* groupName,StringBuffer& Cluster, StringBuffer& ClusterPrefix)
-{
-    if(*groupName == 0)
-    {
-        DBGLOG("NULL PARAMETER groupName");
-        return;
-    }
-    //There is a big estimate here.... namely that one group can only be associated with one cluster.......
-    // if this changes then this code may be invalidated....
-    try
-    {
-        Owned<IPropertyTree> pTopology = getEnvironment("Software/Topology");
-        if (!pTopology)
-            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
-
-        Owned<IPropertyTreeIterator> nodes=  pTopology->getElements("//Cluster");
-        if (nodes->first()) 
-        {
-            do 
-            {
-
-                IPropertyTree &node = nodes->query();
-                if (ContainsProcessDefinition(node,groupName)==true)
-                {
-                    //the prefix info is contained within the parent
-                    ClusterPrefix.append(node.queryProp("@prefix"));
-                    Cluster.append(node.queryProp("@name"));
-                    break;
-                }
-            } while (nodes->next());
-        }
-    }
-    catch(IException* e){   
-      StringBuffer msg;
-      e->errorMessage(msg);
-        IWARNLOG("%s", msg.str());
-        e->Release();
-    }
-    catch(...){
-        IWARNLOG("Unknown Exception caught within CTpWrapper::resolveGroupInfo");
-    }
-}
-
-bool CTpWrapper::ContainsProcessDefinition(IPropertyTree& clusterNode,const char* clusterName)
-{
-    Owned<IPropertyTreeIterator> processNodes = clusterNode.getElements("*");
-    if (processNodes->first()) {
-        do {
-            IPropertyTree &node = processNodes->query();
-            const char* processName = node.queryProp("@process");
-            if (*processName > 0 && (strcmp(processName,clusterName) == 0))
-                return true;
-        } while (processNodes->next());
-        }
-    return false;
-}
-
-
 void CTpWrapper::getMachineInfo(double clientVersion, const char* name, const char* netAddress, IEspTpMachine& machineInfo)
 {
     Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
@@ -1764,25 +1600,6 @@ void CTpWrapper::getDropZoneMachineList(double clientVersion, bool ECLWatchVisib
 
 void CTpWrapper::getTpDropZones(double clientVersion, const char* name, bool ECLWatchVisibleOnly, IArrayOf<IConstTpDropZone>& list)
 {
-#ifdef _CONTAINERIZED
-    Owned<IPropertyTreeIterator> planes = getDropZonePlanesIterator(name);
-    ForEach(*planes)
-    {
-        IPropertyTree & plane = planes->query();
-        const char * dropzonename = plane.queryProp("@name");
-        const char * path = plane.queryProp("@prefix");
-        Owned<IEspTpDropZone> dropZone = createTpDropZone();
-        dropZone->setName(dropzonename);
-        dropZone->setDescription("");
-        dropZone->setPath(path);
-        dropZone->setBuild("");
-        dropZone->setECLWatchVisible(true);
-        IArrayOf<IEspTpMachine> tpMachines;
-        gatherDropZoneMachines(tpMachines, plane);
-        dropZone->setTpMachines(tpMachines);
-        list.append(*dropZone.getClear());
-    }
-#else
     Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> constEnv = envFactory->openEnvironment();
     if (!isEmptyString(name))
@@ -1801,7 +1618,6 @@ void CTpWrapper::getTpDropZones(double clientVersion, const char* name, bool ECL
                 appendTpDropZone(clientVersion, constEnv, dropZoneInfo, list);
         }
     }
-#endif
 }
 
 
@@ -2110,74 +1926,6 @@ void CTpWrapper::getServices(double version, const char* serviceType, const char
     }
 }
 
-extern TPWRAPPER_API ISashaCommand* archiveOrRestoreWorkunits(StringArray& wuids, IProperties* params, bool archive, bool dfu)
-{
-    StringBuffer sashaAddress;
-    if (params && params->hasProp("sashaServerIP"))
-    {
-        sashaAddress.set(params->queryProp("sashaServerIP"));
-        sashaAddress.append(':').append(params->getPropInt("sashaServerPort", DEFAULT_SASHA_PORT));
-    }
-    else
-        getSashaService(sashaAddress, "sasha-wu-archiver", true);
-
-    SocketEndpoint ep(sashaAddress);
-    Owned<INode> node = createINode(ep);
-    Owned<ISashaCommand> cmd = createSashaCommand();
-    cmd->setAction(archive ? SCA_ARCHIVE : SCA_RESTORE);
-    if (dfu)
-        cmd->setDFU(true);
-
-    ForEachItemIn(i, wuids)
-        cmd->addId(wuids.item(i));
-
-    if (!cmd->send(node, 1*60*1000))
-        throw MakeStringException(ECLWATCH_CANNOT_CONNECT_ARCHIVE_SERVER,
-            "Sasha (%s) took too long to respond for Archive/restore workunit.",
-            sashaAddress.str());
-    return cmd.getClear();
-}
-
-extern TPWRAPPER_API IStringIterator* getContainerTargetClusters(const char* processType, const char* processName)
-{
-    Owned<CStringArrayIterator> ret = new CStringArrayIterator;
-    Owned<IPropertyTreeIterator> queues = getComponentConfigSP()->getElements("queues");
-    ForEach(*queues)
-    {
-        IPropertyTree& queue = queues->query();
-        if (!isEmptyString(processType))
-        {
-            const char* type = queue.queryProp("@type");
-            if (isEmptyString(type) || !strieq(type, processType))
-                continue;
-        }
-        const char* qName = queue.queryProp("@name");
-        if (isEmptyString(qName))
-            continue;
-
-        if (!isEmptyString(processName) && !strieq(qName, processName))
-            continue;
-
-        ret->append_unique(qName);
-    }
-    if (!isEmptyString(processType) && !strieq("roxie", processType))
-        return ret.getClear();
-
-    Owned<IPropertyTreeIterator> services = getComponentConfigSP()->getElements("services[@type='roxie']");
-    ForEach(*services)
-    {
-        IPropertyTree& service = services->query();
-        const char* targetName = service.queryProp("@target");
-        if (isEmptyString(targetName))
-            continue;
-
-        if (!isEmptyString(processName) && !strieq(targetName, processName))
-            continue;
-
-        ret->append_unique(targetName);
-    }
-    return ret.getClear();
-}
 
 class CContainerWUClusterInfo : public CSimpleInterfaceOf<IConstWUClusterInfo>
 {
@@ -2325,11 +2073,7 @@ extern TPWRAPPER_API unsigned getContainerWUClusterInfo(CConstWUClusterInfoArray
 
 extern TPWRAPPER_API unsigned getWUClusterInfo(CConstWUClusterInfoArray& clusters)
 {
-#ifndef _CONTAINERIZED
     return getEnvironmentClusterInfo(clusters);
-#else
-    return getContainerWUClusterInfo(clusters);
-#endif
 }
 
 static IPropertyTree * getContainerClusterConfig(const char * clusterName)
@@ -2340,16 +2084,7 @@ static IPropertyTree * getContainerClusterConfig(const char * clusterName)
 
 extern TPWRAPPER_API IConstWUClusterInfo* getWUClusterInfoByName(const char* clusterName)
 {
-#ifndef _CONTAINERIZED
     return getTargetClusterInfo(clusterName);
-#else
-    Owned<IPropertyTree> queue = getContainerClusterConfig(clusterName);
-    if (!queue)
-        return nullptr;
-
-    return new CContainerWUClusterInfo(queue->queryProp("@name"), queue->queryProp("@type"),
-        (unsigned) queue->getPropInt("@width", 1));
-#endif
 }
 
 extern TPWRAPPER_API void initContainerRoxieTargets(MapStringToMyClass<ISmartSocketFactory>& connMap)
@@ -2374,21 +2109,8 @@ extern TPWRAPPER_API void initContainerRoxieTargets(MapStringToMyClass<ISmartSoc
 
 extern TPWRAPPER_API unsigned getThorClusterNames(StringArray& targetNames, StringArray& queueNames)
 {
-#ifndef _CONTAINERIZED
     StringArray thorNames, groupNames;
     getEnvironmentThorClusterNames(thorNames, groupNames, targetNames, queueNames);
-#else
-    Owned<IStringIterator> targets = getContainerTargetClusters("thor", nullptr);
-    ForEach(*targets)
-    {
-        SCMStringBuffer target;
-        targets->str(target);
-        targetNames.append(target.str());
-
-        StringBuffer qName;
-        queueNames.append(getClusterThorQueueName(qName, target.str()));
-    }
-#endif
     return targetNames.ordinality();
 }
 
@@ -2399,12 +2121,7 @@ static CriticalSection validTargetSect;
 static void refreshValidTargets()
 {
     validTargets.clear();
-#ifdef _CONTAINERIZED
-    // discovered from generated cluster names
-    Owned<IStringIterator> it = getContainerTargetClusters(nullptr, nullptr);
-#else
     Owned<IStringIterator> it = getTargetClusters(nullptr, nullptr);
-#endif
     ForEach(*it)
     {
         SCMStringBuffer s;
@@ -2417,25 +2134,12 @@ static void refreshValidTargets()
     }
 }
 
-static void configUpdate(const IPropertyTree *oldComponentConfiguration, const IPropertyTree *oldGlobalConfiguration)
-{
-    CriticalBlock block(validTargetSect);
-    // as much as effort [small] to check if different as to refresh
-    refreshValidTargets();
-    PROGLOG("Valid targets updated");
-}
-
 extern TPWRAPPER_API void validateTargetName(const char* target)
 {
     if (isEmptyString(target))
         throw makeStringException(ECLWATCH_INVALID_CLUSTER_NAME, "Empty target name.");
 
     CriticalBlock block(validTargetSect);
-#ifdef _CONTAINERIZED
-    configUpdateHook.installOnce(configUpdate, true);
-    if (validTargets.find(target) == validTargets.end())
-        throw makeStringExceptionV(ECLWATCH_INVALID_CLUSTER_NAME, "Invalid target name: %s", target);
-#else
     if (validTargets.find(target) == validTargets.end())
     {
         // bare metal rechecks in case env. changed since target list built
@@ -2443,22 +2147,12 @@ extern TPWRAPPER_API void validateTargetName(const char* target)
             throw makeStringExceptionV(ECLWATCH_INVALID_CLUSTER_NAME, "Invalid target name: %s", target);
         refreshValidTargets();
     }
-#endif
 }
 
 bool getSashaService(StringBuffer &serviceAddress, const char *serviceName, bool failIfNotFound)
 {
     if (!isEmptyString(serviceName))
     {
-#ifdef _CONTAINERIZED
-        VStringBuffer serviceQualifier("services[@type='sasha'][@name='%s']", serviceName);
-        Owned<IPropertyTree> serviceTree = getComponentConfigSP()->getPropTree(serviceQualifier);
-        if (serviceTree)
-        {
-            serviceAddress.append(serviceName).append(':').append(serviceTree->queryProp("@port"));
-            return true;
-        }
-#else
         // all services are on same sasha on bare-metal as far as esp services are concerned
         StringBuffer sashaAddress;
         IArrayOf<IConstTpSashaServer> sashaservers;
@@ -2477,7 +2171,6 @@ bool getSashaService(StringBuffer &serviceAddress, const char *serviceName, bool
                 return true;
             }
         }
-#endif
     }
     if (failIfNotFound)
         throw makeStringExceptionV(ECLWATCH_ARCHIVE_SERVER_NOT_FOUND, "Sasha '%s' server not found", serviceName);
@@ -2495,24 +2188,9 @@ bool getSashaServiceEP(SocketEndpoint &serviceEndpoint, const char *service, boo
 
 StringBuffer & getRoxieDefaultPlane(StringBuffer & plane, const char * roxieName)
 {
-#ifdef _CONTAINERIZED
-    Owned<IPropertyTree> queue = getContainerClusterConfig(roxieName);
-    if (!queue)
-        throw makeStringExceptionV(ECLWATCH_INVALID_CLUSTER_NAME, "Unknown queue name %s", roxieName);
-
-    if (queue->getProp("@storagePlane", plane))
-        return plane;
-
-    //Find the first data plane - better if it was retrieved from roxie config
-    Owned<IPropertyTreeIterator> dataPlanes = getGlobalConfigSP()->getElements("storage/planes[labels='data']");
-    if (!dataPlanes->first())
-        throwUnexpectedX("No default data plane defined");
-    return plane.append(dataPlanes->query().queryProp("@name"));
-#else
     Owned <IConstWUClusterInfo> clusterInfo(getTargetClusterInfo(roxieName));
     StringBufferAdaptor process(plane);
     if (clusterInfo && clusterInfo->getPlatform()==RoxieCluster)
         clusterInfo->getRoxieProcess(process);
     return plane;
-#endif
 }

+ 4 - 5
esp/smc/SMCLib/TpWrapper.hpp

@@ -134,7 +134,6 @@ class TPWRAPPER_API CTpWrapper : public CInterface
 private:
     void setAttPath(StringBuffer& Path,const char* PathToAppend,const char* AttName,const char* AttValue,StringBuffer& returnStr);
     void getAttPath(const char* Path,StringBuffer& returnStr);
-    bool ContainsProcessDefinition(IPropertyTree& node,const char* clusterName);
     const char* getNodeNameTag(const char* MachineType);
     void fetchInstances(const char* ServiceType, IPropertyTree& service, IArrayOf<IEspTpMachine>& tpMachines);
     bool checkGroupReplicateOutputs(const char* groupName, const char* kind);
@@ -146,12 +145,14 @@ private:
     void appendThorMachineList(double clientVersion, IConstEnvironment* constEnv, INode& node, const char* clusterName,
          const char* machineType, unsigned& processNumber, unsigned channels, const char* directory, IArrayOf<IEspTpMachine>& machineList);
 
+#ifndef _CONTAINERIZED
+    IPropertyTree* getEnvironment(const char* xpath);
+#endif
+
 public:
-    IMPLEMENT_IINTERFACE;
     CTpWrapper() {};
     virtual ~CTpWrapper() {};
     void getClusterInfo(const char* Cluster,StringBuffer& returnStr);
-    bool getClusterLCR(const char* clusterType, const char* clusterName);
     void getClusterProcessList(const char* ClusterType, IArrayOf<IEspTpCluster>& clusters, bool ignoreduplicatqueues=false, bool ignoreduplicategroups=false);
     void getHthorClusterList(IArrayOf<IEspTpCluster>& clusterList);
     void getGroupList(double espVersion, const char* kindReq, IArrayOf<IEspTpGroup> &Groups);
@@ -165,7 +166,6 @@ public:
     bool checkMultiSlavesFlag(const char* clusterName);
     void getDropZoneMachineList(double clientVersion, bool ECLWatchVisibleOnly, IArrayOf<IEspTpMachine> &MachineList);
     void setMachineInfo(const char* name,const char* type,IEspTpMachine& machine);
-    void resolveGroupInfo(const char* groupName,StringBuffer& Cluster, StringBuffer& ClusterPrefix);
     void getMachineInfo(IEspTpMachine& machineInfo,IPropertyTree& machine,const char* ParentPath,const char* MachineType,const char* nodenametag);
     void getMachineInfo(double clientVersion, const char* name, const char* netAddress, IEspTpMachine& machineInfo);
     void setTpMachine(IConstMachineInfo* machine, IEspTpMachine& tpMachine);
@@ -192,7 +192,6 @@ public:
     void queryTargetClusterProcess(double version, const char* processName, const char* clusterType, IArrayOf<IConstTpCluster>& list);
     void getServices(double version, const char* serviceType, const char* serviceName, IArrayOf<IConstHPCCService>& list);
 
-    IPropertyTree* getEnvironment(const char* xpath);
 };
 
 

+ 3 - 1
fs/dafscontrol/CMakeLists.txt

@@ -50,6 +50,8 @@ target_link_libraries ( dafscontrol
          hrpc 
          dafsclient 
          dalibase 
-         environment 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( dafscontrol environment )
+endif()

+ 3 - 1
plugins/fileservices/CMakeLists.txt

@@ -70,7 +70,6 @@ target_link_libraries ( fileservices
          jlib
          remote 
          dalibase 
-         environment 
          esphttp
          dllserver 
          nbcd 
@@ -79,4 +78,7 @@ target_link_libraries ( fileservices
          workunit 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( fileservices environment )
+endif()
 

+ 14 - 0
plugins/fileservices/fileservices.cpp

@@ -192,6 +192,7 @@ static void setWorkunitState(ICodeContext * ctx, WUState state, const char * msg
     }
 }
 
+#ifndef _CONTAINERIZED
 static IConstEnvironment * openDaliEnvironment()
 {
     if (daliClientActive())
@@ -208,6 +209,7 @@ static IPropertyTree *getEnvironmentTree(IConstEnvironment * daliEnv)
         return &daliEnv->getPTree(); // No need to clone since daliEnv ensures connection stays alive.
     return getHPCCEnvironment();
 }
+#endif
 
 static void setServerAccess(CClientFileSpray &server, IConstWorkUnit * wu)
 {
@@ -287,6 +289,9 @@ static const char *getAccessibleEspServerURL(const char *param, IConstWorkUnit *
     if (param&&*param)
         return param;
 
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(getAccessibleEspServerURL)");
+#else
     CriticalBlock b(espURLcrit);
     if (isUrlListEmpty())
     {
@@ -348,6 +353,7 @@ static const char *getAccessibleEspServerURL(const char *param, IConstWorkUnit *
     PROGLOG("FileServices: Targeting ESP WsFileSpray URL: %s", nextWsFSUrl);
 
     return nextWsFSUrl;
+#endif
 }
 
 StringBuffer & constructLogicalName(IConstWorkUnit * wu, const char * partialLogicalName, StringBuffer & result)
@@ -3008,6 +3014,9 @@ FILESERVICES_API char * FILESERVICES_CALL fsGetEspURL(const char *username, cons
 
 FILESERVICES_API char * FILESERVICES_CALL fsGetDefaultDropZone()
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(fsGetDefaultDropZone)");
+#else
     Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> constEnv = envFactory-> openEnvironment();
     Owned<IConstDropZoneInfoIterator> dropZoneIt = constEnv->getDropZoneIterator();
@@ -3016,10 +3025,14 @@ FILESERVICES_API char * FILESERVICES_CALL fsGetDefaultDropZone()
         dropZoneIt->query().getDirectory(dropZoneDir);
 
     return strdup(dropZoneDir.str());
+#endif
 }
 
 FILESERVICES_API void FILESERVICES_CALL fsGetDropZones(ICodeContext *ctx, size32_t & __lenResult, void * & __result)
 {
+#ifdef _CONTAINERIZED
+    UNIMPLEMENTED_X("CONTAINERIZED(fsGetDropZones)");
+#else
     MemoryBuffer mb;
     Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> constEnv = envFactory-> openEnvironment();
@@ -3034,6 +3047,7 @@ FILESERVICES_API void FILESERVICES_CALL fsGetDropZones(ICodeContext *ctx, size32
 
     __lenResult = mb.length();
     __result = mb.detach();
+#endif
 }
 
 

+ 3 - 1
plugins/workunitservices/CMakeLists.txt

@@ -57,8 +57,10 @@ target_link_LIBRARies ( workunitservices
          hrpc 
          remote 
          dalibase 
-         environment 
          workunit 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( workunitservices environment )
+endif()
 

+ 4 - 0
plugins/workunitservices/workunitservices.cpp

@@ -180,6 +180,9 @@ IPluginContext * parentCtx = NULL;
 
 static void getSashaNodes(SocketEndpointArray &epa)
 {
+#ifdef _CONTAINERIZED
+    WARNLOG("CONTAINERIZED(getSashaNodes) not implemented");
+#else
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> env = factory->openEnvironment();
     Owned<IPropertyTree> root = &env->getPTree();
@@ -191,6 +194,7 @@ static void getSashaNodes(SocketEndpointArray &epa)
             epa.append(sashaep);
         }
     }
+#endif
 }
 
 static IWorkUnitFactory * getWorkunitFactory(ICodeContext * ctx)

+ 4 - 1
roxie/ccd/CMakeLists.txt

@@ -120,13 +120,16 @@ target_link_libraries ( ccd
          deftype 
          thorhelper 
          jhtree 
-         environment 
          schedulectrl
          dllserver 
          workunit 
          libbase58
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( ccd environment )
+endif()
+
 IF (USE_OPENSSL)
     target_link_libraries ( ccd
     	securesocket

+ 2 - 1
roxie/ccd/ccdcontext.cpp

@@ -3646,7 +3646,7 @@ public:
 #ifdef _CONTAINERIZED
         // in a containerized setup, the group is moving..
         return strdup("unknown");
-#endif
+#else
         StringBuffer groupName;
         if (workUnit && clusterNames.length())
         {
@@ -3687,6 +3687,7 @@ public:
             }
         }
         return groupName.detach();
+#endif
     }
     virtual char *queryIndexMetaData(char const * lfn, char const * xpath) { throwUnexpected(); }
     virtual char *getEnv(const char *name, const char *defaultValue) const

+ 2 - 0
roxie/ccd/ccdmain.cpp

@@ -880,12 +880,14 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml)
             lazyOpen = (restarts > 0);
         else
             lazyOpen = topology->getPropBool("@lazyOpen", false);
+#ifndef _CONTAINERIZED
         bool useNasTranslation = topology->getPropBool("@useNASTranslation", true);
         if (useNasTranslation)
         {
             Owned<IPropertyTree> nas = envGetNASConfiguration(topology);
             envInstallNASHooks(nas);
         }
+#endif
         useAeron = topology->getPropBool("@useAeron", false);
         doIbytiDelay = topology->getPropBool("@doIbytiDelay", true);
         minIbytiDelay = topology->getPropInt("@minIbytiDelay", 2);

+ 11 - 0
system/jlib/jutil.cpp

@@ -2421,6 +2421,14 @@ StringBuffer & fillConfigurationDirectoryEntry(const char *dir,const char *name,
 
 IPropertyTree *getHPCCEnvironment()
 {
+#ifdef _CONTAINERIZED
+#ifdef _DEBUG
+    throwUnexpectedX("getHPCCEnvironment() called from container system");
+#else
+    IERRLOG("getHPCCEnvironment() called from container system");
+#endif
+#endif
+
     StringBuffer envfile;
     if (queryEnvironmentConf().getProp("environment",envfile) && envfile.length())
     {
@@ -2444,6 +2452,9 @@ static CriticalSection envConfCrit;
 
 jlib_decl const IProperties &queryEnvironmentConf()
 {
+#if defined(_CONTAINERIZED) && defined(_DEBUG)
+    throwUnexpectedX("queryEnvironmentConf() callled from container system");
+#endif
     CriticalBlock b(envConfCrit);
     if (!envConfFile)
         envConfFile.setown(createProperties(CONFIG_DIR PATHSEPSTR ENV_CONF_FILE, true));

+ 3 - 1
thorlcr/activities/activitymasters_lcr.cmake

@@ -115,7 +115,6 @@ target_link_libraries ( activitymasters_lcr
          deftype 
          thorhelper 
          dalibase 
-         environment 
          dllserver 
          workunit 
          thorcodectx_lcr 
@@ -125,4 +124,7 @@ target_link_libraries ( activitymasters_lcr
          graphmaster_lcr 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( activitymasters_lcr environment )
+endif()
 

+ 3 - 2
thorlcr/activities/activityslaves_lcr.cmake

@@ -127,7 +127,6 @@ target_link_libraries ( activityslaves_lcr
          thorhelper 
          remote 
          dalibase 
-         environment 
          dllserver 
          workunit 
          thorcodectx_lcr 
@@ -137,4 +136,6 @@ target_link_libraries ( activityslaves_lcr
          roxiemem
     )
 
-
+if (NOT CONTAINERIZED)
+    target_link_libraries ( activityslaves_lcr environment )
+endif()

+ 0 - 1
thorlcr/graph/graph_lcr.cmake

@@ -66,7 +66,6 @@ target_link_libraries ( graph_lcr
          jhtree 
          remote 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 

+ 0 - 1
thorlcr/graph/graphmaster_lcr.cmake

@@ -65,7 +65,6 @@ target_link_libraries ( graphmaster_lcr
          thorhelper 
          remote 
          dalibase 
-         environment 
          dllserver 
          workunit 
          thorcodectx_lcr 

+ 0 - 1
thorlcr/graph/graphslave_lcr.cmake

@@ -59,7 +59,6 @@ target_link_libraries ( graphslave_lcr
          thorhelper 
          dafsclient 
          dalibase 
-         environment 
          dllserver 
          workunit 
          thorcodectx_lcr 

+ 5 - 1
thorlcr/master/CMakeLists.txt

@@ -73,7 +73,6 @@ target_link_libraries (  thormaster_lcr
          jhtree 
          dafsclient 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl 
@@ -90,6 +89,11 @@ target_link_libraries (  thormaster_lcr
          activitymasters_lcr 
          swapnodelib
     )
+
 if (USE_OPENSSL)
     target_link_libraries(thormaster_lcr securesocket)
 endif()
+
+if (NOT CONTAINERIZED)
+    target_link_libraries ( thormaster_lcr environment )
+endif()

+ 4 - 1
thorlcr/master/thgraphmanager.cpp

@@ -333,6 +333,7 @@ void CJobManager::fatal(IException *e)
 
 void CJobManager::updateWorkUnitLog(IWorkUnit &workunit)
 {
+#ifndef _CONTAINERIZED
     StringBuffer log, logUrl, slaveLogPattern;
     logHandler->getLogName(log);
     createUNCFilename(log, logUrl, false);
@@ -343,11 +344,11 @@ void CJobManager::updateWorkUnitLog(IWorkUnit &workunit)
     Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(workunit.queryClusterName());
     unsigned numberOfSlaves = clusterInfo->getNumberOfSlaveLogs();
     workunit.addProcess("Thor", globals->queryProp("@name"), 0, numberOfSlaves, slaveLogPattern, false, logUrl.str());
+#endif
 }
 
 
 
-
 #define IDLE_RESTART_PERIOD (8*60) // 8 hours
 class CIdleShutdown : public CSimpleInterface, implements IThreaded
 {
@@ -486,11 +487,13 @@ void CJobManager::run()
 #endif
     querySoCache.init(soPath.str(), DEFAULT_QUERYSO_LIMIT, soPattern);
 
+#ifndef _CONTAINERIZED
     SCMStringBuffer _queueNames;
     const char *thorName = globals->queryProp("@name");
     if (!thorName) thorName = "thor";
     getThorQueueNames(_queueNames, thorName);
     queueName.set(_queueNames.str());
+#endif
 
     jobq.setown(createJobQueue(queueName.get()));
     struct cdynprio: public IDynamicPriority

+ 5 - 0
thorlcr/master/thmastermain.cpp

@@ -719,6 +719,7 @@ int main( int argc, const char *argv[]  )
             globals->setProp("@nodeGroup", thorname);
         }
 
+#ifndef _CONTAINERIZED
         if (globals->getPropBool("@useNASTranslation", true))
         {
             Owned<IPropertyTree> nasConfig = envGetNASConfiguration();
@@ -726,6 +727,7 @@ int main( int argc, const char *argv[]  )
                 globals->setPropTree("NAS", nasConfig.getLink()); // for use by slaves
             Owned<IPropertyTree> masterNasFilters = envGetInstallNASHooks(nasConfig, &thorEp);
         }
+#endif
         
         HardwareInfo hdwInfo;
         getHardwareInfo(hdwInfo);
@@ -886,12 +888,15 @@ int main( int argc, const char *argv[]  )
         e->Release();
         return -1;
     }
+
     StringBuffer queueName;
+#ifndef _CONTAINERIZED
     SCMStringBuffer _queueNames;
     const char *thorName = globals->queryProp("@name");
     if (!thorName) thorName = "thor";
     getThorQueueNames(_queueNames, thorName);
     queueName.set(_queueNames.str());
+#endif
 
     Owned<IException> exception;
     StringBuffer cloudJobName;

+ 3 - 1
thorlcr/mfilemanager/CMakeLists.txt

@@ -60,7 +60,6 @@ target_link_libraries ( mfilemanager_lcr
          jlib
          remote 
          dalibase 
-         environment 
          dalift 
          dllserver 
          nbcd 
@@ -71,4 +70,7 @@ target_link_libraries ( mfilemanager_lcr
          graph_lcr 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( mfilemanager_lcr environment )
+endif()
 

+ 4 - 1
thorlcr/slave/CMakeLists.txt

@@ -69,7 +69,6 @@ target_link_libraries (  thorslave_lcr
          jlib
          dafsclient 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          hql
@@ -85,6 +84,10 @@ target_link_libraries (  thorslave_lcr
          activityslaves_lcr 
     )
 
+if (NOT CONTAINERIZED)
+    target_link_libraries ( thorslave_lcr environment )
+endif()
+
 if (CONTAINERIZED) # only used when dev. option _dafsStorage is enabled
 target_link_libraries (  thorslave_lcr 
          dafsserver

+ 0 - 1
thorlcr/thorcodectx/CMakeLists.txt

@@ -60,7 +60,6 @@ target_link_libraries ( thorcodectx_lcr
         thorhelper 
         remote 
         dalibase 
-        environment 
         dllserver 
         workunit 
         )

+ 0 - 1
tools/swapnode/swapnodelib.cmake

@@ -49,5 +49,4 @@ target_link_libraries ( swapnodelib
          dafsclient
          dalibase
          workunit
-         environment
     )

+ 0 - 1
tools/wutool/CMakeLists.txt

@@ -58,7 +58,6 @@ target_link_libraries ( wutool
          jlib
          remote 
          dalibase 
-         environment 
          dllserver 
          nbcd 
          eclrtl