GPaaS

GPaaS

Introduction to GPaaS

GPaaS (Gaming Platform as a Service) is a specialized PaaS setup for hosting AppWarpS2 game server applications. It works by creating a VM for you on App42 PaaS which is pre-configured with all the requirements for running AppWarpS2.

Once setup, you can update your AppWarpS2 application code anytime on your GPaaS VM just like you do with any App42 PaaS application i.e. via your GIT repository or by uploading the sources directly from your computer.

With this offering, you can develop and deploy your multiplayer games using Shephertz products.


How GPaaS features help

AppWarpS2 is a server side JAVA library. So building and running AppWarpS2 requires the following to be installed on the server machine.



GPaaS VMs with the above software already installed and setup.

AppWarpS2 requires the host machine to have the following TCP and UDP ports to be opened. These are which you game clients connect to for exchanging messages with the server application. GPaaS VM instances are pre-configured with the following required ports opened.



AppWarpS2 also comes with a HTML5 dashboard that can be used to monitor your running application. While this doesn’t required to be hosted on the same machine as your game server, GPaaS VM comes ready with it hosted on:

In order to create your private setup of GPaaS, following steps are to be done:
    • Login with your account on App42 PaaS
Use your credentials to login into App42 PaaS.
 
    • Creating your first GPaaS setup.
Click on the ‘Create GPaaS Setup’ icon under ‘Other Solutions’ on the left panel and fill in the details to create your GPaaS setup.
PaaSHQ Set Up
    • GPaaS Setup List
Click on the ‘GPaaS Setup List’ icon under ‘Other Solutions’ on the left panel to see the setup list.
PaaShQ gpaas list
In order to create your private setup of GPaaS with CLI, following steps are to be done:
app42 addKeys
command: app42 addKeys
Add API key and Secret key
$ app42 addKeys
================= Enter your App42PaaS keys ==================
API Key      = your_api_key
Secret Key   = your_secret_key
Adding keys...done
app42 setupGPaaS
command: app42 setupGPaaS
Setup App42 BGaaS by choosing required configuration
$ app42 setupGPaaS

Enter Setup Name: testChat
Checking Setup Name Availability... OK

1: Amazon (Oregon)
Select IaaS Provider [Amazon (Oregon)]: 

1: t1.micro
2: m1.small
Select Instance Configuration [t1.micro]: 1

Do you want to add Static IP? [Yn]: n

Setting up the GPaaS infrastructure... OK

Operation is in progress, Please wait...|
GPaaS setup has been completed successfully, For details, Login to PaaSHQ console.
app42 gpaasSetups
command: app42 gpaasSetups
List all the gpaas setups
$ app42 gpaasSetups
+-----------------------+--------------------------------------------+------------+-----------------+------------+----------------------+------------+---------------+--------------+
|                                                                                        === GPaaS Setup List ===                       |
+-----------------------+--------------------------------------------+------------+-----------------+------------+----------------------+------------+---------------+--------------+
| Created On            | App Url                           	           | Setup Name | Iaas Provider   | Setup Type       | Email                | Vm Type    | Setup Flavour | Setup Status |
+-----------------------+--------------------------------------------+------------+-----------------+------------+----------------------+------------+---------------+--------------+
| 2013-11-09 04:25:10.0 | http://ec2-x-x-x-x.compute-1.amazonaws.com | testChat   | Amazon (Oregon) | GPaaS      | admin@shephertz.com  | Dedicated  | t1.micro      | RUNNING      |
+-----------------------+--------------------------------------------+------------+-----------------+------------+----------------------+------------+---------------+--------------+
app42 gpaasSetupInfo
command: app42 gpaasSetupInfo
Show gpaas setup information
$app42 gpaasSetupInfo

