Commit Graph

54 Commits

Author SHA1 Message Date
Ben Marsh
12a0d5010f EpicGames.Serialization: Support deserializing into getter-only collection properties.
#preflight none

[CL 20252879 by Ben Marsh in ue5-main branch]
2022-05-17 18:36:34 -04:00
Ben Marsh
7dae34d929 Horde: Missing file.
#preflight none

[CL 19637007 by Ben Marsh in ue5-main branch]
2022-04-05 20:25:41 -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
b50740d5c1 Horde: Compact binary serialization improvements.
- Fix serialization of lists, directories and arrays that are set to null.
- Throw an exception when serializing a type that does not have any explicit compact binary field attributes. This is usually an error, caused by serializing a framework type with no matching converter, but can also occur when serializing an empty base class instance. To handle these situations, the class can be marked with [CbObject] to explicitly opt-in to being valid for serialization.

#fyi Joe.Kirchoff
#preflight none

[CL 19526671 by Ben Marsh in ue5-main branch]
2022-03-28 10:11:10 -04:00
Ben Marsh
508c144999 Horde: Last batch (hopefully) of static analysis fixes/suppressions.
#preflight 623e144c8073508cfc117a87

[CL 19517822 by Ben Marsh in ue5-main branch]
2022-03-25 15:35:47 -04:00
Ben Marsh
6b226011d7 Change EpicGames.Serialization library to match standard coding style.
#preflight none

[CL 19501703 by Ben Marsh in ue5-main branch]
2022-03-24 15:56:16 -04:00
Ben Marsh
17ddfdfdfc Horde: More improvements to Bundles.
- Now does all string manipulations in UTF8 rather than converting to and fro with data received from Perforce
- Added support for reading a stream out of a CbWriter object. This allows pushing data directly to Horde Storage from the piecemeal 1kb buffers it allocates without having to concatenate everything into a contiguous array first, removing some big allocations and data copying on the common path for serializing objects into Horde Storage.
- Refactored the way that BundleNodeRef objects work so they don't need to track the Bundle that owns them, so we can add some serialization/deserialization tests without having to set up as much framework code.

#preflight none

[CL 19345769 by Ben Marsh in ue5-main branch]
2022-03-10 19:56:01 -05:00
Joakim Lindqvist
0cf8a00ca9 Compact Binary Serialization C# - Added support for serializing uint and ulong
#preflight none

[CL 19171576 by Joakim Lindqvist in ue5-main branch]
2022-02-28 05:12:00 -05:00
Ben Marsh
1b3110c5ec Horde: Refactored system for creating bundles of tree objects.
- Tree can now be modified without having to have entire working set in memory.
- Multiple nodes can be compressed/decompressed together, and an optional IMemoryCache allows caching decompressed blocks.
- Added support for specifying custom compact-binary serializers on individual properties.
- Added test suite to test bundling functionality.
- Fixed issue where VarInts of negative values would not serialize correctly.
#preflight 621952f68849a7424fa36567

[CL 19158249 by Ben Marsh in ue5-main branch]
2022-02-25 17:11:58 -05:00
Joakim Lindqvist
6e85431bc6 EpicGames.Serialization - Added support for C# arrays (and not just lists) when serializing C# properties to compact binary
Also fixed issue were empty lists would not be serialized (field skipped)

#preflight none

[CL 19111704 by Joakim Lindqvist in ue5-main branch]
2022-02-24 05:44:28 -05:00
Joakim Lindqvist
b37024fe9b C# Compact Binary Serialization - Added more tests from Horde Storage (Jupiter Tests) and fixed issues exposed by them.
#preflight none

[CL 19111703 by Joakim Lindqvist in ue5-main branch]
2022-02-24 05:44:12 -05:00
Ben Marsh
184f8d56fb Change IoHash to be a pure struct rather than wrapping a ReadOnlyMemory<byte> buffer.
#preflight 620a675317632e9484560674

[CL 18978869 by Ben Marsh in ue5-main branch]
2022-02-14 09:35:17 -05:00
Ben Marsh
1efd86c9da Horde: Use Horde.Storage for remote execution storage, rather than the legacy storage implementation in Horde.Build.
- Agent and server both use the IStorageClient interface in EpicGames.Horde to communicate with the storage backend.
- An instance of Horde.Storage is run in the same process as Horde.Build for local development, but is compiled out for containerized builds.
- Compute clusters are defined in global config file, and control permissions for who can create remote execution jobs. In the future it will likely be used to control access for different machines, prioritization, etc...
- Each compute cluster has an identifier, and the API for starting/monitoring jobs includes that identifier as part of the route (ie. /api/v1/compute/<cluster-id>).
- Removed gRPC interface for storage and compute services. May be resurrected in the future.

