MiniGameRouter
: Register center, REST API implementationMiniGameRouter.SDK
: SDK for clientsMiniGameRouter.SideCar
: Default sidecar server implementationMiniGameRouter.Benchmark
: Benchmark project for various core functions and logicMiniGameRouter.PressureTest
: A demo fake client used to run the pressure test for the Register Center
Currently, all major projects fully support standlone & docker/K8s env deployment.
- Install .NET 8 SDK from Microsoft - Dotnet
- Go to any of the project dir listed above
- Run:
dotnet publish -c Release
- Go to
/[Project_Dir]/bin/Release/net8.0
, you should see the build output and the executable of the project.
- Setup required docker env on server
- Go to repo's root dir (NOT PROJECT'S SUB DIR)
- Run:
docker build . -f [PROJECT_DIR]/Dockerfile -t minigamerouter/[NAME]:latest
- Use docker run to start the container.
docker run -d \
-p [EXPOSE_PORT]:80 \
--name [NAME] \
--add-host=host.docker.internal:host-gateway \
-e ASPNETCORE_HTTP_PORTS=80 \
-e "ConnectionStrings:RedisCache=host.docker.internal:6379" \
-e "ConnectionStrings:DefaultMongoConnection=mongodb://host.docker.internal:27017" \
minigamerouter/backend:latest
docker run -d \
--name [NAME] \
--add-host=host.docker.internal:host-gateway \
-e "MiniGameRouter:ConnectionString=http://host.docker.internal:[PORT]" \
-e "PressureTest:ConnectionString=http://host.docker.internal:[PORT]" \
minigamerouter/pressure_test:latest
The default config for the pressure test is:
"PressureTest": {
"ConnectionString": "[CONNECTION_STRING]", // Backend Endpoint
"ServiceCount": 10, // Service count
"InstanceCount": 20, // Instance count,
// this means how many instance under one service.
// Total number of reg = ServiceCount * InstanceCount
"RandomEndPointOps": {
"ParallelCount": 20, // Number of concurrent ops
"GetSubInstanceCount": 10, // Instance count for get test
"EnableRandomCreateAndDelete": true, // Enable instance random create and delete
"EnableRandomUpdate": true, // Enable instance random edit
"EnableRandomGet": true // Enable instance random get
},
"RandomDynamicMappingOps": {
"ParallelCount": 200, // Number of concurrent ops
"MappingCount": 10000, // Total mappings register count
"EnableRandomCreateAndGet": true // Enable mapping random create and get
}
}