Commit Graph

177 Commits

Author SHA1 Message Date
mark lintott
8bad2c0365 Removed the callback system from core Analytics system. Fixed up analytics gathering in DerivedDataCache, Virtualization and HttpCacheStore
#rb wes.hunt
#preflight 63be95bd68068a8bd6a4438e

[CL 23651011 by mark lintott in ue5-main branch]
2023-01-11 14:28:01 -05:00
paul chipchase
b9bdf31e54 The VA filesystem backend no longer requires that the 'Path' option be setup in the config file.
#rb Per.Larsson
#rnx
#preflight 63bec803c543a64b7d38d89f

- If no 'Path' option is found the path will default to the projects saved directory, under a 'VAPayloads' subdirectory
- This works as an okay default if the backend is being used for cached storage.

[CL 23645795 by paul chipchase in ue5-main branch]
2023-01-11 10:56:47 -05:00
paul chipchase
1d320da3d8 Add documentation for the 'MaxConnections' option found in the FSourceControlBackend.
#rb trivial
#rnx
#preflight 63beaa196e6e8d4662dac3d7

[CL 23644140 by paul chipchase in ue5-main branch]
2023-01-11 07:38:34 -05:00
paul chipchase
7c4a834261 Change TryVirtualizePackages/TryRehydratePackages to return the corresponding results structure rather than an enum value.
#rb Per.Larsson
#jira UE-169626
#rnx
#preflight 63bd670a71079a8d1c0e837b

- Since the API was forcing the caller to pass in a results structure to be filled in, we might as well make it the return value.
- Added a ::WasSuccessful method to the results structures that can be used instead of checking if the result had errors or not.
- Remove the reset method from FVirtualizationResult/FRehydrationResult as they no longer need it.
- The older deprecated methods still use the results enum, so we cannot easily deprecate those enums yet.

[CL 23626072 by paul chipchase in ue5-main branch]
2023-01-10 09:15:11 -05:00
paul chipchase
66b32a743f Add a new overload to IVirtualizationSystem::TryRehydratePackages, which takes additional options (via a bitfield enum) and returns more info about the resulting process. The original version has been deprecated.
#rb Per.Larsson
#jira UE-169626
#rnx
#preflight 63bd0ebfd862fdd347bce1fe

### VA System
- This allows us to provide the user with more ways to customize the rehydration and return more detailed info about it if the calling code wishes to log additional info. In both cases we can extend the options and the data returned without changing the API.
- At the moment the only flag we support is 'Checkout', which requests that the rehydration process checkout any package that it needs to modify rather than giving an error. This means that the user does not need to check packages out from revision control before running the rehydration process.
-- We still check if packages can be modified and warn the user if they can't, as package files could be locked in other ways.
- The rehydration process will now long the time taken if verbose logging is set for the category 'LogVirtualization'

### UnrealVirtualizationTool
- The virtualize command now reports how many packages were checked out if the flag was set.
- The rehydration command now supports a '-Checkout' commandline flag, which when enabled will use the new api to checkout the packages that need to be checked out when rehydrated.

[CL 23625132 by paul chipchase in ue5-main branch]
2023-01-10 06:27:20 -05:00
matt peters
71802fb86c Analytics: Backed out 22909100 and 22951911
#rnx

[CL 23583550 by matt peters in ue5-main branch]
2023-01-04 18:51:41 -05:00
paul chipchase
80beaf7cc8 Add a new overload to IVirtualizationSystem::TryVirtualizePackages, which takes additional options (via a bitfield enum) and returns more info about the resulting process. The original version has been drepcated.
#rb Per.Larsson
#jira UE-169626
#rnx
#preflight 639c4112012902cb8db43e13

