Skip to content

Commit 78a0da2

Browse files
committed
R2023a release!
1 parent 34b3550 commit 78a0da2

16 files changed

+4498
-4177
lines changed

packer/v1/build-matlab-ami.pkr.hcl

+16-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ variable "PRODUCTS" {
1818

1919
}
2020

21-
variable "BASE_AMI" {
21+
variable "BASE_AMI_NAME" {
2222
type = string
23-
default = "ami-0f9c44e98edf38a2b"
24-
description = "Default AMI ID refers to the Windows Server 2022 image provided by Microsoft."
25-
26-
validation {
27-
condition = can(regex("^ami-", var.BASE_AMI))
28-
error_message = "The BASE_AMI must start with \"ami-\"."
29-
}
23+
default = "Windows_Server-2022-English-Full-Base-*"
24+
description = "Default AMI name refers to the Windows Server 2022 image provided by Microsoft."
3025
}
3126

3227
variable "BUILD_SCRIPTS" {
@@ -133,6 +128,8 @@ variable "AMI_TAGS" {
133128
Build = "MATLAB"
134129
Type = "matlab-on-aws"
135130
Platform = "Windows"
131+
Base_AMI_ID = "{{ .SourceAMI }}"
132+
Base_AMI_Name = "{{ .SourceAMIName }}"
136133
}
137134
description = "The tags Packer adds to the resultant machine image."
138135
}
@@ -197,7 +194,15 @@ source "amazon-ebs" "AMI_Builder" {
197194
volume_type = "gp2"
198195
}
199196
region = "us-east-1"
200-
source_ami = "${var.BASE_AMI}"
197+
source_ami_filter {
198+
filters = {
199+
"virtualization-type" = "hvm"
200+
"name" = "${var.BASE_AMI_NAME}"
201+
"root-device-type" = "ebs"
202+
}
203+
owners = ["801119661308"] # Owner ID associated with Windows Server AMIs
204+
most_recent = true
205+
}
201206
subnet_id = "${var.SUBNET_ID}"
202207
run_tags = "${var.INSTANCE_TAGS}"
203208
tags = "${var.AMI_TAGS}"
@@ -282,6 +287,8 @@ build {
282287
release = "MATLAB ${var.RELEASE}"
283288
specified_products = "${var.PRODUCTS}"
284289
build_scripts = join(", ", "${var.BUILD_SCRIPTS}")
290+
base_ami_id = "{{ .SourceAMI }}"
291+
base_ami_name = "{{ .SourceAMIName }}"
285292
}
286293
}
287294
}

packer/v1/build/config/matlab/startup-accelerator/R2023a/msa.ini

+1,244-1,092
Large diffs are not rendered by default.

packer/v1/build/config/matlab/startup-accelerator/R2023b/msa.ini

+3,107-3,032
Large diffs are not rendered by default.

