• Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language HCL
  • License
    Other
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Stand up a MATLAB desktop with Remote Desktop access using AWS CloudFormation

MATLAB on Amazon Web Services

Requirements

Before starting, you will need the following:

Costs

You are responsible for the cost of the AWS services used when you create cloud resources using this guide. Resource settings, such as instance type, will affect the cost of deployment. For cost estimates, see the pricing pages for each AWS service you will be using. Prices are subject to change.

Introduction

The following guide will help you automate the process of running the MATLAB desktop on Amazon Web Services using a virtual machine and connect to it using the Remote Desktop Protocol (RDP) or SSH. The automation is accomplished using an AWS CloudFormation template. The template is a JSON file that defines the resources needed to run MATLAB on AWS. For information about the architecture of this solution, see Architecture and Resources. For information about templates, see AWS CloudFormation Templates.

Prepare your AWS Account

  1. If you don't have an AWS account, create one at https://aws.amazon.com by following the on-screen instructions.
  2. Use the regions selector in the navigation bar to choose a region supported for the release of MATLAB that you want to deploy.
  3. Create a key pair in that region. The key pair is necessary as it is the only way to connect to the instance as an administrator.
  4. 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 with this deployment.

Deployment Steps

By default, the MATLAB reference architectures below launch prebuilt machine images, described in Architecture and Resources. Using a prebuilt machine image is the easiest way to deploy a MATLAB reference architecture. Alternatively, to build your own machine image with MATLAB using our build scripts, see Build and Deploy Your Own Machine Image.

Deploy Prebuilt Machine Image

To view instructions for deploying the MATLAB reference architecture, select a MATLAB release:

Linux Windows
R2023b R2023b
R2023a R2023a
R2022b R2022b
R2022a R2022a
R2021b R2021b
R2021a R2021a
R2020b R2020b
R2020a
R2019b
R2019a_and_older

The above instructions allow you to launch instances based on the latest prebuilt MathWorks® Amazon Machine Images (AMIs). MathWorks periodically replaces older AMIs with new images. For more details, see When are the MathWorks Amazon Machine Images updated?

Build and Deploy Your Own Machine Image

For details of the scripts which form the basis of the MathWorks Linux AMI build process, see Build Your Own Machine Image. You can use these scripts to build your own custom Linux machine image for running MATLAB on Amazon Web Services. You can then deploy this custom image with the MathWorks infrastructure as code (IaC) templates.

Architecture and Resources

MATLAB on AWS Reference Architecture

Deploying this reference architecture sets up a single AWS EC2 instance containing MATLAB, a private VPC with an internet gateway, a private subnet, and a security group that opens the appropriate ports for SSH and RDP access.

To make deployment easy, we have prepared an Amazon Machine Image (AMI) with pre-installed drivers. The AMI contains the following software:

  • MATLAB, Simulink, Toolboxes, and support for GPUs.
  • Add-ons: Several pretrained deep neural networks for classification, feature extraction, and transfer learning with Deep Learning Toolbox™, including GoogLeNet, ResNet-50, and NASNet-Large.

Resources

The following resources will be created as part of the CloudFormation Stack:

  1. Security Group for SSH and RDP access
  2. EC2 Instance

The following resources may be created according to your deployment configuration:

  1. IAM role
  2. A CloudWatch log group
  3. An elastic IP address
  4. A SSM document

FAQ

When are the MathWorks Amazon Machine Images updated?

The links in Deployment Steps launch instances based on the latest MathWorks AMIs for at least the four most recent MATLAB releases. MATLAB releases occur twice each year.

For each MATLAB release, MathWorks periodically replaces the corresponding AMI with a newer AMI that includes the latest MATLAB updates and important security updates of the base OS image.

When MathWorks replaces an AMI, the older AMI is deleted. However, any running instances previously launched from the older AMI are not affected. To continue using an older AMI, copy the AMI into your AWS account. For more details on how to copy an AMI, see How do I copy the AMI? For more details on how to customize the reference architectures to deploy the copied AMI see How do I customize the AMI?