- This allows us to provide the user with more ways to customize the virtualization and return more detailed info about it if the calling code wishes to log additional info. In both cases we can extend the options and the data returned without changing the API.
- Previously if we virtualized a package that was not checked out in revision control we would warn the user and then skip updating the package file on disk. This means the payloads would be uploaded but the user would be left with no local changes. Since sometimes we know we don't need to check out any package (virtualizing the packages in a change list for example) we don't want to always incur the cost of polling reivision control to see which packages do need checking out. This is why we now allow the caller to request package files be checked out via the new options enum EVirtualizationOptions.
-- If the EVirtualizationOptions::Checkout flag is provided we will poll the revision control status of all package files and then check out those which need it.
-- We still check if packages can be modified and warn the user if they can't, as package files could be locked in other ways.
- Added a new utility function to SourceControlUtilties to make it easier to check out packages. There is similar functionality elsewhere in the code base but the virtualization module is too low level to make use of it.
- Updated existing code that calls ::TryVirtualizePackages and add cases of ''using namespace UE::Virtualization' where required to improve readability.
- The UnrealVirtualizationTool now supports a new cmdline option "-checkout" that can be used when virtualizing packages. This will checkout any package that was actually virtualized so the result can be saved back out to the workspace domain. This means we no longer require the caller to have checked out the packages before running the tool.

[CL 23536832 by paul chipchase in ue5-main branch]
2022-12-16 06:25:07 -05:00
paul chipchase
b4055bd14c Virtualizing an asset will no longer display an error message if the project has no caching storage backends set up.
#rb Per.Larsson
#jira UE-171492
#rnx
#preflight 6391f02d67018b14b581c0b0

- It is possible that a project might want to have persistent storage enabled but no caching storage, it is probably a bad idea but it should work. However before this fix doing so would cause an error to be logged during the virtualization of a package and fail the process.
- During the virtualization process we now check if pushing is enabled for cache storage before trying to push there, if not then we log that the phase is being skipped.
- Even though the above fixes the problem we would still get odd results when pushing payloads to cached storage without any backends enabled.
-- We now check if the pushing process is disabled before processing requests, so we can fail faster. There is now also a proper error value for this that can be stored in each request (FPushRequest) where as previously they'd all still display "pending"
-- We also check to see if the requested push type has any associated backend before processing requests and have a specific error value for this. Note that we consider
- We also now force the visibility of the slow task progress bar, as otherwise we might not end up displaying the virtualization progress to the progress dialog (this is a work around to a long standing problem with the slow task system due to the time limit associated with updating the dialog via EnterProgressFrame, this needs to be fixed elsewhere)

#ushell-cherrypick of 23445439 by paul.chipchase

[CL 23461405 by paul chipchase in ue5-main branch]
2022-12-09 03:39:20 -05:00
brandon schaefer
f77afc5a1d Fix lifetime issues, all of these are undefined behaviour
#jira UE-172308
#rb Jimmy.Andrews
[FYI] Steve.Robb
#preflight 63922e890d013d47efae9480

[CL 23460229 by brandon schaefer in ue5-main branch]
2022-12-08 21:22:12 -05:00
aditya ravichandran
338fb4be16 Replace some remaining instances of "Source Control" with "Revision Control" in text
#rb JeanMichel.Dignard, Robb.Surridge

[CL 23251078 by aditya ravichandran in ue5-main branch]
2022-11-23 12:08:16 -05:00
aditya ravichandran
f8b7ee5555 Replace any instances of "Source Control" with "Revision Control" in text in the Editor
#rb JeanMichel.Dignard, Robb.Surridge
#preflight 637d180efa348e8480e8837e

[CL 23250808 by aditya ravichandran in ue5-main branch]
2022-11-23 11:57:50 -05:00
paul chipchase
909615801d Fix the VA filesystem backend from failing to serialize pushed payloads correctly.
#rb Per.Larsson
#jira UE-170012
#rnx
#preflight 63724fa79e3bea8079f2ed76

- The original for loop was added at a time where FCompressedBuffer did not support serialization directly, at that time the code worked.
- Now it looks like the FCompressedBuffer returned by the call to ::GetPayload is going out of scope early, which means that the FSharedBuffer ends up zero length (and quite possibly unsafe to use)
- However nowadays FCompressedBuffer has both a operator<< and direct ::Load/::Save methods so we can remove the for loop and simplify the code.

