An application in Docker is not of much use if it cannot communicate with the outside world. A typical Docker application consists of a collection of containers, each designed to carry out a specific function, and which can communicate with each other and the outside world through the HTTP protocol. Exchanging data with Matlab docker containers is not possible with standard Matlab nor with the docker tools available since Matlab 2020b. However the Modelit Webserver toolbox makes it possible to execute Matlab code in a Docker container as a microservice.

In this post we show how to run a compiled Matlab application in a Docker container that is able to send and receive messages from other services. This post is a continuation of the Matlab in Docker post in which a Docker container was created in which a simple "Hello world" Matlab function was executed.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Developing in Matlab gives the developer access to high level high level mathematical programming environment. However integrating this code in modern software environment with multiple languages, frameworks and architectures creates enormous complexity. Docker simplifies and accelerates this workflow. Support for Docker was introduced in Matlab 2020b but it is also possible to compile Matlab and use it in a Docker container for earlier Matlab versions. In this post we will make a very simple 'Hello world' in Matlab application and compile it under Unix and run it in a Docker container. The example is made for Matlab 2019b but should work in any other Matlab version.

This post is the first part of the Matlab in Docker posts, in the next post we will make a Matlab application that runs in Docker and that is able to send a receive data to and from other services.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Background:

Matlab's webread and urlread are single threaded functions. When executing multiple download commands they are executed sequentially, while blocking the main Matlab process. For most applications in Matlab this is not a problem, normally data is downloaded once and when the data are available the main program continues its execution. But if data have to be retrieved in various separate requests, for example in the MapViewer where a number of tiles with background images have to be downloaded, it is important that the application's communication is fast and does not block the main application while downloading. 

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

In this post we show how to build an application that uses Javascript for the front-end while the back-end is implemented in Matlab. The front-end and back-end are coupled by using the Modelit Webserver toolbox. This toolbox was recently extended to support websockets which makes it possible to have two-way communication. I.e. the front-end can send messages to the back-end and vice versa.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Background:

For complex applications it is useful to have a flexible logging framework. In which the logging can be sent to different destinations, for example a database, a file or the console in a format the can be configured at any time and that can filter out the desired messages depending on the environment. For example all messages in the development environment or only errors in the production environment. The Log4j framework offers all these functionalities. The previously mentioned features can be configured in a .properties file. In this way the logging can be configured without touching the source code.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive