Main Content

AWS Deployment for MATLAB Production Server (PAYG)

The deployment process for using the MATLAB® Production Server™ pay-as-you-go (PAYG) offering on AWS® consists of launching the software from the AWS marketplace, viewing price and license agreements, choosing whether you want to deploy in a new or existing virtual private cloud (VPC), and then launching the CloudFormation template to specify cloud resources for your server deployment. After deployment to AWS is complete, you configure and manage MATLAB Production Server by logging in to the MATLAB Production Server (PAYG) dashboard.

If you already have a MATLAB Production Server license and want to deploy MATLAB Production Server on AWS, you can deploy the reference architecture from GitHub®. See MATLAB Production Server Reference Architecture on AWS.

To run an application on MATLAB Production Server, you need to create the application using MATLAB Compiler SDK™. For more information, see Create Deployable Archive for MATLAB Production Server.

Software Costs

Charges for the use of MATLAB Production Server software are on a per vCPU/per hour basis. The total amount is based on the number of vCPUs across all the Amazon EC2® instances in your auto scaling group. After deploying MATLAB Production Server on AWS, you must change the number of MATLAB Production Server workers from the MATLAB Production Server dashboard to match the total number of vCPUs of the EC2 instances in your auto scaling group.

The default EC2 instance that the deployment uses is m5.xlarge, which has 4 vCPUs and runs 4 MATLAB Production Server workers. If you select a different EC2 instance during deployment, you must change the number of MATLAB Production Server workers from the MATLAB Production Server dashboard to match the number of vCPUs in the instance that you selected. For example, if you select m5.2xlarge, which has 8 vCPUs, you must change the number of workers in the dashboard to 8 to match the number of vCPUs. The total charge for the MATLAB Production Server software is based on the number of vCPUs across all your VMs. For example, if you select an 8 vCPU m5.2xlarge instance and choose to run 4 instances in your auto scaling group, you are charged for 8 vCPUs x 4 instances = 32 vCPUs of usage per hour.

Prepare AWS Account

Before you can start the deployment, you must have the following:

  • An AWS account to deploy resources on AWS and configure your server environment.

  • A key pair for your AWS account. For more information, see Amazon EC2 Key Pairs.

  • An X.509 certificate. For information about creating a certificate, see Create and Sign an X509 Certificate.

  • If necessary, request a service limit increase for the Amazon EC2 instance type or VPCs. You might need to do this if you already have existing deployments that use that instance type or you think you might exceed the default limit. To request a service limit increase, see AWS Support. For more information about service quotas, see Amazon EC2 Service Quotas.

You are responsible for the cost of the AWS services and resources that the deployment uses.

Subscribe to MATLAB Production Server (PAYG) Software

Go to the MATLAB Production Server (PAYG) offering page on AWS marketplace. To subscribe, click Continue to Subscribe.

Doing so takes you to a page where you can view the terms and pricing details. Click Continue to Configuration to continue the software configuration process.

Deploy to Existing or New VPC

You can deploy MATLAB Production Server to an existing VPC if you already have an infrastructure on AWS. Otherwise, you can deploy to a new VPC.

  1. Select the delivery method — if you want to deploy a new VPC or use an existing VPC for your MATLAB Production Server deployment.

  2. Select the MATLAB Production Server version to deploy.

  3. Select the region where you want to deploy.

  4. Click Continue to Launch to review your configuration.

Launch CloudFormation Console

To launch the CloudFormation console, click Launch. From the console, you create the resources stack for the deployment and specify stack details for server.

Create Stack

Do not change the default selections on this page. The default selections use the CloudFormation template for deploying MATLAB Production Server (PAYG). Click Next.

Specify Stack Details

Configure cloud resources for your server environment in this step.

Stack name

First, enter a name for your stack that will hold the AWS resources that you provision, for example, Boston.

Server

Next, you configure the Amazon EC2 instances and data persistence. Each MATLAB Production Server instance runs on an EC2 instance and each MATLAB Production Server instance runs multiple MATLAB Production Server workers. To deploy a server instance, you must specify parameters for the EC2 instance or virtual machine (VM), such as the size and number of VMs. All the VMs in the deployment use Linux®.

Parameter NameValue
Number of Server VMs

Specify the number of VMs to run MATLAB Production Server instances, for example, 6.

The deployment template sets the default to 2 VMs for load balancing.

You can change the number of VMs after the initial deployment. For more information, see Change Number of Virtual Machines.

Server VM Type

Choose the Amazon EC2 instance type to use for the server instances, for example, m5.xlarge.

These Amazon EC2 instance types are supported:

  • m5.xlarge, m5.2xlarge, m5.4xlarge, m5.8xlarge, m5.12xlarge, m5.16xlarge, m5.24xlarge, m5.metal

  • c5.xlarge, c5.2xlarge, c5.4xlarge, c5.8xlarge, c5.12xlarge, c5.16xlarge, c5.24xlarge, c5.metal

  • r5.xlarge, r5.2xlarge, r5.4xlarge, r5.8xlarge, r5.12xlarge, r5.16xlarge, r5.24xlarge, r5.metal

For more information, see Amazon EC2 Instance Types.

Create Elasticache for Redis™

Choose whether you want to create an Elasticache for Redis.

