2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/22e18808fc58/ Changeset: 22e18808fc58 User: Dave Bouvier Date: 2013-06-24 21:41:59 Summary: Add support for optionally extracting a file downloaded with the download_file tool dependency action. Add a change_directory action. Affected #: 3 files diff -r 69797172b07930e2751dd2fe7a6e317f1e68a769 -r 22e18808fc582fba8ae3d71c8f9556792354c1be lib/tool_shed/galaxy_install/tool_dependencies/common_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py @@ -216,7 +216,7 @@ return os.path.abspath( file_path ) raise ValueError( 'Could not find path to file %s' % os.path.abspath( os.path.join( file_path, file_name ) ) ) -def url_download( install_dir, downloaded_file_name, download_url ): +def url_download( install_dir, downloaded_file_name, download_url, extract=True ): file_path = os.path.join( install_dir, downloaded_file_name ) src = None dst = None @@ -236,7 +236,22 @@ src.close() if dst: dst.close() - return os.path.abspath( file_path ) + if extract: + if istar( file_path ): + # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2</action> + extract_tar( file_path, install_dir ) + dir = tar_extraction_directory( install_dir, file_path ) + elif isjar( file_path ): + dir = os.path.curdir + elif iszip( file_path ): + # <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-tools-1.56.zip</action> + zip_archive_extracted = extract_zip( file_path, install_dir ) + dir = zip_extraction_directory( install_dir, file_path ) + else: + dir = install_dir + else: + dir = install_dir + return dir def zip_extraction_directory( file_path, file_name ): """Try to return the correct extraction directory.""" diff -r 69797172b07930e2751dd2fe7a6e317f1e68a769 -r 22e18808fc582fba8ae3d71c8f9556792354c1be lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -180,19 +180,7 @@ downloaded_filename = action_dict[ 'target_filename' ] else: downloaded_filename = os.path.split( url )[ -1 ] - downloaded_file_path = common_util.url_download( work_dir, downloaded_filename, url ) - if common_util.istar( downloaded_file_path ): - # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2</action> - common_util.extract_tar( downloaded_file_path, work_dir ) - dir = common_util.tar_extraction_directory( work_dir, downloaded_filename ) - elif common_util.isjar( downloaded_file_path ): - dir = os.path.curdir - elif common_util.iszip( downloaded_file_path ): - # <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-tools-1.56.zip</action> - zip_archive_extracted = common_util.extract_zip( downloaded_file_path, work_dir ) - dir = common_util.zip_extraction_directory( work_dir, downloaded_filename ) - else: - dir = os.path.curdir + dir = common_util.url_download( work_dir, downloaded_filename, url, extract=True ) elif action_type == 'shell_command': # <action type="shell_command">git clone --recursive git://github.com/ekg/freebayes.git</action> # Eliminate the shell_command clone action so remaining actions can be processed correctly. @@ -227,10 +215,10 @@ if not os.path.exists( full_path_to_dir ): os.makedirs( full_path_to_dir ) # The package has been down-loaded, so we can now perform all of the actions defined for building it. - with lcd( dir ): - for action_tup in filtered_actions: + for action_tup in filtered_actions: + current_dir = os.path.abspath( os.path.join( work_dir, dir ) ) + with lcd( current_dir ): action_type, action_dict = action_tup - current_dir = os.path.abspath( os.path.join( work_dir, dir ) ) if action_type == 'make_directory': common_util.make_directory( full_path=action_dict[ 'full_path' ] ) elif action_type == 'move_directory_files': @@ -316,13 +304,21 @@ if return_code: return elif action_type == 'download_file': - # Download a single file to the current directory. + # Download a single file to the current working directory. url = action_dict[ 'url' ] - if action_dict[ 'target_filename' ]: + if 'target_filename' in action_dict: filename = action_dict[ 'target_filename' ] else: filename = url.split( '/' )[ -1 ] - common_util.url_download( current_dir, filename, url ) + extract = action_dict.get( 'extract', False ) + common_util.url_download( current_dir, filename, url, extract=extract ) + elif action_type == 'change_directory': + target_directory = os.path.realpath( os.path.join( current_dir, dir, action_dict[ 'directory' ] ) ) + current_working_dir = os.path.realpath( dir ) + if target_directory.startswith( current_working_dir ) and os.path.exists( target_directory ): + dir = target_directory + else: + log.error( 'Invalid or nonexistent directory %s specified, ignoring change_directory action.', target_directory ) def log_results( command, fabric_AttributeString, file_path ): """ diff -r 69797172b07930e2751dd2fe7a6e317f1e68a769 -r 22e18808fc582fba8ae3d71c8f9556792354c1be lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -13,6 +13,7 @@ from tool_shed.util import xml_util from galaxy.model.orm import and_ from galaxy.web import url_for +from galaxy.util import asbool log = logging.getLogger( __name__ ) @@ -390,15 +391,19 @@ # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2</action> if action_elem.text: action_dict[ 'url' ] = action_elem.text - if 'target_filename' in action_elem.attrib: - action_dict[ 'target_filename' ] = action_elem.attrib[ 'target_filename' ] + target_filename = action_elem.get( 'target_filename', None ) + if target_filename: + action_dict[ 'target_filename' ] = target_filename else: continue elif action_type == 'download_file': # <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action> if action_elem.text: action_dict[ 'url' ] = action_elem.text - action_dict[ 'target_filename' ] = action_elem.attrib.get( 'target_filename', None ) + target_filename = action_elem.get( 'target_filename', None ) + if target_filename: + action_dict[ 'target_filename' ] = target_filename + action_dict[ 'extract' ] = asbool( action_elem.get( 'extract', False ) ) else: continue elif action_type == 'make_directory': @@ -407,6 +412,12 @@ action_dict[ 'full_path' ] = evaluate_template( action_elem.text ) else: continue + elif action_type == 'change_directory': + # <action type="change_directory">PHYLIP-3.6b</action> + if action_elem.text: + action_dict[ 'directory' ] = action_elem.text + else: + continue elif action_type in [ 'move_directory_files', 'move_file' ]: # <action type="move_file"> # <source>misc/some_file</source> https://bitbucket.org/galaxy/galaxy-central/commits/b16265a28cfc/ Changeset: b16265a28cfc User: Dave Bouvier Date: 2013-06-24 21:43:14 Summary: Add the threadpool_kill_thread_limit option to universe_wsgi.ini.sample. Affected #: 1 file diff -r 22e18808fc582fba8ae3d71c8f9556792354c1be -r b16265a28cfce30b5678dad9551f08bfdc538ad3 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -40,6 +40,9 @@ # Number of threads in the web server thread pool. #threadpool_workers = 10 +# Set the number of seconds a thread can work before you should kill it (assuming it will never finish) to 3 hours. +threadpool_kill_thread_limit = 10800 + # ---- Filters -------------------------------------------------------------- # Filters sit between Galaxy and the HTTP server. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.