Main Content

Install Products for Submitting Polyspace Analysis from Desktops to Servers Hosted on AWS

Cloud platforms enable you to easily scale your resources to meet your requirements and to securely access those resources from anywhere. This topic describes installation and configuration steps so that you can offload a Polyspace® analysis from a client machine to a more powerful machine hosted on an Amazon® Web Services (AWS) cloud platform.

Note

These instructions are valid only for Polyspace Server products version R2021b and later. To deploy versions R2021a and earlier to AWS, contact MathWorks Technical Support.

Prepare Your Installation

Before you begin your installation, make sure that you have:

  • An AWS account

  • A valid license for Polyspace Bug Finder or Code Prover Server and MATLAB Parallel Server.

  • An SSH keypair for your region. To generate the keypair file, follow these instructions.

  • A client machine with a Polyspace Desktop product already installed. See Install Polyspace Desktop Products.

To ease cloud deployments, MathWorks provides reference architectures that enable you to start a cluster in a few clicks by using a template. The clusters run on Linux virtual machines on EC2 resources in AWS. To complete this installation:

  1. Install a license manager server. See Configure and Deploy Network License Manager Stack. This step is optional if you already have a license manager server.

  2. Deploy the MATLAB Parallel Server and Polyspace resources to AWS. See Configure and Deploy MATLAB Parallel Server and Polyspace Server Stack.

  3. Configure the inbound traffic rules to enable communication between the license server and the MATLAB Parallel Server cluster. See Configure Security Groups.

  4. Configure the client machines that offload the analysis to the AWS cluster. See Configure Client Machines.

Polyspace does not support online licensing. To manage license checkouts, install a license server on the cloud or use an onsite license server.

Client machine offloading to MPS cluster hosted on AWS

Configure and Deploy Network License Manager Stack

If you already have a License Manager Server running and that server is accessible from the cloud, skip this section.

To deploy a network license manager on AWS, use the license-manager-for-matlab-on-aws architecture:

  1. Select a release.

  2. On the page for the release that you selected, click Launch Stack for your region. For example, us-east-1.

  3. Complete the template configuration.

    ParameterDescription
    Stack nameSpecify a name to identify the license manager instance. For example, ps-license-server-stack.
    VPC to deploy this stack toSelect the ID of a virtual private cloud (VPC) from the drop-down list.
    Subnet for the license serverSelect an existing subnet from the drop-down list.
    CIDR IP address range of client

    Specify public IP address that is allowed to connect to the server hosting the license manager from outside the VPC. Typically, this is the public IP of your client machine.

    To find this IP address, from the client machine, search “What’s my IP address” in a search engine or contact your IT administrator.

    For example, if your IP is 123.456.78, enter 123.456.78/32.

    Name of SSH keySelect an EC2 KeyPair from the drop-down list. To generate a keypair, see these instructions.
    Password Password you use to log into the license manager dashboard. Specify a password then confirm that password in the Confirm Password field.
  4. Click Create stack. The process takes a few moments to complete. Keep the page open or bookmark it. You need information from the Outputs and Parameters tabs on this page to complete later configuration steps.

    AWS license server stack output tab

  5. Once the status of the stack is CREATE_COMPLETE, go to the Outputs tab and click the ServerAddress URL to open the license manager dashboard.

    Use the password from step 3 to log into the dashboard and follow the Getting started instructions to activate your license and start the license manager.

Configure and Deploy MATLAB Parallel Server and Polyspace Server Stack

To deploy the MATLAB Parallel Server, which includes Polyspace, on AWS, use the matlab-parallel-server-on-aws reference architecture.

  1. Select a release. Polyspace products are available in the reference architecture only in R2021b and later releases.

    On the page for the release that you selected, click Launch Stack for your region. For example, us-east-1.

  2. Complete the template configuration.

    ParameterDescription
    Stack nameSpecify a name to identify the MATLAB Parallel Server instance. For example, ps-mps-cloud.
    Cluster nameSpecify a name to identify the cluster. You use this name in the cluster configuration of Polyspace on the client machines.
    Number of worker nodesSpecify a number equal to or smaller than the number of available licenses.
    Number of workers to start on each node

    Specify 1 worker per node.

    Make sure that the Instance type for the worker nodes is set to an appropriate instance type that meets or exceeds the minimum Polyspace hardware requirements (16 GB RAM and 4 cores). See Amazon EC2 Instance Types.

    Name of SSH key

    Select an EC2 KeyPair from the drop-down list. To generate a keypair, see these instructions.

    If you deployed a license manager on the cloud, this must match the value of the SSHKeyName on the Parameters tab of the license manager stack.

    VPC to deploy this stack to

    Select the ID of a virtual private cloud (VPC) from the drop-down list.

    If you deployed a license manager on the cloud, this must match the value of the VPC on the Parameters tab of the license manager stack.

    Subnets for the head node and worker nodes

    Select an existing subnet from the drop-down list.

    If you deployed a license manager on the cloud, this must match the value of the Subnet on the Parameters tab of the license manager stack.

    CIDR IP address range of client

    Specify public IP address that is allowed to connect to the server hosting the license manager from outside the VPC. Typically, this is the public IP of your client machine.

    To find this IP address, from the client machine, search “What’s my IP address” in a search engine or contact your IT administrator.

    For example, if your IP is 123.456.78, enter 123.456.78/32.

    Additional security group to place instances in

    If you deployed a license manager on the cloud, this must match the value of the SecurityGroup on the Outputs tab of the license manager stack. Otherwise, you can leave this field blank.

    License Manager for MATLAB connection string

    Specify the address of the license manager in the format port@hostname, for example, 27000@ip-123-45-67-89.ec2.internal.

    Typically, the port number is 27000. If you deployed a license manager on the cloud, hostname must match the value of the ServerPrivateDNS on the Outputs tab of the license manager stack. Otherwise, if you use an onsite license manager, hostname corresponds to the hostname of the server that hosts the license manager.

  3. Click Create stack. The process takes a few moments to complete.

    Once the status of the stack is CREATE_COMPLETE, go to the Outputs tab and click the BucketURL URL.

  4. On the following page, on the Objects tab, select the settings object and click download to download the cluster profile .settings file. You use this file when you configure the client machines to enable communication between the cluster and the client machine.

