help="unretrieve the simulations with these ID's") parser.add_argument( "--keep", action="store_true", help= "add this option to make sure the output is kept remotely after a subsequent retrieve attempt" ) # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # Create the remote execution environment remote = Remote() remote.setup(arguments.remote) for path in fs.files_in_path(fs.cwd(), extension="sim"): # Create simulation sim = RemoteSimulation.from_file(path) if not sim.retrieved: continue local_output_path = sim.output_path remote_simulation_path = sim.remote_simulation_path remote_output_path = sim.remote_output_path remote_input_path = sim.remote_input_path if not remote.is_directory(remote_simulation_path):
definition.add_required("remote", str, "the remote host ID") # Add flags definition.add_flag("versions", "compare versions", "v") # Get configuration reader = ConfigurationReader("compare_python_packages") config = reader.read(definition) # ----------------------------------------------------------------- # Create the remote execution environment remote = Remote() # Log in remote.setup(config.remote) # Get all python packages installed on the remote host remote_packages = remote.installed_python_packages # Get local python package version local_packages = introspection.installed_python_packages() # Loop over all python packages necessary for PTS for dependency in introspection.get_all_dependencies(): # Skip standard modules if introspection.is_std_lib(dependency): continue # Check present and version locally if dependency in local_packages:
log.start("Starting get_poisson_errors ...") # ----------------------------------------------------------------- temp_name = time.unique_name(config.band.replace(" ", "")) # ----------------------------------------------------------------- # Remotely if config.remote is not None: # Create the remote remote = Remote() # Setup the remote remote.setup(config.remote) # Remove specification of the remote arguments_no_remote = arguments[:-2] # Make a new temporary directory remotely remote_path = fs.join(remote.home_directory, temp_name) remote.create_directory(remote_path) remote.change_cwd(remote_path) # Send the appropriate command remote.launch_pts_command("get_poisson_errors", arguments_no_remote) # Retrieve the remote directory remote.download(remote_path, fs.cwd(), show_output=True) local_path = fs.join(fs.cwd(), fs.name(remote_path))
# ----------------------------------------------------------------- # Create the command-line parser parser = argparse.ArgumentParser() parser.add_argument("remote", nargs='?', default=None, help="the name of the remote host to connect to") parser.add_argument("ids", type=parsing.simulation_ids, help="unretrieve the simulations with these ID's") parser.add_argument("--keep", action="store_true", help="add this option to make sure the output is kept remotely after a subsequent retrieve attempt") # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # Create the remote execution environment remote = Remote() remote.setup(arguments.remote) for path in fs.files_in_path(fs.cwd(), extension="sim"): # Create simulation sim = RemoteSimulation.from_file(path) if not sim.retrieved: continue local_output_path = sim.output_path remote_simulation_path = sim.remote_simulation_path remote_output_path = sim.remote_output_path remote_input_path = sim.remote_input_path if not remote.is_directory(remote_simulation_path): remote.create_directory(remote_simulation_path)