Creating this service allows you to use the persistence functionality of the server. Persistence provides a mechanism to cache data between calls to MATLAB code running on a server instance. For more information, see Data Caching Basics.

You can provision a Redis cache after the initial deployment.

For information on connecting to the deployed Redis cache, see .

Dashboard Login

After you deploy the server VMs, you can manage the server using the MATLAB Production Server dashboard. The dashboard provides a web-based interface to configure and manage MATLAB Production Server in the cloud. Specify the login credentials for the dashboard.

Parameter NameValue
Username for Dashboard

Specify the administrator user name to log in to the MATLAB Production Server dashboard.

Password for Dashboard

Specify the administrator password to log in to the MATLAB Production Server dashboard.

Confirm Password for DashboardReenter the administrator password to log in to the MATLAB Production Server dashboard.

Network

You can specify which key pair can access the VMs in the deployment, which IP addresses can access the dashboard, whether your solution should use a public IP address, and enable HTTPS communication for the server.

Parameter NameValue
Name of Existing Key Pair

Choose the name of an existing Amazon EC2 key pair to allow access to all the VMs in the stack, for example: boston-keypair.

For information about creating an Amazon EC2 key pair, see Amazon EC2 Key Pairs.

Allow Connections from IP Address

Specify the range of IP addresses that is permitted to connect to the dashboard that manages the server, for example, 10.0.0.1/24.

Specify the range of IP addresses in CIDR notation, which provides the IP address before the slash and the subnet mask after the slash. The mask determines the number of IP addresses to include.

You can use a CIDR calculator to determine the CIDR notation for a range of IP addresses.

Make Solution Available over Internet

Make your solution available over the Internet by setting this parameter to Yes. The solution will use public IP addresses.

If you set this parameter to No, the CloudFormation template does not assign a public IP address for the VM that hosts the dashboard. To access the dashboard, you can use a different VM located in the same virtual network as the VM that hosts the dashboard.

ARN of SSL Certificate

Provide the Amazon® Resource Name (ARN) of an SSL certificate to enable secure HTTPS communication using the HTTPS server endpoint, for example, 123456789012. Find the ARN in the AWS Certificate Manager.

For information on creating and uploading a self-signed certificate, see Create and Sign an X509 Certificate and Import SSL Certificate.

Existing VPC

If you want to deploy resources for MATLAB Production Server in an existing VPC, you must specify the following parameters, in addition to the parameters specified earlier. If you chose to deploy in a new VPC, the template does not provide you with an option to specify the following parameters.

Parameter NameValue
Existing VPC ID

Find the ID of your existing VPC in the VPC dashboard and enter it here.

  1. Navigate to the VPC dashboard and locate your VPC.

  2. Use the value under VPC ID.

IP address range of your existing VPC

Find the IP address range of your existing VPC in the VPC dashboard and enter it here.

  1. Navigate to the VPC dashboard and select your VPC.

  2. Use the value under IPv4 CIDR.

Subnet 1 IDSpecify the ID of the existing subnet that will host the dashboard and other resources.
Subnet 2 IDSpecify the ID of the existing subnet that will host the server VMs.

If you use an existing VPC, you must open the following ports. When deploying in a new VPC, the deployment opens these ports by default.

  • 443 – Required for communicating with the dashboard and the MATLAB execution endpoint.

  • 8000, 8002 – Required for communication between the dashboard, MATLAB Production Server workers, and various microservices within the virtual network. These ports do not need to be accessible over the Internet.

  • 9910 – Required for the elastic load balancer health check to work. This port needs to be accessible over the Internet.

  • 22, 3389 – Required for remote login functionality for troubleshooting and debugging. You can close these ports after the deployment is complete.

Configure Stack Options

Configuring stack options is optional. You can leave all fields blank or enter values based on your requirement. Click Next to review your stack details and stack options.

Review

Review or edit your stack details and any stack options that you set. You must select the acknowledgement to create IAM resources. Otherwise, the deployment produces a Requires capabilities : [CAPABILITY_IAM] error and fails to create resources.

When you are satisfied with your stack configuration, click Create Stack to start the creation of resources in AWS for your server environment. Resource creation can take up to 20 minutes. After resource creation, it can take up to 15 minutes for the resources to be active.

Connect and Log In to Dashboard

After the deployment successfully creates all resources, connect and log in to the MATLAB Production Server dashboard to configure and manage your server.

Note

The Internet Explorer® web browser is not supported for interacting with the dashboard.

If your solution uses private IP addresses, you can connect to the dashboard from a VM located in the same virtual network as the VM that hosts the dashboard.

  1. In the AWS management console, select the stack that you deployed. You can find the stack under the CloudFormation service.

  2. In the stack detail pane, expand the Outputs section.

  3. Look for the key named MATLABProductionServerDashboardURL and click the corresponding URL listed under Value. This URL is the HTTPS endpoint to the MATLAB Production Server dashboard.

  4. Use the administrator user name and password that you specified in the dashboard login step of the deployment process to log in.

Note

For password reset requests, contact MathWorks Support.

After you log in, configure role-based access control for the dashboard, which lets you grant users the privileges to perform tasks on the dashboard and server, according to their role. For more information on how to configure role-based access control, see Dashboard Access Control.

Related Topics