Browse Source

Merge branch 'candidate-7.8.x'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 years ago
parent
commit
1513621445

+ 1 - 0
dockerfiles/hpcc/templates/_helpers.tpl

@@ -49,6 +49,7 @@ Pass in root as .
 {{- define "hpcc.generateGlobalConfigMap" -}}
 imageVersion: {{ required "Please specify .global.image.version" .Values.global.image.version | quote }}
 singleNode: {{ .Values.global.singleNode | default false }}
+defaultEsp: {{ .Values.global.defaultEsp | default (index .Values.esp 0).name }}
 {{- end -}}
 
 {{/*

+ 3 - 0
dockerfiles/hpcc/values.schema.json

@@ -77,6 +77,9 @@
         },
         "logging": {
           "$ref": "#/definitions/logging"
+        },
+        "defaultEsp": {
+          "type": "string"
         }
       },
       "additionalProperties": false

+ 5 - 0
dockerfiles/hpcc/values.yaml

@@ -39,6 +39,11 @@ global:
   logging:
     detail: 100
 
+  # Specify a defauleEsp to control which EclWatch service is returned from Std.File.GetEspURL, and other uses
+  # If not specified, the first esp component present is assumed.
+  # Can also be overridden locally in individual components
+  ## defaultEsp: myesp
+
 dali:
 - name: mydali
   storage:

+ 2 - 0
ecl/hthor/hthor.cpp

@@ -172,6 +172,7 @@ ILocalOrDistributedFile *resolveLFNFlat(IAgentContext &agent, const char *logica
 
 bool isRemoteReadCandidate(const IAgentContext &agent, const RemoteFilename &rfn)
 {
+#ifndef _CONTAINERIZED
     if (!agent.queryWorkUnit()->getDebugValueBool("forceRemoteDisabled", false))
     {
         if (!rfn.isLocal())
@@ -181,6 +182,7 @@ bool isRemoteReadCandidate(const IAgentContext &agent, const RemoteFilename &rfn
         if (agent.queryWorkUnit()->getDebugValueBool("forceRemoteRead", testForceRemote(localPath)))
             return true;
     }
+#endif
     return false;
 }
 

+ 0 - 2
esp/smc/SMCLib/InfoCacheReader.cpp

@@ -27,7 +27,6 @@ bool CInfoCache::isCachedInfoValid(unsigned timeOutSeconds)
 
 void CInfoCacheReaderThread::threadmain()
 {
-#ifndef _CONTAINERIZED
     PROGLOG("CInfoCacheReaderThread %s started.", name.get());
     unsigned int autoRebuildMillSeconds = 1000*autoRebuildSeconds;
     while (!stopping)
@@ -73,5 +72,4 @@ void CInfoCacheReaderThread::threadmain()
             waiting.compare_exchange_strong(expected, false);
         }
     }
-#endif
 }

+ 18 - 0
plugins/fileservices/fileservices.cpp

@@ -2800,6 +2800,23 @@ FILESERVICES_API void FILESERVICES_CALL fsDfuPlusExec(ICodeContext * ctx,const c
 
 FILESERVICES_API char * FILESERVICES_CALL fsGetEspURL(const char *username, const char *userPW)
 {
+#ifdef _CONTAINERIZED
+    const char *defaultEsp = queryComponentConfig().queryProp("@defaultEsp");
+    if (!defaultEsp)
+        defaultEsp = queryGlobalConfig().queryProp("@defaultEsp");
+    if (defaultEsp)
+    {
+        StringBuffer credentials;
+        if (username && username[0] && userPW && userPW[0])
+            credentials.setf("%s:%s@", username, userPW);
+        else if (username && username[0])
+            credentials.setf("%s@", username);
+
+        // MORE - do we want to make such things as port and protocol configurable?
+        VStringBuffer espURL("http://%s%s:8010", credentials.str(), defaultEsp);
+        return espURL.detach();
+    }
+#else
     Owned<IConstEnvironment> daliEnv = openDaliEnvironment();
     Owned<IPropertyTree> env = getEnvironmentTree(daliEnv);
 
@@ -2858,6 +2875,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsGetEspURL(const char *username, cons
             }
         }
     }
+#endif
     return strdup("");
 }
 

+ 15 - 24
system/yaml/CMakeLists.txt

@@ -20,30 +20,21 @@ remove_definitions(-fvisibility=hidden)
 
 if(WIN32 OR APPLE)
     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-    add_subdirectory(${HPCC_SOURCE_DIR}/system/yaml/libyaml ${CMAKE_BINARY_DIR}/system/libyaml EXCLUDE_FROM_ALL)
-    if ( NOT PLUGIN )
-        install(PROGRAMS ${LIBRARY_OUTPUT_PATH}/libyaml${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION lib)
-        install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libyaml/LICENSE RENAME libyaml-LICENSE.txt DESTINATION lib)
-    endif ( NOT PLUGIN )
 else()
-    set(LIBYAML_OUTPUT_DIR ${CMAKE_BINARY_DIR})
-
-    include(ExternalProject)
-    ExternalProject_Add(
-        libyaml
-        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libyaml
-        BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/libyaml
-        CMAKE_ARGS -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${LIBYAML_OUTPUT_DIR}
-        BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} LDFLAGS=-Wl,-rpath-link,${LIB_PATH} yaml
-        INSTALL_COMMAND "")
+    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+endif()
 
-    add_library(yaml SHARED IMPORTED GLOBAL)
-    set_property(TARGET yaml PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/libyaml/libyaml${CMAKE_SHARED_LIBRARY_SUFFIX})
-    add_dependencies(yaml libyaml)
+add_subdirectory(${HPCC_SOURCE_DIR}/system/yaml/libyaml ${CMAKE_BINARY_DIR}/system/libyaml EXCLUDE_FROM_ALL)
 
-    if ( NOT PLUGIN )
-        install(CODE "set(ENV{LD_LIBRARY_PATH} \"\$ENV{LD_LIBRARY_PATH}:${CMAKE_CURRENT_BINARY_DIR}/libyaml:${PROJECT_BINARY_DIR}\")")
-        install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libyaml/libyaml${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION lib)
-        install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libyaml/LICENSE RENAME libyaml-LICENSE.txt DESTINATION lib)
-    endif ( NOT PLUGIN )
-endif()
+if(NOT PLUGIN)
+    if(WIN32)
+        install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/yaml${CMAKE_SHARED_LIBRARY_SUFFIX}
+            DESTINATION lib)
+    else()
+        install(PROGRAMS ${LIBRARY_OUTPUT_PATH}/libyaml${CMAKE_SHARED_LIBRARY_SUFFIX}
+            DESTINATION lib)
+    endif()
+    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libyaml/LICENSE
+        RENAME libyaml-LICENSE.txt
+        DESTINATION lib)
+endif(NOT PLUGIN)

+ 2 - 0
thorlcr/thorutil/thormisc.cpp

@@ -1489,6 +1489,7 @@ const ITranslator *getLayoutTranslation(const char *fname, IPartDescriptor &part
 
 bool isRemoteReadCandidate(const CActivityBase &activity, const RemoteFilename &rfn)
 {
+#ifndef _CONTAINERIZED
     if (!activity.getOptBool(THOROPT_FORCE_REMOTE_DISABLED))
     {
         if (!rfn.isLocal())
@@ -1498,6 +1499,7 @@ bool isRemoteReadCandidate(const CActivityBase &activity, const RemoteFilename &
         if (activity.getOptBool(THOROPT_FORCE_REMOTE_READ, testForceRemote(localPath)))
             return true;
     }
+#endif
     return false;
 }