Commit Graph

198 Commits

Author SHA1 Message Date
paul chipchase
8cf12f5179 Add code documentation describing the perforce set up required for storing VA payloads.
#rb trivial
#jira UE-180708
#rnx
#preflight 64186329691c5ebc156cdb24

[CL 24715179 by paul chipchase in ue5-main branch]
2023-03-20 09:49:52 -04:00
paul chipchase
ae6c359ca8 Allow the error message displayed when VA payloads fail to pull to be customized.
#rb none
#jira UE-180383
#preflight 64183a83691c5ebc155d21a2

- The payload pull error dialog now suports an additional custom line in the dialog that can be set via Engine:[Core.VirtualizationModule]:AdditionalPullErrorMsg. The intent is to allow teams to provide additional help and info to their users.
- The default error text is now localized.

[CL 24714178 by paul chipchase in ue5-main branch]
2023-03-20 07:40:06 -04:00
paul chipchase
633a13ec9c Add a new error handling flow (off by default) to VA when payloads fail to pull.
#rb none
#jira UE-180383
#preflight 64147be21c44ff98b969b1aa

- The new flow will display an error dialog to the user informing them of the problem and ask if they want to retry or quit the process. This is quite a shift if how we have been handling failed payload pulls up until and this is the first rough implementation so for now it is off by default.
- We only show one dialog at a time and if a new error occurs while we are waiting for user input, that thread is set to wait on the existing dialogs outcome.

[CL 24689856 by paul chipchase in ue5-main branch]
2023-03-17 11:15:24 -04:00
paul chipchase
9be422f486 Clean up VA config file parsing code
#rb trivial
#jira none
#rnx
#preflight 6413305ef81cce1dd8daae8b

- We no longer error if the values cannot be parsed from the config file, our defaults in BaseEngine.ini are the same defaults that we have in code anyway.
- We now trust that FConfigFile will not write to the variable passed into it on parse failure so there is no need to parse to a local variable first, then apply that to the member if the parse was a success.

[CL 24671648 by paul chipchase in ue5-main branch]
2023-03-16 11:23:43 -04:00
paul chipchase
40df3d2c61 Add an option ''-UseLocalIniFileSettings=True/False" to the VA source control backend, which controls if we allow the user of the locally saved 'SourceControlSettings.ini' or not
#rb trivial
#jira UE-180257
#preflight 6411cdbb5819afacaf06fbc9

- By default the value is true and the local ini file is used.
- Allows teams to opt out of loading settings from the locally saved ini file if they wish to.

[CL 24654053 by paul chipchase in ue5-main branch]
2023-03-15 10:17:32 -04:00
paul chipchase
6a78587b59 Improve error message shown to the user if they fail to connect to the VA perforce backend
#rb Per.Larsson
#jira UE-170132
#rnx
#preflight 640f33c5363e9b40ab8cd7af

