mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_16.04' into dev
Conflicts: test/unit/tools/test_select_parameters.py
This commit is contained in:
@@ -22,6 +22,8 @@ log = logging.getLogger( __name__ )
|
||||
|
||||
__all__ = [ 'DRMAAJobRunner' ]
|
||||
|
||||
RETRY_EXCEPTIONS_LOWER = frozenset(['invalidjobexception', 'internalexception'])
|
||||
|
||||
|
||||
class DRMAAJobRunner( AsynchronousJobRunner ):
|
||||
"""
|
||||
@@ -34,12 +36,11 @@ class DRMAAJobRunner( AsynchronousJobRunner ):
|
||||
"""Start the job runner"""
|
||||
global drmaa
|
||||
|
||||
runner_param_specs = dict(
|
||||
drmaa_library_path=dict( map=str, default=os.environ.get( 'DRMAA_LIBRARY_PATH', None ) ),
|
||||
invalidjobexception_state=dict( map=str, valid=lambda x: x in ( model.Job.states.OK, model.Job.states.ERROR ), default=model.Job.states.OK ),
|
||||
invalidjobexception_retries=dict( map=int, valid=lambda x: int >= 0, default=0 ),
|
||||
internalexception_state=dict( map=str, valid=lambda x: x in ( model.Job.states.OK, model.Job.states.ERROR ), default=model.Job.states.OK ),
|
||||
internalexception_retries=dict( map=int, valid=lambda x: int >= 0, default=0 ) )
|
||||
runner_param_specs = {
|
||||
'drmaa_library_path': dict( map=str, default=os.environ.get( 'DRMAA_LIBRARY_PATH', None ) ) }
|
||||
for retry_exception in RETRY_EXCEPTIONS_LOWER:
|
||||
runner_param_specs[retry_exception + '_state'] = dict( map=str, valid=lambda x: x in ( model.Job.states.OK, model.Job.states.ERROR ), default=model.Job.states.OK )
|
||||
runner_param_specs[retry_exception + '_retries'] = dict( map=int, valid=lambda x: int >= 0, default=0 )
|
||||
|
||||
if 'runner_param_specs' not in kwargs:
|
||||
kwargs[ 'runner_param_specs' ] = dict()
|
||||
@@ -248,12 +249,15 @@ class DRMAAJobRunner( AsynchronousJobRunner ):
|
||||
try:
|
||||
assert external_job_id not in ( None, 'None' ), '(%s/%s) Invalid job id' % ( galaxy_id_tag, external_job_id )
|
||||
state = self.ds.job_status( external_job_id )
|
||||
# Reset exception retries
|
||||
for retry_exception in RETRY_EXCEPTIONS_LOWER:
|
||||
setattr( ajs, retry_exception + '_retries', 0)
|
||||
except ( drmaa.InternalException, drmaa.InvalidJobException ) as e:
|
||||
ecn = type(e).__name__
|
||||
retry_param = ecn.lower() + '_retries'
|
||||
state_param = ecn.lower() + '_state'
|
||||
retries = getattr( ajs, retry_param, 0 )
|
||||
log.warning("(%s/%s) unable to check job status because of %s exception for %d tries: %s", galaxy_id_tag, external_job_id, ecn, retries + 1, e)
|
||||
log.warning("(%s/%s) unable to check job status because of %s exception for %d consecutive tries: %s", galaxy_id_tag, external_job_id, ecn, retries + 1, e)
|
||||
if self.runner_params[ retry_param ] > 0:
|
||||
if retries < self.runner_params[ retry_param ]:
|
||||
# will retry check on next iteration
|
||||
|
||||
@@ -20,7 +20,7 @@ EXTRA_CONFIG_KWDS = {
|
||||
'conda_prefix': None,
|
||||
'conda_exec': None,
|
||||
'conda_debug': None,
|
||||
'conda_ensure_channels': 'r,bioconda',
|
||||
'conda_ensure_channels': 'r,bioconda,iuc',
|
||||
'conda_auto_install': False,
|
||||
'conda_auto_init': False,
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ from ..conda_util import (
|
||||
|
||||
DEFAULT_BASE_PATH_DIRECTORY = "_conda"
|
||||
DEFAULT_CONDARC_OVERRIDE = "_condarc"
|
||||
DEFAULT_ENSURE_CHANNELS = "r,bioconda"
|
||||
DEFAULT_ENSURE_CHANNELS = "r,bioconda,iuc"
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -899,7 +899,12 @@ class SelectToolParameter( ToolParameter ):
|
||||
|
||||
def from_json( self, value, trans, other_values={} ):
|
||||
legal_values = self.get_legal_values( trans, other_values )
|
||||
if len(list(legal_values)) == 0 and trans.workflow_building_mode:
|
||||
workflow_building_mode = trans.workflow_building_mode
|
||||
for context_value in other_values.itervalues():
|
||||
if isinstance( context_value, RuntimeValue ):
|
||||
workflow_building_mode = True
|
||||
break
|
||||
if len( list( legal_values ) ) == 0 and workflow_building_mode:
|
||||
if self.multiple:
|
||||
# While it is generally allowed that a select value can be '',
|
||||
# we do not allow this to be the case in a dynamically
|
||||
|
||||
@@ -516,8 +516,14 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix
|
||||
@web.require_login( "use Galaxy workflows" )
|
||||
def gen_image( self, trans, id ):
|
||||
stored = self.get_stored_workflow( trans, id, check_ownership=True )
|
||||
try:
|
||||
svg = self._workflow_to_svg_canvas( trans, stored )
|
||||
except Exception:
|
||||
status = 'error'
|
||||
message = 'Galaxy is unable to create the SVG image. Please check your workflow, there might be missing tools.'
|
||||
return trans.fill_template( "/workflow/sharing.mako", use_panels=True, item=stored, status=status, message=message )
|
||||
trans.response.set_content_type("image/svg+xml")
|
||||
return self._workflow_to_svg_canvas( trans, stored ).tostring()
|
||||
return svg.tostring()
|
||||
|
||||
@web.expose
|
||||
@web.require_login( "use Galaxy workflows" )
|
||||
|
||||
@@ -238,11 +238,9 @@
|
||||
<hr/>
|
||||
<h3>Export</h3>
|
||||
<div class="sharing-section">
|
||||
<button>
|
||||
<a href="${h.url_for( controller=self.controller, action='display_by_username_and_slug', username=item.user.username, slug=item.slug, format='json-download' )}" style="text-decoration: none;">
|
||||
<a class="action-button" href="${h.url_for( controller=self.controller, action='display_by_username_and_slug', username=item.user.username, slug=item.slug, format='json-download' )}">
|
||||
Download
|
||||
</a>
|
||||
</button>
|
||||
${get_class_display_name( item.__class__ ).lower()} as a file so that it can be saved or imported into another Galaxy server.
|
||||
</div>
|
||||
</%def>
|
||||
@@ -278,11 +276,11 @@
|
||||
method="POST">
|
||||
<div class="form-row">
|
||||
<label>myExperiment username:</label>
|
||||
<input type="text" name="myexp_username" value="" size="25" placeholder="username"/>
|
||||
<input type="text" name="myexp_username" value="" size="25" placeholder="username" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label>myExperiment password:</label>
|
||||
<input type="password" name="myexp_password" value="" size="25" placeholder="password"/>
|
||||
<input type="password" name="myexp_password" value="" size="25" placeholder="password" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="submit" value="Export to myExperiment"/>
|
||||
@@ -295,11 +293,9 @@
|
||||
<%def name="render_more(item)">
|
||||
## Add link to render as SVG image.
|
||||
<div class="sharing-section">
|
||||
<button>
|
||||
<a href="${h.url_for(controller='workflow', action='gen_image', id=trans.security.encode_id( item.id ) )}" style="text-decoration: none;">
|
||||
Create image
|
||||
</a>
|
||||
</button>
|
||||
<a class="action-button" href="${h.url_for(controller='workflow', action='gen_image', id=trans.security.encode_id( item.id ) )}">
|
||||
Create image
|
||||
</a>
|
||||
of ${get_class_display_name( item.__class__ ).lower()} in SVG format
|
||||
</div>
|
||||
## Add form to export to myExperiment.
|
||||
|
||||
@@ -33,7 +33,7 @@ class SelectToolParameterTestCase( BaseParameterTestCase ):
|
||||
def test_validated_datasets( self ):
|
||||
self.options_xml = '''<options><filter type="data_meta" ref="input_bam" key="dbkey"/></options>'''
|
||||
try:
|
||||
self.param.from_json( model.HistoryDatasetAssociation(), self.trans, { "input_bam": basic.RuntimeValue() } )
|
||||
self.param.from_json( model.HistoryDatasetAssociation(), self.trans, { "input_bam": None } )
|
||||
except ValueError as err:
|
||||
assert str(err) == "Parameter my_name requires a value, but has no legal values defined."
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user