packer/v1/release-config/R2020b.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2020b"
66
// Microsoft Windows Server 2019 Base (64-bit (x86))
7-
BASE_AMI = "ami-035d8ae8de3734e5a"
7+
BASE_AMI_NAME = "Windows_Server-2019-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/release-config/R2021a.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2021a"
66
// Microsoft Windows Server 2019 Base (64-bit (x86))
7-
BASE_AMI = "ami-035d8ae8de3734e5a"
7+
BASE_AMI_NAME = "Windows_Server-2019-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/release-config/R2021b.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2021b"
66
// Microsoft Windows Server 2019 Base (64-bit (x86))
7-
BASE_AMI = "ami-035d8ae8de3734e5a"
7+
BASE_AMI_NAME = "Windows_Server-2019-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/release-config/R2022a.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2022a"
66
// Microsoft Windows Server 2019 Base (64-bit (x86))
7-
BASE_AMI = "ami-035d8ae8de3734e5a"
7+
BASE_AMI_NAME = "Windows_Server-2019-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/release-config/R2022b.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2022b"
66
// Microsoft Windows Server 2019 Base (64-bit (x86))
7-
BASE_AMI = "ami-035d8ae8de3734e5a"
7+
BASE_AMI_NAME = "Windows_Server-2019-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/release-config/R2023a.pkrvars.hcl

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,35 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2023a"
66
// Microsoft Windows Server 2022 Base (64-bit (x86))
7-
BASE_AMI = "ami-0f9c44e98edf38a2b"
7+
BASE_AMI_NAME = "Windows_Server-2022-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",
1111
"10_Initialize-EBSVolume.ps1",
1212
"20_Set-AdminPassword.ps1",
1313
"30_Initialize-CloudWatchLogging.ps1",
1414
"40_Set-DDUX.ps1",
15+
"50_Setup-MATLABProxy.ps1",
1516
"60_Set-MATLABLicense.ps1",
1617
"70_Invoke-MATLABStartupAccelerator.ps1",
1718
"80_Invoke-MSHStartupAccelerator.ps1",
1819
"99_Invoke-OptionalUserCommand.ps1"
1920
]
2021
RUNTIME_SCRIPTS = [
21-
"Install-NVIDIAGridDriver.ps1"
22+
"Install-NVIDIAGridDriver.ps1",
23+
"Start-MATLABProxy.ps1",
24+
"generate-certificate.py"
2225
]
2326
BUILD_SCRIPTS = [
2427
"Install-StartupScripts.ps1",
2528
"Install-NVIDIADrivers.ps1",
2629
"Install-Dependencies.ps1",
30+
"Install-MATLABProxy.ps1",
2731
"Install-MATLAB.ps1",
2832
"Remove-IE.ps1"
2933
]
3034
PRODUCTS = "5G_Toolbox AUTOSAR_Blockset Aerospace_Blockset Aerospace_Toolbox Antenna_Toolbox Audio_Toolbox Automated_Driving_Toolbox Bioinformatics_Toolbox Bluetooth_Toolbox C2000_Microcontroller_Blockset Communications_Toolbox Computer_Vision_Toolbox Control_System_Toolbox Curve_Fitting_Toolbox DDS_Blockset DSP_HDL_Toolbox DSP_System_Toolbox Data_Acquisition_Toolbox Database_Toolbox Datafeed_Toolbox Deep_Learning_HDL_Toolbox Deep_Learning_Toolbox Econometrics_Toolbox Embedded_Coder Filter_Design_HDL_Coder Financial_Instruments_Toolbox Financial_Toolbox Fixed-Point_Designer Fuzzy_Logic_Toolbox GPU_Coder Global_Optimization_Toolbox HDL_Coder HDL_Verifier Image_Acquisition_Toolbox Image_Processing_Toolbox Industrial_Communication_Toolbox Instrument_Control_Toolbox LTE_Toolbox Lidar_Toolbox MATLAB MATLAB_Coder MATLAB_Compiler MATLAB_Compiler_SDK MATLAB_Production_Server MATLAB_Report_Generator MATLAB_Test MATLAB_Web_App_Server Mapping_Toolbox Medical_Imaging_Toolbox Mixed-Signal_Blockset Model_Predictive_Control_Toolbox Model-Based_Calibration_Toolbox Motor_Control_Blockset Navigation_Toolbox Optimization_Toolbox Parallel_Computing_Toolbox Partial_Differential_Equation_Toolbox Phased_Array_System_Toolbox Powertrain_Blockset Predictive_Maintenance_Toolbox RF_Blockset RF_PCB_Toolbox RF_Toolbox ROS_Toolbox Radar_Toolbox Reinforcement_Learning_Toolbox Requirements_Toolbox Risk_Management_Toolbox Robotics_System_Toolbox Robust_Control_Toolbox Satellite_Communications_Toolbox Sensor_Fusion_and_Tracking_Toolbox SerDes_Toolbox Signal_Integrity_Toolbox Signal_Processing_Toolbox SimBiology SimEvents Simscape Simscape_Battery Simscape_Driveline Simscape_Electrical Simscape_Fluids Simscape_Multibody Simulink Simulink_3D_Animation Simulink_Check Simulink_Coder Simulink_Compiler Simulink_Control_Design Simulink_Coverage Simulink_Design_Optimization Simulink_Design_Verifier Simulink_Desktop_Real-Time Simulink_PLC_Coder Simulink_Real-Time Simulink_Report_Generator Simulink_Test SoC_Blockset Spreadsheet_Link Stateflow Statistics_and_Machine_Learning_Toolbox Symbolic_Math_Toolbox System_Composer System_Identification_Toolbox Text_Analytics_Toolbox UAV_Toolbox Vehicle_Dynamics_Blockset Vehicle_Network_Toolbox Vision_HDL_Toolbox WLAN_Toolbox Wavelet_Toolbox Wireless_HDL_Toolbox Wireless_Testbench"
3135
DCV_INSTALLER_URL = "https://d1uj6qtbmh3dt5.cloudfront.net/2023.0/Servers/nice-dcv-server-x64-Release-2023.0-15487.msi"
3236
NVIDIA_DRIVER_INSTALLER_URL = "https://uk.download.nvidia.com/tesla/518.03/518.03-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe"
3337
PYTHON_INSTALLER_URL = "https://www.python.org/ftp/python/3.10.5/python-3.10.5-amd64.exe"
38+
MATLAB_PROXY_VERSION = "0.10.0"