#preflight none

[CL 18784247 by Ben Marsh in ue5-main branch]
2022-01-29 14:50:26 -05:00
Ben Marsh
32ab8d1b88 CS: Support for serialization and deserialization of polymorphic class hierarchies into compact binary.
The base class in a hierarchy must have the [CbPolymorphic] attribute, and derived classes must have the [CbDiscriminator] attribute, giving an identifier to indicate the derived type.

#preflight none
#p4v-preflight-copy 18635755
#preflight 61e6d83a7f0c4b5aad620c89

[CL 18640150 by Ben Marsh in ue5-main branch]
2022-01-18 10:30:25 -05:00
Ben Marsh
17fda19db7 CS: Support for serialization and deserialization of polymorphic class hierarchies.
The base class in a hierarchy must have the [CbPolymorphic] attribute, and derived classes must have the [CbDiscriminator] attribute, giving an identifier to indicate the derived type.

#preflight none
#preflight 61e600aa3778a195de94dc27

[CL 18635774 by Ben Marsh in ue5-main branch]
2022-01-17 18:52:44 -05:00
Ben Marsh
edb86dcf5b Horde: Fix build error.
#preflight none

[CL 18630244 by Ben Marsh in ue5-main branch]
2022-01-16 18:52:58 -05:00
Ben Marsh
9e6e68ba17 CS: Add overloads for commonly serialized compact binary types.
#preflight 61e4a67d7b0f77175a5d6621

[CL 18630220 by Ben Marsh in ue5-main branch]
2022-01-16 18:26:30 -05:00
Ben Marsh
5e131f7ddc CS: Rename compact binary files to match the classes they contain.
#preflight none

[CL 18628533 by Ben Marsh in ue5-main branch]
2022-01-15 13:33:44 -05:00
Ben Marsh
7e7bec2660 Horde: Include hourly rate for using an agent in returned agent and job documents.
Global config file now includes a list of conditions which are evaluated against an agent's properties. The first condition that matches specifies the rate for the agent. This should give us plenty of flexibility in pricing out esoteric configurations dependent on factors like instance type, OS, etc...

Rates are cached in Redis and re-evaluated every 5 minutes.

#fyi Josh.Engebretson
#preflight none

[CL 18469963 by Ben Marsh in ue5-main branch]
2021-12-15 14:47:12 -05:00
Ryan Durand
bcac0e411f Fix symbols publishing for Horde.Agent builds.
#rnx
#jira none
#rb ben.marsh

[CL 18423821 by Ryan Durand in ue5-main branch]
2021-12-09 15:21:08 -05:00
Ben Marsh
e1cb80903f Horde: Fix tests in serialization library.
#fyi Ryan.Durand

[CL 18271689 by Ben Marsh in ue5-main branch]
2021-11-23 12:18:30 -05:00
Ben Marsh
c3df64ec48 Horde: Add support for directly serializing raw compact binary objects. Fixes the /api/v1/objects endpoint when given a compact binary content type.
#fyi Joe.Kirchoff

[CL 17889706 by Ben Marsh in ue5-main branch]
2021-10-21 16:14:26 -04:00
Ben Marsh
e68d68c639 Horde: Add convenience methods in CompactBinarySerializer to read/write from byte spans.
[CL 17721938 by Ben Marsh in ue5-main branch]
2021-10-05 11:16:41 -04:00
Ben Marsh
2f6b890df1 Horde: Reduce memory usage when capturing workspace (part 2)
* Added UTF8 native version of fstat record to avoid unnecessary conversions
* Avoid conversion to/from UTF8 strings when converting Perforce records into CB objects
* Fixed implicit conversion of string to UTF8 string in argument check
* Converted ViewMap to use UTF8 strings

[CL 17601088 by Ben Marsh in ue5-main branch]
2021-09-22 17:34:10 -04:00
Ben Marsh
2d70fb8adc Horde: Reduce memory usage when querying workspace state (pt 1)
* CbWriter instances may now be cleared, and can cache allocated buffers between uses.
* Records may now be returned using IAsyncEnumerable<T> allowing them to be processed as they are received, and removing the need to allocate large numbers of temporary objects.

[CL 17599803 by Ben Marsh in ue5-main branch]
2021-09-22 16:10:08 -04:00