From 31d21d78e061790db69b8ee0ac3d1259bf4d3faa Mon Sep 17 00:00:00 2001 From: Prabhakar Kumar Date: Fri, 27 Jun 2025 15:52:04 +0530 Subject: [PATCH 01/19] Update to v0.3.0, introducing support for MATLAB R2025a --- src/matlab/devcontainer-feature.json | 5 +++-- src/matlab/install-helper-functions.sh | 2 +- src/matlab/install.sh | 7 ++++--- test/matlab/install_release_on_ubuntu24.04.sh | 14 ++++++++++++++ test/matlab/scenarios.json | 16 ++++++++++++---- test/matlab/test.sh | 6 +++--- 6 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 test/matlab/install_release_on_ubuntu24.04.sh diff --git a/src/matlab/devcontainer-feature.json b/src/matlab/devcontainer-feature.json index edf23e9..67c7ac4 100644 --- a/src/matlab/devcontainer-feature.json +++ b/src/matlab/devcontainer-feature.json @@ -1,13 +1,14 @@ { "name": "MATLAB", "id": "matlab", - "version": "0.2.0", + "version": "0.3.0", "description": "Installs MATLAB with supporting packages and tools.", "documentationURL": "https://github.com/mathworks/devcontainer-features", "options": { "release": { "type": "string", "proposals": [ + "R2025a", "R2024b", "R2024a", "R2023b", @@ -21,7 +22,7 @@ "R2019b", "R2019a" ], - "default": "R2024b", + "default": "R2025a", "description": "MATLAB Release to install." }, "products": { diff --git a/src/matlab/install-helper-functions.sh b/src/matlab/install-helper-functions.sh index 513547f..5a35e89 100755 --- a/src/matlab/install-helper-functions.sh +++ b/src/matlab/install-helper-functions.sh @@ -136,7 +136,7 @@ function ihf_get_remove_cmd() { # returns "true/false" string if MATLAB_RELEASE is valid function ihf_is_valid_matlab_release() { # List of supported MATLAB_RELEASE values - local _SUPPORTED_MATLAB_RELEASES=("R2024b" "R2024a" "R2023b" "R2023a" "R2022b" "R2022a" "R2021b" "R2021a" "R2020b" "R2020a" "R2019b" "R2019a") + local _SUPPORTED_MATLAB_RELEASES=("R2025a" "R2024b" "R2024a" "R2023b" "R2023a" "R2022b" "R2022a" "R2021b" "R2021a" "R2020b" "R2020a" "R2019b" "R2019a") ## Validate MATLAB_RELEASE if [ -z "$MATLAB_RELEASE" ]; then diff --git a/src/matlab/install.sh b/src/matlab/install.sh index c5fc3ad..712d6f2 100755 --- a/src/matlab/install.sh +++ b/src/matlab/install.sh @@ -17,8 +17,8 @@ set -eu -o pipefail ## Set defaults to all the options in the feature. -# R2024b is the latest available release. -RELEASE="${RELEASE:-"R2024b"}" +# R2025a is the latest available release. +RELEASE="${RELEASE:-"R2025a"}" PRODUCTS="${PRODUCTS:-"MATLAB"}" DOC="${DOC:-"false"}" INSTALLGPU="${INSTALLGPU:-"false"}" @@ -92,6 +92,7 @@ function install_matlab_engine_for_python() { # Installing the engine is tricky # The installation can fail if the python version does not match the supported release declare -A matlabengine_map + matlabengine_map['R2025a']="25.1" matlabengine_map['R2024b']="24.2" matlabengine_map['R2024a']="24.1" matlabengine_map['R2023b']="23.2" @@ -225,7 +226,7 @@ if [ "$SKIPMATLABINSTALL" != 'true' ]; then # Handle GPU installation if [ "${INSTALLGPU}" == "false" ]; then - RELEASES_THAT_SUPPORT_NOGPU=("R2024b" "R2024a" "R2023b" "R2023a") + RELEASES_THAT_SUPPORT_NOGPU=("R2025a" "R2024b" "R2024a" "R2023b" "R2023a") # The value variable is assigned a regex that matches the exact value value="\<${MATLAB_RELEASE}\>" if [[ ${RELEASES_THAT_SUPPORT_NOGPU[@]} =~ $value ]]; then diff --git a/test/matlab/install_release_on_ubuntu24.04.sh b/test/matlab/install_release_on_ubuntu24.04.sh new file mode 100644 index 0000000..32fbd59 --- /dev/null +++ b/test/matlab/install_release_on_ubuntu24.04.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +## Execute the command below from the root folder of the feature to run this test in isolation: +# devcontainer features test --features matlab --skip-autogenerated --filter install_release_on_ubuntu24.04 + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +check "r2025a is installed" bash -c "cat /opt/matlab/R2025a/VersionInfo.xml | grep 'R2025a'" + +# Report results +# If any of the checks above exited with a non-zero exit code, the test will fail. +reportResults \ No newline at end of file diff --git a/test/matlab/scenarios.json b/test/matlab/scenarios.json index 638cf72..74aeb13 100644 --- a/test/matlab/scenarios.json +++ b/test/matlab/scenarios.json @@ -1,9 +1,17 @@ { - "install_release_on_ubuntu":{ + "install_release_on_ubuntu24.04": { + "image": "ubuntu:24.04", + "features": { + "matlab": { + "release": "r2025a" + } + } + }, + "install_release_on_ubuntu": { "image": "ubuntu:22.04", - "features":{ - "matlab":{ - "release" : "r2022b" + "features": { + "matlab": { + "release": "r2022b" } } }, diff --git a/test/matlab/test.sh b/test/matlab/test.sh index 22df139..cbe3fee 100644 --- a/test/matlab/test.sh +++ b/test/matlab/test.sh @@ -19,9 +19,9 @@ # # Thus, the value of all options will fall back to the default value in # the Feature's 'devcontainer-feature.json'. -# For the 'matlab' feature, that means the default version installed in R2024b +# For the 'matlab' feature, that means the default version installed in R2025a # These are the default values that are passed into the feature: -# RELEASE="R2024b" +# RELEASE="R2025a" # OS="ubuntu22.04" # PRODUCTS="MATLAB" # DOC="false" @@ -56,7 +56,7 @@ source dev-container-features-test-lib # Feature-specific tests # The 'check' command comes from the dev-container-features-test-lib. Syntax is... # check