Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 2.06 KB

File metadata and controls

69 lines (48 loc) · 2.06 KB

tool_template_matlab

Template repository for building a MATLAB tool that follows the Tool Specification container contract.

How gotap works here

This template installs gotap inside the image and uses it as the default runtime shim:

CMD ["gotap", "run", "foobar", "--input-file", "/in/input.json"]

At build time, gotap generate creates get_parameters.m from src/tool.yml. At runtime, runTool.m uses the generated helper to validate /in/input.json, load parameters and data paths, and write structured run logs.

Required file structure

/
|- in/
|  |- input.json
|- out/
|  |- ...
|- src/
|  |- tool.yml
|  |- runTool.m
|  |- get_parameters.m   (generated at build time)
|  |- CITATION.cff

Build and run

Build the image from the template root:

docker build -t tbr_matlab_template .

Run the sample tool:

docker run --rm -it \
  -v "$(pwd)/in:/in" \
  -v "$(pwd)/out:/out" \
  -e TOOL_RUN=foobar \
  tbr_matlab_template

TOOL_RUN is only needed when the image contains more than one tool entry.

Customize

  1. Update src/tool.yml to describe your tool.
  2. Add MATLAB or system dependencies in Dockerfile.
  3. Implement the tool logic in src/runTool.m.
  4. Rebuild the image so gotap generate refreshes get_parameters.m.

Generated bindings and platform note

The generated get_parameters.m helper is the only supported parameter-access path in this template. It exposes:

  • get_parameters()
  • get_run_context()
  • get_logger()

On the current arm64 macOS Docker host, mathworks/matlab:r2022b is pulled as linux/amd64, so builds are currently blocked by base-image platform compatibility rather than by the template contract.

MATLAB license

The upstream mathworks/matlab:r2022b image requires a MATLAB license configured for cloud use. See the MathWorks container documentation and your license administrator if you need to run the image outside the sample workflow.