Skip to content

Commit

Permalink
Updates files to reference MATLAB R2024b.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmcdonnellmw authored and Prabhakar Kumar committed Sep 12, 2024
1 parent b0c629d commit 379a529
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 125 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ jobs:
strategy:
fail-fast: false
matrix:
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
matlab-release:
- R2024b
- R2024a
- R2023b
- R2023a
- R2022b
- R2022a
- R2021b
- R2021a
- R2020b

steps:
- name: Checkout repo
Expand Down Expand Up @@ -65,7 +74,7 @@ jobs:
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Generate license file
run: echo '${{ secrets.MATLAB_LICENSE_FILE_R2024A }}' > ${{ env.LICENSE_FILE_PATH }}
run: echo '${{ secrets.MATLAB_LICENSE_FILE_R2024B }}' > ${{ env.LICENSE_FILE_PATH }}

- name: Test container
env:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/from-matlab-docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ jobs:
strategy:
fail-fast: false
matrix:
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a]
matlab-release:
- R2024b
- R2024a
- R2023b
- R2023a
- R2022b
- R2022a

steps:
- name: Checkout repo
Expand Down Expand Up @@ -60,7 +66,7 @@ jobs:
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Generate license file
run: echo '${{ secrets.MATLAB_LICENSE_FILE_R2024A }}' > ${{ env.LICENSE_FILE_PATH }}
run: echo '${{ secrets.MATLAB_LICENSE_FILE_R2024B }}' > ${{ env.LICENSE_FILE_PATH }}

- name: Test container
working-directory: tests
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/matlab-container-offline-install-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,23 @@ env:
ALT_PATH: alternates/matlab-container-offline-install
MATLAB_PRODUCT_LIST: "MATLAB Symbolic_Math_Toolbox Deep_Learning_Toolbox_Model_for_ResNet-50_Network"
LICENSE_FILE_PATH: ${{ github.workspace }}/license.lic

jobs:
build-test-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
matlab-release:
- R2024b
- R2024a
- R2023b
- R2023a
- R2022b
- R2022a
- R2021b
- R2021a
- R2020b

steps:
- name: Checkout repo
Expand Down Expand Up @@ -80,9 +89,8 @@ jobs:
python -m pip install --upgrade pip
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Generate license file
run: echo '${{ secrets.MATLAB_LICENSE_FILE_R2024A }}' > ${{ env.LICENSE_FILE_PATH }}
run: echo '${{ secrets.MATLAB_LICENSE_FILE_R2024B }}' > ${{ env.LICENSE_FILE_PATH }}

- name: Test container
working-directory: tests
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/matlab-installer-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ jobs:
strategy:
fail-fast: false
matrix:
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
matlab-release:
- R2024b
- R2024a
- R2023b
- R2023a
- R2022b
- R2022a
- R2021b
- R2021a
- R2020b