How do I save my changes in the AMI?

All your files and changes are stored locally on the virtual machine. They will persist until you either terminate the virtual machine instance or delete the stack. Stopping the instance does not destroy the data on the instance. If you want your changes to persist outside the stack or before you terminate an instance, you’ll need to:

  • Copy your files to another location (Example: S3 or Mount an Amazon EBS volume and create a snapshot), or
  • Create an image of the virtual machine.

What happens to my data if I shut down the instance?

You may want to shut down the instance when you aren’t using it to save some money (you only pay for the storage used by the virtual machine when it is stopped). To shut down an EC2 instance, locate it in the AWS web console, select the instance and choose “Instance State/Stop” from the “Actions” menu. You can restart it from the same menu. Any files or changes made to the virtual machine will persist when shutting down and will be there when you restart. A side-effect of shutting down the virtual machine and restarting is that the public IP address and DNS name may change. Inspecting the EC2 instance in the AWS console will reveal the new IP address and DNS name.

How do I keep the same public IP address?

To avoid having to change the IP address between restarts, you can enable the Keep public IP address the same during deployment. For more information, see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html.

How do I save an AMI?

To save an AMI, locate the EC2 Instance in the AWS web console and select Actions > Image > Create Image.

How do I copy the AMI?

To copy the AMI for a certain MATLAB version to a target region of your choice, follow these steps:

  • Choose the MATLAB release that you want to copy from the Releases folder of this repository. Download and open the CloudFormation template .json file for that release.
  • Locate the Mappings section in the CloudFormation template. Copy the AMI ID for one of the existing regions, for example, us-east-1.
  • To copy the AMI to your target region, see Copy an AMI in the AWS documentation.
  • In the Mappings section of the CloudFormation template, add a new RegionMap pair corresponding to your target region. Insert the new AMI ID of the AMI in the target region.
  • In your AWS Console, change your region to your target region. In the CloudFormation menu, select Create Stack > With new resources option. Provide the modified CloudFormation template.

You can now deploy the AMI in your target region using the AMI that you copied.

How do I customize the AMI?

You can customize a prebuilt AMI by launching the reference architecture, applying any changes you want to the EC2 Instance (such as installing additional software, drivers, and files), and then saving an image of that instance using the AWS Console. For more information, see How do I save an AMI?. When you create a stack, replace the AMI ID in the CloudFormation template with the AMI ID of your customized image.

You can also create a custom image by building your own using the Packer scripts we provide. See Build and Deploy Your Own Machine Image.

How do I use a different license manager?

The AMI uses MathWorks Hosted License Manager by default. For information on how to use other license managers, see MATLAB Licensing in the Cloud.

Technical Support

If you require assistance or have a request for additional features or capabilities, please contact MathWorks Technical Support.


Copyright 2018-2023 The MathWorks, Inc.


More Repositories

1

matlab-dockerfile

Create a docker container that contains a MATLAB install
Python
321
star
2

matlab-on-azure

Stand up a MATLAB desktop with Remote Desktop access using Azure Deployment
HCL
36
star
3

container-images

MathWorks container images on Docker Hub
Dockerfile
34
star
4

matlab-parallel-server-on-aws

Stand up a MATLAB Parallel Server cluster using CloudFormation
Shell
27
star
5

matlab-integration-for-jupyter

Create Jupyter Docker images with MATLAB integration
Dockerfile
27
star
6

matlab-production-server-on-aws

Stand up a MATLAB Production Server using CloudFormation
Python
23
star
7

matlab-production-server-on-kubernetes

MATLAB Production Server on Kubernetes
17
star
8

getting-started-with-matlab-in-docker

17
star
9

matlab-apache-kafka

MATLAB Interface for Apache Kafka
MATLAB
16
star
10

matlab-production-server-on-azure

Stand up a MATLAB Production Server using Azure Deployment
Python
12
star
11

