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 install
won'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.
Relevant questions
GameLift Plug-in for Unity now available
asked a year agoGamelift Unity Ubuntu Build Failed
asked 2 years agoBuild succeeds but backend changes are not deployed
asked 6 months agoCreate client in Unity
Accepted Answerasked 5 years agoUnity plugin for Gamelift failing to deploy
asked 2 months agoHow to implement unity client to get notification from game session placement?
asked a year agoInstalling NodeJS + NPM in a Build fleet (not Realtime Script)
asked 21 days agoNodeJs server SDK
asked 5 years agoGameLift Hosting for existing game
asked a year agoSupport for Unity 2019 in GameLift Realtime Client SDK
asked 2 years ago