aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 32a468452..395ae5fc2 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -54,12 +54,14 @@
#include "admin/admin.h"
#include "cache/kvcache.h"
#include "cache/structuredcache.h"
+#include "cache/structuredcachestore.h"
#include "compute/apply.h"
#include "diag/diagsvcs.h"
#include "experimental/usnjournal.h"
#include "projectstore.h"
#include "testing/launch.h"
#include "upstream/jupiter.h"
+#include "upstream/upstreamcache.h"
#include "upstream/zen.h"
#include "zenstore/gc.h"
#include "zenstore/scrub.h"
@@ -139,7 +141,28 @@ public:
if (ServiceConfig.StructuredCacheEnabled)
{
spdlog::info("instantiating structured cache service");
- m_StructuredCacheService.reset(new zen::HttpStructuredCacheService(m_DataRoot / "cache", *m_CasStore, *m_CidStore));
+ m_CacheStore = std::make_unique<ZenCacheStore>(*m_CasStore, m_DataRoot / "cache");
+
+ std::unique_ptr<zen::UpstreamCache> UpstreamCache;
+ if (ServiceConfig.UpstreamCacheEnabled)
+ {
+ using namespace std::literals;
+
+ zen::UpstreamCacheOptions UpstreamOptions;
+ UpstreamOptions.ThreadCount = 4;
+ UpstreamOptions.JupiterEnabled = true;
+ UpstreamOptions.JupiterEndpoint = "https://jupiter.devtools-dev.epicgames.com"sv;
+ UpstreamOptions.JupiterDdcNamespace = "ue4.ddc"sv;
+ UpstreamOptions.JupiterBlobStoreNamespace = "test.ddc"sv;
+ UpstreamOptions.JupiterOAuthProvider = "https://epicgames.okta.com/oauth2/auso645ojjWVdRI3d0x7/v1/token"sv;
+ UpstreamOptions.JupiterOAuthClientId = "0oao91lrhqPiAlaGD0x7"sv;
+ UpstreamOptions.JupiterOAuthSecret = "-GBWjjenhCgOwhxL5yBKNJECVIoDPH0MK4RDuN7d"sv;
+
+ UpstreamCache = zen::MakeUpstreamCache(UpstreamOptions, *m_CacheStore, *m_CidStore);
+ }
+
+ m_StructuredCacheService.reset(
+ new zen::HttpStructuredCacheService(*m_CacheStore, *m_CasStore, *m_CidStore, std::move(UpstreamCache)));
}
else
{
@@ -297,6 +320,7 @@ private:
zen::HttpServer m_Http;
std::unique_ptr<zen::CasStore> m_CasStore{zen::CreateCasStore()};
std::unique_ptr<zen::CidStore> m_CidStore;
+ std::unique_ptr<ZenCacheStore> m_CacheStore;
zen::CasGc m_Gc{*m_CasStore};
zen::CasScrubber m_Scrubber{*m_CasStore};
HttpTestService m_TestService;
@@ -397,5 +421,7 @@ main(int argc, char* argv[])
SPDLOG_CRITICAL("Caught exception in main: {}", e.what());
}
+ ShutdownLogging();
+
return 0;
}