[CL 23133173 by paul chipchase in ue5-main branch]
2022-11-15 03:18:08 -05:00
henrik karlsson
fa90b399a4 Added includes for future change. This changelist only contains added #include and a couple of empty placeholder files
Tested compiling fortnite, unrealeditor, lyra, qagame with non-unity/pch

#preflight 63635997876630122adeab9f
#rb none

[CL 22958990 by henrik karlsson in ue5-main branch]
2022-11-03 14:18:47 -04:00
mark lintott
c6f8a9e9d9 Removed AnalyticsEventAttribute.h from the ZenServerInterface and VirtualizationManager header
#rb paul.chipchase
#jira none
#preflight 63625ed70c2e7c8f91891d11

[CL 22911432 by mark lintott in ue5-main branch]
2022-11-02 08:18:25 -04:00
mark lintott
490070be3c Decoupled Zen, DerivedDataCache and Virtualization dependency from Studio Analytics. Systems can now register callbacks to append or modify Event payloads to analytics events by name via the FAnalytics interface.
#rb Nick.Darnell
#fyi Paul.Chipchase,Zousar.Shaker
#preflight 636248d054471d10bedc3749

[CL 22909100 by mark lintott in ue5-main branch]
2022-11-02 06:56:10 -04:00
paul chipchase
1a00222986 The perforce source control API can now issue a single p4 print command with multiple depot file paths as arguments rather than issuing a single p4 print command per file.
#rb PJ.Kack
#jira UE-167578
#rnx
#preflight 635bdddd5b54febd38b7efd0

- Clean up the source control backend by removing the older code path that was ifdefed out and clean up the new path.
- FPerforceConnection no longer takes a TOptional<FSharedBuffer> but takes an optional pointer to a TArray of FSharedBuffer. When gathering files this should return one FSharedBuffer per file requested.
-- It might make more sense to attach the FSharedBuffer to the FP4Record but that would require some bigger changes and would be better suited to being some follow on work. All the code is private in the module and not exposed so it is fairly safe and easy to do these refactors later.

- Replaced the TArray buffer for gathering files with a purpose built class FP4DepotFile.
- When issuing a p4 print command with multiple files we will get one call to ClientUser::OutputStat followed by calls to either ClientUser::OutputText or ClientUser::OutputBinary until all of the file has been delivered, then we will get another call to ClientUser::OutputStat for the next file and so on.
-- Note with binary files we seem to get one final call to ClientUser::OutputBinary with zero size, which I assume is supposed to signal the end of the transfer, text files do not get this, they seem to just stop.

[CL 22888671 by paul chipchase in ue5-main branch]
2022-11-01 15:10:19 -04:00
Zak Middleton
73efd27f6c #ue5 - Truncation fixes for modules:
StatsViewer
StatusBar
TargetDeviceServices
TargetPlatform
Teleporter
TimeManagement
TranslationEditor
ViewportInteraction
Virtualization
WindowsPlatformFeatures
WindowsTargetPlatform

#jira UE-160837, UE-160843
#rb Andrew.Davidson, Dave.Jones2
#preflight 636024751c75ff834a526197

[CL 22873932 by Zak Middleton in ue5-main branch]
2022-10-31 18:33:27 -04:00
paul chipchase
2300a007fe Allow the VA file system backend root path to be overriden by an environment variable, allowing users to choose where they want the data to be stored.
#rb Per.Larsson
#jira UE-168458
#rnx
#preflight 635a77d49b2e9c76c7052e41

[CL 22810926 by paul chipchase in ue5-main branch]
2022-10-27 11:33:48 -04:00
paul chipchase
3bb9e2ffc1 Allow VA backends to be marked as read only to prevent new payloads being pushed to them.
#rb Per.Larsson
#jira UE-168452
#rnx
#preflight 635a4773f1493f97864fb660

- IVirtualizationBackend can now have its operations disabled after it is created.
-- This means that a backend that only supported pushing and not pulling would end up with no valid operations if marked as read only. This will not assert because we do this after the backend is created and we only check on creation.

