浏览代码

Merge pull request #13592 from jakesmith/hpcc-23827-playground-topo

HPCC-23827 Fix ECL playground target queue in containers

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 年之前
父节点
当前提交
ab5df3e923

+ 3 - 7
esp/platform/espp.cpp

@@ -306,6 +306,7 @@ esp:
   daliServers: dali
   daliServers: dali
 )!!";
 )!!";
 
 
+static Owned<IPropertyTree> espConfig;
 
 
 static void usage()
 static void usage()
 {
 {
@@ -410,15 +411,10 @@ int init_main(int argc, const char* argv[])
             throw MakeStringException(-1, "Failed to load config file %s", cfgfile);
             throw MakeStringException(-1, "Failed to load config file %s", cfgfile);
 
 
 #ifdef _CONTAINERIZED
 #ifdef _CONTAINERIZED
-        Owned<IPropertyTree> espConfig;
-        /* For now, whilst esp lives with needing/reading a copy of the whole /Environment as it's configuration
-         * continue to do so, but also read component configuration (esp.yaml), and carry it inside the envpt tree,
-         * that is passed through services.
-         * Each service that can pick up the component config from "Config"
-         */
         espConfig.setown(loadConfiguration(defaultYaml, argv, "esp", "ESP", nullptr, nullptr));
         espConfig.setown(loadConfiguration(defaultYaml, argv, "esp", "ESP", nullptr, nullptr));
+
+        // TBD: Some esp services read daliServers from it's legacy config file
         procpt->setProp("@daliServers", espConfig->queryProp("@daliServers"));
         procpt->setProp("@daliServers", espConfig->queryProp("@daliServers"));
-        envpt->setPropTree("Config", espConfig.getClear());
 #endif
 #endif
 
 
         const char* build_ver = BUILD_TAG;
         const char* build_ver = BUILD_TAG;

+ 13 - 1
esp/services/ws_topology/ws_topologyService.cpp

@@ -1319,9 +1319,20 @@ bool CWsTopologyEx::onTpLogicalClusterQuery(IEspContext &context, IEspTpLogicalC
     try
     try
     {
     {
         context.ensureFeatureAccess(FEATURE_URL, SecAccess_Read, ECLWATCH_TOPOLOGY_ACCESS_DENIED, "WsTopology::TpLogicalClusterQuery: Permission denied.");
         context.ensureFeatureAccess(FEATURE_URL, SecAccess_Read, ECLWATCH_TOPOLOGY_ACCESS_DENIED, "WsTopology::TpLogicalClusterQuery: Permission denied.");
-
         IArrayOf<IEspTpLogicalCluster> clusters;
         IArrayOf<IEspTpLogicalCluster> clusters;
         CConstWUClusterInfoArray wuClusters;
         CConstWUClusterInfoArray wuClusters;
+#ifdef _CONTAINERIZED
+        Owned<IPropertyTreeIterator> iter = queryComponentConfig().getElements("queues");
+        ForEach(*iter)
+        {
+            IPropertyTree &queue = iter->query();
+            Owned<IEspTpLogicalCluster> cluster = createTpLogicalCluster();
+            cluster->setName(queue.queryProp("@name"));
+            cluster->setType(queue.queryProp("@type"));
+            cluster->setLanguageVersion("3.0.0");
+            clusters.append(*cluster.getClear());
+        }
+#else
         getEnvironmentClusterInfo(wuClusters);
         getEnvironmentClusterInfo(wuClusters);
         ForEachItemIn(c, wuClusters)
         ForEachItemIn(c, wuClusters)
         {
         {
@@ -1335,6 +1346,7 @@ bool CWsTopologyEx::onTpLogicalClusterQuery(IEspContext &context, IEspTpLogicalC
             cluster->setLanguageVersion("3.0.0");
             cluster->setLanguageVersion("3.0.0");
             clusters.append(*cluster.getClear());
             clusters.append(*cluster.getClear());
         }
         }
+#endif
         resp.setTpLogicalClusters(clusters);
         resp.setTpLogicalClusters(clusters);
     }
     }
     catch(IException* e)
     catch(IException* e)

+ 1 - 2
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -351,7 +351,6 @@ void CWsWorkunitsEx::init(IPropertyTree *cfg, const char *process, const char *s
         OERRLOG("No Dali Connection Active.");
         OERRLOG("No Dali Connection Active.");
         throw MakeStringException(-1, "No Dali Connection Active. Please Specify a Dali to connect to in you configuration file");
         throw MakeStringException(-1, "No Dali Connection Active. Please Specify a Dali to connect to in you configuration file");
     }
     }
-    config.setown(cfg->getPropTree("Config"));   
 
 
     DBGLOG("Initializing %s service [process = %s]", service, process);
     DBGLOG("Initializing %s service [process = %s]", service, process);
 
 
@@ -444,7 +443,7 @@ void CWsWorkunitsEx::refreshValidClusters()
     validClusters.kill();
     validClusters.kill();
 #ifdef _CONTAINERIZED
 #ifdef _CONTAINERIZED
     // discovered from generated cluster names
     // discovered from generated cluster names
-    Owned<IPropertyTreeIterator> iter = config->getElements("queues");
+    Owned<IPropertyTreeIterator> iter = queryComponentConfig().getElements("queues");
     ForEach(*iter)
     ForEach(*iter)
     {
     {
         IPropertyTree &queue = iter->query();
         IPropertyTree &queue = iter->query();