Commit Graph

27 Commits

Author SHA1 Message Date
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
Ben Marsh
60ca64286f Horde: Change schedule service to allow multiple updates to be handled at once. Triggers are now scheduled in a sorted set stored in Redis, and served in order.
[CL 18397368 by Ben Marsh in ue5-main branch]
2021-12-07 14:02:22 -05:00
Ben Marsh
4f89a74d6b Missing copyright notice.
[CL 17896457 by Ben Marsh in ue5-main branch]
2021-10-22 09:53:40 -04:00
Ben Marsh
cf8620f2fa Horde: Take a lock when updating an issue, to prevent triggering multiple server pods doing the same thing.
[CL 17896396 by Ben Marsh in ue5-main branch]
2021-10-22 09:36:55 -04:00
Ben Marsh
e218f4cc86 Horde: Add a notification system for agent update events. Allows agents to react immediately to setting changes, rather than having to wait for the next session update to commence.
[CL 17844810 by Ben Marsh in ue5-main branch]
2021-10-18 10:13:39 -04:00
Ben Marsh
e322c1969f Horde: Missing file.
[CL 17665333 by Ben Marsh in ue5-main branch]
2021-09-29 14:30:25 -04:00
Ben Marsh
65b48b3a00 Horde: First version of Perforce metadata mirroring. Replicates the state of each stream into the CAS as a merkle tree, allowing faster metadata updates on clients.
Not yet enabled by default due to memory issues.

[CL 17587591 by Ben Marsh in ue5-main branch]
2021-09-21 16:26:45 -04:00
Ben Marsh
35cd4ff3c3 Horde: Add missing methods to strongly typed Redis wrappers, and add support for serializing all primitive types.
[CL 17564161 by Ben Marsh in ue5-main branch]
2021-09-18 15:02:30 -04:00
Ben Marsh
732cba332a Horde: Missing file.
[CL 17563736 by Ben Marsh in ue5-main branch]
2021-09-18 12:26:44 -04:00
Ben Marsh
6243269106 Horde: Change Redis wrapper to a more object-oriented API. Individual data types now include a reference to the database, allowing methods to directly modify their values.
[CL 17563734 by Ben Marsh in ue5-main branch]
2021-09-18 12:25:51 -04:00
Ben Marsh
7146bb7f90 Horde: Add additional functionality to Redis library, including support for hashes.
[CL 17171062 by Ben Marsh in ue5-main branch]
2021-08-14 17:45:23 -04:00