Start a Local Cluster¶
In this section, we describe how to set up a local environment for testing your application with the Genvid MILE SDK integrated.
Before You Begin¶
Install the Genvid Toolbox.
Make sure it’s included in your
PATH
.Make sure you have the following tools necessary for SDK integration:
- Python v3.8.6
- Visual C++ Build Tools 2017
- Node JS 10.16.3 LTS
- AWS CLI for Amazon
- Azure CLI for Azure
- Tight VNC
- GIT
Note
The above mentioned tools can also be installed with the help of the Global Packages included with the Genvid MILE SDK installer, with the exception of Azure CLI which is currently not offered in the SDK installer.
Initialize a Local Cluster¶
At the command line in your shell window:
Install a bastion server.
genvid-bastion install -lmu -b {mybastion}
This command sets up the supervisor servers and runs the Genvid bastion-api services on them. See the genvid-bastion reference for more information on what this script does.
Changed in version 1.20.0: Creating a local cluster is now an option when running
genvid-bastion install
. It no longer automatically creates it by default. Run thegenvid-sdk setup
to create a local cluster.mybastion is a unique identifier for your bastion server. It must:
- Be between 3 and 32 characters.
- Only contain lowercase letters, numbers, or hyphens.
- Start with a letter.
The supervisor servers use a working directory under
~/.genvid
. You can change this location by settingGENVID_SERVICES_DATADIR
environment variable to another valid directory.Note
Although most of the data is written under the
GENVID_SERVICES_DATADIR
, the current implementation isn’t able to transfer everything to this specific working directory. Some data, like the Terraform’sworkdir
, must be located next to the Terraform configuration files underbastion-services/terraform
under the installation directory.Set up the local cluster.
genvid-sdk setup
Clean any old configuration information.
genvid-sdk clean-config
Load the current configuration.
genvid-sdk load-config-sdk
At this point, your local environment is set up with the minimum set of services to run your project.
Make sure you stop all services when you’re done streaming.
The references for the other commands of genvid-bastion are available in genvid-bastion.
Sharing a Cluster¶
You can share a single cluster among multiple projects, but you can only run one game on it at a time. You cannot run more than one local cluster per machine, since their ports would conflict.
The local cluster uses the following ports:
Application | TCP Ports | UDP Ports |
---|---|---|
Consul [1] | 8300, 8301, 8302, 8400, 8500, 8600 | 8301, 8302, 8600 |
Vault [2] | 8200 | |
Nomad [3] | 4646, 4647, 4648 | 4648 |
Bastion [4] | 8092 | |
Other | 20000 - 60000 |
[1] | Consul ports used |
[2] | Vault Configuration |
[3] | Nomad Agent configuration |
[4] | See GENVID_BASTION_BINDING_PORT |
Nomad dynamically allocates other ports when it schedules an application to run
on the cluster. All services also send metrics on udp://localhost:8125/
, as
explained in the Metrics section.
Setting the Local IP¶
By default, the local cluster’s IP addresses are bound to 127.0.0.1. If you want to use a specific machine’s IP address, you need to change two environment variables.
If you have already set up a cluster, you first need to stop the services and clear all current configuration information.
Stop the cluster.
From your preferred Unix shell, uninstall and clean the services.
genvid-bastion uninstall -c
Once any old configuration information is cleared, open a Windows command prompt.
Set
GENVID_DEFAULT_IP
to the visible IP of the machine.Set the
CONSUL_HTTP_ADDR
to the same IP.set GENVID_DEFAULT_IP=123.123.123.123 set CONSUL_HTTP_ADDR=123.123.123.123:8500
From your Unix shell, restart the cluster.
genvid-bastion install -umlb {mybastion}