def get_shm_volumes():
volumes, volume_mounts = [], []<EOL>shm_volume = client.V1Volume(<EOL>name=constants.SHM_VOLUME,<EOL>empty_dir=client.V1EmptyDirVolumeSource(medium='<STR_LIT>')<EOL>)<EOL>volumes.append(shm_volume)<EOL>shm_volume_mount = client.V1VolumeMount(name=shm_volume.name, mount_path='<STR_LIT>')<EOL>volume_mounts.append(shm_volume_mount)<EOL>return volumes, volume_mounts<EOL>
Mount an tmpfs volume to /dev/shm.
This will set /dev/shm size to half of the RAM of node.
By default, /dev/shm is very small, only 64MB.
Some experiments will fail due to lack of share memory,
such as some experiments running on Pytorch.