packer/v1/release-config/R2023b.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2023b"
66
// Microsoft Windows Server 2022 Base (64-bit (x86))
7-
BASE_AMI = "ami-0f9c44e98edf38a2b"
7+
BASE_AMI_NAME = "Windows_Server-2022-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/release-config/R2024a.pkrvars.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// For more information on these variables, see /packer/build-matlab-ami.pkr.hcl.
55
RELEASE = "R2024a"
66
// Microsoft Windows Server 2022 Base (64-bit (x86))
7-
BASE_AMI = "ami-0f9c44e98edf38a2b"
7+
BASE_AMI_NAME = "Windows_Server-2022-English-Full-Base-*"
88
STARTUP_SCRIPTS = [
99
"env.ps1",
1010
"00_Confirm-InstanceProfile.ps1",

packer/v1/runtime/Install-NVIDIAGridDriver.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function Install-NVidiaGridDrivers {
3131
Start-Transcript -Path 'C:\Windows\NVIDIADrivers\grid-drivers-installation.log'
3232

3333
# Invoke instance meta-data service to retrieve the instance type of the running VM
34-
$InstanceType = $(Invoke-WebRequest -UseBasicParsing -Uri http://169.254.169.254/latest/meta-data/instance-type).Content
34+
$Token = $(Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token-ttl-seconds" = "120"} -Method PUT -Uri http://169.254.169.254/latest/api/token)
35+
$InstanceType = $(Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token" = $token} -Method GET -Uri http://169.254.169.254/latest/meta-data/instance-type)
3536

3637
# Extract class from the instance type
3738
$InstanceClass = $InstanceType.Split('.')[0]

packer/v1/startup/00_Confirm-InstanceProfile.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ function Confirm-InstanceProfile {
2020
$Response = $null
2121
while ($StatusCode -ne 200) {
2222
try {
23-
$Response = Invoke-WebRequest -UseBasicParsing -Uri http://169.254.169.254/latest/meta-data/iam/info
23+
$Token = Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token-ttl-seconds" = "120"} -Method PUT -Uri http://169.254.169.254/latest/api/token
24+
$Response = Invoke-WebRequest -UseBasicParsing -Uri http://169.254.169.254/latest/meta-data/iam/info -Headers @{ "X-aws-ec2-metadata-token" = $Token }
2425
$StatusCode = $Response.StatusCode
2526
Start-Sleep -Milliseconds 100
2627
}

packer/v1/startup/40_Set-DDUX.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ function Set-DDUX {
2020
[Environment]::SetEnvironmentVariable('MW_CONTEXT_TAGS', 'MATLAB:AWS:V1', [System.EnvironmentVariableTarget]::Machine)
2121
[Environment]::SetEnvironmentVariable('MW_DDUX_FORCE_ENABLE', $true, [System.EnvironmentVariableTarget]::Machine)
2222

23-
$ResponseInstanceId = Invoke-WebRequest -Uri http://169.254.169.254/latest/meta-data/instance-id
24-
$ResponseRegion = Invoke-WebRequest -Uri http://169.254.169.254/latest/meta-data/placement/region
23+
$Token = Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token-ttl-seconds" = "120"} -Method PUT -Uri http://169.254.169.254/latest/api/token
24+
$ResponseInstanceId = Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token" = $token} -Method GET -Uri http://169.254.169.254/latest/meta-data/instance-id
25+
$ResponseRegion = Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token" = $token} -Method GET -Uri http://169.254.169.254/latest/meta-data/placement/region
26+
2527
$MWAppTagGroup = aws ec2 describe-tags --filters "Name=resource-id,Values=$ResponseInstanceId" 'Name=key,Values=mw-app' --region "$ResponseRegion"
2628
$MWAppTag = (Write-Output $MWAppTagGroup | ConvertFrom-Json).Tags.Value
2729

releases/R2023a/README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Step 1. Launch the Template
44

5-
Click the **Launch Stack** button to deploy a standalone MATLAB® desktop client on AWS®. This will open the CloudFormation Create Stack screen in your web browser.
5+
Click the **Launch Stack** button to deploy a standalone MATLAB® desktop client on AWS®. This
6+
opens the CloudFormation Create Stack screen in your web browser.
67

78
| Region | Launch Link |
89
| --------------- | ----------- |
@@ -46,14 +47,16 @@ After you click the Launch Stack button above, the “Create stack” page will
4647
| **VPC to deploy this stack to** | ID of an existing VPC in which to deploy this stack |
4748
| **Subnet** | ID of an existing subnet |
4849
| **RDP Key Pair** | Name of an existing EC2 KeyPair to allow RDP access to all the instances. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html for details on creating these. |
50+
| **Enable browser access for MATLAB** | Option that enables access to MATLAB on your cloud MATLAB instance within a browser. Opening MATLAB in a browser opens a separate MATLAB session to your Remote Desktop Protocol (RDP) session or NICE DCV session. |
4951
| **Allow RDP and SSH connections from** | IP address range that will be allowed to connect to this instance from outside of the VPC. This field should be formatted as \<ip_address>/\<mask>. E.g. 10.0.0.1/32. This is the public IP address which can be found by searching for 'what is my ip address' on the web. The mask determines the number of IP addresses to include. A mask of 32 is a single IP address. This calculator can be used to build a specific range: https://www.ipaddressguide.com/cidr. You may need to contact your IT administrator to determine which address is appropriate. |
50-
| **Remote password** | Password for the user Administrator |
52+
| **Remote password** | Password for the user Administrator. You also need to enter this as an authentication token to access MATLAB on your cloud instance within a browser. |
5153
| **Confirm remote password** | Confirm Password |
5254
| **License Manager for MATLAB connection string** | Optional License Manager for MATLAB, specified as a string in the form \<port>@\<hostname>. If not specified, use online licensing. If specified, the network license manager (NLM) must be accessible from the specified VPC and subnets. To use the private hostname of the NLM hub instead of the public hostname, specify the security group ID of the NLM hub in the AdditionalSecurityGroup parameter. For more information, see https://github.com/mathworks-ref-arch/license-manager-for-matlab-on-aws. |
5355
| **Configure cloudwatch logging for the MATLAB instance** | Flag indicating whether cloudwatch logging for the MATLAB instance is enabled. |
5456
| **Additional security group to place instances in** | ID of an additional (optional) Security Group for the instances to be placed in. Often the License Manager for MATLAB's Security Group. |
5557
| **Use Elastic IP address that persists across machine reboots** | Flag indicating whether you want to keep the same public IP address for the instance. |
5658
| **AutoShutdown** | Choose whether you want to enable autoshutdown for your instance after a certain number of hours |
59+
| **Custom AMI ID (Optional)** | ID of a custom Amazon Machine Image (AMI) in the target region (optional). If the build has been customized then the resulting machine image may no longer be compatible with the provided CloudFormation template. Compatability can in some cases be restored by making corresponding modifications to the CloudFormation template. The ID should start with 'ami-'. |
5760
| **Optional user inline command** | Provide an optional inline PowerShell command to run on machine launch. For example, to set an environment variable CLOUD=AWS, use this command excluding the angle brackets: \<[System.Environment]::SetEnvironmentVariable("CLOUD","AWS", "Machine");>. You can use either double quotes or two single quotes. To run an external script, use this command excluding the angle brackets: \<Invoke-WebRequest "https://www.example.com/script.ps1" -OutFile script.ps1; .\script.ps1>. Find the logs at '$Env:ProgramData\MathWorks\startup.log'. |
5861

5962

@@ -63,14 +66,21 @@ After you click the Launch Stack button above, the “Create stack” page will
6366

6467
## Step 3. Connect to the Virtual Machine in the Cloud
6568

69+
To connect to the Virtual Machine (VM) using Remote Desktop Client, follow these steps:
6670
1. Expand the **Outputs** section in the *Stack Detail* page.
6771
1. Look for the key named `RDPSSHConnection` and copy the corresponding public DNS name listed under value. *For example*: ec2-11-222-33-44.compute-1.amazonaws.com
6872
1. Launch any remote desktop client, paste the public DNS name in the appropriate field, and connect. On the Windows Remote Desktop Client you need to paste the public DNS name in the **Computer** field and click **Connect**.
6973
1. In the login screen that's displayed, use the username `Administrator` and the password you specified while setting up the stack in [Step 2](#step-2-configure-the-stack).
7074
1. You can also connect using SSH from the terminal using the format: `ssh Administrator@<DNS name>`. *For example*: ssh [email protected]
7175

76+
If you choose to enable browser access for MATLAB, then:
77+
1. Expand the **Outputs** section in the *Stack Details* page.
78+
1. Look for the key named `BrowserConnection` and click on it
79+
1. On the login screen, use the password you specified while deploying the stack in [Step 2](#step-2-configure-the-stack) as the 'auth token' to authenticate.
80+
1. Browser access for MATLAB is enabled using `matlab-proxy`, a MathWorks&reg; developed Python&reg; package. For more information on `matlab-proxy`, refer to [matlab-proxy GitHub repository](https://github.com/mathworks/matlab-proxy).
81+
7282
## Step 4. Start MATLAB
73-
Double-click the MATLAB icon on the virtual machine desktop to start MATLAB. The first time you start MATLAB, you need to enter your MathWorks&reg; Account credentials to license MATLAB. For other ways to license MATLAB, see [MATLAB Licensing in the Cloud](https://www.mathworks.com/help/install/license/licensing-for-mathworks-products-running-on-the-cloud.html).
83+
Double-click the MATLAB icon on the virtual machine desktop to start MATLAB. The first time you start MATLAB, you need to enter your MathWorks Account credentials to license MATLAB. For other ways to license MATLAB, see [MATLAB Licensing in the Cloud](https://www.mathworks.com/help/install/license/licensing-for-mathworks-products-running-on-the-cloud.html).
7484

7585
>**Note**: It may take up to a minute for MATLAB to start the first time.
7686
@@ -96,6 +106,6 @@ This CloudFormation template uses nested stacks to reference templates used by m
96106

97107
----
98108

99-
Copyright 2020-2023 The MathWorks, Inc.
109+
Copyright 2020-2024 The MathWorks, Inc.
100110

101111
----

0 commit comments

Comments
 (0)