Configure Security Groups

After you start the License Manager and the MATLAB Parallel Server stacks, add an inbound rule to their respective security groups to allow each stack to communicate with the other stack. The security group defines the ports that are opened for inbound and outbound traffic. See Security groups for your VPC.

To edit the security groups:

  1. From the EC2 service page, click Security Groups on the left pane then, on the security groups page, click the Security group ID of the license manager stack. You can use the Description field to identify the security group of the license manager.

  2. On the next page, select the Inbound rules tab and click Edit inbound rules. You might need to expand the bottom section of the page to see all the rules.

  3. Scroll to the bottom of the page, click Add rule, and then select All TCP from the Type drop-down list. Add the MATLAB Parallel Server security group to the Source field by clicking inside that field and selecting the security group from the menu.

  4. Click Save rules and then select the MATLAB Parallel Server security group and add a rule for the license manager security group by repeating steps 2 and 3.

If you did not deploy the license manager on AWS, make sure that the MATLAB Parallel Server security group has the necessary rules to communicate with your license manager.

Configure Client Machines

After you deploy the MATLAB Parallel Server and Polyspace Server on the cloud, configure the client machines that you use to offload the analyses to Polyspace in the cloud.

  1. From the client machine, open the Polyspace desktop interface, go to Tools > Preferences, select the Server Configuration tab, and click Settings.

  2. On the Cluster Profile Manager window toolstrip, click Import. Select the cluster profile .settings file that you downloaded in step 4 of Configure and Deploy MATLAB Parallel Server and Polyspace Server Stack. If you did not setup the MATLAB Parallel Server stack on AWS, contact your AWS administrator to obtain the cluster profile file.

    Copy the values of the MJSName and Host fields from the properties tab. Click Edit at the bottom right of the window to make the field text selectable. You use these values in later configuration steps.

  3. Click Validate on the toolstrip to check the communication with the AWS cluster. Some issues that might cause the validation to fail are:

    • Incorrect CIDR IP address. Check the stack settings or contact your cluster administrator.

    • Incorrect security group configuration. Check the security group settings or contact your cluster administrator.

    • Invalid MATLAB Parallel Server license. Check that your using the correct license or contact your license administrator.

    This validation step does not check the validity of your Polyspace Server product license. To check that you are using a valid license, see Check the Polyspace Server License.

  4. Close the Cluster Profile Manager and enter the MJSName that you obtained in step 2 in the Job Scheduler host name field.

  5. Restart the Polyspace desktop interface to apply the new settings.

To start offloading analysis to Polyspace in the cloud, in the Configuration pane of the Polyspace desktop interface, select the Run Settings node and enable analysis on a remote cluster. See also Bug Finder Analysis on Clusters.

Check the Polyspace Server License

The validation step that you perform in the Cluster Profile Manager does not check the validity of the Polyspace Server license. To check the Polyspace Server license, at the command line on the client machine, navigate to the Polyspace desktop installation folder, for instance C:\Program Files\Polyspace\R2022b, and run this command:

  • Windows®

    polyspace\bin\polyspace-bug-finder.exe -ver -batch -scheduler MJSName@host

  • Linux®

    polyspace/bin/polyspace-bug-finder -ver -batch -scheduler MJSName@host

where MJSName and host are the values that you obtained from the Cluster Profile Manager in the step 2 of Configure Client Machines.

The command outputs system information about the machine where the Polyspace Server products are deployed. If you have a valid license, you see a message similar to this message in the output:

Polyspace related licenses and license feature names:

Polyspace Bug Finder Server: Polyspace_BF_Server
Polyspace Code Prover Server: Polyspace_CP_Server
If you get a license error message or if the output does not list any Polyspace products under the line Polyspace related licenses and license feature names:, your Polyspace license might be invalid. Contact your Polyspace license administrator.

Update or Delete Resources

To upgrade to a newer release of the reference architectures, you must delete the existing resources and deploy the new version.

To delete the existing resources, in your AWS account, go to CloudFormation, select a stack, and click Delete.

If you update the license manager to a newer version, the new resource has a different host ID. Even if you choose to keep the same license manager stack, you must update your license file when you update to a new version of Polyspace.