Commit Graph

37 Commits

Author SHA1 Message Date
ben marsh
49f034ac5e Horde: Upgrade all NuGet packages.
* MongoDB upgrade will be submitted later to isolate risk on LINQv3 changes.

[CL 30047145 by ben marsh in ue5-main branch]
2023-12-01 13:36:10 -05:00
ben marsh
a5ff6a06ea Horde: Upgrade StackExchange.Redis to latest version.
#jira

[CL 29832966 by ben marsh in ue5-main branch]
2023-11-18 14:39:19 -05:00
ben marsh
cd8326072e Horde: Fix dispose order in tests.
#jira

[CL 29758378 by ben marsh in ue5-main branch]
2023-11-15 15:56:55 -05:00
ben marsh
7ac3ac889d Horde: Various fixes to RedisConnectionPool to address stalls creating new connections.
* Now reuses existing multiplexers unless connections have a high load. Previous behavior would just create a new connection for each request until pool size is reached.
* Use the connection pool for ASP.NET key store, rather than having a separate connection in RedisService.
* Replaced ConcurrentBag with array for pooled connections. Each read from this collection creates a copy for each use, and it has a fixed max size anyway.
* Fix connections not being disposed.
* Fix config service now waiting for background tasks to complete during shutdown.

#jira

[CL 29750298 by ben marsh in ue5-main branch]
2023-11-15 12:22:14 -05:00
Ben Marsh
8684b930ed Remove implicit conversions from string to Utf8String. This conversion is not free, and recent versions of the MongoDB driver do not handle implicit conversions correctly at runtime.
[CL 28456358 by Ben Marsh in ue5-main branch]
2023-10-04 10:49:04 -04:00
Ben Marsh
14aee7947a Horde: Enable code style warnings in "Analyze" configuration for Horde.Agent and Horde.Agent.TrayApp, and fix current violations.
[CL 27806357 by Ben Marsh in ue5-main branch]
2023-09-12 16:20:59 -04:00
Ben Marsh
61c723973e EpicGames.Redis: Support using protobuf (via protobuf-net) for serializing structures to Redis strings.
#preflight none

[CL 23550571 by Ben Marsh in ue5-main branch]
2022-12-20 11:16:58 -05:00
Ben Marsh
7795a71e87 Horde: Add a default converter for compound types to/from Redis values, serializing each property as a string.
#preflight none

[CL 23298046 by Ben Marsh in ue5-main branch]
2022-11-28 16:58:50 -05:00
Ben Marsh
2f1664e8c5 Horde: Missing file.
#preflight none

[CL 23287864 by Ben Marsh in ue5-main branch]
2022-11-28 08:59:30 -05:00
Ben Marsh
3acfaf7cfc Horde: Refactor EpicGames.Redis to have an interface more in line with StackExchange.Redis. Typed keys are now analagous to RedisKey, rather than capturing an IDatabaseAsync interface as well, making the use of transactions more natural.
#preflight none

[CL 23279128 by Ben Marsh in ue5-main branch]
2022-11-27 18:27:25 -05:00
Ben Marsh
08a5142fef Horde: Support for log tailing with new storage backend.
* Once a log is retrieved, server adds an entry with this log id to a sorted set in Redis, scored by expiry time and broadcasts it to any other server instances.
* If a log is being tailed, server keeps the total number of lines in a Redis key and appends chunks of log data to a sorted set for that log scored by index of the first line.
* Chunks are split on fixed boundaries, in order to allow older entries to be purged by score without having to count the number of lines they contain first.
* Agent polls for requests to provide tail data via LogRpcService.UpdateLogTail, which calls LogTailService.WaitForTailNext. WaitForTailNext returns the index of the total line count for this log if it is being tailed (indicating the index of the next line that the agent should send to the server), or blocks until the log is being tailed.
* Once data is flushed to persistent storage, the number of flushed lines is added to LogRpcService._trimQueue and the line data is removed from Redis after LogRpcService.TrimAfter.
* Log node contains a "complete" flag indicating whether it is necessary to check for tail data.

#preflight none

[CL 23215856 by Ben Marsh in ue5-main branch]
2022-11-19 14:15:32 -05:00
Ben Marsh
f0c9bcc7e7 Horde: Missing files.
#preflight none

[CL 23030917 by Ben Marsh in ue5-main branch]
2022-11-08 12:09:56 -05:00
Ben Marsh
60fb2115fb Horde: Upgrade all NuGet packages to latest.
#preflight 630cf402e1124837752f0cb3

[CL 21682720 by Ben Marsh in ue5-main branch]
2022-08-29 13:34:15 -04:00
carl bystrom
86d53262a2 Horde: Use a connection pool for all Redis commands
Only expose ConnectionPool from RedisService to avoid using Database or ConnectionMultiplexer directly.
#preflight 62f2661d3b773d041627aad0

[CL 21286130 by carl bystrom in ue5-main branch]
2022-08-09 09:55:46 -04:00
Ben Marsh
8f48e56bbf Prevent Redis exceptions breaking in the debugger. Restore original code, but pass CancellationToken.None to make intent clear.
#preflight none
#fyi Joe.Kirchoff

[CL 20556567 by Ben Marsh in ue5-main branch]
2022-06-08 10:44:39 -04:00
joe kirchoff
ef7ed09092 EpicGames.Redis: net6.0 upgrade
#rnx
#rb none
#preflight 629f8c30f73a9b013dc53111

