-
Notifications
You must be signed in to change notification settings - Fork 1
DevOps
scscgit edited this page Sep 25, 2020
·
6 revisions
TODO:
- Solve a bug why we can't upgrade Unity from 2018 to latest (ask on Discord for details, 2019 has some arbitrary min. RAM limit or something)
- Establish a CI/CD pipeline on GitHub
- Prepare a basic test automation scenario with a few example Unit tests
- Prepare a test automation framework for multiplayer, so that server + client can run together and test any arbitrary action
- Create some MP test scenarios to test the synchronization of Vehicle Physics, so we cover basic issues like the previous WebSocket bug
- Create some login test scenarios to test creating and logging in the user accounts (Note: back-end server will be probably a separate project)
- Prepare a test automation framework for multiplayer, so that server + client can run together and test any arbitrary action
- Based on the current situation of Unity and other available CI/CD products, GitHub Actions was chosen as a framework, because it's easily accessible, directly integrated with our preferred GitHub platform, it seems to be officially supported, and it supports declarative configuration, which makes it easy to use and maintain.
- Personally I've had some experience with also building Unity using Travis CI in the past, but it wasn't really easy to use, required configuring custom .sh scripts that download Unity editor itself, along with implementing our own C# build scripts to be triggered by command line inside the project, had trouble configuring tests, and most importantly, I wasn't able to set up any automated deployment of the resulting binary as a Release on a GitHub repository. Feel free to ask me for details on Discord, but this would be generally a bad way forward, even though it's also free. To provide additional context, it's also possible to develop our own pipeline using custom-hosted open-source products like Jenkins, which is often used for enterprise purposes, but we don't have any knowledge about how difficult is it to set up with Unity.
- The requirement is to automatically execute the pipeline on a commit (to master branch), executing tests and displaying their success result near the commit description, and deploying specified client/server build artifacts as a new entry under Releases, which effectively provides us an unlimited hosting of files
- The marketplace of Unity actions is here: https://github.com/search?p=1&q=unity&type=Marketplace
- The main ones will be probably Builder and Test Runner, probably requiring the License Activation, probably set up using a secret field inside GitHub (not committed). Some docs are here: https://unity-ci.com/docs/github/getting-started
- Testing GitHub Actions locally: on Windows install Chocolatey and install https://github.com/nektos/act using admin cmd:
choco install act-cli
- Decide on the (directory & content) structure and prepare a simple example for unit tests, integration tests, smoke tests...
- Research alternatives and try to use officially supported libraries and features, start by https://docs.unity3d.com/Manual/testing-editortestsrunner.html
- Must be multi-player aware by supporting scenarios with multiple clients.
- As a reference to take inspiration, Mirror has their own internal library tests at https://github.com/vis2k/Mirror/tree/master/Assets/Mirror/Tests
- Both Mirror server hosting and back-end hosting should be preferably supported by the same service, being as feature-rich and scalable as possible.
- Free web hostings are usually only for PHP pages (because they run on Apache HTTP Server).
- We need something that can be cheap as long as we have low (zero) server load, so we can develop and test over a real server.
- Heroku supports free hosting with 550-1,000 dyno hours per month: https://www.heroku.com/pricing
- Need to research how to deploy Mirror server (Docker?), and to setup CD pipeline
- Heroku may be more expensive than AWS in the long-term: https://railsware.com/blog/heroku-vs-aws-which-paas-hosting-to-choose/
- GameLift: hourly Spot and On-Demand prices may be cheaper: https://aws.amazon.com/gamelift/pricing/
- AWS has issues with being unable to configure billing limits, making it stressful to manage account with a credit card
- Serverless manifesto to describe ideal hosting conditions: https://www.serverless.com/learn/manifesto/
- Need to research HTTPS certificate automation scripts, e.g. to use Let's Encrypt and regenerate every 3 months using DNS validation
- PlayFab tutorial: https://docs.google.com/document/d/1ZgtDsgTcccyj25jSZgQPJ3_gnUCaOqQoJ9cvay2IfV4