SDK in the cloud

Once a cluster is up, you need to upload the SDK and the project to it.

Loading the SDK to a cluster

To load a project in the cloud the first step is to upload the SDK images to a s3 bucket. This step may take a while but it is only required to be done once per bastion. The same images will be reused for each cluster.

genvid-sdk upload-images-sdk

The next step is to set up the SDK.

genvid-sdk -c myclusterid setup

After this step, some services are available in Cluster-UI. You can open Cluster-UI with the following command.

genvid-sdk -c myclusterid monitor

Although the list of jobs is empty, you can find the list of nodes at the top. It may take some time for some nodes to show up, like the game node. It can take up to 55 minutes for a Windows server to finish its configuration but the average is more between 15 and 25 minutes. If they don’t, check with your cloud provider to see if the node will eventually come up or if there are other issues with it.

Even without all the nodes available, you can load the SDK configuration into the cluster:

genvid-sdk -c myclusterid load-config-sdk

The SDK definition is loaded and now there is one job: services.

Build the Tutorial sample for the cloud

Assuming the Docker host was set up correctly, you can build the images for the tutorial. (See Building with Docker for more information.)

py tutorial.py build-cloud

Now, upload the images and load the project definition:

py tutorial.py -c myclusterid upload-images --update-config
py tutorial.py -c myclusterid load

After this step, the images are available on S3 and the project configuration is loaded and ready to use in the cloud.

  • Open the Jobs page:
 genvid-sdk -c myclusterid monitor

* Click the **Start all** button.
* Click the ``Tutorial Demo`` link.

Check that everything is working correctly.

When you’re finished click the Stop All button to stop the services.

Note that the Unity Sample and Unreal Cube sample can be run in the cloud with similar steps.

Running the Unreal Tournament game

Unreal Tournament is a large game and requires some preparation in to simplify transfers to the server.

The first thing to do is to package your game project. Follow the Unreal Engine Documentation on Packaging Projects and create a Package for the WindowsNoEditor platform in Development mode. The [UT Folder] below corresponds to the [PackageDirectory]\\WindowsNoEditor folder of the documentation.

aws s3 mb s3://[some_unique_name]/v1/
aws s3 sync [UT Folder]/ s3://[some_unique_name]/v1/

Next you edit the bucket in your configuration files. An example is available under config/cloud.example.hcl:

config {
  cloud {
    artifact {
      s3url       = "s3://[some_unique_name]/v1/"
      destination = "z:\\game\\"
    }
  }
}

The s3url contains the location towards your S3 bucket. The destination value is the folder where the game is downloaded on the game machine. We use the Z: drive (a local drive to the AWS instance) to avoid hitting IO limits of an EBS volume which would otherwise stall the game process. Finally, you need to rename the cloud.example.hcl file to cloud.hcl to be able to load the cloud configuration properly via the python script.

Ensure the cluster is properly setup:

genvid-sdk -c myclusterid clean
genvid-sdk -c myclusterid setup
genvid-sdk -c myclusterid load-config-sdk

Load the project definition into the cluster:

py ut4.py -c myclusterid load

Start the custom job to update the game:

genvid-sdk -c myclusterid start update

You can see the last output and status of the running job from the hashi-ui webpage or using:

genvid-sdk -c myclusterid log -t update

During this time, you can build the website and upload it to S3:

py ut4.py -c myclusterid build-cloud
py ut4.py -c myclusterid upload-images --update-config

The last command ensures the Docker images are all up-to-date.

Once the update job is finished, you can start the game:

genvid-sdk -c myclusterid start

After a couple of seconds, the website should be ready. Open the webpage with the command:

genvid-sdk -c myclusterid open web

When you finish, you can stop the game:

genvid-sdk -c myclusterid stop # Stop the game but not the servers.