def extract(self): """Extract Cassandra. Returns: Boolean: True if extraction was successful otherwise False. """ dir_path = "{}/apache-cassandra-{}".format(self.src_dir, self.version) file_path = dir_path + "-bin.tar.gz" if os.path.isdir(self.cassandra_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract Cassandra because "{}" could not be found.'. format(file_path)) return False logging.info("Extracting Cassandra.") extract.tar(file_path, self.src_dir) os.rename(dir_path, self.cassandra_dir) if os.path.isdir(self.cassandra_dir): return True return False
def extract(self): """Extract OpenSSL. Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}/openssl-{}.tar.gz".format(self.src_dir, self.version) if os.path.exists(self.openssl_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract OpenSSL because "{}" could not be found.'. format(file_path)) return False logging.info("Extracting OpenSSL.") extract.tar(file_path, self.src_dir) os.rename("{}-{}".format(self.openssl_dir, self.version), self.openssl_dir) if os.path.exists(self.openssl_dir): return True return False
def extract(self): """Extract BLIS. Returns: Boolean: True if extraction was successful otherwise False. """ dir_path = "{}/AMD-BLIS-Linux-{}".format(self.src_dir, self.version) file_path = dir_path + ".tar.gz" if os.path.isdir(self.blis_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract BLIS because "{}" could not be found.'.format( file_path)) return False logging.info("Extracting BLIS.") extract.tar(file_path, self.src_dir) extracted_name = self.src_dir + "/amd-blis-" + self.version.lower() os.rename(extracted_name, self.blis_dir) if os.path.isdir(self.blis_dir): return True return False
def extract(self): """Extract the Linux kernel. Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}/linux-{}.tar.gz".format(self.src_dir, self.version) if os.path.isdir(self.kernel_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract the Linux kernel because "{}" could not be ' "found.".format(file_path)) return False logging.info("Extracting the Linux kernel.") extract.tar(file_path, self.src_dir) os.rename("{}-{}".format(self.kernel_dir, self.version), self.kernel_dir) if os.path.isdir(self.kernel_dir): return True return False
def extract(self): """Extract MLC. Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}/mlc_v{}.tgz".format(self.src_dir, self.version) if os.path.isdir(self.mlc_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract MLC because "{}" could not be found.' " Please download it from: \n\n" "https://software.intel.com/en-us/articles/intelr-memory-latency-checker" .format( # nopep8 file_path)) return False logging.info("Extracting MLC.") os.makedirs(self.mlc_dir, exist_ok=True) extract.tar(file_path, self.mlc_dir) if os.path.isdir(self.mlc_dir): return True return False
def extract(self): """Extract Docker. Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}/docker-{}-ce.tgz".format(self.src_dir, self.version) if os.path.isdir(self.docker_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract Docker because "{}" could not be found.'. format(file_path)) return False logging.info("Extracting Docker.") extract.tar(file_path, self.src_dir) # No rename necessary if os.path.isdir(self.docker_dir): return True return False
def extract(self): """Extract High-Performance Linpack (HPL). Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}-{}.tar.gz".format(self.hpl_dir, self.version) if os.path.exists(self.hpl_dir): return True if not os.path.isfile(file_path): text = 'Cannot extract HPL because "{}" could not be ' "found.".format( file_path) prettify.error_message(text) logging.error(text) return False logging.info("Extracting High-Performance Linpack.") extract.tar(file_path, self.src_dir) os.rename("{}-{}".format(self.hpl_dir, self.version), self.hpl_dir) if os.path.exists(self.hpl_dir): return True return False
def extract(self): """Extract MySQL. Returns: Boolean: True if extraction was successful otherwise False. """ dir_path = "{}/mysql-{}-linux-glibc{}-x86_64".format( self.src_dir, self.mysql_ver, self.glibc_ver) file_path = dir_path + ".tar.gz" if os.path.isdir(self.mysql_dir): return True if not os.path.isfile(file_path): prettify.error_message( 'Cannot extract MySQL because "{}" could not be found.'.format( file_path)) return False logging.info("Extracting MySQL.") extract.tar(file_path, self.src_dir) os.rename(dir_path, self.mysql_dir) if os.path.isdir(self.mysql_dir): return True return False
def extract(self): """Extract LMbench. Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}/lmbench{}.tar.gz".format(self.src_dir, self.version) if os.path.isdir(self.lmbench_dir): return True logging.info("Extracting LMbench.") extract.tar(file_path, self.src_dir) os.rename(self.lmbench_dir + self.version, self.lmbench_dir) if os.path.isdir(self.lmbench_dir): return True return False
def extract(self): """Extract YCSB. Returns: Boolean: True if extraction was successful otherwise False. """ ycsb_archive_path = "{}/ycsb-{}.tar.gz".format(self.src_dir, self.version) jconnect_dir = "{}/mysql-connector-java-{}".format( self.src_dir, self.jconnect_ver) jconnect_archive_path = jconnect_dir + ".tar.gz" jconn_final = self.src_dir + "/mysql-connector-java" if not os.path.isfile(ycsb_archive_path): prettify.error_message( 'Cannot extract YCSB because "{}" could not be found.'.format( ycsb_archive_path)) return False if not os.path.isfile(jconnect_archive_path): prettify.error_message( 'Cannot extract MySQL J Connector because "{}" could not be' " found.".format(jconnect_archive_path)) return False if not os.path.isdir(self.ycsb_dir): logging.info("Extracting YCSB.") extract.tar(ycsb_archive_path, self.src_dir) os.rename("{}/ycsb-{}".format(self.src_dir, self.version), self.ycsb_dir) logging.info("Extracting YCSB Complete.") if not os.path.isdir(jconn_final): logging.info("Extracting MySQL J Connector.") extract.tar(jconnect_archive_path, self.src_dir) os.rename(jconnect_dir, jconn_final) logging.info("Extracting MySQL J Connector Complete.") if os.path.isdir(self.ycsb_dir) and os.path.isdir(jconn_final): return True return False
def extract(self): """Extract zlib. Returns: Boolean: True if extraction was successful otherwise False. """ file_path = "{}/zlib-{}.tar.gz".format(self.src_dir, self.version) if os.path.isdir(self.zlib_dir): logging.debug('"%s" exists, exiting early.', self.zlib_dir) return True if not os.path.isfile(file_path): prettify.error_message('Cannot extract zlib because "{}" could ' "not be found.".format(file_path)) return False logging.info("Extracting zlib.") extract.tar(file_path, self.src_dir) logging.debug('Renaming "%s-%s" to "%s".', self.zlib_dir, self.version, self.zlib_dir) os.rename("{}-{}".format(self.zlib_dir, self.version), self.zlib_dir)