Exemple #1
0
def PrepareWorkers(vms) -> None:
    if FLAGS.mpi_vendor == 'intel':
        intelmpi.NfsExportIntelDirectory(vms)
    else:
        for vm in vms:
            vm.Install('openmpi')
    nfs_service.NfsExportAndMount(vms, _RUN_DIR)
    _TestInstall(vms)
Exemple #2
0
def NfsExportIntelDirectory(vms) -> None:
    """NFS exports the /opt/intel from the headnode to the workers.

  Args:
    vms: List of VMs.  The first one is the headnode, the remainder will NFS
      mount the /opt/intel drive from the headnode.
  """
    nfs_service.NfsExportAndMount(vms, _INTEL_ROOT)
    # Still need to have clients ulimit and ptrace fixed
    vm_util.RunThreaded(FixEnvironment, vms[1:])
    TestInstall(vms)
    def testNfsExportAndMount(self):
        mock_nfs_create = self.enter_context(
            mock.patch.object(nfs_service, 'UnmanagedNfsService'))
        headnode = mock.Mock(internal_ip='10.0.1.11')
        vm1 = mock.Mock(user_name='perfkit')
        vm2 = mock.Mock(user_name='perfkit')

        nfs_service.NfsExportAndMount([headnode, vm1, vm2], '/client_path',
                                      '/server_path')

        mock_nfs_create.assert_called_with(None, headnode, False,
                                           '/server_path')
        mount_cmd = (
            'sudo mkdir -p /client_path; '
            'sudo chown perfkit /client_path; '
            'echo "10.0.1.11:/server_path /client_path nfs defaults 0 0\n" '
            '| sudo tee -a /etc/fstab; sudo mount -a')
        for vm in (vm1, vm2):
            vm.Install.assert_called_with('nfs_utils')
            vm.RemoteCommand.assert_called_with(mount_cmd)
def PrepareWorkers(vms) -> None:
    intelmpi.NfsExportIntelDirectory(vms)
    nfs_service.NfsExportAndMount(vms, _RUN_DIR)
    _TestInstall(vms)