def extract_solr_tarball(solr_tarball_path, SOLR_VERSION): '''Extract the solr tarball to /usr/local and symlink it to /usr/local/solr''' print "\n*******************************" print "Extracting Solr" print "******************************* \n" with esg_bash2py.pushd("/usr/local"): esg_functions.extract_tarball(solr_tarball_path) os.remove(solr_tarball_path) esg_bash2py.symlink_force( "solr-{SOLR_VERSION}".format(SOLR_VERSION=SOLR_VERSION), "solr")
def install_mod_wsgi(): '''Have to ensure python is install properly with the shared library for mod_wsgi installation to work''' print "\n*******************************" print "Setting mod_wsgi" print "******************************* \n" pip.main(['install', "mod_wsgi==4.5.3"]) with esg_bash2py.pushd("/etc/httpd/modules"): #If installer running in a conda env if "conda" in find_executable("python"): esg_bash2py.symlink_force( "/usr/local/conda/envs/esgf-pub/lib/python2.7/site-packages/mod_wsgi/server/mod_wsgi-py27.so", "/etc/httpd/modules/mod_wsgi-py27.so") else: esg_bash2py.symlink_force( "/usr/local/lib/python2.7/site-packages/mod_wsgi/server/mod_wsgi-py27.so", "/etc/httpd/modules/mod_wsgi-py27.so")
def setup_java(): ''' Installs Oracle Java from rpm using yum localinstall. Does nothing if an acceptible Java install is found. ''' print "*******************************" print "Setting up Java {java_version}".format(java_version=config["java_version"]) print "******************************* \n" if force_install: pass if check_for_existing_java(): setup_java_answer = raw_input("Do you want to continue with Java installation and setup? [y/N]: ") or "N" if setup_java_answer.lower().strip() not in ["y", "yes"]: print "Skipping Java installation" return last_java_truststore_file = esg_functions.readlinkf(config["truststore_file"]) esg_bash2py.mkdir_p(config["workdir"]) with esg_bash2py.pushd(config["workdir"]): java_tarfile = esg_bash2py.trim_string_from_head(config["java_dist_url"]) jdk_directory = java_tarfile.split("-")[0] java_install_dir_parent = config["java_install_dir"].rsplit("/",1)[0] #Check for Java tar file if not os.path.isfile(java_tarfile): print "Don't see java distribution file {java_dist_file_path} either".format(java_dist_file_path=os.path.join(os.getcwd(),java_tarfile)) download_java(java_tarfile) print "Extracting Java tarfile", java_tarfile esg_functions.extract_tarball(java_tarfile, java_install_dir_parent) #Create symlink to Java install directory (/usr/local/java) esg_bash2py.symlink_force(os.path.join(java_install_dir_parent, jdk_directory), config["java_install_dir"]) os.chown(config["java_install_dir"], config["installer_uid"], config["installer_gid"]) #recursively change permissions esg_functions.change_permissions_recursive(config["java_install_dir"], config["installer_uid"], config["installer_gid"]) set_default_java() print check_java_version("java")
def create_symlink(TOMCAT_VERSION): esg_bash2py.symlink_force( "/usr/local/apache-tomcat-{TOMCAT_VERSION}".format( TOMCAT_VERSION=TOMCAT_VERSION), "/usr/local/tomcat")
def symlink_pg_binary(): '''Creates a symlink to the /usr/bin directory so that the publisher setup.py script can find the postgres version''' esg_bash2py.symlink_force("/usr/pgsql-9.6/bin/pg_config", "/usr/bin/pg_config")