2048 Game

Updated at:

This topic describes how to deploy the 2048 game with one click.

Overview

This example automatically builds a Compute Nest service. The process takes about 2 minutes. The build is successful when the service status changes to To be submitted. The build workflow is as follows:

  1. Upload files and build a Compute Nest file deployment artifact.

  2. Create a Compute Nest service and associate it with the file deployment artifact.

Service architecture

This is a single-node deployment on a single ECS instance, accessible on port 80 via its public IP address.

Service build billing

Building this service for testing is free. For costs associated with creating a service instance, see the Billing for service instances section.

RAM user permissions

If you use a RAM user to create a service instance, you must grant that user the required permissions before creating the instance. For detailed instructions, see Manage permissions for a RAM user.

The following table lists the required permissions.

Policy name

Description

AliyunECSFullAccess

Permissions to manage ECS.

AliyunVPCFullAccess

Permissions to manage VPC.

AliyunROSFullAccess

Permissions to manage ROS.

AliyunComputeNestUserFullAccess

User-side permissions to manage Compute Nest services.

AliyunComputeNestSupplierFullAccess

Provider-side permissions to manage Compute Nest services.

Service instance billing

The cost of a service instance on Compute Nest is based on the following resources:

  • Selected vCPU and memory specifications

  • System disk type and capacity

  • Public bandwidth

Supported billing methods include:

  • pay-as-you-go (hourly)

  • subscription

You can view the estimated cost in real time when you create a service instance.

The following instance types are available:

Instance family

vCPU and memory

System disk

Public bandwidth

ecs.c6.large

c6 memory-optimized, 2 vCPU, 4 GiB memory

200 GiB ESSD cloud disk (PL0)

1 Mbps fixed public bandwidth

ecs.c6.xlarge

c6 memory-optimized, 4 vCPU, 8 GiB memory

200 GiB ESSD cloud disk (PL0)

1 Mbps fixed public bandwidth

Deployment process

Deployment parameters

Parameter group

Parameter

Description

Service instance

Service instance name

The name can be up to 64 characters long, must start with a letter, and can contain digits, letters, hyphens (-), and underscores (_).

Region

The region where you want to deploy the service instance.

ECS instance configuration

Instance type

The instance types available in the selected availability zone.

Network configuration

Availability zone

The availability zone where the ECS instance resides.

Deployment steps

  1. Deploy the service instance.

    Click the deployment link. On the deployment page, follow the prompts to configure the instance parameters. After you confirm the parameters and accept the terms of service, click Create Now.

  2. View the service instance.

    The service instance deploys in about one minute. After the deployment is complete, in the Compute Nest console, click Service Instance Management in the left-side navigation pane. Then, choose My Service Instances > Private Deployment Services tab to view the created service instance. Its status is Deployed.

  3. Access the 2048 game from the service instance.

    On the service instance details page, go to the Overview tab and confirm that the instance status is Deployed. Then, click the link in the Url field to open the 2048 game.

  4. You can now play the 2048 game in your browser.