aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorJoe Kirchoff <[email protected]>2022-03-22 11:47:38 -0700
committerGitHub <[email protected]>2022-03-22 11:47:38 -0700
commitcc5adf4cb79c92993fabfe09e75dfadb7d4c9665 (patch)
tree4ba0a18f68e39685fa784d872bbb4bb9ba2b6fd7 /zenserver/zenserver.cpp
parentmove workthreadpool to zencore (#63) (diff)
downloadzen-cc5adf4cb79c92993fabfe09e75dfadb7d4c9665.tar.xz
zen-cc5adf4cb79c92993fabfe09e75dfadb7d4c9665.zip
Enable Horde compute code on Linux & Mac (#61)
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp53
1 files changed, 29 insertions, 24 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index d8e97b117..c9708dba8 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -104,7 +104,7 @@ ZEN_THIRD_PARTY_INCLUDES_END
#include "auth/authservice.h"
#include "cache/structuredcache.h"
#include "cache/structuredcachestore.h"
-#include "compute/apply.h"
+#include "compute/function.h"
#include "diag/diagsvcs.h"
#include "experimental/usnjournal.h"
#include "frontend/frontend.h"
@@ -272,21 +272,26 @@ public:
m_LocalProjectService = zen::LocalProjectService::New(*m_CasStore, m_ProjectStore);
#endif
-#if ZEN_USE_EXEC
- std::filesystem::path SandboxDir = m_DataRoot / "exec" / "sandbox";
- zen::CreateDirectories(SandboxDir);
- m_HttpLaunchService = std::make_unique<zen::HttpLaunchService>(*m_CasStore, SandboxDir);
-#endif
+#if ZEN_WITH_EXEC_SERVICES
-#if ZEN_WITH_COMPUTE_SERVICES
- if (ServerOptions.ComputeServiceEnabled)
+ if (ServerOptions.ExecServiceEnabled)
{
- ZEN_INFO("instantiating compute services");
+ ZEN_INFO("instantiating exec service");
std::filesystem::path SandboxDir = m_DataRoot / "exec" / "sandbox";
zen::CreateDirectories(SandboxDir);
m_HttpLaunchService = std::make_unique<zen::HttpLaunchService>(*m_CasStore, SandboxDir);
+ }
+ else
+ {
+ ZEN_INFO("NOT instantiating exec services");
+ }
+#endif // ZEN_WITH_EXEC_SERVICES
+
+#if ZEN_WITH_COMPUTE_SERVICES
+ if (ServerOptions.ComputeServiceEnabled)
+ {
InitializeCompute(ServerOptions);
}
else
@@ -331,11 +336,18 @@ public:
m_Http->RegisterService(m_CasService);
+#if ZEN_WITH_EXEC_SERVICES
+ if (ServerOptions.ExecServiceEnabled)
+ {
+ if (m_HttpLaunchService != nullptr)
+ {
+ m_Http->RegisterService(*m_HttpLaunchService);
+ }
+ }
+#endif // ZEN_WITH_EXEC_SERVICES
#if ZEN_WITH_COMPUTE_SERVICES
if (ServerOptions.ComputeServiceEnabled)
{
- m_Http->RegisterService(*m_HttpLaunchService);
-
if (m_HttpFunctionService != nullptr)
{
m_Http->RegisterService(*m_HttpFunctionService);
@@ -365,9 +377,7 @@ public:
void InitializeState(const ZenServerOptions& ServerOptions);
void InitializeStructuredCache(const ZenServerOptions& ServerOptions);
-#if ZEN_WITH_COMPUTE_SERVICES
void InitializeCompute(const ZenServerOptions& ServerOptions);
-#endif
#if ZEN_ENABLE_MESH
void StartMesh(int BasePort)
@@ -610,16 +620,14 @@ private:
zen::HttpAdminService m_AdminService{m_GcScheduler};
zen::HttpHealthService m_HealthService;
zen::MeshTracker m_ZenMesh{m_IoContext};
+#if ZEN_WITH_EXEC_SERVICES
+ std::unique_ptr<zen::HttpLaunchService> m_HttpLaunchService;
+#endif // ZEN_WITH_EXEC_SERVICES
#if ZEN_WITH_COMPUTE_SERVICES
- std::unique_ptr<zen::HttpLaunchService> m_HttpLaunchService;
std::unique_ptr<zen::HttpFunctionService> m_HttpFunctionService;
-#endif
+#endif // ZEN_WITH_COMPUTE_SERVICES
std::unique_ptr<zen::HttpFrontendService> m_FrontendService;
-#if ZEN_USE_EXEC
- std::unique_ptr<zen::HttpLaunchService> m_HttpLaunchService;
-#endif
-
#if ZEN_USE_NAMED_PIPES
zen::Ref<zen::LocalProjectService> m_LocalProjectService;
#endif
@@ -837,7 +845,7 @@ ZenServer::InitializeCompute(const ZenServerOptions& ServerOptions)
const ZenUpstreamCacheConfig& UpstreamConfig = ServerOptions.UpstreamCacheConfig;
// Horde compute upstream
- if (UpstreamConfig.HordeConfig.Url.empty() == false && UpstreamConfig.HordeConfig.Url.empty() == false)
+ if (UpstreamConfig.HordeConfig.Url.empty() == false && UpstreamConfig.JupiterConfig.Url.empty() == false)
{
std::string_view EndpointName = UpstreamConfig.HordeConfig.Name.empty() ? "Horde"sv : UpstreamConfig.HordeConfig.Name;
@@ -868,11 +876,8 @@ ZenServer::InitializeCompute(const ZenServerOptions& ServerOptions)
.OpenIdProvider = UpstreamConfig.JupiterConfig.OpenIdProvider,
.AccessToken = UpstreamConfig.JupiterConfig.AccessToken};
- std::filesystem::path ApplySandboxDir = m_DataRoot / "exec" / "apply";
- zen::CreateDirectories(ApplySandboxDir);
m_HttpFunctionService = std::make_unique<zen::HttpFunctionService>(*m_CasStore,
*m_CidStore,
- ApplySandboxDir,
ComputeOptions,
StorageOptions,
ComputeAuthConfig,
@@ -880,7 +885,7 @@ ZenServer::InitializeCompute(const ZenServerOptions& ServerOptions)
*m_AuthMgr);
}
}
-#endif
+#endif // ZEN_WITH_COMPUTE_SERVICES
////////////////////////////////////////////////////////////////////////////////