Update: FWIW to anyone who comes across this post, I've actually changed my thinking on Question 1, about prepackaging NodeJs and node_modules.
It's more reliable to have all the binaries/dependencies packaged in one build so that during installation, there's less that could go wrong. If I installed NVM, Node, and ran NPM from within install.sh, I'd have to consider:
- If Github.com is down, NVM's install script won't be unavailable
- If NVM's version changes, or the Github project gets hijacked, the NVM install is unreliable
- If Nodejs.org is down, NVM can't install Node
- If Npmjs.com is down,
npm installwon't work, no node_modules
Since these fleets scale dynamically, this chain of events happens at unpredictable times. It's not like I can just deploy once, verify everything worked, and sleep well. A scale-up event could randomly fail in the middle of the night due to a network hiccup on any of those websites.
Considering all of these factors, I've decided to leave my build + install scripts unchanged. All dependencies are pre-packaged ahead of time. This is probably obviously correct to those familiar with Docker, but since GameLift is not very Docker-friendly, I had forgotten some of its ideologies.
Re: Question 2, about using
exec to start my Node process, I only have one concern. I'm running into an error about my game server processes not exiting cleanly within 30 seconds when they've been asked to. My code is listening for the
ProcessTerminate event, calls
ProcessEnding and, after that succeeds, calls
process.exit() accordingly. The error might be related to exec, but I don't see how yet. Could just be a code bug I'm not seeing.
GameLift Plug-in for Unity now availableasked a year ago
Gamelift Unity Ubuntu Build Failedasked 2 years ago
Build succeeds but backend changes are not deployedasked 6 months ago
Create client in UnityAccepted Answerasked 5 years ago
Unity plugin for Gamelift failing to deployasked 2 months ago
How to implement unity client to get notification from game session placement?asked a year ago
Installing NodeJS + NPM in a Build fleet (not Realtime Script)asked 21 days ago
NodeJs server SDKasked 5 years ago
GameLift Hosting for existing gameasked a year ago
Support for Unity 2019 in GameLift Realtime Client SDKasked 2 years ago