steps:
- name: Checkout repo
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/non-interactive-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ jobs:
fail-fast: false
matrix:
matlab-release:
[R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
- R2024b
- R2024a
- R2023b
- R2023a
- R2022b
- R2022a
- R2021b
- R2021a
- R2020b

steps:
- name: Checkout repo
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Copyright 2019-2024 The MathWorks, Inc.
# This Dockerfile allows you to build a Docker® image with MATLAB® installed using the MATLAB Package
# Manager. Use the optional build arguments to customize the version of MATLAB, list of products to
# This Dockerfile allows you to build a Docker® image with MATLAB® installed using the MATLAB Package
# Manager. Use the optional build arguments to customize the version of MATLAB, list of products to
# install, and the location at which to install MATLAB.

# Here is an example docker build command with the optional build arguments.
# docker build --build-arg MATLAB_RELEASE=R2024a
# docker build --build-arg MATLAB_RELEASE=R2024b
# --build-arg MATLAB_PRODUCT_LIST="MATLAB Deep_Learning_Toolbox Symbolic_Math_Toolbox"
# --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab/R2024a"
# --build-arg LICENSE_SERVER=12345@hostname.com
# --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab/R2024b"
# --build-arg LICENSE_SERVER=12345@hostname.com
# -t my_matlab_image_name .

# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
ARG MATLAB_RELEASE=R2024a
ARG MATLAB_RELEASE=R2024b

# Specify the list of products to install into MATLAB.
ARG MATLAB_PRODUCT_LIST="MATLAB"

# Specify MATLAB Install Location.
ARG MATLAB_INSTALL_LOCATION="/opt/matlab/${MATLAB_RELEASE}"

# Specify license server information using the format: port@hostname
# Specify license server information using the format: port@hostname
ARG LICENSE_SERVER

# When you start the build stage, this Dockerfile by default uses the Ubuntu-based matlab-deps image.
Expand Down Expand Up @@ -55,7 +55,7 @@ WORKDIR /home/matlab
# Run mpm to install MATLAB in the target location and delete the mpm installation afterwards.
# If mpm fails to install successfully, then print the logfile in the terminal, otherwise clean up.
# Pass in $HOME variable to install support packages into the user's HOME folder.
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \
&& chmod +x mpm \
&& sudo HOME=${HOME} ./mpm install \
--release=${MATLAB_RELEASE} \
Expand All @@ -69,20 +69,20 @@ RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \

# Option 1. Specify the host and port of the machine that serves the network licenses
# if you want to store the license information in an environment variable. This
# is the preferred option. You can either use a build variable, like this:
# --build-arg LICENSE_SERVER=27000@MyServerName or you can specify the license server
# is the preferred option. You can either use a build variable, like this:
# --build-arg LICENSE_SERVER=27000@MyServerName or you can specify the license server
# directly using: ENV MLM_LICENSE_FILE=27000@flexlm-server-name
ENV MLM_LICENSE_FILE=$LICENSE_SERVER

# Option 2. Alternatively, you can put a license file into the container.
# Enter the details of the license server in this file and uncomment the following line.
# COPY network.lic ${MATLAB_INSTALL_LOCATION}/licenses/

# The following environment variables allow MathWorks to understand how this MathWorks
# product (MATLAB Dockerfile) is being used. This information helps us make MATLAB even better.
# Your content, and information about the content within your files, is not shared with MathWorks.
# To opt out of this service, delete the environment variables defined in the following line.
# To learn more, see the Help Make MATLAB Even Better section in the accompanying README:
# The following environment variables allow MathWorks to understand how this MathWorks
# product (MATLAB Dockerfile) is being used. This information helps us make MATLAB even better.
# Your content, and information about the content within your files, is not shared with MathWorks.
# To opt out of this service, delete the environment variables defined in the following line.
# To learn more, see the Help Make MATLAB Even Better section in the accompanying README:
# https://github.com/mathworks-ref-arch/matlab-dockerfile#help-make-matlab-even-better
ENV MW_DDUX_FORCE_ENABLE=true MW_CONTEXT_TAGS=MATLAB:DOCKERFILE:V1

Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ cd matlab-dockerfile

Build container with a name and tag of your choice.
```bash
docker build -t matlab:R2024a .
docker build -t matlab:R2024b .
```

Run the container. Test the container by running an example MATLAB command such as ver.
```bash
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024a -batch ver
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024b -batch ver
```
The [Dockerfile](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/Dockerfile) defaults to building a container for MATLAB R2024a.
The [Dockerfile](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/Dockerfile) defaults to building a container for MATLAB R2024b.

The example command `ver` displays the version number of MATLAB and other installed products. For more information, see [ver](https://www.mathworks.com/help/matlab/ref/ver.html). For more information on running the container, see the section on [Running the Container](#run-the-container).

Expand All @@ -66,9 +66,9 @@ The [Dockerfile](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/ma

| Argument Name | Default value | Description |
|---|---|---|
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | R2024a | The MATLAB release you want to install, in lower-case. For example: `R2019b`|
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | R2024b | The MATLAB release you want to install, in lower-case. For example: `R2019b`|
| [MATLAB_PRODUCT_LIST](#build-an-image-with-a-specific-set-of-products) | MATLAB | Products to install as a space-separated list. For more information, see [MPM.md](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/MPM.md). For example: `MATLAB Simulink Deep_Learning_Toolbox Fixed-Point_Designer`|
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/R2024a | The path to install MATLAB. |
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/R2024b | The path to install MATLAB. |
| [LICENSE_SERVER](#build-an-image-configured-to-use-a-license-server) | *unset* | The port and hostname of the machine that is running the Network License Manager, using the `port@hostname` syntax. For example: `27000@MyServerName` |

Use these arguments with the the `docker build` command to customize your image.
Expand All @@ -83,24 +83,24 @@ docker build --build-arg MATLAB_RELEASE=R2019b -t matlab:R2019b .
#### Build an Image with a specific set of products
For example, to build an image with MATLAB and Simulink®, use this command.
```bash
docker build --build-arg MATLAB_PRODUCT_LIST='MATLAB Simulink' -t matlab:R2024a .
docker build --build-arg MATLAB_PRODUCT_LIST='MATLAB Simulink' -t matlab:R2024b .
```

#### Build an Image with MATLAB installed to a specific location
For example, to build an image with MATLAB installed at /opt/matlab, use this command.
```bash
docker build --build-arg MATLAB_INSTALL_LOCATION='/opt/matlab' -t matlab:R2024a .
docker build --build-arg MATLAB_INSTALL_LOCATION='/opt/matlab' -t matlab:R2024b .
```

#### Build an Image Configured to Use a License Server

Including the license server information with the `docker build` command means you do not have to pass it when running the container.
```bash
# Build container with the License Server.
docker build --build-arg LICENSE_SERVER=27000@MyServerName -t matlab:R2024a .
docker build --build-arg LICENSE_SERVER=27000@MyServerName -t matlab:R2024b .

# Run the container, without needing to pass license information.
docker run --init --rm matlab:R2024a -batch ver
docker run --init --rm matlab:R2024b -batch ver
```

## Use the Network License Manager
Expand Down Expand Up @@ -133,7 +133,7 @@ With the `docker build` command, either:

```bash
# Example
docker build -t matlab:R2024a --build-arg LICENSE_SERVER=27000@MyServerName .
docker build -t matlab:R2024b --build-arg LICENSE_SERVER=27000@MyServerName .
```
- Use the `network.lic` file:
1. Place the `network.lic` file in the same folder as the Dockerfile.
Expand All @@ -142,41 +142,41 @@ With the `docker build` command, either:

```bash
# Example
docker build -t matlab:R2024a .
docker build -t matlab:R2024b .
```

With the `docker run` command, use the `MLM_LICENSE_FILE` environment variable. For example:

```bash
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024a -batch ver
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024b -batch ver
```

## Run the Container
If you did not provide the license server information when building the image, then provide it when running the container. Set the environment variable `MLM_LICENSE_FILE` using the `-e` flag, with the network license manager's location in the format `port@hostname`.
```bash
# Start MATLAB, print version information, and exit:
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024a -batch ver
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024b -batch ver
```
You can run the container **without** specifying `MLM_LICENSE_FILE` if you provided the license server information when building the image, as shown in the examples below.
### Run MATLAB in an Interactive Command Prompt
To start the container and run MATLAB in an interactive command prompt, execute:
```bash
docker run --init -it --rm matlab:R2024a
docker run --init -it --rm matlab:R2024b
```
### Run MATLAB in Batch Mode
To start the container, run a MATLAB command, and then exit, execute:
```bash
# Container runs the command RAND in MATLAB and exits.
docker run --init --rm matlab:R2024a -batch rand
docker run --init --rm matlab:R2024b -batch rand
```
### Run MATLAB with Startup Options
To override the default behavior of the container and run MATLAB with any set of arguments, such as `-logfile`, execute:
```bash
docker run --init -it --rm matlab:R2024a -logfile "logfilename.log"
docker run --init -it --rm matlab:R2024b -logfile "logfilename.log"
```
To learn more, see the documentation: [Commonly Used Startup Options](https://www.mathworks.com/help/matlab/matlab_env/commonly-used-startup-options.html).
Expand All @@ -194,7 +194,7 @@ For some workflows and toolboxes, you must specify dependencies. You must do thi
* Use the MATLAB Engine API for C and Fortran®.
* Use the Polyspace® 32-bit tcc compiler.
The [matlab-deps repository](https://github.com/mathworks-ref-arch/container-images/tree/main/matlab-deps) repository lists Dockerfiles for various releases and platforms. To view the Dockerfile for R2024a, click [here](https://github.com/mathworks-ref-arch/container-images/blob/main/matlab-deps/r2024a/ubuntu22.04/Dockerfile).
The [matlab-deps repository](https://github.com/mathworks-ref-arch/container-images/tree/main/matlab-deps) repository lists Dockerfiles for various releases and platforms. To view the Dockerfile for R2024b, click [here](https://github.com/mathworks-ref-arch/container-images/blob/main/matlab-deps/r2024b/ubuntu22.04/Dockerfile).
These Dockerfiles contain commented lines with the libraries that support these additional capabilities. Copy and uncomment these lines into your Dockerfile.
Expand Down
16 changes: 8 additions & 8 deletions alternates/building-on-matlab-docker-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
ARG MATLAB_RELEASE=R2024a
ARG MATLAB_RELEASE=R2024b

# Specify the extra products to install into the image. These products can either be toolboxes or support packages.
ARG ADDITIONAL_PRODUCTS="Symbolic_Math_Toolbox Deep_Learning_Toolbox_Model_for_ResNet-50_Network"
Expand All @@ -22,8 +22,8 @@ USER root
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install --no-install-recommends --yes \
wget \
ca-certificates \
wget \
ca-certificates \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -54,7 +54,7 @@ RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \

# Alternatively, you can provide a license server to use
# with the docker image while building the image.
# Specify the host and port of the machine that serves the network licenses
# Specify the host and port of the machine that serves the network licenses
# if you want to bind in the license info as an environment variable.
# You can also build with something like --build-arg LICENSE_SERVER=27000@MyServerName,
# in which case you should uncomment the following two lines.
Expand All @@ -63,11 +63,11 @@ RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \
# ARG LICENSE_SERVER
# ENV MLM_LICENSE_FILE=$LICENSE_SERVER

# The following environment variables allow MathWorks to understand how this MathWorks
# product is being used. This information helps us make MATLAB even better.
# Your content, and information about the content within your files, is not shared with MathWorks.
# The following environment variables allow MathWorks to understand how this MathWorks
# product is being used. This information helps us make MATLAB even better.
# Your content, and information about the content within your files, is not shared with MathWorks.
# To opt out of this service, delete the environment variables defined in the following line.
# See the Help Make MATLAB Even Better section in the accompanying README to learn more:
# See the Help Make MATLAB Even Better section in the accompanying README to learn more:
# https://github.com/mathworks-ref-arch/matlab-dockerfile#help-make-matlab-even-better
ENV MW_DDUX_FORCE_ENABLE=true MW_CONTEXT_TAGS=$MW_CONTEXT_TAGS,MATLAB:TOOLBOXES:DOCKERFILE:V1

Expand Down
Loading

0 comments on commit 379a529

Please sign in to comment.