| 1 | = Storage |
| 2 | |
| 3 | == Local Disks |
| 4 | |
| 5 | By default, each server node is attached with a fixed amount of local disk space under '''"/dev/sda"'''. You can check the total amount of disk space by running: |
| 6 | |
| 7 | {{{#!shell-session |
| 8 | root@NODE:~# lsblk |
| 9 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS |
| 10 | sda 8:0 0 446.6G 0 disk |
| 11 | |-sda1 8:1 0 150G 0 part / |
| 12 | `-sda2 8:2 0 250G 0 part /mnt/sda2 |
| 13 | }}} |
| 14 | |
| 15 | Per different setups of each disk image, the size of actual mounted disk space under '''"/dev/sda1"''' may vary. You can mount extra disk space (if available) to any mount points under the file system of your server node using '''fdisk''' command: |
| 16 | |
| 17 | {{{#!shell-session |
| 18 | root@NODE:~# fdisk /dev/sda |
| 19 | |
| 20 | Welcome to fdisk (util-linux 2.37.2). |
| 21 | Changes will remain in memory only, until you decide to write them. |
| 22 | Be careful before using the write command. |
| 23 | |
| 24 | Command (m for help): ... |
| 25 | }}} |
| 26 | |
| 27 | == NFS Mounting |
| 28 | |
| 29 | Since local storage space is limited, large files (e.g. datasets and trained models) are better kept remotely. This can be done efficiently with the help of '''Network File System (NFS)''', which allows you to mount remote directories and do read/write as if they are local directories. |
| 30 | |
| 31 | Below are two common use cases of NFS. |
| 32 | |
| 33 | === COSMOS Storage |
| 34 | |
| 35 | The easiest way is to use the storage spaces provided by the COSMOS ecosystem: '''"cosmos_data"''' and '''"datasets"'''. |
| 36 | |
| 37 | To mount these, |
| 38 | |
| 39 | 1. Install [https://packages.ubuntu.com/focal/net/nfs-common nfs-common]: |
| 40 | {{{#!shell-session |
| 41 | apt-get update |
| 42 | apt-get install nfs-common |
| 43 | }}} |
| 44 | |
| 45 | 2. Open '''"/etc/fstab"''' and '''__append__''' (NOT overwrite with) the following lines: |
| 46 | {{{#!shell-session |
| 47 | 10.0.0.41:/datasets /mnt/datasets nfs sec=sys,nfsvers=4.1,rw,defaults 0 0 |
| 48 | 10.108.0.21:/cosmos_data /mnt/cosmos_data nfs sec=sys,nfsvers=4.1,rw,defaults 0 0 |
| 49 | }}} |
| 50 | |
| 51 | 3. Create mounting points under your local file system: |
| 52 | {{{#!shell-session |
| 53 | mkdir /mnt/datasets |
| 54 | mkdir /mnt/cosmos_data |
| 55 | }}} |
| 56 | |
| 57 | 4. Mount the NFS: |
| 58 | {{{#!shell-session |
| 59 | mount -a |
| 60 | }}} |
| 61 | |
| 62 | 5. Check the mounted NFS storage space using '''df -h''' command: |
| 63 | {{{#!shell-session |
| 64 | root@NODE:~# df -h |
| 65 | Filesystem Size Used Avail Use% Mounted on |
| 66 | /dev/sda1 148G 108G 33G 77% / |
| 67 | /dev/sda2 246G 246G 0 100% /mnt/sda2 |
| 68 | tmpfs 95G 65M 94G 1% /dev/shm |
| 69 | 10.108.0.21:/cosmos_data 5.1T 931G 4.1T 19% /mnt/cosmos_data |
| 70 | 10.0.0.41:/datasets 2.1T 284G 1.8T 14% /mnt/datasets |
| 71 | }}} |
| 72 | |
| 73 | === Google Cloud Buckets |
| 74 | |
| 75 | Apart from native COSMOS storage, you may also mount external NFS like Google Cloud buckets. |
| 76 | |
| 77 | To do so, |
| 78 | |
| 79 | 1. Prepare an alive project and a GCS bucket |
| 80 | 2. Install Google Cloud CLI and GCSFuse |
| 81 | 3. In your console, login to your GCP account and configure the project |
| 82 | 4. Create mounting point and mount the bucket |
| 83 | |
| 84 | Find and follow detailed instructions in [https://cloud.google.com/storage/docs/gcsfuse-quickstart-mount-bucket here]. |
| 85 | |