schrodinger.utils.installation_check module¶
- schrodinger.utils.installation_check.get_distro_package() str ¶
Returns the distro package to use for package requirements check handling the special case for distros.
- schrodinger.utils.installation_check.ensure_logfile(output_dir=None)¶
Context manager for adding a logfile to LOGGERS. Ensures that multiple nested entries into the context manager only add one logfile.
- schrodinger.utils.installation_check.main() int ¶
Run installation check.
- Returns
exit code
- schrodinger.utils.installation_check.cd(path)¶
- schrodinger.utils.installation_check.get_host_entries(args)¶
Get all the host entries (jobcontrol.Host objects) from the hosts file. If no -test arguments were given, return them all. If -test arguments were given, return entries whose names are given by those arguments and which are present in the hosts file (warn on absent ones)
- schrodinger.utils.installation_check.run_test_jobs(entries, launch_dir='.', duration=10, timeout=None)¶
Run testapp jobs using a list of host entries (jobcontrol.Host objects). Return a list of all jobids, succeeded and failed, that were run
- schrodinger.utils.installation_check.get_postmortem_command(jobids: List[str]) List[str] ¶
Return correct postmortem command.
- schrodinger.utils.installation_check.run_postmortem(jobids)¶
Run postmortem for a given set of jobids, log the results into the “postmortem.log”
- schrodinger.utils.installation_check.https_session(max_retries=5)¶
- schrodinger.utils.installation_check.download_linux_packages_requirement(sess: requests.sessions.Session, file_to_download: str) str ¶
Download the given file using the given requests session to a temporary location and return the path.
- schrodinger.utils.installation_check.env_update_and_run(cmd: List) subprocess.CompletedProcess ¶
Run bash script in an isolated environment.
- schrodinger.utils.installation_check.test_deps()¶
Determine if we have required packages to satisfy the suite dependencies.
If test fails, raises RuntimeError with suggestion on how to fix.
- schrodinger.utils.installation_check.get_installation_check_commands()¶
- Returns a map of diagnostic commands with:
key: command description value: args list
- schrodinger.utils.installation_check.run_installation_check(output_dir='.')¶
Runs diagnostic commands and writes output in the directory specified. Note: licadmin will write the license - info file in the current directory, not in output_dir. We may want to remove the output_dir argument and leave it to the caller to cd to the correct directory
- schrodinger.utils.installation_check.print_installation_check(output_file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)¶
Runs diagnostic commands and writes output to the single file specified. This will not run licadmin to avoid generating any extraneous files.
- schrodinger.utils.installation_check.queue_inst_file(queue_name, filename)¶
- schrodinger.utils.installation_check.queue_orig_dir(queue_name)¶
- schrodinger.utils.installation_check.queue_orig_file(queue_name, filename)¶
- schrodinger.utils.installation_check.queue_config_diffs()¶
Return a collection of diffs of config and template queue files (original version from the installation vs what’s in the user’s queues dir)
- schrodinger.utils.installation_check.queue_config_file_pairs()¶
Return a list of pairs of config/template queue files to be compared, and a list of warnings. A pair is one file from the user’s installation and the original version of the same file (from the ‘orig’ subdirectory). A warning is produced whenever the ‘orig’ subdirectory is not found, or when a user’s or original file that should be present, is not.
- schrodinger.utils.installation_check.queue_config_files_diff(inst_filepath, orig_filepath)¶
Return a diff (list of strings) of two config/template queue files
- schrodinger.utils.installation_check.log_banner(logger)¶
Log the basic information.
- schrodinger.utils.installation_check.check_running_as_root(logger)¶
Produce a warning if we are running as root.
- schrodinger.utils.installation_check.parse_args(args=None)¶
Parse cmdline arguments.
- class schrodinger.utils.installation_check.TestJobDJ(entries, basedir=None, *args, **kwargs)¶
Bases:
schrodinger.job.queue.JobDJ
A flavor of JobDJ that takes a list of host entries (jobcontrol.Host objects) and lets the caller schedule exactly one job per entry.
Create an instance of this class, add the jobs, and call run().
- __init__(entries, basedir=None, *args, **kwargs)¶
Constructor.
- Parameters
hosts – A list of hosts to run on. Items of the list can be a (<hostname>, <maximum_concurrent_subjobs>) tuple that gives a host name and the maximum number of processors that can be used on that host. Or, items of the list can be a
ResourceHost
object that provides a detailed listing of the number of processors on each host that can be used for jobs requesting specific resources. The list can mix tuple andResourceHost
items. If a host appears more than once (whether as a tuple orResourceHost
), the information in the multiple entries is added together. Processors in the tuple form are only considered usable by jobs that have resource_requirement=None (The default state for jobs). The default value of None for this parameter means the host information is determined automatically from the command line and is usually desired.local – No longer functional in JOB_SERVER.
max_retries – Number of allowed retries per subjob. If this is set, it is never overridden by the
SCHRODINGER_MAX_RETRIES
environment variable. If it is not set, the value in default_max_retries is used, andSCHRODINGER_MAX_RETRIES
is allowed to override. If you wish to disable restarting altogether, set this value to zero.default_max_retries – Number of allowed retries per subjob. This value can always be overridden by the
SCHRODINGER_MAX_RETRIES
environment variable. Default is zero.max_failures – Total number of allowed subjob failures before
JobDJ
exits. If it is not defined, a default of zero will be used (exit on any failure after attempting to restart), but this can be overridden with theSCHRODINGER_MAX_FAILURES
environment variable. To allow an unlimited number of subjob failures, set max_failures to the module level NOLIMIT constant.verbosity – There are three allowed verbosity levels: “quiet” - only warnings and errors are printed; “normal” -
JobDJ
progress is printed; and “verbose” - additional debugging info is printed. Default is “quiet”.job_class – The class to use as the default job constructor when the
addJob
argument is not aBaseJob
instance.update_delay – The number of seconds to wait between job control database reads for
JobControlJob
jobs. (This delay is for an individual job, not for any job database read.) Default is None, which causes the module level constant UPDATE_DELAY to be used.smart_dist_resources – Custom resources that the localhost provides for smart distribution. Jobs that require a custom resource that is not included in this list will not be run on the localhost even if smart distribution is turned on. This information is unused if smart distribution is off. Each item of the list is a string that defines a custom resource.
- Raises
HostTypeError – if the host argument or one of its items is of the wrong type
- basedir()¶
- entryByName(name)¶
- completedJobids()¶
The jobids of all jobs that have completed (with success or failure)
- class schrodinger.utils.installation_check.TestJob(command_dir=None, duration=10, timeout=None)¶
Bases:
schrodinger.job.queue.JobControlJob
A flavor of JobControlJob to be used with TestJobDJ. Its command line will be determined when run() is called on it, by setup(); the job will get named after the host entry that it gets to run on.
- __init__(command_dir=None, duration=10, timeout=None)¶
- Parameters
command_dir (str) – The launch directory of the job
duration (int) – The duration of the (testapp) job
timeout (int) – Timeout (in seconds) after which the job will be killed. If None, the job is allowed to run indefinitely.
- doCommand(host, *args, **kwargs)¶
Launch job on specified
host
using jobcontrol.launch_job().- Parameters
host – Host on which the job will be executed.
local – Removed in JOB_SERVER.
- run(host, *args, **kwargs)¶
Run the job.
- The steps taken are as follows:
Execute the preCommand method for things like changing the working directory.
Call the doCommand to do the actual work of computation or job launching.
Call the postCommand method to undo the changes from the preCommand that need to be undone.
- formCommand(entry)¶
Generate a command line appropriate for a given host entry
- schrodinger.utils.installation_check.find_user_libstdcpp()¶
Returns path to system libstdc++.so.6 (or default libstdc++.so.6 before SCHRODINGER environment was found.
- schrodinger.utils.installation_check.get_libstdcpp_version(library)¶
Returns GLIBCXX minor version from a given library.
- Parameters
library (str) – pathname to a libstdc++.so.6
- schrodinger.utils.installation_check.get_bundled_libstdcpp()¶