Skip to content

Dependency Installation

Dependency Installation is the process of installing software requirements (dependencies) for your applications before those applications are deployed. E.g. an application could require some library to be installed on the host in order to run properly.

If your applications have no additional software requirements, you do not have to use this process.

Dependency installation occurs on a host before any game or utility applications are deployed. This is done by using a DependencyInstaller.

Dependencies must also be un-installed when all applications have been removed from a host. This is done by using a DependencyUninstaller.

If you use a DependencyInstaller, you must also create and use a DependencyUninstaller to clean up a host after all regular instances have been removed. Both must be defined in a DependencyDeploymentTemplate. Finally, the DependencyDeploymentTemplate must be assigned to the Fleet you are using.

Dependency Installer

A Dependency Installer is an "Application" of type DependencyInstaller that consists of a script and any dependencies you want to install that may not be part of a regular package manager like APT (Debian / Ubuntu).

Please refer to the Creating a Dependency (Un-)Installer application paragraph for more information.

Installer deployment process

Figure 1: Dependency installation process

Attention

If a dependency installation fails the platform will select another host, but it will only do that once. If two dependency installations fail, we stop the deployment process by setting the Fleet's operationalStatus to 0 (manual deployment / scaling disabled) and follow up with an email notification listing the details surrounding the environment it ran in, and the console output of the Dependency Installer.

Dependency Un-installer

A Dependency Un-installer is an "Application" of type DependencyUninstaller that consists of a script and any programs you need to un-install dependencies that may not be part of a regular package manager like APT (Debian / Ubuntu).

Please refer to the Creating a Dependency (Un-)Installer application paragraph for more information.

Un-installer deployment process

Figure 2: Dependency un-installation process

Creating a Dependency (Un-)Installer Application

Creation of an Application of type DependencyInstaller or DependencyUninstaller is identical to the creation of other types of Applications. The only difference is that you must set the type of the Application to either DependencyInstaller or DependencyUninstaller. This means that you first create the Application elements, then upload your DependencyInstaller build archive, then create an ApplicationBuild element.

The contents of the Application archive in this case are either a Bash script (Linux) or a PowerShell script (Windows). Additional files can be included, e.g. custom libraries or installers of a service you want to run during the lifetime of game instances on a host. Anything you need, you can put it in the DependencyInstaller Application archive.

Linux

Dependencies on Linux are installed via a shell script that will be executed by the Bash command line interpreter. This script can contain any commands you need to install your dependencies.

  • The Bash script must have the .sh extension. It does not require a shebang.
  • The script will be executed with root privileges.
  • The working directory will be the location of the script itself, so you can refer to files that are part of the DependencyInstaller Application using relative paths.

Bash example script (DependencyInstaller)

apt-get -y install openssl
apt-get -y install libatomic1
cp ./MyCustomLib.so /usr/local/lib/

Bash example script (DependencyUninstaller)

apt-get -y remove openssl
apt-get -y remove libatomic1
rm /usr/local/lib/MyCustomLib.so

Warning 1

When (un-)installing dependencies via a package manager, ensure they will not prompt for confirmations. This will otherwise stall the (un-)installation process, with the result that the dependency (un-)installation will eventually time-out and fail.

Warning 2

Make sure you use UNIX line endings in your Bash script.

Warning 3

Please note that if there is no Game or Utility to uninstall on the fleet, the Dependency Uninstaller will report an issue in a failed email because there is nothing to uninstall.

Windows

Dependencies on Windows are installed via a PowerShell script. This script can contain any commands you need to install your dependencies.

  • The PowerShell script must have the .ps1 extension.
  • The script will be executed with Administrator privileges.
  • The working directory will be the location of the script itself, however in Windows it's better not to use relative paths in all cases. E.g. msiexec does not like relative paths. The following example shows how to run an MSI file with an absolute path:

PowerShell example script (DependencyInstaller)

$cwd = (Get-Item -Path ".\").FullName
msiexec.exe /i $cwd\MyDependencyInstaller.msi /QN

PowerShell example script (DependencyUninstaller)

$cwd = (Get-Item -Path ".\").FullName
msiexec.exe /x $cwd\MyDependencyInstaller.msi /QN

Warning 1

When (un-)installing dependencies via a package manager, ensure they will not prompt for confirmations. This will otherwise stall the (un-)installation process, with the result that the dependency (un-)installation will eventually time-out and fail.

Warning 2

Avoid (un-)installing dependencies that require a reboot afterwards!

Behavior of the Dependency (Un-)Installer for different Fleet statuses

The Dependency Installer will automatically run in most cases, but there are differences in that behavior within the different Fleet operational statuses.

Fleet Operational Status 0 (manual deployment)

All deployments must be performed manually. This includes, where applicable:

Deployment of instances Upscaling is performed by manually deploying all application instances. This includes, where applicable:

  • manually deploy dependency installer for each host you deploy game instances on
  • manually deploy utilities for each host you deploy game instances on
  • manually deploy game instances

Removal of instances - scale down Downscaling is performed by manually removing all application instances. This includes, where applicable:

  • manually remove game instances
  • manually remove utilities
  • manually deploy dependency un-installer after having removed all game instances and utilities
  • manually remove the dependency installer and un-installer instances

Fleet Operational Status 1 (automatic deployment)

Deployment of instances Upscaling is performed automatically by increasing minimum capacity. This includes, where applicable:

  • automatically deploy dependency installer for each host we deploy game instances on
  • automatically deploy utilities for each host we deploy game instances on
  • automatically deploy game instances

Removal of instances - scale down Downscaling is performed by decreasing minimum capacity and manually removing all deployed application instances. When all game and utility instances have been removed from a host, the dependency un-installer will run automatically. This includes, where applicable:

  • manually remove game instances
  • manually remove utilities
  • the dependency un-installer will deploy automatically after you have removed all game instances and utilities
  • finally the dependency installer and un-installer instances will automatically be removed

Fleet Operational Status 2 (automatic deployment + scaling)

All deployments and removal of application instances are performed by our automatic scaler service. This includes, where applicable:

Deployment of instances - scale up Upscaling is automatically performed by our scaler according to minimum capacity, the buffer value and game instance occupation. This includes, where applicable:

  • automatically deploy dependency installer for each host we deploy game instances on
  • automatically deploy utilities for each host we deploy game instances on
  • automatically deploy game instances

Removal of instances - scale down Downscaling is automatically performed by our scaler according to minimum capacity, the buffer value and game instance occupation. This includes, where applicable:

  • automatically remove game instances
  • automatically remove utilities
  • automatically deploy dependency un-installer after having removed all game instances and utilities
  • automatically remove the dependency installer and un-installer instances

Creating a Dependency Deployment Template

This process is described in the DependencyDeploymentTemplate element chapter.

Assigning the template to a Fleet

This process is described in the DependencyDeploymentTemplate element chapter.

Important note

The Dependency Installation process is a powerful one and gives you a lot of control and flexibility. Besides installation of dependencies for applications, it can also be used to install services / daemons that will run for as long as there are Game applications installed on a host.

Whatever you choose to install, it is very important that everything is removed / uninstalled once a host becomes empty. This applies mostly to bare metal servers, because these will be re-used at a later time, possibly for different applications, unlike VMs that are destroyed when they are no longer needed. But even on VMs, the Dependency Un-installer will still be run. This allows you to e.g. unregister a monitoring node from a monitoring system.