[CL 20541358 by joe kirchoff in ue5-main branch]
2022-06-07 13:41:17 -04:00
joe kirchoff
4ce400a2a1 [Backout] - CL20528968
#fyi joe.kirchoff
Original CL Desc
-----------------------------------------------------------------
EpicGames.Redis: net6.0 upgrade (with warnings)

Remaining warnings:
RedisChannel.cs(15,25,15,37): warning CA1066: Type EpicGames.Redis.RedisChannel<T> should implement IEquatable<T> because it overrides Equals
Utility\RedisLock.cs(14,15,14,24): warning CA1063: Provide an overridable implementation of Dispose(bool) on 'RedisLock' or mark the type as sealed. A call to Dispose(false) should only clean up native resources. A call to Dispose(true) should clean up both managed and native resources.
Utility\RedisLock.cs(39,26,39,38): warning CA1816: Change RedisLock.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it.
Utility\RedisLock.cs(79,11,79,96): warning CA2008: Do not create tasks without passing a TaskScheduler
Utility\RedisLock.cs(33,15,33,22): warning CA1063: Modify 'RedisLock.Dispose' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns
Utility\RedisLock.cs(33,15,33,22): warning CA1816: Change RedisLock.Dispose() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it.

#rnx
#rb none
#preflight 629e7910cb76a3f715a5cc4f

[CL 20540282 by joe kirchoff in ue5-main branch]
2022-06-07 12:45:18 -04:00
joe kirchoff
d7738ded81 EpicGames.Redis: net6.0 upgrade (with warnings)
Remaining warnings:
RedisChannel.cs(15,25,15,37): warning CA1066: Type EpicGames.Redis.RedisChannel<T> should implement IEquatable<T> because it overrides Equals
Utility\RedisLock.cs(14,15,14,24): warning CA1063: Provide an overridable implementation of Dispose(bool) on 'RedisLock' or mark the type as sealed. A call to Dispose(false) should only clean up native resources. A call to Dispose(true) should clean up both managed and native resources.
Utility\RedisLock.cs(39,26,39,38): warning CA1816: Change RedisLock.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it.
Utility\RedisLock.cs(79,11,79,96): warning CA2008: Do not create tasks without passing a TaskScheduler
Utility\RedisLock.cs(33,15,33,22): warning CA1063: Modify 'RedisLock.Dispose' so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in Visual Basic), and then returns
Utility\RedisLock.cs(33,15,33,22): warning CA1816: Change RedisLock.Dispose() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it.

#rnx
#rb none
#preflight 629e7910cb76a3f715a5cc4f

[CL 20528968 by joe kirchoff in ue5-main branch]
2022-06-06 18:10:10 -04:00
Ben Marsh
a18929e82f Horde: Add timing stats to remote execution responses.
Two sets of data are returned - one detailing the timeline of the task on the server (being queued, through dispatched, to completed), and one detailing the timeline of the task on the remote agent (downloading data, executing the task, and uploading the result).

The standalone compute command implementation in Horde.Agent also logs its own timeline of events.

#preflight none

[CL 19675739 by Ben Marsh in ue5-main branch]
2022-04-07 15:34:25 -04:00
Ben Marsh
83041dec73 Horde: Add a subsystem for hosting tools on Horde.
- Each tool can have a number of deployments which are rolled out over time. Clients can specify a "phase" value indicating where in the queue they want to take updates (ie. whether they want to be early- or late-adopters), and deployments can be paused and cancelled.
- Tool channels are configured through the global configuration file. Tools can be marked "public", meaning that they do not require authentication against Horde for access. This can be useful for auto-update scenarios.
- The most recent 5 deployments are kept in the tool at any time.

The collection and controller implementation here is an experiment in reducing the amount of boilerplate currently adopted as a pattern in Horde. Notably:

- Model and collection classes are concrete rather than interfaces (since we don't generally mock them anyway).
- The same model class with annotations is used for response objects (paving the way to supporting patching and filtering using the same public model as the internal model).
- The VersionedCollection class is used to handle automatic migration of documents across schema versions, and cache document values with Redis.
- MongoDB property names are explicit and short, rather than just taking variable names.

#preflight none

[CL 19636699 by Ben Marsh in ue5-main branch]
2022-04-05 20:17:50 -04:00
Ben Marsh
cda1b66bba Reformat EpicGames.Core according to standard coding conventions.
#preflight 623cd2e84368f558e30b4a9e

[CL 19502309 by Ben Marsh in ue5-main branch]
2022-03-24 16:35:00 -04:00
Ben Marsh
e2d80dd25c Horde: Handle edge cases with values for RedisString objects.
#preflight none

[CL 18475195 by Ben Marsh in ue5-main branch]
2021-12-16 08:42:15 -05:00
Ben Marsh
c5b39b6dae Horde: Remove debug code.
#preflight none

[CL 18473554 by Ben Marsh in ue5-main branch]
2021-12-15 23:32:46 -05:00
Ben Marsh
0c6981996e Horde: Fix race condition in call to AgentService.GetRate().
#preflight none

[CL 18473198 by Ben Marsh in ue5-main branch]
2021-12-15 22:19:45 -05:00
Ben Marsh
15b45f470f Horde: Simpler version of scheduling service. Now has one pod queue up all work to process (and update stream data), and other pods can just deque items.
[CL 18419245 by Ben Marsh in ue5-main branch]
2021-12-09 10:24:49 -05:00