|
| 1 | +# HDsort Compiled Docker Images |
| 2 | + |
| 3 | +This documentation is intended to show how to create a Docker image with Matlab compiled HDsort sorter. The main goal of this project is to avoid the requirement of Matlab Licenses and also abstract the installation and setup steps to run the sorter |
| 4 | + |
| 5 | +There are three main steps for generating a functional HDsort docker image: |
| 6 | +1. Compile HDsort as Matlab's Standalone Application |
| 7 | +2. Create a (base) docker image with Matlab Runtime and the compiled application from step 1 |
| 8 | +3. Extend the docker image from step 2 for improvements and fixes |
| 9 | + |
| 10 | +## Requirements |
| 11 | +- Packaging a MATLAB Docker image is supported on Linux only |
| 12 | +- Docker |
| 13 | +- Matlab |
| 14 | + |
| 15 | +### Matlab Requirements |
| 16 | +- MATLAB Compiler |
| 17 | +- More requirements to be checked and listed... |
| 18 | + |
| 19 | +## Compiling HDsort as Matlab's Standalone Application |
| 20 | +- Git clone or Download HDsort [source code](https://git.bsse.ethz.ch/hima_public/HDsort) |
| 21 | +- Open Matlab |
| 22 | +- Set Matlab's workspace folder to `/path/to/spikeinterface-dockerfiles/hdsort-compiled` |
| 23 | +- Run `mcc` command with `hdsort_compiled.m` as base and adding path to git cloned HDSort: |
| 24 | +```matlab |
| 25 | +>> mcc -m hdsort_compiled.m -a <git-cloned-path>/HDsort |
| 26 | +``` |
| 27 | + |
| 28 | +## Generating Base Docker Image |
| 29 | +- To generate the base docker image (called `hdsort-matlab-base`) with the compiled application, run the following command in Matlab console: |
| 30 | +```matlab |
| 31 | +>> compiler.package.docker('hdsort_compiled', 'requiredMCRProducts.txt', 'ImageName', 'hdsort-matlab-base') |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +- [Optional] Files generated by Matlab Compiler can be deleted: |
| 36 | + - In your terminal, go to the `hdsort-compiled` folder in this project: |
| 37 | + ```bash |
| 38 | + $ cd /path/to/spikeinterface-dockerfiles/hdsort-compiled |
| 39 | + ``` |
| 40 | + |
| 41 | + - Run `rm` command: |
| 42 | + ```bash |
| 43 | + $ rm -r \ |
| 44 | + hdsort-matlab-basedocker \ |
| 45 | + hdsort_compiled \ |
| 46 | + includedSupportPackages.txt \ |
| 47 | + mccExcludedFiles.log \ |
| 48 | + readme.txt \ |
| 49 | + requiredMCRProducts.txt \ |
| 50 | + run_hdsort_compiled.sh \ |
| 51 | + unresolvedSymbols.txt |
| 52 | + ``` |
| 53 | + |
| 54 | + |
| 55 | +## Extending Base Image and creating final image |
| 56 | +The Dockerfile in this folder applies some fixes and updates to the base image generated automatically by Matlab in order to properly run waveclus: |
| 57 | + |
| 58 | + |
| 59 | +- In your terminal, go to the folder for this project: |
| 60 | +``` |
| 61 | +$ cd /path/to/spikeinterface-dockerfiles/hdsort-compiled |
| 62 | +``` |
| 63 | + |
| 64 | +- Run build script: |
| 65 | +``` |
| 66 | +$ source build.sh |
| 67 | +``` |
0 commit comments