Skip to content

Commit 946161a

Browse files
committed
minor cleanup
renamed: docs/hpc/04_datasets/squash_file_system_and_singularity.md -> docs/hpc/04_datasets/02_squash_file_system_and_singularity.md new file: docs/hpc/06_tools_and_software/01_intro.md renamed: docs/hpc/06_tools_and_software/conda_environments.md -> docs/hpc/06_tools_and_software/02_conda_environments.md new file: docs/hpc/07_containers/01_intro.md renamed: docs/hpc/07_containers/singularity_with_conda.md -> docs/hpc/07_containers/02_singularity_with_conda.md new file: docs/hpc/07_containers/03_squash_file_system_and_singularity.md renamed: docs/hpc/08_ood/open_on_demand.md -> docs/hpc/08_ood/01_open_on_demand.md modified: docs/hpc/09_tutorials/02_hpc_foundations.mdx
1 parent 842986e commit 946161a

File tree

8 files changed

+70
-4
lines changed

8 files changed

+70
-4
lines changed

docs/hpc/04_datasets/squash_file_system_and_singularity.md renamed to docs/hpc/04_datasets/02_squash_file_system_and_singularity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Squash File System and Singularity
22

3-
View available datasets on the [Datasets page](./datasets.md).
3+
View available datasets on the [Datasets page](../04_datasets/01_intro.md).
44

55
## Working with Datasets
66
Writable ext3 overlay images have conda environments installed inside, Singularity can work with squashFS for fixed datasets, such as the coco datasets.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Tools and Software

docs/hpc/06_tools_and_software/conda_environments.md renamed to docs/hpc/06_tools_and_software/02_conda_environments.md

File renamed without changes.

docs/hpc/07_containers/01_intro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Apptainer/Singularity

docs/hpc/07_containers/singularity_with_conda.md renamed to docs/hpc/07_containers/02_singularity_with_conda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ pip install tensorboard
287287
```
288288

289289
:::note
290-
[Click here](./conda_environments.md) for information on how to configure your conda environment.
290+
[Click here](../06_tools_and_software/02_conda_environments.md) for information on how to configure your conda environment.
291291
:::
292292

293293
Please also keep in mind that once the overlay image is opened in default read-write mode, the file will be locked. You will not be able to open it from a new process. Once the overlay is opened either in read-write or read-only mode, it cannot be opened in RW mode from other processes either. For production jobs to run, the overlay image should be open in read-only mode. You can run many jobs at the same time as long as they are run in read-only mode. In this ways, it will protect the computation software environment, software packages are not allowed to change when there are jobs running.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Squash File System and Singularity
2+
3+
View available datasets on the [Datasets page](../04_datasets/01_intro.md).
4+
5+
## Working with Datasets
6+
Writable ext3 overlay images have conda environments installed inside, Singularity can work with squashFS for fixed datasets, such as the coco datasets.
7+
8+
```sh
9+
/scratch/work/public/ml-datasets/coco/coco-2014.sqf
10+
/scratch/work/public/ml-datasets/coco/coco-2015.sqf
11+
/scratch/work/public/ml-datasets/coco/coco-2017.sqf
12+
13+
14+
singularity exec \
15+
--overlay /scratch/wang/zzz/pytorch1.8.0-cuda11.1.ext3:ro \
16+
--overlay /scratch/work/public/ml-datasets/coco/coco-2014.sqf:ro \
17+
--overlay /scratch/work/public/ml-datasets/coco/coco-2015.sqf:ro \
18+
--overlay /scratch/work/public/ml-datasets/coco/coco-2017.sqf:ro \
19+
/scratch/work/public/singularity/cuda11.1-cudnn8-devel-ubuntu18.04.sif /bin/bash
20+
```
21+
22+
If you have many tiny files as fixed datasets, please make squashFS files to work with Singularity. Here is an example
23+
24+
1. Make a temporary folder in /state/partition1, it is a folder in local hard drive on each computer node
25+
```sh
26+
mkdir -p /state/partition1/sw77
27+
cd /state/partition1/sw77
28+
```
29+
30+
2. Unzip files there, for example
31+
```sh
32+
tar -vxzf /scratch/work/public/examples/squashfs/imagenet-example.tar.gz
33+
```
34+
35+
3. Change access permissions in case we'll share files with others
36+
```sh
37+
find imagenet-example -type d -exec chmod 755 {} \;
38+
find imagenet-example -type f -exec chmod 644 {} \;
39+
```
40+
41+
4. Convert to a single squashFS file on host
42+
```sh
43+
mksquashfs imagenet-example imagenet-example.sqf -keep-as-directory
44+
```
45+
For more details on working with squashFS, please see [this page from the SquashFS documentation](http://www.iitk.ac.in/LDP/HOWTO/SquashFS-HOWTO/mksqoverview.html).
46+
47+
5. Copy this file to /scratch
48+
```sh
49+
cp -rp /state/partition1/sw77/imagenet-example.sqf /scratch/sw77/.
50+
```
51+
52+
6. To test, files are in /imagenet-example inside Singularity container
53+
```sh
54+
singularity exec --overlay /scratch/sw77/imagenet-example.sqf:ro /scratch/work/public/singularity/ubuntu-20.04.1.sif /bin/bash
55+
Singularity> find /imagenet-example | wc -l
56+
1303
57+
Singularity> find /state/partition1/sw77/imagenet-example | wc -l
58+
1303
59+
```
60+
61+
7. To delete the tempoary folder on host
62+
```sh
63+
rm -rf /state/partition1/sw77
64+
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cd /scratch/$USER/my_env
4343
cp -rp /scratch/work/public/overlay-fs-ext3/overlay-15GB-500K.ext3.gz .
4444
gunzip overlay-15GB-500K.ext3.gz
4545
```
46-
Above we used the overlay file "overlay-15GB-500K.ext3.gz" which will contain all of the installed packages. There are more optional overlay files. You can find instructions on the following pages: [Singularity with Conda](./singularity_with_conda.md), [Squash File System and Singularity](./squash_file_system_and_singularity.md).
46+
Above we used the overlay file "overlay-15GB-500K.ext3.gz" which will contain all of the installed packages. There are more optional overlay files. You can find instructions on the following pages: [Singularity with Conda](../07_containers/02_singularity_with_conda.md), [Squash File System and Singularity](../07_containers/03_squash_file_system_and_singularity.md).
4747

4848
### Launch Singularity Environment for Installation
4949
```sh

docs/hpc/09_tutorials/02_hpc_foundations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Similar to `/home`, users have access to multiple filesystems that are :
109109
| /scratch | /scratch/**Net_ID**/ | General Storage | $SCRATCH
110110
| /archive | /archive/**Net_ID**/ | Cold Storage | $ARCHIVE
111111

112-
You will find more details about these filesystems at [Greene Storage Types page](../06_spec_sheet.mdx).
112+
You will find more details about these filesystems at [Greene Storage Types page](../11_spec_sheet.mdx).
113113

114114
You can jump to your `/scratch` directory at `/scratch/Net_ID/` with the `cd` command as `cd /scratch/Net_ID`, Or you could simple use the `$SCRATCH` environment variable as:
115115

0 commit comments

Comments
 (0)