Deploying ETPro Match Servers
•
31 Dec 2015, 20:46
•
Tutorials
The thing with competitive match servers is that they really don't vary much, they're almost exact duplicates of each other excluding a few configuration options such as hostname and passwords. If you go to a GamesTV ETPro server, and then hop over to your own - they will be pretty much the same.
When the servers start to become slightly different however, then problems occur - for example:
To resolve this issue, there needs to be a consistent setup of the gameserver service, that's where Docker comes in. Docker is a way of containing applications, it allows you to consistently replicate the environment (from files to operating system libraries) and easily provision a service based on an image.
These images typically have very few configurable options and are very lightweight but contain all the necessary data in order to provision a service. Such as ETPro.
A while back, I started working on an ETPro Docker image (`msh100/ETPro`), I have been using this for some time now and I know of some other users (including the past couple of ET LANs). This image allows you to set a hostname, some passwords, and your maps - they're the only configurable options. Start a container from the image and you have a running ETPro match server with ETTV support.
Example:
Providing Docker is installed, by running this:
The gameserver service would then be running on port `27960` of your server with the latest version of the image `msh100/ETPro`, this means if the image is ever upgraded the updates would be usable by restarting the container.
This is all nice, but it can become a hassle to maintain anything from the command line, especially if you only want to stop/start/restart services. Luckily the Docker ecosystem is quite large and there are numerous ways to simplify the deployment of these ETPro servers (or any Docker container).
There are a number of services, and utilities to improve orchestrating services in Docker containers on Linux, we will mainly focus on Tutum here but some include:
For the sole use of gameservers, some of these may be far too complex for basic use so we're going to stick with Tutum.
Tutum is a hosted service to manage Docker containers on your own servers. Once you have your own server, you can log into Tutum and obtain a shell line to run on the server in order to provision containers from Tutum's interface.
Note: This is a very basic example, you will only be able to run one container per node in this manner - It is of course possible to run more than one by using multiple services, or using the scaling option (provided you address port assignment correctly).
Assuming you're on your server and running as root, head over to the Tutum website and log in (or sign up), then head to the "Nodes" page and "Bring your own node". A box will appear with a `curl` command piped into `sh` - paste this into your server and wait.
This server was a fresh install of Ubuntu 14.04 with nothing extra installed.
Once you have a node, you can start to run services on that instance. Head over to the Services page on Tutum and add a new service.
The first option will be which image do you want to run the service from, in this case we want to use the `msh100/ETPro` image on the Docker public registry - so type that in and proceed.
On the next page, you start with some basic configuration options. Most of this you can leave how it is but you want to set the following:
Next proceed to environment variables. These are the configuration options for the gameserver itself.
The ETPro image has the following configurable environment variables:
If you do not set an environment variable, the container will use the default. Here's an example of a completed environment variable page:
Then "Create and deploy"!
Within a few minutes the gameserver will be online. It will take some time for the image to initially download and for the maps to download but once that's done the gameserver will be fully usable as expected.
Running a server like this yourself can work out cheaper than using a gameserver provider and also give you a lot more flexibility. Here are a couple of hosts I recommend if you need somewhere to run these containers:
Between the two there are a lot of locations you can run your Docker containers (especially on Vultr).
When the servers start to become slightly different however, then problems occur - for example:
- ETPro match servers not supporting ETTV.
- Out of date configurations.
- Staggered upgrades (an update would manually be changed on each server).
To resolve this issue, there needs to be a consistent setup of the gameserver service, that's where Docker comes in. Docker is a way of containing applications, it allows you to consistently replicate the environment (from files to operating system libraries) and easily provision a service based on an image.
These images typically have very few configurable options and are very lightweight but contain all the necessary data in order to provision a service. Such as ETPro.
ETPro Docker Image
A while back, I started working on an ETPro Docker image (`msh100/ETPro`), I have been using this for some time now and I know of some other users (including the past couple of ET LANs). This image allows you to set a hostname, some passwords, and your maps - they're the only configurable options. Start a container from the image and you have a running ETPro match server with ETTV support.
Example:
Providing Docker is installed, by running this:
- The `msh100/ETPro` image downloads and the container starts.
- The requested maps download from the map redirect.
- The match server starts with the configuration options specified.
The gameserver service would then be running on port `27960` of your server with the latest version of the image `msh100/ETPro`, this means if the image is ever upgraded the updates would be usable by restarting the container.
Simplification
This is all nice, but it can become a hassle to maintain anything from the command line, especially if you only want to stop/start/restart services. Luckily the Docker ecosystem is quite large and there are numerous ways to simplify the deployment of these ETPro servers (or any Docker container).
Options
There are a number of services, and utilities to improve orchestrating services in Docker containers on Linux, we will mainly focus on Tutum here but some include:
- Shipyard
- Rancher
- Mesos
- Kubernetes
- Many MANY more
For the sole use of gameservers, some of these may be far too complex for basic use so we're going to stick with Tutum.
Tutum
Tutum is a hosted service to manage Docker containers on your own servers. Once you have your own server, you can log into Tutum and obtain a shell line to run on the server in order to provision containers from Tutum's interface.
Provision Tutum Node
Note: This is a very basic example, you will only be able to run one container per node in this manner - It is of course possible to run more than one by using multiple services, or using the scaling option (provided you address port assignment correctly).
Assuming you're on your server and running as root, head over to the Tutum website and log in (or sign up), then head to the "Nodes" page and "Bring your own node". A box will appear with a `curl` command piped into `sh` - paste this into your server and wait.
This server was a fresh install of Ubuntu 14.04 with nothing extra installed.
Start an ETPro server
Once you have a node, you can start to run services on that instance. Head over to the Services page on Tutum and add a new service.
The first option will be which image do you want to run the service from, in this case we want to use the `msh100/ETPro` image on the Docker public registry - so type that in and proceed.
On the next page, you start with some basic configuration options. Most of this you can leave how it is but you want to set the following:
- Service Name - Set this to something you will recognise.
- Ports - Select `27960` as the container port (`udp`) this must not change and must be published, and you can chose whatever node port you want (click on "dynamic" to change this to your port, typically "27960"). This is the port that clients will connect on.
- Autorestart - Always. In the event the gameserver crashes, or the node restarts, the gameserver will start itself back up.
Next proceed to environment variables. These are the configuration options for the gameserver itself.
The ETPro image has the following configurable environment variables:
If you do not set an environment variable, the container will use the default. Here's an example of a completed environment variable page:
Then "Create and deploy"!
Within a few minutes the gameserver will be online. It will take some time for the image to initially download and for the maps to download but once that's done the gameserver will be fully usable as expected.
Server Providers
Running a server like this yourself can work out cheaper than using a gameserver provider and also give you a lot more flexibility. Here are a couple of hosts I recommend if you need somewhere to run these containers:
- Vultr (Shameless referral link)
- DigitalOcean (Shameless referral link)
Between the two there are a lot of locations you can run your Docker containers (especially on Vultr).
After running server can you access server console?
I use screen
When you have a Basic VPS from digitalocean for like 10$ you can easily host around 2~3 match servers. The Dutch location is also good regarding pings from my experience.
Regarding your image I would add baserace configurations as well and remove the pb folder. I also noticed you are working on CSGO docker image https://github.com/msh100/Docker-Images/tree/master/csgo Let me know if you got that finished, since I would like to run some csgo servers on demand.
As for CSGO, will keep you updated <3
awesome project friend
I'm no server admin, nor do I know much about it.
What I do know is that it looks pretty cool.
We're deploying localhost with Drush, Compass, composer, bulk, git, svn,... all with a push on the button (we made docker in a UI :D ; Basically we start containers by clicking on the container we want) So basically we can click what ever we need to setup a localhost in less than a min.
Problem is: a few bugs. Using stuff out of your docker is kinda fucked up if you want to let it work with something in your docker.
but anyway, I know just the small parts. 1.5 senior devs/server admins are working on it. This is not my expertise, but it looks pretty cool.
It's a huge amount of work to transition but can be worth it!
You made a Docker UI? That means there are now 10 million and 1 of them! :D
Anyway, nice work here (but I prefer debian rather than ubuntu).