Skip to content

Latest commit

 

History

History
109 lines (70 loc) · 3.77 KB

developer.md

File metadata and controls

109 lines (70 loc) · 3.77 KB

Developer docs

Setup instructions

After installing the necessary dependencies, you will need to clone this repository from GitHub and move into the Enigma-PD-WML directory:

git clone https://github.com/UCL-ARC/Enigma-PD-WML.git
cd Enigma-PD-WML

Building the Docker Image

You can build the image with the following command:

cd Enigma-PD-WML
docker build -f Dockerfile -t enigma-pd-wml .

Building the Apptainer Image

If you want to run the container via Apptainer, you can convert this Docker image into an Apptainer one via:

docker image save enigma-pd-wml -o enigma-pd-wml.tar
apptainer build enigma-pd-wml.sif docker-archive:enigma-pd-wml.tar

Running the pipeline with Docker

After building the Docker image, you can run a container based on this local image:

docker run -v "${PWD}"/data:/data enigma-pd-wml

Note, this requires your BIDS data is stored in the directory Enigma-PD-WML/data.

Running the pipeline with Apptainer

After building the Apptainer image, you can run a container based on this local image:

apptainer run --bind "${PWD}"/data:/data enigma-pd-wml.sif

Note, this requires your BIDS data is stored in the directory Enigma-PD-WML/data, and that enigma-pd-wml.sif is in the Enigma-PD-WML directory.

Making new releases to docker hub

This repository has a github actions workflow to automate uploading to Docker Hub when a new release is made on github.

  • Go to the releases tab and click 'Draft a new release'.

  • Click 'Choose a tag' and enter a new version number e.g. v1.0.0

  • Click 'Generate release notes'. This will add a summary of any commits since the last release.

  • Click the green 'Publish release' button at the bottom left.

  • This will trigger the action to run and upload the code on the main branch to Docker Hub and Sylabs Cloud. Note: as the images are very large, this will take a while! (around 40 minutes)

Linting setup (pre-commit)

This repository has another github actions workflow to run various linting checks on pull requests / commits to main. This uses pre-commit, a python based tool. The enabled checks can be seen/updated in the pre-commit configuration file.

Some of the main ones used are:

It can be useful to run pre-commit locally to catch issues early. To do so, you will need to have python installed locally (for example, by installing Miniforge or similar)

Then run:

pip install pre-commit

Then (from inside a local clone of this github repository), run:

pre-commit install

pre-commit should now run automatically every time you git commit, flagging any issues.

Some notes on the Dockerfile

There are two main components to the Dockerfile:

  • The requirements for UNets-pgs
  • The requirements for FSL

All requirements for the UNets-pgs workflow come from the base pgs image, including the bash script and packages like tensorflow.

FSL is installed as detailed in their installation docs and configuration docs. We're using the -V option at the end of the fslinstaller command to fix it to a specific FSL version .