def copy_compiled_source(head_node, temp_path): #copies from temp to head node source os.system("tar -czvf ./source.tar.gz -C " + temp_path + " .") h_add = head_node.address h_user = head_node.username helper.copy_file_to_remote(h_add, h_user,"source.tar.gz", head_node.path.source) tar_command = "tar -C " + head_node.path.source + " -xzvf " + head_node.path.source + "/source.tar.gz" helper.run_command(h_add, h_user, tar_command) helper.run_command(h_add, h_user, "rm " + head_node.path.source + "/source.tar.gz") os.system("rm ./source.tar.gz") print "Source Copied To HeadNode" return
def fill_gofs_bin(head_node, machine_list, goffish_relative_path): headnode_source_path = head_node.path.source gofs_zip_path = headnode_source_path + goffish_relative_path +'gofs/code/modules/gofs-distribution/target/gofs-bin.zip' helper.copy_file_from_remote(head_node.address, head_node.username, gofs_zip_path, 'gofs-bin.zip') for m in machine_list: remote_path = m.path.bin + '/gofs-bin' helper.copy_file_to_remote(m.address, m.username, 'gofs-bin.zip', remote_path) helper.run_command(m.address, m.username, "unzip " + remote_path + '/gofs-bin.zip' + " -d " + remote_path) helper.run_command(m.address, m.username, "rm "+ remote_path + '/gofs-bin.zip') helper.run_command(m.address, m.username, "cp -r " + remote_path +'/gofs/* '+remote_path +'/') helper.run_command(m.address, m.username, "chmod 777 "+ remote_path + '/*') helper.run_command(m.address, m.username, "rm -r "+ remote_path + '/gofs') return
def fill_gopher_bin(head_node, machine_list, goffish_relative_path): headnode_source_path = head_node.path.source gopher_server_zip_path = headnode_source_path + goffish_relative_path +'gopher/code/modules/deployment/server/target/gopher-server-bin.zip' helper.copy_file_from_remote(head_node.address, head_node.username, gopher_server_zip_path, 'gopher-server-bin.zip') for m in machine_list: remote_path = m.path.bin + '/gopher-bin' helper.copy_file_to_remote(m.address, m.username, 'gopher-server-bin.zip', remote_path) helper.run_command(m.address, m.username, "unzip " + remote_path + '/gopher-server-bin.zip' + " -d " + remote_path) helper.run_command(m.address, m.username, "rm "+ remote_path + '/gopher-server-bin.zip') gopher_bin_zip_path = headnode_source_path + goffish_relative_path +'gopher/code/modules/deployment/client/target/gopher-client-bin.zip' helper.copy_file_from_remote(head_node.address, head_node.username, gopher_bin_zip_path, 'gopher-client-bin.zip') for m in machine_list: remote_path = m.path.bin + '/gopher-bin' helper.copy_file_to_remote(m.address, m.username, 'gopher-client-bin.zip', remote_path) helper.run_command(m.address, m.username, "unzip " + remote_path + '/gopher-client-bin.zip' + " -d " + remote_path) helper.run_command(m.address, m.username, "rm "+ remote_path + '/gopher-client-bin.zip') return