You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* On HPC, the internet connection may not be not available on running node, you should download models in advance. See the downloading instruction [here](https://github.com/hnguyentt/MouseCHD/tree/master/containers#apptainer)
55
46
* Test if container run correctly: `apptainer exec --nv <path/to/mousechd.sif> mousechd -h`
* Append this prefix before every command in the [How to use](https://github.com/hnguyentt/MouseCHD?tab=readme-ov-file#how-to-use): `sudo docker run --gpus all -v /path/on/host:/path/in/container mousechd`
23
+
*`--gpus all`: container can see and use all gpus available on host
24
+
*`-v /path/on/host:/path/in/container`: mount host data to container. For example, I mount my home folder to container home folder: `-v /home/hnguyent:/homme/hnguyent`
25
+
26
+
For example, I run [segmentation](https://github.com/hnguyentt/MouseCHD?tab=readme-ov-file#2-heart-segmentation) like this: `sudo docker run --gpus all -v /home/hnguyent:/home/hnguyent mousechd mousechd segment -indir /home/hnguyent/DATA/images -outdir /home/hnguyent/DATA/HeartSeg`
27
+
28
+
17
29
## Apptainer
18
30
[Apptainer](https://apptainer.org/) is an open-source containerization tool, designed specifically for High-Performance Computing (HPC) environments. Unlike traditional container solutions like Docker, Apptainer emphasizes **unprivileged execution**, ensuring safe deployment in shared computing infrastructures, where running services as root may pose security risks. Apptainer enables portability of applications across different systems, while allowing access to GPUs, specialized hardware, and libraries.
19
31
20
-
1. Build Apptainer image
21
-
```bash
22
-
sudo apptainer build mousechd.sif mousechd.def
32
+
### Downloading models in advance on HPC
33
+
On HPC, the internet connection may not be available on running node, you should download models in advance, copy and paste in command line on HPC:
* Download model in advance (only on HPC) like the [instruction above]().
44
+
* Append this prefix before every command in the [How to use](https://github.com/hnguyentt/MouseCHD?tab=readme-ov-file#how-to-use): `apptainer exec [-B /path/to/directory/on/host] --nv <path/to/mousechd.sif>`:
45
+
*`--nv`: container can see and use available gpus.
46
+
*`-B /path/to/directory/on/host`: `B` flag is for binding directories from the host into the container. If your data is not visible by container, especially on HPC, you could use this flag to mount your data to container.
47
+
48
+
For example, I run [segmentation](https://github.com/hnguyentt/MouseCHD?tab=readme-ov-file#2-heart-segmentation) like this:
49
+
50
+
* On my local machine: `sapptainer exec --nv mousechd.sif mousechd segment -indir /home/hnguyent/DATA/images -outdir /home/hnguyent/DATA/HeartSeg`.
26
51
27
-
Append the prefix: `apptainer shell --nv mousechd.sif `
52
+
* On HPC, I append additional SLURM prefix to request for computational resources: `srun -J "mousechd" -p gpu --qos=gpu --gres=gpu:1 --cpus-per-task=2 --mem-per-cpu=250000 apptainer exec -B /mount_data --nv mousechd.sif DATA/zeus/hnguyent/images -outdir DATA/zeus/hnguyent/HeartSeg`. Here I need to use `-B` flag to make my data visible in container.
0 commit comments