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.

genvid-sdk -c myclusterid upload-images-sdk --update-config

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

The list of jobs is empty. 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. For the sample, we add a section in config/stream.hcl for this purpose. An example is available under config/cloud.example.hcl:

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

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.

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.