Enter Setup Name: cloudapi
+-----------------------+--------------------------------------------+------------+-----------------+------------+---------+---------------+--------------+
|                                                                                        === GPaaS Details ===                       |
+-----------------------+-----------------------------------------+------------+-----------------+------------+------------+---------------+--------------+
| Created On            | App Url                                            | Setup Name | Iaas Provider   | Setup Type     | Vm Type    | Setup Flavour   | Setup Status |
+-----------------------+---------------------------------------- +------------+-----------------+------------+------------+---------------+--------------+
| 2013-11-09 04:25:10.0 | http://ec2-x-x-x-x.compute-1.amazonaws.com   | testChat   | Amazon (Oregon) | GPaaS    | Dedicated  | t1.micro        | RUNNING      |
+-----------------------+-----------------------------------------+------------+-----------------+------------+------------+---------------+--------------+
  • Congratulations! you have succesfully completed the GPaaS setup. The GPaaS setup contains the AppWarpS2 sample chat application by default. You can verify that its running by accessing your dashboard. The default chat application code and steps for using it are explained here.
    PaaSHQ Set Up


    Now to deploy your own application on your GPaaS VM, you have the option of either uploading your code from your computer or we can fetch it from your GIT repo. In both the cases, you need to follow a directory structure described below.


  • Application directory structure requirement

    When hosting your AppWarpS2 application on to GPaaS, your application should follow a certain directory structure that our building and running scripts expect. This structure is also followed by our samples which can be used as a reference.

    Ensure that your application is developed according to the following top level folder structure if you are going to be building and running using the provided ANT script.

    ./src
    ./libs
    ./AppConfig.json
    ./warp.xml
    The src folder should contain Main.java and your server application and extension classes for different domain adaptors.

    The libs folder contains the library files(jar) that will be used by the server application. These include among other JARs the AppWarpS2.jar file.

    AppConfig.json file contains the server configuration variables which are

    "TickTime" : "500" (Timer Event in milliseconds)
    "LogLevel" : "WARN" (ALL, DEBUG, FATAL, ERROR, INFO, WARN, OFF, TRACE)
    "AdminUsername" : "admin" (Admin UserName)
    "AdminPassword" : "password" (Admin Password)
    "HSQLDBFile" : "HSQLDBFile" (path for HSQLDB files by default files will be created in running directory)
    "LICENSE_KEY" : "x45-tp0987-1276" (your AppWarp S2 license key)

    warp.xml file contains the ant script which is used to build and run server.

    For example in the given SpaceWarFare sample application, the java src classes are declared in the package “spacewarfare”. You should edit this file according to your package name by editing the following line in the warp.xml file.


    About GPaaS Logs

    AppWarpS2 generates its logs under a folder called Logs in its working directory. You can access this folder from the PaaSHQ management console as explained here. This folder also contains the log files generated when you deploy your application code. GPaaS first compiles your code, if successful stops the current application and then runs the application you just deployed. The logs of the compilation are available in compile.out file which you should check to confirm the result of your deploy operation.
    PaaSHQ Set Up

    Download AppWarpS2 Application

    You can download AppWarpS2 application directly from PaaS HQ Console. Just click on the “Download AppWarpS2(GPaaS) Setup” button on the top.
    PaaSHQ Set Up


    Deploying AppWarpS2 Application on App42 PaaS

    Once you have created your AppWarpS2 application you can deploy it on App42 PaaS (GPaaS) platform.


    Starting/Stopping GPaaS on App42 PaaS

    GPaaS is dedicated App42WarpS2 VM. App42 PaaS provides two types of start/stop in this case.

    • Application Start/Stop
    • You can simply click on “App List” on the left panel of your PaaS HQ Console. From the list, click on the “Start/Stop” icon of your App42WarpS2 application. This will only “Start/Stop” your application. You can still access your dashboard.
      PaaSHQ Set Up

    • VM Start/Stop
    • You can simply click on the “GPaaS Setup List” on the left panel of your PaaS HQ Console. From the list, click on the “Start/Stop” icon of your setup. This will “Start/Stop” your GPaaS VM. Doing this (unless you have assigned a Static IP to your setup), will change your application URL and you will not be able to access your dashboard too.
      PaaSHQ Set Up

    Assign Static IP To GPaaS Setup

    As explained earlier, IP assigned to your GPaaS VM will change when you stop and start your VM (ie your GPaaS setup). If you want that the IP assigned to your GPaaS setup should not change, you can assign static IP to your setup either at the time of GPaaS setup or if you have already created your setup, you still have the option to assign the static IP.

    • At the time of GPaaS Setup
    • To assign Static IP at the time of creating GPaaS setup, you need to check ‘Assign Static IP’ check box as shown below.
      PaaSHQ Set Up

    • After GPaaS Setup
    • To assign Static IP to already created GPaaS setup, Click on ‘Manage Static IP’ on the left panel and then Click on the ‘Assign Static IP’ icon under ‘Manage Static IP’ on the right panel as shown below.
      PaaSHQ Set Up

    List Static IP

    Click on the ‘Manage Static IP’ on the left panel to list the Static IPs.
    PaaSHQ Set Up

    Release Static IP

    You can release Static IP from your GPaaS Setup by clicking on the ‘Manage Static IP’ on the left panel and then Click on the ‘Release Static IP’ icon under ‘Manage Static IP’ on the right panel as shown below.
    PaaSHQ Set Up

    Upgrade GPaaS Dashboard

    You can upgrade your GPaaS Dashboard by clicking on the ‘GPaaS Setup List‘ on the left panel and then click on the ‘Upgrade Dashboard‘ on the right panel as shown below.
    PaaSHQ Set Up