mathworks-gcp-support

Complete reference to all Google Cloud Platform (GCP) support packages for use with MathWorks products on the Cloud. This is an umbrella to be able to recursively pull all GCP related content from a single project.
MATLAB
12
star
12

matlab-parallel-server-on-azure

Stand up a MATLAB Parallel Server cluster using Azure Deployment
PowerShell
11
star
13

matlab-avro

MATLAB interface for Apache Avro files.
MATLAB
9
star
14

matlab-parallel-server-with-aws-batch

Stand up a MATLAB Parallel Server AWS Batch configuration using CloudFormation
7
star
15

polyspace-bug-finder-server-dockerfile

Create a docker container that contains a Polyspace Bug Finder Server install
7
star
16

matlab-rabbitmq

MATLAB Interface for RabbitMQ
MATLAB
6
star
17

license-manager-for-matlab-on-aws

Stand up a Network License Manager for MATLAB using CloudFormation
Shell
6
star
18

matlab-azure-services

MATLAB Interface for Azure Services, supports KeyVault, Azure Blob & Azure Data Lake
MATLAB
5
star
19

matlab-aws-common

Code common to MATLAB interfaces. Code in this repository is used as a dependency for other projects such as matlab-aws-s3.
MATLAB
5
star
20

matlab-azure-blob

MATLAB interface for Windows Azure Blob Storage.
MATLAB
4
star
21

matlab-parquet

MATLAB Interface for Apache Parquet
4
star
22

matlab-aws-s3

MATLAB interface for AWS S3.
MATLAB
4
star
23

matlab-aws-athena

MATLAB Interface for AWS Athena
MATLAB
4
star
24

matlab-on-aws-win

PowerShell
3
star
25

license-manager-for-matlab-on-azure

Stand up a Network License Manager for MATLAB using Azure Deployment
PowerShell
3
star
26

matlab-google-cloud-storage

Support for the Google Cloud Platform. This package contains the client Library for Google Cloud Storage
MATLAB
3
star
27

matlab-web-app-server-on-aws

Stand up a MATLAB Web App Server using CloudFormation
Python
3
star
28

matlab-apache-spark

MATLAB
3
star
29

matlab-aws-sns

MATLAB Interface for AWS SNS
MATLAB
3
star
30

mathworks-aws-support

Amazon Web Services (AWS) support packages providing interfaces for use with MathWorks products on the AWS Cloud. This is an umbrella project to be able to recursively pull all AWS related content from a single project.
3
star
31

matlab-on-azure-win

PowerShell
2
star
32

matlab-openapi-generator

MATLAB Generator for OpenAPI enables generation of RESTful Clients and Models based on OpenAPI 3.0 specifications
MATLAB
2
star
33

matlab-parallel-server-on-kubernetes

Utilities for using MATLAB® Parallel Server in a Kubernetes® cluster.
Go
2
star
34

matlab-web-app-server-on-azure

Stand up a MATLAB Web App Server using Azure Deployment
Python
2
star
35

iac-building-blocks

MathWorks Infrastructure as Code Building Blocks
1
star
36

matlab-azure-data-lake

MATLAB Interface for Azure Data Lake.
MATLAB
1
star
37

matlab-aws-dynamodb

MATLAB Interface for AWS DynamoDB
MATLAB
1
star
38

matlab-gcp-common

Common components used across MATLAB® interfaces for Google Cloud Platform™ services
MATLAB
1
star
39

license-manager-for-matlab-on-gcp-using-terraform

Stand up a Network License Manager for MATLAB using Terraform
Shell
1
star
40

polyspace-access-on-aws

Stand up a Polyspace Access server using AWS CloudFormation
1
star
41

matlab-codespaces

This repository show different ways you can configure your dev containers to run MATLAB in codespaces.
Dockerfile
1
star
42

openapi-productionserver

​​OpenAPI Interface for MATLAB Production Server​
MATLAB
1
star