def remoteCleanUp(cluster_info, host_config): srcipt = "cleanup.sh" src_local = "./" dst_remote = "/home/{0}".format(host_config["username"]) if pai_common.sftp_paramiko(src_local, dst_remote, srcipt, host_config) == False: return commandline = "sudo sh cleanup.sh" if pai_common.ssh_shell_paramiko(host_config, commandline) == False: return
def remoteBootstrap(cluster_info, host_config): # sftp your script to remote host with paramiko. srcipt_package = "kubernetes.tar" src_local = "template/generated/{0}".format(host_config["hostip"]) dst_remote = "/home/{0}".format(host_config["username"]) if pai_common.sftp_paramiko(src_local, dst_remote, srcipt_package, host_config) == False: return commandline = "tar -xvf kubernetes.tar && sudo ./src/start.sh {0}:8080 {1} {2}".format(cluster_info['api-servers-ip'], host_config['username'], host_config['hostip']) if pai_common.ssh_shell_paramiko(host_config, commandline) == False: return