Table Of Contents

Base Environment

Overview

The base environment type provides an ability to deploy APS applications with certain requirements to their environment. Any type that implements the application type may require an environment type as a dependency through a strong relation.

../../../../../_images/environment-1.png

Responsibility of the environment is:

  • Provide the required environment for the application, for example, standard PHP package and database system.

  • Deploy application files from an APS package (see Install Application Instance for more details).

  • Configure an APS endpoint for the application, so that the APS controller is able to connect to the application directly. The environment also upgrades files of already provisioned applications (see Upgrade for details).

../../../../../_images/environment-2.png

It is also possible for one environment to “know” how to work with different types of applications (for example, there may be a “PHP+Python” environment that can deploy both “PHP” and “Python” types of applications, etc.).

Type Definition

Each environment is used to install application instances and it follows the Install Application Instance workflow for this.

The environment type definition:

{
    "apsVersion": "2.0",

    "name": "Environment",

    "id": "http://aps-standard.org/types/infrastructure/environment/1.0",

    "properties": {
       "entryPoint": {
          "type": "string",
          "description": "Application access point"
       },

       "engines": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "List of supported engines",
            "pattern": "php|python|perl|java|.net|exec|.+"
          }
       },

       "hardware": {
          "type": "Hardware"
       },

       "platform": {
          "type": "Platform"
       }
    },

    "structures": {
      "OS": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Operating system name",
            "pattern": "Windows|Linux|MacOS|.+"
          },
          "name": {
            "type": "string",
            "description": "Operation system distribution",
            "pattern": "redhat|centos|debian|ubuntu|cloudlinux|.+"
          },
          "edition": {
            "type": "string",
            "description": "Operation system edition",
            "pattern": "datacenter|server|desktop|.*"
          },
          "version": {
            "type": "number",
            "description": "Operation system Version in format <major>.<minor>"
          }
        }
      },
      "CPU": {
        "type": "object",
        "properties": {
          "number": {
            "type": "integer",
            "description": "Number of CPUcores"
          },
          "power": {
            "type": "number",
            "description": "CPU Power in  MHz"
          }
        }
      },
      "Platform": {
        "type": "object",
        "properties": {
          "arch": {
            "type": "string",
            "description": "System architecture",
            "pattern": "x86|x86_64|ia64|arm|.+"
          },
          "os": {
            "type": "OS",
            "description": "System operating system"
          }
        }
      },
      "Hardware": {
        "type": "object",
        "properties": {
          "bandwidth": {
            "type": "integer",
            "description": "Bandwidth in Mbps",
            "unit": "mbps"
          },
          "cpu": {
            "type": "CPU"
          },
          "diskspace": {
            "type": "integer",
            "description": "Disk space in Mbytes",
            "unit": "mb"
          },
          "memory": {
            "type": "integer",
            "description": "Memory size in Mbytes",
            "unit": "mb"
          }
        }
      }
    },
    
    "relations": {
       "application": {
            "type": "http://aps-standard.org/types/core/application/1.0"
       }
    }
}

Derivatives of this type define more specific environments:

Embedded UI Navigation

When developing an application that must be installed inside an environment, you would also most probably need to plug the application UI into the environment UI. For this purpose, follow these rules when defining navigation trees of both applications for the customer control panel (CCP).

  1. In the declaration of the environment navigation tree for CCP, declare the special placeholder whose ID is http://aps-standard.org/ui/infrastructure/environment/system, for example:

    <navigation id="ccp-vps" label="VPS">
       <plugs-to id="http://www.parallels.com/ccp/2" />
       ...
       <view id="vps-ve.list" label="VPS">
          ...
          <placeholder id="http://aps-standard.org/ui/infrastructure/environment/system" />
       </view>
       ...
    </navigation>
    
  2. To plug an application view into the placeholder declared earlier, the view declaration must contain the following plugs-to element:

    <plugs-to id="http://aps-standard.org/ui/infrastructure/environment/system" />