- Output the entire depot path when failing to download 'payload_metainfo' along with the address of the server.
- We ask the source control provider for the status and parse the p4 port from that as there is no way (currently) to get this info directly via the source control api, which currently works but is a bit flaky long term.
-- I am not sure if we want to keep the error reporting like this and so I am loath to make changes to the source control API unless I am sure we actually want the functionality.
- Removed duplicate code paths, there is now only one branch that will log an error.
- Removed call to FConnect as that does not do anything unless a client is set and we do not use one with this connection. (FConnect is mostly about client set up validation rather than actually connecting to the server since we always make a new perforce connection for each command anyway.
-- Instead we now check if the source control provider is available after we call Init, if this returns false then no connection was made.
- Documented the purpose behind calling ISourceControlProvider::Init

[CL 24613062 by paul chipchase in ue5-main branch]
2023-03-13 11:10:53 -04:00
paul chipchase
4166d55804 Fix typo in VA source control backend logging.
#rb trivial
#jira none
#rnx
#preflight 6409819ca92b27de3c82f080

[CL 24572518 by paul chipchase in ue5-main branch]
2023-03-09 02:40:45 -05:00
paul chipchase
ae52fd7713 Clean up some of the code documentation regarding virtualization filtering.
#rb trivial
#jira none
#rnx
#preflight 6408843a827cf9251b123cb1

[CL 24558187 by paul chipchase in ue5-main branch]
2023-03-08 08:06:42 -05:00
paul chipchase
8a3c4c85ec Add a config file option '-IgnoreFile=' that allows a project to define the name of the p4ignore file used in the perforce environment.
#rb trivial
#jira UE-175158
#preflight 63f8cd34ae54ee4ce9ea207b

- We really should just read this value out of the users p4 environment settings, but that would require a source control api change and would need to be done in a source control agnostic way. Letting a project just define the name is a quick way to expose the functionality.
- At some point if we do extend the source control api then this option can be deprecated.

[CL 24400577 by paul chipchase in ue5-main branch]
2023-02-24 09:58:54 -05:00
paul chipchase
9992c0d589 Add a new config file option (-WorkingDir=ABC) when setting up a VA source control backend that allows finer grain control over where payloads are submitted from.
#rb trivial
#jira UE-175157
#rnx
#preflight 63f8b493ae54ee4ce9de6b78

- This feature was requested so that a team could opt into submitting from their appdata or temp directories instead of the project saved directory (our default)
- Deprecated the option '-SubmitFromTempDir' as it could be replacated with "-WorkingDir=$(Temp)/UnrealEngine/VASubmission"

[CL 24399707 by paul chipchase in ue5-main branch]
2023-02-24 08:50:29 -05:00
paul chipchase
1bea3bb207 Add a function to the virtualization utilities that will expand environment variables found in a file path.
#rb trivial
#jira UE-175157
#rnx
#preflight 63f8b276ae54ee4ce9dcb620

[CL 24399368 by paul chipchase in ue5-main branch]
2023-02-24 07:58:31 -05:00
paul chipchase
86dc9142b1 Add progress logging to the reydrate commandlet.
#rb trivial
#jira none
#rnx
#preflight 63ee42a2d669f2ed779879c7

- The commandlet runs quite slowly at the moment, logging the progress every 10 seconds or so helps the user see that work is being done and the process hasn't locked up.

[CL 24257562 by paul chipchase in ue5-main branch]
2023-02-16 10:07:47 -05:00
paul chipchase
b5f5cebd2b Expose more control over when virtualized payloads are placed in cached storage
#rb PJ.Kack
#jira UE-177013
#preflight 63ece283956709374a03eb8a

- The existing config file option 'EnableCacheAfterPull' is now deprecated. If we detect that it is still in the config file we will warn the user about it but continue to apply the value to maintain compatibility.
- Add a new config file option 'EnableCacheOnPull' which controls if a payload is pushed to cached storage after it has been pulled from persistent storage. (Default true)
- Add a new config file option 'EnableCacheOnPush' which controls if a payload is pushed to cached storage before it is pushed to persistent storage. (Default true)
- We now store the info about caching in a single enum bitfield ECachingPolicy.
- Added an up to date comment section about ini file set up for FVirtualizationManager which was previously missing.

[CL 24230636 by paul chipchase in ue5-main branch]
2023-02-15 10:32:09 -05:00
paul chipchase
7e1f558bae Removed the option to opt into virtualization for engine packages. They will be filtered out from virtualization in all cases.
#rb Per.Larsson
#jira UE-177015
#preflight 63eb71ea956709374ab61d5e

- So far nobody has proposed any worthwhile use case for virtualizing engine content given the following downsides:
-- We cannot ever do so internally as we would be unable to distribute the virtualized packages.
-- Projects and the engine packages cannot always be accessed via the same client spec, leading to problems if we try.
-- Engine content is typically small and not suited to virtualization in the first place.
- If we remove the option then we can exclude the engine packages from our VA commandlets which will give less confusing output (at the moment if you try to virtualize a project containing a single package we will report that several thousand packages were found as we need to parse engine content too)
- Deprecated the ini file options, if we detect them we will warn the user that the option is still present and that engine content now will never virtualize.

[CL 24208899 by paul chipchase in ue5-main branch]
2023-02-14 07:19:53 -05:00
paul chipchase
f4645786f9 Add a warning when virtualizing packages if we find any that predate when package trailers were enabled.
#rb Per.Larsson
#jira UE-176605
#preflight 63ea68d9b91ae11c1cbab311

- A common problem that has been reported is that the user has tried to virtualize packages with the virtualization tool but not seen any virtualization occur. When debugged the issue turns out to be that the packages are too old and need to be re-saved.
- If the user submits via the editor then the package will be auto reverted if it has not yet been re-saved  so this problem is not seen in that flow.
- Although this is a problem that will solve itself over time, it would be helpful to the person testing the system if we explicitly log that X number of packages were too old.
- Given how annoying this has proven to people the log message is currently set to warning.
- We don't actually return why a package trailer fails to load from FPackageTrailer::LoadTrailer, as working that out requires additional file reading and most the time we don't really care.
- Instead I added a new utility to the virtualization module so that we can opt into checking the reason.
- At the moment we only report if the package is too old and not for every possible reason.

[CL 24206813 by paul chipchase in ue5-main branch]
2023-02-14 04:12:26 -05:00
paul chipchase
a7dbc48169 Fix up include order
#rb trivial
#jira none
#rnx
#preflight 63e64774d948b2493a1afb2d

[CL 24117873 by paul chipchase in ue5-main branch]
2023-02-10 08:44:31 -05:00
paul chipchase
b234516542 Improve the error message when using the console command 'DumpPackagePayloadInfo' if the package does not contain a FPackageTrailer.
#rb Per.Larsson
#jira UE-176605
#preflight 63e4bb8a046845470872df95

- Instead of just giving an error message stating that the trailer could not be found, we now try to return why the trailer cannot be found, if the package is corrupted, or was last saved before the package trailer concept was introduced etc.

[CL 24094160 by paul chipchase in ue5-main branch]
2023-02-09 04:42:06 -05:00
paul chipchase
d30b9f7d91 Fix a potential slate assert if a VA connection issue is encountered on a background thread once the editor has initialized.
#rb Per.Larsson
#jira UE-175189
#rnx
#preflight 63d27eae450d5cdd0b4df619

- We were raising a FMessageLog to print a warning, then using ::OnConnectionError to defer the FMessageLog::Notify call until the next editor tick so an easy fix is to pass the warning to ::OnConnectionError and piggyback onto the defferal if needed.
- The messages used to be errors but were demoted during development, now that FSourceControlBackend has SuppressNotifications option and can supress the notifications on a per project basis we can restore the messages to errors.
- When calling ::OnConnectionError we will send the message to FMessageLog if we are currently on the game thread, then defer the notification until next tick as we were doing so previously. The deferral is needed in case the notify comes during editor start up (which for a connection problem is likely) so that the notification appears at the correct time. If we are not on the game thread we should still print the message to the log file so that debugging is easier, only the FMessageLog part needs to be deferred to the GameThread. In this case we need to tell FMessageLog to not print to the log file to avoid duplicates.

[CL 23919185 by paul chipchase in ue5-main branch]
2023-01-30 19:23:14 -05:00
paul chipchase
c2b57a755d Sanitize filepath input to the virtualization and rehydration processes.
#rb Per.Larsson
#rnx
#preflight 63d7b0135428dc67b160b3aa

- CL 23859876 introduced optimizations that consider a filepath to be invalid if the path contains consecutive path separators (DirA//DirB for example instead of DirA/DirB) and although no issues were seen when testing we fairly quickly ran into a user facing errors when trying to submit work from the editor.
- The users client spec root had a '\' at the end of it where as most internal devs do not. This in turn caused problems when parsing file info from source control as the code was assuming that the client spec root had no trailing separator and was adding one.
- Although the system providing the bad filepaths will be fixed it makes sense to sanitize the filepath input for these two processes as any system, including 3rd party ones could be providing the paths.

[CL 23919107 by paul chipchase in ue5-main branch]
2023-01-30 19:19:19 -05:00
paul chipchase
0d730ab6a6 Allow the revision control VA backend to prioritize requests from the game thread when limited by the number of p4 server connections allowed.
#rb Per.Larsson
#jira UE-174290
#rnx
#preflight 63c8fa22d15a37ae31487446

- Previously once the number of perforce connections allowed was reached we'd block all additional requests until an outstanding connection as been released at which point a random waiting thread would get the go ahead to make its own connection and so on. If the GameThread was making a request under these conditions the user could be left with a blocked editor while they wait for the GameThread to get a turn.
- This change allows FSourceControlBackend to create a semaphore that gives priority to the GameThread during contention so that the user gets the fastest possible response.

- FSemaphore now takes a bitfield of flags as a parameter in the constructor to allow us to specialize its behavior with the only support option being to prioritize the game thread.
- If the GameThread tries to acquire the semaphore and the prioritization option is enabled we use a slightly different path code path ::AcquireFromGameThread
-- Unlike the normal acquire code path, this path does not increment the count when waiting. This effectively reserves the next open slot for the calling thread.
-- Given that there is only one request on the GameThread at a time we don't have to check Counter once the event has been triggered. The even triggering means we know that one of the slots has been freed and we know we have already reserved that slot so we can just go ahead and return success at that point.
- Added a profile scope to acquire as that would've made the original problem easier to catch.
- Still need to look into replacing this with std::counting_semaphore once we can rely on c++ 20 support.

[CL 23771977 by paul chipchase in ue5-main branch]
2023-01-19 07:58:12 -05:00
paul chipchase
9341db99ce Do not raise an error if revision control is disabled. If packages did actually need to be checked out then we will raise the appropriate error when trying to modify them.
#rb trivial
#rnx
#preflight 63c4fa7fb0652247508bcb57

- Fleshed out the comment for the function to better describe the return value.

[CL 23727404 by paul chipchase in ue5-main branch]
2023-01-16 03:53:12 -05:00
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