[CL 22810918 by paul chipchase in ue5-main branch]
2022-10-27 11:33:43 -04:00
paul chipchase
c05f9909e8 Fix some broken VA debug commandline options
#rb Per.Larsson
#jira UE-168057
#rnx
#preflight 635656e6e6096564af1bc117

- Work on UE-165308 broke the following commandlines as they were accidently converted to cmdline switches rather than values
-- VABackendGraph
-- VAMissBackends
-- VAMissChance
- ::IsCmdLineSet has now been split into two utility wrappers, one for params (bools) and one for values.

[CL 22792790 by paul chipchase in ue5-main branch]
2022-10-26 17:26:09 -04:00
paul chipchase
462290f718 Extending the VA pulling API to allow for batch pulls
#rb Per.Larsson
#jira UE-163093
#rnx
#preflight 63526abcae33b04ec1ee4a65

- The caller can now request more than one payload to be pulled froim the system at a time. In theory this will allow backends to pull data quicker.
-- The file system backend works with the new system but makes no attempt to take advantage as the backend is not intended for serious production use.
-- The DDC backend should be taking full advantage of the new batching API
-- Note that although the source control API does attempt to take advantage of batching, the internal source control API implementation is not doing so. This will be addressed in a future submit.
- This does make the pulling logic a bit more complicated in FVirtualizationManager as we need to deal with some payloads being found in the first backend, some in the second and some in the third etc.
-- To help deal with this a new class FPullRequestCollection has been added which abstracts a lot of complexity away.

[CL 22707955 by paul chipchase in ue5-main branch]
2022-10-21 22:27:40 -04:00
paul chipchase
bf3eee797c Updated all VA related commandlines to work without '-' although the previous version of the command line options will continue to work.
#rb Per.Larsson
#jira UE-165308
#rnx
#preflight 634ff17e8449f85a47390fbe

- It was pointed out that a command line option containing '-' characters could confuse parsers and it is not worth the risk to keep them.
- Now we accept versions of each command line without the '-' character which will be the version that we document for users in 5.1

[CL 22650940 by paul chipchase in ue5-main branch]
2022-10-20 02:20:37 -04:00
paul chipchase
8a227b60bb Add a VA rehydration code path that rehydrates a package to a memory buffer rather than replacing the original package on disk.
#rb Per.Larsson
#rnx
#preflight 634805f7f93be0f634b8ed5b

- Added a new FArchive 'FFixedBufferWriterArchive' that will let me serialize to an already allocated, fixed sized memory buffer.
- Moved the code for opening and reading packages to shared utility functions so that it is easier to keep the error messages consistent.
- Moved common code to a new function ::TryRehydrateBuilder so that both rehydration methods can share it.
- Note that technically we are changing the API since now we accept a TConstArrayView for the package file paths for both the virtualization and rehydration paths, but existing code will be compatible with this change.

[CL 22511406 by paul chipchase in ue5-main branch]
2022-10-13 16:28:28 -04:00
paul chipchase
b7e65fd7a7 We now also log the VA payload count along side the other statistics.
#rb trivial
#jira UE-160942
#rnx
#preflight 634557f5c272487ed4ab2014

- In addition to adding the hit counter (which can be very useful when debugging) the stats logging code has been factored out to a single lambda tht is called for each set of stats to make it easier to update in future.

[CL 22457126 by paul chipchase in ue5-main branch]
2022-10-11 09:52:11 -04:00
paul chipchase
90bea28a6e Setting the cvar 'VA.AllowPkgVirtualization' as part of a device profile will no longer log warnings about the cvar being unregistered.
#rb Per.Larsson
#rnx
#preflight 633ad936c250f60502b2d8cb

- Everything was working but when a cvar is set via a device profile we expect the cvar to be registered sooner, hence the warning.
- Added a new define UE_USE_GLOBAL_CVAR to FVirtualizationManager.cpp, when set we use a static global cvar for 'VA.AllowPkgVirtualization' rather then creating and registering one when the system is mounted.
- Since the cvar can now outlive the manager we also needed to add a way to remove the bound lambda from the cvar when the manager is destroyed.

[CL 22322164 by paul chipchase in ue5-main branch]
2022-10-03 20:36:09 -04:00