Use MATLAB Production Server Cloud Console

After you deploy a MATLAB® Production Server™ environment in Azure®, use the MATLAB Production Server cloud console to manage server instances. The cloud console is a web-based interface to configure and manage server instances on the cloud.

For information on how to connect to the cloud console, see Connect and Log In to Cloud Console.

View Information About Server Instances

View information about the server instance virtual machines (VMs) deployed on Azure, click Home on the cloud console navigation menu.

View HTTPS Endpoint

When you run MATLAB Production Server on the cloud, you get two HTTPS endpoints that use self-signed certificates. One of the HTTPS endpoints provides access to the application gateway that connects the server instances. This endpoint is displayed on the home page of the cloud console and is used to make requests to the server.

  1. On the cloud console navigation menu, click Home.

  2. Copy the parameter value listed next to HTTPS Server Endpoint.

Upload a MATLAB Application

You can run an application on MATLAB Production Server that is created usingMATLAB Compiler SDK™. Upload the application using the cloud console.

  1. On the cloud console navigation menu, click Applications.

  2. Click +Upload Application.

  3. Click Browse CTF File, select the file, and click Upload.

For information on how to create an application, see Create a Deployable Archive for MATLAB Production Server.

Edit the Server Configuration

You can edit the MATLAB Production Server configuration properties.

  1. On the cloud console navigation menu, select Administration > Server Configuration.

  2. Find the server property you want to change and enter the appropriate value. To assign a value to a property that has been commented out, remove the hash symbol and assign a value.

  • Use this configuration to allow requests from specific domains.

    --cors-allowed-origins http://www.w3.org, https://www.apache.org

  • Use this configuration to set the number of workers to 4.

    --num-workers 4

    Note

    When setting the num-workers property, you need to carefully consider your cluster setup. Each VM in the cluster runs an instance of MATLAB Production Server and each instance runs multiple MATLAB workers. Using 1 core per MATLAB worker is recommended. For example, if the server size is set to Standard_D4s_v3 Server, which specifies 4 cores, set num-workers be no more than 4 workers per instance.

Edit the Azure Cache for Redis Configuration

MATLAB Production Server uses Redis™ for data persistence. Persistence allows caching of data between calls to MATLAB code running on a server instance.

To use the Azure Cache for Redis from your deployment, you must specify certain parameters in the configuration. To edit the Azure cache for Redis configuration, in the cloud console navigation menu, select Administration > Persistence Configuration.

Specify the cache configuration in JSON format as follows.

{
  "Connections": {
    "<connection_name>": {
      "Provider": "Redis",
      "Host": "<hostname>",
      "Port": <port_number>,
      "Key": <access_key>
    }
  }
}

ValueDescription
<connection_name>

Specify a name for the connection to the persistence service. Use this name in MATLAB code to pass data to the cache.

<hostname> and <port_number>

Specify the host name and port number for the Azure Cache for Redis from the Azure portal. The port number has to be a non-SSL port. To retrieve the host name and port number, follow these steps.

  • Log in to your Azure portal and select the resource group associated with the deployment.

  • Select the Azure Cache for Redis resource within the resource group. This resource usually has the name vmss<uniqueID>redis.

  • Select Overview and copy the values listed under Host name and under Ports.

You can also use an Azure Cache for Redis that you create outside of this deployment. The steps to retrieve the host name and port number are the same.

<access_key>

To retrieve an access key to connect to an Azure cache for Redis resource, follow these steps.

  • Log in to your Azure portal and select the resource group associated with this deployment.

  • Select the Azure Cache for Redis resource within the resource group. This resource usually has the name vmss<uniqueID>redis.

  • Select Access Keys from the left pane.

  • In the resulting pane, copy the access key string listed under Primary.

For more information on using a data cache, see Use a Data Cache to Persist Data.

Get the License Server MAC Address

You can get the license server MAC address only after deploying the solution to the cloud. You need a fixed MAC address to get a license file from the MathWorks® License Center.

  1. In the cloud console navigation menu, select Administration > License.

  2. Copy the license server MAC address displayed at the top.

Upload a License File

You can upload the license file only after provisioning the cloud resources. You can use MATLAB Production Server on Azure only after you upload a license file.

  1. In the cloud console navigation menu, select Administration > License.

  2. Click Browse License File and select your license file.

  3. Click Upload.

Upload an HTTPS Certificate

You can change the self-signed certificate to the HTTPS endpoint that lets you connect to the cloud console. The server automatically restarts after uploading a certificate. You need to log out and log back in. When you upload a new certificate, you lose all pending requests.

  1. In the cloud console navigation menu, select Administration > HTTPS Certificate.

  2. Click Browse Certificate and select a certificate file. The solution supports PFX files only.

  3. Enter the certificate password in the Certificate Password field.

  4. Click Upload.

Set Up Authentication Using Azure Active Directory

The solution uses Azure Active Directory® (Azure AD) to provide an identity to each user. To use Azure AD, you must specify the following:

  • Access control configuration file

  • Access control policy file

  1. In the cloud console navigation menu, select Administration > Azure AD.

  2. Enter the details of each file and click Save and Apply Configuration.

  3. Edit the Server Configuration and enable the option access-control-provider.

Sample code for the access control configuration file follows.

{
  "tenantId": "54ss4lk1-8428-7256-5fvh-d5785gfhkjh6",
  "serverAppId": "j21n12bg-3758-3r78-v25j-35yj4c47vhmt",
  "jwksUri": "https://login.microsoftonline.com/common/discovery/keys",
  "issuerBaseUri": "https://sts.windows.net/",
  "jwksTimeOut": 120
}

Sample code for the access control policy file follows.

{
  "version": "1.0.0",
  "policy" : [
    {
      "id": "policy1",
      "description": "MPS Access Control policy for XYZ Corp.",
      "rule": [
        {
          "id": "rule1",
          "description": "group A can execute ctf magic",
          "subject": { "groups": ["aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"] },
          "resource": { "ctf": ["magic"] },
          "action": ["execute"]
        },
        {
          "id": "rule2",
          "description": "group A and group B can execute ctf monteCarlo and fastFourier",
          "subject": { "groups": ["aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"]  },
          "resource": { "ctf": ["monteCarlo", "fastFourier"] },
          "action": ["execute"]
        },
        {
          "id": "rule3",
          "description": "QE group C can execute any ctf starts with test",
          "subject": { "groups": ["cccccccc-cccc-cccc-cccc-cccccccccccc"] },
          "resource": { "ctf": ["test*"] },
          "action": ["execute"] 
        }
      ]
    }
  ]
}

For more information, see Access Control.

Related Topics