EmpyrionWebAccess
EmpyrionWebAccess copied to clipboard
Linux Container support
I run some game servers to help a small community in an unpaid capacity on my Kubernetes cluster on some hardware in my house. I don't want to run Windows VMs, so I usually run game servers that require Windows through Wine. I have some custom container image builds, including one for Empyrion. It works fine, but trying to load EWA causes it to simply repeatedly crashloop with various Windows-specific .NET calls failing. I understand you probably don't intend on officially supporting Linux or containerized installs, but EWA is uniquely positioned to enable better game server hosting through Kubernetes scheduling of containerized servers - so I'm hopeful you're at least interested in looking into this. If you've got Docker available, you can rebuild the image or pull the one I've built from registry.jharmison.com/game-servers/empyrion:latest and manually side-load EWA to test it out. I can also get you some amount of access to my cluster if you'd prefer to poke around my own deployment.
I've uploaded a log, and the relevant lines start showing up around line 4883.
Some examples of the stack traces:
023-06-07 23:54:12.232 +00:00 [ERR] User not in the 'Performance Monitor Users' group, no performance counter available
System.InvalidOperationException: Category does not exist.
at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, Boolean readOnly)
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName)
at EmpyrionModWebHost.Controllers.SysteminfoManager.Initialize(ModGameAPI dediAPI) in T:\EWA\EmpyrionModWebHost\Controllers\SysteminfoController.cs:line 164
07-23:54:12.746 23_54 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
07-23:54:12.751 23_54 -LOG- {:EWAModClient} Game_Start: System.IO.DirectoryNotFoundException: Could not find a part of the path 'Z:\steam\empyrion\Saves\Games\Season 2\Playfields'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at System.IO.Directory.EnumerateDirectories(String path)
at EmpyrionModWebHost.Controllers.PlayfieldManager.ReadPlayfields() in T:\EWA\EmpyrionModWebHost\Controllers\PlayfieldController.cs:line 66
at EmpyrionModWebHost.Controllers.PlayfieldManager.Initialize(ModGameAPI dediAPI) in T:\EWA\EmpyrionModWebHost\Controllers\PlayfieldController.cs:line 56
at EmpyrionNetAPIAccess.EmpyrionModBase.Game_Start(ModGameAPI dediAPI)
07-23:54:13.085 23_54 -LOG- {:EWAModClient} Application: OnStopping
I'm able to join the server and play normally - I just can't EWA itself to stop crashing, even while we're on the server.
If I download the ModLoader.zip from here and extract it to Content/Mods, would that be enough to at least use the Backpack Extender mod? That's the one that people are asking me to get running in particular. I tried to get EWA working a few different ways for a while now (Installing various .NET versions in wine, running different Mono versions, installing Linux-native .NET versions outside of wine, etc.) and haven't had any luck. I know enough C# to be dangerous, but definitely nothing about the Visual Studio tool ecosystem and frankly can't make heads or tails of this repo because of it.
The error with the PerformanceCounters is not bad, the EWA is prepared for it, only the access to the playfields in the savegame (Z:\steam\empyrion\Saves\Games\Season 2\Playfields) puts it out of step. Something still seems to be wrong with your configuration.
PS: Unfortunately, I only have rudimentary experience with containers and Linux - let's see if I can get something to work.
After connecting to the server to generate some playfield data, I'm not getting those same stack traces repeatedly. Instead I'm getting this:
08-13:09:26.412 13_09 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:09:26.509 13_09 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/1360' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:09:27.909 13_09 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:09:47.513 13_09 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:09:47.606 13_09 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/2444' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:09:48.917 13_09 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:09:49.106 13_09 -LOG- {:EWAModClient} Application: OnStopping
08-13:09:52.881 13_09 -LOG- INFO: Uptime=13h16m 60.057 2348 heap=1165MB fps=Infinity players= 0 pfs=r0/i2/a0 ticks=1117994 nwqueue=
08-13:09:59.607 13_09 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:09:59.702 13_09 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/44' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:10:01.110 13_10 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:10:20.705 13_10 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:10:20.800 13_10 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/2816' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:10:22.120 13_10 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:10:22.348 13_10 -LOG- {:EWAModClient} Application: OnStopping
08-13:10:32.896 13_10 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:10:32.990 13_10 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/2352' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:10:34.355 13_10 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:10:34.405 13_10 -LOG- {:EWAModClient} Application: OnStopping
08-13:10:52.941 13_10 -LOG- INFO: Uptime=13h17m 60.058 2359 heap=1165MB fps=39.9 players= 0 pfs=r0/i2/a0 ticks=1119195 nwqueue=
08-13:10:53.994 13_10 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:10:54.088 13_10 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/256' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:10:55.410 13_10 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:10:55.639 13_10 -LOG- {:EWAModClient} Application: OnStopping
08-13:11:06.110 13_11 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:11:06.206 13_11 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/2348' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:11:07.644 13_11 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:11:27.211 13_11 -LOG- {:EWAModClient} ModClientDll: start host 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe'
08-13:11:27.305 13_11 -LOG- {:EWAModClient} ModClientDll: host started 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe/2892' -> StartInfo:'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA\EmpyrionModWebHost.exe' in 'Z:\steam\empyrion\Content\Mods\EWALoader\Client\..\EWA' with '-EmpyrionToModPipe EmpyrionToEWAPiped0c82abdce184aedb2c7eaa5e5361df0 -ModToEmpyrionPipe EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 -GameDir "Z:\steam\empyrion" "Z:\steam\empyrion\DedicatedServer\EmpyrionDedicated.exe" -batchmode -nographics -logFile "Logs/current.log" '
08-13:11:28.653 13_11 -LOG- {:EWAExtenderCommunication} ServerPipe: EWAToEmpyrionPipe7fee721f91c5426494aa8f8ebf768237 connected 10485760
08-13:11:28.846 13_11 -LOG- {:EWAModClient} Application: OnStopping
And the web server isn't responding ~~- though I suspect I may know why. Does the web interface look for a specific HTTP Host to route packets, or will it accept connections for any host? It's common in containerized environments to stick reverse proxies in front of your application to enable external access, so that's what I've got set up at the moment - and the Hostname from the perspective of the process right now is randomized every time it restarts, so can't be relied on.~~
~~If EWA is trying to be smarter about web requests, there is some extra configuration I can make to "trick" it - just need to know whether that's what it expects.~~
Nevermind, after updating this (and restarting just to be safe) I get no connection still:
Alright, so!
I've got things where they appear to be mostly working.
With that said - would you welcome a contribution for some (English only, with apologies) documentation on how to use EWA with a Linux-based Empyrion server container?
Of course I can link such a documentation in the EWA or include it.
Note: The first login also creates a first user. All further users must then be added via the EWA interface.
PS: You can also store certificate information for HTTPS in the "appsettings.json" for the Kestrel so that the browser is "satisfied".
I typically do all of my workloads without TLS inside my cluster, performing TLS termination at the Ingress (which is that reverse proxy thing I mentioned before). Do I see correctly that there's no mechanism to disable HTTPS and use HTTP only?
I'll be generating my certificates out-of-band but can get them injected into the container if EWA really needs them, and it appears that Kestrel supports PEM-format certificates/keys, which is good because PKCS#12 format is cumbersome to work with using my tooling.
I'll get a guide put together on my side in the next few days and see whether you think linking to it would be better than including it here.
Oh, you're also asking about the VirtualBackpack. The easiest way to do this is to unpack the ModLoader.zip into the Mods Order of Empyrion. Then you can switch it on/off or update it via the EWA. The other mods are also included ;-)
https://github.com/GitHub-TC/EmpyrionModPackage
I have had a few very busy weeks and haven't been able to thoroughly document all of this, but I did get it operational inside the container image, and built a Helm chart for managing it on Kubernetes. We've got a server that will be going public once Reforged Eden patches for 1.10 running with it. We've been stress testing it and working on confirming the management strategy, and EWA is working fine.
Undocumented (yet) image that can download and set up EWA using evironment variables: https://git.jharmison.com/containers/game-servers/src/branch/main/images/games/empyrion
Undocumented (yet) helm chart that can wire EWA up with config to support exposing with Ingress using trusted TLS certificates on k8s: https://git.jharmison.com/containers/game-servers/src/branch/main/charts/empyrion
A few more tweaks to everything to come before I go through and flesh out docs, but maybe the code links will help someone in the short term before I get that done :)