mathworks-ref-arch / matlab-dockerfile

Create a docker container that contains a MATLAB install
Other
331 stars 95 forks source link

Simulink license not `inuse` but present #88

Closed ncomte closed 6 months ago

ncomte commented 7 months ago

I'm trying to build a simple POC where I want to run simulink tests in the docker image I built from this dockerfile. I added the product to be installed ARG MATLAB_PRODUCT_LIST="MATLAB Simulink" within the Dockerfile. When I try and run my tests, I get an error, and while checking with license('inuse') it returns only matlab. But then when I check with license('test', 'simulink') it returns 1.

Here is the runtime error I get while trying to run my tests

Warning: A Requirements Toolbox license is not available. Setup of RMI skipped.
> In prjSetup (line 63)
In matlab.internal.project.util.runMATLABCodeInBase
In matlab.internal.project.util.runMATLABScriptDuringStartup
In matlab.project.loadProject
In matlab.project.loadProject
In openProject
In runt (line 1)
In run (line 99)
Warning: A Simulink Check license is not available.
> In prjSetup (line 74)
In matlab.internal.project.util.runMATLABCodeInBase
In matlab.internal.project.util.runMATLABScriptDuringStartup
In matlab.project.loadProject
In matlab.project.loadProject
In openProject
In runt (line 1)
In run (line 99)

I'm running this build of matlab

                 < M A T L A B (R) >
       Copyright 1984-2023 The MathWorks, Inc.
R2023b Update 6 (23.2.0.2485118) 64-bit (glnxa64)
                  December 28, 2023

Also, I should note that when running the exact same project on my windows version of matlab, everything works properly from the cli. Any help would be appreciated in trying to debug this issue.

Cheers !

michaelmcdonnellmw commented 7 months ago

Hi @ncomte,

Thank you for reaching out to us regarding this issue. From the information provided, we believe that we have a fix for the issue and if not, there are some steps to take to gather more information on the issue.

It appears from the MATLAB_PRODUCT_LIST that you provided that only MATLAB and Simulink are being installed into the Image. However, from the warning messages provided, the "Simulink Check" and "Requirements Toolbox" are required for your workflow.

You can confirm the toolboxes and upport packages you have installed locally by running the following locally and in the container:

>> ver
>> matlabshared.supportpkg.getInstalled

Once you have confirmed your installed produced you an modify the MATLAB_PRODUCT_LIST, as shown below, to make sure you have that this is not the cause of the issue.

>> ARG MATLAB_PRODUCT_LIST="MATLAB Simulink Simulink_Check Requirements_Toolbox"

Please try deploying using the Dockerfile with all required toolboxes specified, following the example above, and test if this resolves the issue.

You can verify which toolboxes are installed by executing the commands below in the MATLAB Command Prompt:

>> toolboxes = matlab.addons.toolbox.installedToolboxes;
>> struct2table(toolboxes)

One thing to not from the original message is that executing the command "license('inuse')" returns checked out licenses (licenses currently in use) and executing the command "license('test', 'toolbox_name')" returns if the user has a license for that toolbox, not whether that toolbox is in use. If you have a license for Simulink, but the product is not currently in use, then you would expect to see "license('inuse') return a list of products without Simulink, but "license('test', 'simulink') return true (1).

If the toolboxes required for your workflow are present on both your local machine and the deployed instance, please reach out to MathWorks Technical Support with the details you have already provided and the outcomes of the steps above and they will be able to assist further. For information on how to contact MathWorks Technical Support, please see the link below: https://uk.mathworks.com/help/matlab/matlab_env/contact-technical-support.html

ncomte commented 6 months ago

Thanks for your reply. Indeed I missed a few products that needed to be installed. I also had issues in my searching script. I was looking for all files having the Test label, but some of my actual tests didn't have it, while broken tests had it.