Merge branch 'dev' of github.com:galaxyproject/galaxy into dev

This commit is contained in:
Eric Rasche
2015-09-25 16:59:55 -05:00
51 changed files with 385 additions and 142 deletions
+1
View File
@@ -76,6 +76,7 @@ tool-data/shared/igv/igv_build_sites.txt
tool-data/shared/rviewer/rviewer_build_sites.txt
tool-data/shared/ncbi/builds.txt
tool-data/shared/ucsc/builds.txt
tool-data/shared/ucsc/manual_builds.txt
tool-data/shared/ensembl/builds.txt
tool-data/shared/ucsc/publicbuilds.txt
tool-data/shared/ucsc/ucsc_build_sites.txt
@@ -241,10 +241,12 @@ var DatasetCollection = Backbone.Model
return json;
},
/** is the collection done with updates and ready to be used? (finished running, etc.) */
/** Is this collection in a 'ready' state no processing (for the collection) is left
* to do on the server.
*/
inReadyState : function(){
//TODO: state currenly unimplemented for collections
return true;
var populated = this.get( 'populated' );
return ( this.isDeletedOrPurged() || populated );
},
//TODO:?? the following are the same interface as DatasetAssociation - can we combine?
@@ -159,20 +159,22 @@ var DatasetListItemEdit = _super.extend(
/** Render icon-button to re-run the job that created this dataset. */
_renderRerunButton : function(){
var creating_job = this.model.get('creating_job');
return faIconButton({
title : _l( 'Run this job again' ),
href : this.model.urls.rerun,
classes : 'rerun-btn',
target : this.linkTarget,
faIcon : 'fa-refresh',
onclick : function(ev) {
ev.preventDefault();
var form = new ToolsForm.View({'job_id' : creating_job});
form.deferred.execute(function(){
Galaxy.app.display(form.$el);
});
}
});
if (this.model.get('rerunnable')){
return faIconButton({
title : _l( 'Run this job again' ),
href : this.model.urls.rerun,
classes : 'rerun-btn',
target : this.linkTarget,
faIcon : 'fa-refresh',
onclick : function(ev) {
ev.preventDefault();
var form = new ToolsForm.View({'job_id' : creating_job});
form.deferred.execute(function(){
Galaxy.app.display(form.$el);
});
}
});
}
},
/** Render an icon-button or popupmenu of links based on the applicable visualizations */
@@ -37,8 +37,6 @@ var DatasetListItemView = _super.extend(
/** where should pages from links be displayed? (default to new tab/window) */
this.linkTarget = attributes.linkTarget || '_blank';
this._setUpListeners();
},
/** event listeners */
@@ -60,13 +58,21 @@ var DatasetListItemView = _super.extend(
},
// ......................................................................... expandable
/** In this override, only get details if in the ready state.
/** In this override, only get details if in the ready state, get rerunnable if in other states.
* Note: fetch with no 'change' event triggering to prevent automatic rendering.
*/
_fetchModelDetails : function(){
var view = this;
if( view.model.inReadyState() && !view.model.hasDetails() ){
return view.model.fetch({ silent: true });
// special case the need for the rerunnable and creating_job attributes
// needed for rendering re-run button on queued, running datasets
} else if( !view.model.has( 'rerunnable' ) ){
return view.model.fetch({ silent: true, data: {
// only fetch rerunnable and creating_job to keep overhead down
keys: [ 'rerunnable', 'creating_job' ].join(',')
}});
}
return jQuery.when();
},
+3 -5
View File
@@ -21,11 +21,9 @@ var HDCAListItemView = _super.extend(
/** event listeners */
_setUpListeners : function(){
_super.prototype._setUpListeners.call( this );
// re-rendering on deletion
this.model.on( 'change', function( model, options ){
if( _.isEqual( _.keys( model.changed ), [ 'visible' ] ) ){
this.render();
}
this.render();
}, this );
},
@@ -46,7 +44,7 @@ var HDCAListItemView = _super.extend(
_swapNewRender : function( $newRender ){
_super.prototype._swapNewRender.call( this, $newRender );
//TODO: model currently has no state
var state = this.model.get( 'state' ) || STATES.OK;
var state = !this.model.get( 'populated' ) ? STATES.RUNNING : STATES.OK;
//if( this.model.has( 'state' ) ){
this.$el.addClass( 'state-' + state );
//}
@@ -120,12 +120,12 @@ define(['utils/utils', 'utils/deferred', 'mvc/ui/ui-misc', 'mvc/form/form-view',
if (self.form == undefined){
self.form = new Form();
}
self.form.modal.show({
Galaxy.modal.show({
title : 'Tool cannot be executed',
body : error_message,
buttons : {
'Close' : function() {
self.form.modal.hide();
Galaxy.modal.hide();
}
}
});
@@ -35,6 +35,7 @@ return {
success : function(response) {
callback && callback();
form.reciept(ToolTemplate.success(response));
// begin checking the history for updates
self._refreshHdas();
},
error : function(response, response_full) {
@@ -135,11 +136,11 @@ return {
/** Refreshes the history panel
*/
_refreshHdas: function() {
_refreshHdas: function(detailIds, options) {
if (parent.Galaxy && parent.Galaxy.currHistoryPanel) {
parent.Galaxy.currHistoryPanel.refreshContents();
parent.Galaxy.currHistoryPanel.refreshContents(detailIds, options);
}
}
};
});
});
+14
View File
@@ -574,6 +574,12 @@ nglims_config_file = tool-data/nglims.yaml
# nodejs to wrap connections in SSL).
#dynamic_proxy_external_proxy=False
# Additionally, when the dynamic proxy is proxied by an upstream server, you'll
# want to specify a prefixed URL so both Galaxy and the proxy reside under the
# same path that your cookies are under. This will result in a url like
# https://FQDN/galaxy-prefix/gie_proxy for proxying
#dynamic_proxy_prefix=gie_proxy
# -- Logging and Debugging
# If True, Galaxy will attempt to configure a simple root logger if a
@@ -648,6 +654,14 @@ use_interactive = True
# lot of CPU.
#use_heartbeat = False
# Log to Sentry
# Sentry is an open source logging and error aggregation platform. Setting
# sentry_dsn will enable the Sentry middleware and errors will be sent to the
# indicated sentry instance. This connection string is available in your
# sentry instance under <project_name> -> Settings -> API Keys.
#sentry_dsn = None
# -- Data Libraries
# These library upload options are described in much more detail in the wiki:
+1 -1
View File
@@ -263,7 +263,7 @@
options should be reserved for defining cluster
specific options.
-->
<env id="_JAVA_OPTIONS">-Xmx=6GB</env>
<env id="_JAVA_OPTIONS">-Xmx6G</env>
<env id="ANOTHER_OPTION" raw="true">'5'</env> <!-- raw disables auto quoting -->
<env file="/mnt/java_cluster/environment_setup.sh" /> <!-- will be sourced -->
<env exec="module load javastuff/2.10" /> <!-- will be sourced -->
@@ -1,5 +1,4 @@
[main]
# Following options are ignored if using the Galaxy dynamic proxy but
# are useful if mapping a range of ports for environment consumption.
#apache_urls = False
@@ -7,32 +6,39 @@
#ssl = False
[docker]
# Command to execute docker. For example `sudo docker` or `docker-lxc`.
command = docker
# Command to launch docker container. For example `sudo docker` or `docker-lxc`.
# If you need to use a command like `sg` you can do that here, just be sure to
# wrap all of the docker portion in single quotes. E.g. `sg 'docker' 'docker {docker_args}'`
#
# It is recommended that you use command_inject if you need to inject
# additional parameters. This command string is re-used for a `docker inspect`
# command and will likely cause errors if it is extensively modified, past the
# usual group/sudo changes.
#command = docker {docker_args}
# The docker image name that should be started.
image = bgruening/docker-ipython-notebook:dev
# Additional arguments that are passed to the `docker run` command.
command_inject = --sig-proxy=true -e DEBUG=false
# Command to wrap around the full docker command.
# For example, `sg 'docker' '{cmd}'` where {cmd} will be replaced by the full
# docker command. Make sure to surround the {cmd} with single quotes(').
# Default: empty
#command_wrapper =
#command_inject = --sig-proxy=true -e DEBUG=false
# URL to access the Galaxy API with from the spawn Docker containter, if empty
# this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the
# Docker host of the spawned container if that is also not set.
#galaxy_url =
#galaxy_url =
# The Docker hostname. It can be useful to run the Docker daemon on a different
# host than Galaxy.
#docker_hostname = localhost
# Try to set the tempdirectory to world execute - this can fix the issue
# where 'sudo docker' is not able to mount the folder otherwise.
# where 'sudo docker' is not able to mount the folder otherwise.
# "finalize namespace chdir to /import permission denied"
wx_tempdir = False
#wx_tempdir = False
# Overwride the IE tempdirectory. This can be useful if you regular tempdir is
# located on an NFS share, which does not work well as Docker volume. In this case
# you can have a shared sshfs share which you can use as temporary directory to
# share data between the IE and Galaxy.
#docker_galaxy_temp_dir = None
@@ -33,18 +33,16 @@ if hda.datatype.__class__.__name__ != "Ipynb":
else:
shutil.copy( hda.file_name, empty_nb_path )
## General IE specific
# Access URLs for the notebook from within galaxy.
notebook_access_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/notebooks/ipython_galaxy_notebook.ipynb')
notebook_login_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/login?next=%2Fipython%2F${PORT}%2Ftree')
# Add all environment variables collected from Galaxy's IE infrastructure
ie_request.launch(env_override={
'notebook_password': PASSWORD,
})
## General IE specific
# Access URLs for the notebook from within galaxy.
notebook_access_url = ie_request.url_template('${PROXY_URL}/ipython/notebooks/ipython_galaxy_notebook.ipynb')
notebook_login_url = ie_request.url_template('${PROXY_URL}/ipython/login?next=${PROXY_PREFIX}%2Fipython%2Ftree')
%>
<html>
<head>
@@ -1,19 +1,44 @@
[main]
# This cannot be changed
# This CANNOT be changed. Eventually will be deprecated
password_auth = True
# Other
apache_urls = False
ssl = False
# Following options are ignored if using the Galaxy dynamic proxy but
# are useful if mapping a range of ports for environment consumption.
#apache_urls = False
#ssl = False
[docker]
command = docker
# Command to launch docker container. For example `sudo docker` or `docker-lxc`.
# If you need to use a command like `sg` you can do that here, just be sure to
# wrap all of the docker portion in single quotes. E.g. `sg 'docker' 'docker {docker_args}'`
#
# It is recommended that you use command_inject if you need to inject
# additional parameters. This command string is re-used for a `docker inspect`
# command and will likely cause errors if it is extensively modified, past the
# usual group/sudo changes.
#command = docker {docker_args}
# The docker image name that should be started.
image = erasche/docker-rstudio-notebook:dev
# Additional arguments that are passed to the `docker run` command. `-u`
# settings are completely ignored.
command_inject = --sig-proxy=true -e DEBUG=false
# Additional arguments that are passed to the `docker run` command.
#command_inject = --sig-proxy=true -e DEBUG=false
# URL to access the Galaxy API with from the spawned Docker container, if empty
# URL to access the Galaxy API with from the spawn Docker containter, if empty
# this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the
# Docker host of the spawned container, if that is also not set.
#galaxy_url=
# Docker host of the spawned container if that is also not set.
#galaxy_url =
# The Docker hostname. It can be useful to run the Docker daemon on a different
# host than Galaxy.
#docker_hostname = localhost
# Try to set the tempdirectory to world execute - this can fix the issue
# where 'sudo docker' is not able to mount the folder otherwise.
# "finalize namespace chdir to /import permission denied"
#wx_tempdir = False
# Overwride the IE tempdirectory. This can be useful if you regular tempdir is
# located on an NFS share, which does not work well as Docker volume. In this case
# you can have a shared sshfs share which you can use as temporary directory to
# share data between the IE and Galaxy.
#docker_galaxy_temp_dir = None
@@ -12,14 +12,6 @@ temp_dir = ie_request.temp_dir
PASSWORD = ie_request.notebook_pw
USERNAME = "galaxy"
## General IE specific
# Access URLs for the notebook from within galaxy.
# TODO: Make this work without pointing directly to IE. Currently does not work
# through proxy.
notebook_pubkey_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/auth-public-key')
notebook_access_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/')
notebook_login_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/auth-do-sign-in')
# Did the user give us an RData file?
if hda.datatype.__class__.__name__ == "RData":
shutil.copy( hda.file_name, os.path.join(temp_dir, '.RData') )
@@ -27,8 +19,16 @@ if hda.datatype.__class__.__name__ == "RData":
ie_request.launch(env_override={
'notebook_username': USERNAME,
'notebook_password': PASSWORD,
'cors_origin': ie_request.attr.proxy_url,
})
## General IE specific
# Access URLs for the notebook from within galaxy.
# TODO: Make this work without pointing directly to IE. Currently does not work
# through proxy.
notebook_pubkey_url = ie_request.url_template('${PROXY_URL}/rstudio/auth-public-key')
notebook_access_url = ie_request.url_template('${PROXY_URL}/rstudio/')
notebook_login_url = ie_request.url_template('${PROXY_URL}/rstudio/auth-do-sign-in')
%>
<html>
<head>
+1
View File
@@ -443,6 +443,7 @@ class Configuration( object ):
self.dynamic_proxy_bind_port = int( kwargs.get( "dynamic_proxy_bind_port", "8800" ) )
self.dynamic_proxy_bind_ip = kwargs.get( "dynamic_proxy_bind_ip", "0.0.0.0" )
self.dynamic_proxy_external_proxy = string_as_bool( kwargs.get( "dynamic_proxy_external_proxy", "False" ) )
self.dynamic_proxy_prefix = kwargs.get( "dynamic_proxy_prefix", "gie_proxy" )
# Default chunk size for chunkable datatypes -- 64k
self.display_chunk_size = int( kwargs.get( 'display_chunk_size', 65536) )
+2 -2
View File
@@ -39,11 +39,11 @@ class Binary( data.Data ):
@staticmethod
def register_sniffable_binary_format(data_type, ext, type_class):
Binary.sniffable_binary_formats.append({"type": data_type, "ext": ext, "class": type_class})
Binary.sniffable_binary_formats.append({"type": data_type, "ext": ext.lower(), "class": type_class})
@staticmethod
def register_unsniffable_binary_ext(ext):
Binary.unsniffable_binary_formats.append(ext)
Binary.unsniffable_binary_formats.append(ext.lower())
@staticmethod
def is_sniffable_binary( filename ):
+1 -1
View File
@@ -1402,7 +1402,7 @@ class JobWrapper( object ):
job = has_metrics.get_job()
per_plugin_properties = self.app.job_metrics.collect_properties( job.destination_id, self.job_id, self.working_directory )
if per_plugin_properties:
log.info( "Collecting job metrics for %s: %s" % ( has_metrics, getattr( has_metrics, 'id', None ) ) )
log.info( "Collecting metrics for %s %s" % ( type(has_metrics).__name__, getattr( has_metrics, 'id', None ) ) )
for plugin, properties in per_plugin_properties.iteritems():
for metric_name, metric_value in properties.iteritems():
if metric_value is not None:
+9
View File
@@ -280,6 +280,7 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
'peek',
'creating_job',
'rerunnable',
'uuid',
'permissions',
@@ -328,6 +329,7 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
'resubmitted' : lambda i, k, **c: self.hda_manager.has_been_resubmitted( i ),
'creating_job' : self.serialize_creating_job,
'rerunnable' : self.rerunnable,
'display_apps' : self.serialize_display_apps,
'display_types' : self.serialize_old_display_applications,
@@ -439,6 +441,13 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
else:
return None
def rerunnable( self, hda, key, **context ):
if hda.creating_job:
tool = self.app.toolbox.get_tool(hda.creating_job.tool_id, hda.creating_job.tool_version)
if tool and tool.is_workflow_compatible:
return True
return False
class HDADeserializer( datasets.DatasetAssociationDeserializer,
taggable.TaggableDeserializerMixin,
+3
View File
@@ -3047,6 +3047,9 @@ class DatasetCollectionInstance( object, HasName ):
id=self.id,
name=self.name,
collection_type=self.collection.collection_type,
populated=self.collection.populated,
populated_state=self.collection.populated_state,
populated_state_message=self.collection.populated_state_message,
type="collection", # contents type (distinguished from file or folder (in case of library))
)
+2
View File
@@ -1538,6 +1538,8 @@ class Tool( object, Dictifiable ):
group_errors[-1] = { '__index__': 'Cannot add repeat (max size=%i).' % input.max }
any_group_errors = True
rep_index += 1
if any_group_errors:
errors[ input.name ] = group_errors
elif isinstance( input, Conditional ):
group_state = state[input.name]
group_prefix = "%s|" % ( key )
+1 -1
View File
@@ -75,7 +75,7 @@ class YamlToolSource(ToolSource):
for output in output_defs:
outputs[output.name] = output
# TODO: parse outputs collections
return output_defs, odict()
return outputs, odict()
def _parse_output(self, tool, name, output_dict):
# TODO: handle filters, actions, change_format
+121 -39
View File
@@ -1,6 +1,7 @@
import ConfigParser
import os
import json
import stat
import random
import tempfile
@@ -40,18 +41,15 @@ class InteractiveEnviornmentRequest(object):
self.load_deploy_config()
self.attr.docker_hostname = self.attr.viz_config.get("docker", "docker_hostname")
self.attr.proxy_request = trans.app.proxy_manager.setup_proxy(
trans, host=self.attr.docker_hostname
)
self.attr.proxy_url = self.attr.proxy_request[ 'proxy_url' ]
self.attr.PORT = self.attr.proxy_request[ 'proxied_port' ]
# Generate per-request passwords the IE plugin can use to configure
# the destination container.
self.notebook_pw_salt = self.generate_password(length=12)
self.notebook_pw = self.generate_password(length=24)
self.temp_dir = os.path.abspath( tempfile.mkdtemp() )
ie_parent_temp_dir = self.attr.viz_config.get("docker", "docker_galaxy_temp_dir") or None
self.temp_dir = os.path.abspath( tempfile.mkdtemp( dir=ie_parent_temp_dir ) )
if self.attr.viz_config.getboolean("docker", "wx_tempdir"):
# Ensure permissions are set
try:
@@ -60,15 +58,26 @@ class InteractiveEnviornmentRequest(object):
log.error( "Could not change permissions of tmpdir %s" % self.temp_dir )
# continue anyway
# This duplicates the logic in the proxy manager
if self.attr.galaxy_config.dynamic_proxy_external_proxy:
self.attr.proxy_prefix = '%s/%s' % (
self.attr.galaxy_config.cookie_path,
self.attr.galaxy_config.dynamic_proxy_prefix)
else:
self.attr.proxy_prefix = ''
def load_deploy_config(self, default_dict={}):
# For backwards compat, any new variables added to the base .ini file
# will need to be recorded here. The ConfigParser doesn't provide a
# .get() that will ignore missing sections, so we must make use of
# their defaults dictionary instead.
default_dict['command_inject'] = '--sig-proxy=true'
default_dict['docker_hostname'] = 'localhost'
default_dict['wx_tempdir'] = 'False'
default_dict['command_wrapper'] = ''
default_dict = {
'command': 'docker {docker_args}',
'command_inject': '--sig-proxy=true -e DEBUG=false',
'docker_hostname': 'localhost',
'wx_tempdir': 'False',
'docker_galaxy_temp_dir': None
}
viz_config = ConfigParser.SafeConfigParser(default_dict)
conf_path = os.path.join( self.attr.our_config_dir, self.attr.viz_id + ".ini" )
if not os.path.exists( conf_path ):
@@ -102,8 +111,10 @@ class InteractiveEnviornmentRequest(object):
'history_id': self.attr.history_id,
'api_key': api_key,
'remote_host': request.remote_addr,
'docker_port': self.attr.PORT,
# DOCKER_PORT is NO LONGER AVAILABLE. All IEs must update.
'cors_origin': request.host_url,
'user_email': self.trans.user.email,
'proxy_prefix': self.attr.proxy_prefix,
}
if self.attr.viz_config.has_option("docker", "galaxy_url"):
@@ -138,36 +149,27 @@ class InteractiveEnviornmentRequest(object):
return "false"
def url_template(self, url_template):
"""Process a URL template
There are several variables accessible to the user:
- ${PROXY_URL} will be replaced with the dynamically create proxy's url
- ${PROXY_PREFIX} will be replaced with the prefix that may occur
"""
Process a URL template
There are several variables accessible to the user:
- ${PROXY_URL} will be replaced with dynamically create proxy
- ${PORT} will be replaced with the port the docker image is attached to
"""
# Figure out our substitutions
# Next several lines for older style replacements (not used with Galaxy dynamic
# proxy)
if self.attr.SSL_URLS:
protocol = 'https'
else:
protocol = 'http'
if not self.attr.APACHE_URLS:
# If they are not using apache URLs, that implies there's a port attached to the host
# string, thus we replace just the first instance of host that we see.
url_template = url_template.replace('${HOST}', '${HOST}:${PORT}', 1)
url_template = url_template.replace('${PROTO}', protocol) \
.replace('${HOST}', self.attr.HOST)
# Only the following replacements are used with Galaxy dynamic proxy
# URLs
url = url_template.replace('${PROXY_URL}', str(self.attr.proxy_url)) \
.replace('${PORT}', str(self.attr.PORT))
.replace('${PROXY_PREFIX}', str(self.attr.proxy_prefix.replace('/', '%2F')))
return url
def volume(self, host_path, container_path, **kwds):
@@ -182,18 +184,22 @@ class InteractiveEnviornmentRequest(object):
conf.update(env_override)
env_str = ' '.join(['-e "%s=%s"' % (key.upper(), item) for key, item in conf.items()])
volume_str = ' '.join(['-v "%s"' % volume for volume in volumes])
cmd = '%s run %s -d %s -p %s:%s -v "%s:/import/" %s %s' % \
(self.attr.viz_config.get("docker", "command"),
env_str,
self.attr.viz_config.get("docker", "command_inject"),
self.attr.PORT, self.attr.docker_port,
temp_dir,
volume_str,
self.attr.viz_config.get("docker", "image"))
cmd_wrapper = self.attr.viz_config.get("docker", "command_wrapper")
if cmd_wrapper != '' and '{cmd}' in cmd_wrapper:
cmd = cmd_wrapper.format( cmd=cmd )
return cmd
# This is the basic docker command such as "sudo -u docker docker {docker_args}"
# or just "docker {docker_args}"
command = self.attr.viz_config.get("docker", "command")
# Then we format in the entire docker command in place of
# {docker_args}, so as to let the admin not worry about which args are
# getting passed
command = command.format(docker_args='run {command_inject} {environment} -d -P -v "{temp_dir}:/import/" {volume_str} {image}')
# Once that's available, we format again with all of our arguments
command = command.format(
command_inject=self.attr.viz_config.get("docker", "command_inject"),
environment=env_str,
temp_dir=temp_dir,
volume_str=volume_str,
image=self.attr.viz_config.get("docker", "image")
)
return command
def launch(self, raw_cmd=None, env_override={}, volumes=[]):
if raw_cmd is None:
@@ -206,5 +212,81 @@ class InteractiveEnviornmentRequest(object):
stdout, stderr = p.communicate()
if p.returncode != 0 or len(stderr):
log.error( "%s\n%s" % (stdout, stderr) )
return None
else:
log.debug( "Container id: %s" % stdout)
port_mappings = self.get_proxied_ports(stdout)
if len(port_mappings) > 1:
log.warning("Don't know how to handle proxies to containers with multiple exposed ports. Arbitrarily choosing first")
elif len(port_mappings) == 0:
log.warning("No exposed ports to map! Images MUST EXPOSE")
return None
# Fetch the first port_mapping
(service, host_ip, host_port) = port_mappings[0]
# Now we configure our proxy_requst object and we manually specify
# the port to map to and ensure the proxy is available.
self.attr.proxy_request = self.trans.app.proxy_manager.setup_proxy(
self.trans,
host=self.attr.docker_hostname,
port=host_port,
proxy_prefix=self.attr.proxy_prefix,
)
# These variables then become available for use in templating URLs
self.attr.proxy_url = self.attr.proxy_request[ 'proxy_url' ]
# Commented out because it needs to be documented and visible that
# this variable was moved here. Usually would remove commented
# code, but again, needs to be clear where this went. Remove at a
# later time.
#
# PORT is no longer exposed internally. All requests are forced to
# go through the proxy we ship.
# self.attr.PORT = self.attr.proxy_request[ 'proxied_port' ]
def get_proxied_ports(self, container_id):
"""Run docker inspect on a container to figure out which ports were
mapped where.
:type container_id: str
:param container_id: a docker container ID
:returns: a list of triples containing (internal_port, external_ip,
external_port), of which the ports are probably the only
useful information.
Someday code that calls this should be refactored whenever we get
containers with multiple ports working.
"""
command = self.attr.viz_config.get("docker", "command")
command = command.format(docker_args="inspect %s" % container_id)
log.info("Inspecting docker container {0} with command [{1}]".format(
container_id,
command
))
p = Popen(command, stdout=PIPE, stderr=PIPE, close_fds=True, shell=True)
stdout, stderr = p.communicate()
if p.returncode != 0 or len(stderr):
log.error( "%s\n%s" % (stdout, stderr) )
return None
inspect_data = json.loads(stdout)
# [{
# "NetworkSettings" : {
# "Ports" : {
# "3306/tcp" : [
# {
# "HostIp" : "127.0.0.1",
# "HostPort" : "3306"
# }
# ]
mappings = []
port_mappings = inspect_data[0]['NetworkSettings']['Ports']
for port_name in port_mappings:
for binding in port_mappings[port_name]:
mappings.append((
port_name.replace('/tcp', '').replace('/udp', ''),
binding['HostIp'],
binding['HostPort']
))
return mappings
+5 -3
View File
@@ -17,7 +17,9 @@ SECURE_COOKIE = "galaxysession"
class ProxyManager(object):
def __init__( self, config ):
for option in [ "manage_dynamic_proxy", "dynamic_proxy_bind_port", "dynamic_proxy_bind_ip", "dynamic_proxy_debug", "dynamic_proxy_external_proxy" ]:
for option in ["manage_dynamic_proxy", "dynamic_proxy_bind_port",
"dynamic_proxy_bind_ip", "dynamic_proxy_debug",
"dynamic_proxy_external_proxy", "dynamic_proxy_prefix"]:
setattr( self, option, getattr( config, option ) )
self.launch_by = "node" # TODO: Support docker
if self.manage_dynamic_proxy:
@@ -29,7 +31,7 @@ class ProxyManager(object):
def shutdown( self ):
self.lazy_process.shutdown()
def setup_proxy( self, trans, host=DEFAULT_PROXY_TO_HOST, port=None ):
def setup_proxy( self, trans, host=DEFAULT_PROXY_TO_HOST, port=None, proxy_prefix="" ):
if self.manage_dynamic_proxy:
log.info("Attempting to start dynamic proxy process")
self.lazy_process.start_process()
@@ -46,7 +48,7 @@ class ProxyManager(object):
if not self.dynamic_proxy_external_proxy:
proxy_url = '%s://%s:%d' % (scheme, host, self.dynamic_proxy_bind_port)
else:
proxy_url = '%s://%s' % (scheme, host)
proxy_url = '%s://%s%s' % (scheme, host, proxy_prefix)
return {
'proxy_url': proxy_url,
'proxied_port': proxy_requests.port,
+4 -1
View File
@@ -285,7 +285,10 @@ class WorkflowProgress( object ):
raise modules.DelayedWorkflowEvaluation()
return replacement
def set_outputs_for_input( self, step, outputs={} ):
def set_outputs_for_input( self, step, outputs=None ):
if outputs is None:
outputs = {}
if self.inputs_by_step_id:
outputs[ 'output' ] = self.inputs_by_step_id[ step.id ]
+1
View File
@@ -16,6 +16,7 @@ SAMPLES="
config/shed_data_manager_conf.xml.sample
lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
tool-data/shared/ucsc/builds.txt.sample
tool-data/shared/ucsc/manual_builds.txt.sample
tool-data/shared/ucsc/ucsc_build_sites.txt.sample
tool-data/shared/igv/igv_build_sites.txt.sample
tool-data/shared/rviewer/rviewer_build_sites.txt.sample
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"hdca-li.js","sources":["../../../src/mvc/history/hdca-li.js"],"names":["define","STATES","DC_LI","DC_PANEL","BASE_MVC","_l","_super","DCListItemView","HDCAListItemView","extend","className","prototype","_setUpListeners","call","this","model","on","_","isEqual","keys","changed","render","_getFoldoutPanelClass","get","ListCollectionPanel","PairCollectionPanel","ListOfPairsCollectionPanel","TypeError","_swapNewRender","$newRender","state","OK","$el","addClass","toString","modelString","templates","warnings","hidden","wrapTemplate","titleBarTemplate","titleBar"],"mappings":"AAAAA,QACI,qBACA,+BACA,kCACA,eACA,sBACD,SAAUC,EAAQC,EAAOC,EAAUC,EAAUC,GAGhD,GAAIC,GAASJ,EAAMK,eAGfC,EAAmBF,EAAOG,QAM1BC,UAAcJ,EAAOK,UAAUD,UAAY,mBAG3CE,gBAAkB,WACdN,EAAOK,UAAUC,gBAAgBC,KAAMC,MAEvCA,KAAKC,MAAMC,GAAI,SAAU,SAAUD,GAC3BE,EAAEC,QAASD,EAAEE,KAAMJ,EAAMK,UAAa,aACtCN,KAAKO,UAEVP,OAIPQ,sBAAwB,WACpB,OAAQR,KAAKC,MAAMQ,IAAK,oBACpB,IAAK,OACD,MAAOpB,GAASqB,mBACpB,KAAK,SACD,MAAOrB,GAASsB,mBACpB,KAAK,cACD,MAAOtB,GAASuB,2BAExB,KAAM,IAAIC,WAAW,2BAA6Bb,KAAKC,MAAMQ,IAAK,qBAItEK,eAAiB,SAAUC,GACvBvB,EAAOK,UAAUiB,eAAef,KAAMC,KAAMe,EAE5C,IAAIC,GAAQhB,KAAKC,MAAMQ,IAAK,UAAatB,EAAO8B,EAIhD,OAFAjB,MAAKkB,IAAIC,SAAU,SAAWH,GAEvBhB,KAAKkB,KAKhBE,SAAW,WACP,GAAIC,GAAgBrB,KAAW,MAAIA,KAAKC,MAAQ,GAAK,YACrD,OAAO,oBAAsBoB,EAAc,MAwC/C,OAnCJ3B,GAAiBG,UAAUyB,UAAa,WAEpC,GAAIC,GAAWpB,EAAER,UAAYH,EAAOK,UAAUyB,UAAUC,UACpDC,OAASlC,EAASmC,cAEd,mCACI,+CACIlC,EAAI,mCACR,SACJ,WACD,gBAIHmC,EAAmBpC,EAASmC,cAE5B,6CACI,mCACA,sBAEI,kDACA,mDACJ,SACA,+BACJ,UACD,aAEH,OAAOtB,GAAER,UAAYH,EAAOK,UAAUyB,WAClCC,SAAWA,EACXI,SAAWD,QAOXhC,iBAAmBA"}
{"version":3,"file":"hdca-li.js","sources":["../../../src/mvc/history/hdca-li.js"],"names":["define","STATES","DC_LI","DC_PANEL","BASE_MVC","_l","_super","DCListItemView","HDCAListItemView","extend","className","prototype","_setUpListeners","call","this","model","on","render","_getFoldoutPanelClass","get","ListCollectionPanel","PairCollectionPanel","ListOfPairsCollectionPanel","TypeError","_swapNewRender","$newRender","state","OK","RUNNING","$el","addClass","toString","modelString","templates","warnings","_","hidden","wrapTemplate","titleBarTemplate","titleBar"],"mappings":"AAAAA,QACI,qBACA,+BACA,kCACA,eACA,sBACD,SAAUC,EAAQC,EAAOC,EAAUC,EAAUC,GAGhD,GAAIC,GAASJ,EAAMK,eAGfC,EAAmBF,EAAOG,QAM1BC,UAAcJ,EAAOK,UAAUD,UAAY,mBAG3CE,gBAAkB,WACdN,EAAOK,UAAUC,gBAAgBC,KAAMC,MAEvCA,KAAKC,MAAMC,GAAI,SAAU,WACrBF,KAAKG,UACNH,OAIPI,sBAAwB,WACpB,OAAQJ,KAAKC,MAAMI,IAAK,oBACpB,IAAK,OACD,MAAOhB,GAASiB,mBACpB,KAAK,SACD,MAAOjB,GAASkB,mBACpB,KAAK,cACD,MAAOlB,GAASmB,2BAExB,KAAM,IAAIC,WAAW,2BAA6BT,KAAKC,MAAMI,IAAK,qBAItEK,eAAiB,SAAUC,GACvBnB,EAAOK,UAAUa,eAAeX,KAAMC,KAAMW,EAE5C,IAAIC,GAASZ,KAAKC,MAAMI,IAAK,aAAiClB,EAAO0B,GAAxB1B,EAAO2B,OAIpD,OAFAd,MAAKe,IAAIC,SAAU,SAAWJ,GAEvBZ,KAAKe,KAKhBE,SAAW,WACP,GAAIC,GAAgBlB,KAAW,MAAIA,KAAKC,MAAQ,GAAK,YACrD,OAAO,oBAAsBiB,EAAc,MAwC/C,OAnCJxB,GAAiBG,UAAUsB,UAAa,WAEpC,GAAIC,GAAWC,EAAE1B,UAAYH,EAAOK,UAAUsB,UAAUC,UACpDE,OAAShC,EAASiC,cAEd,mCACI,+CACIhC,EAAI,mCACR,SACJ,WACD,gBAIHiC,EAAmBlC,EAASiC,cAE5B,6CACI,mCACA,sBAEI,kDACA,mDACJ,SACA,+BACJ,UACD,aAEH,OAAOF,GAAE1B,UAAYH,EAAOK,UAAUsB,WAClCC,SAAWA,EACXK,SAAWD,QAOX9B,iBAAmBA"}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"tools-jobs.js","sources":["../../../src/mvc/tools/tools-jobs.js"],"names":["define","Utils","ToolTemplate","submit","form","options","callback","self","this","job_def","tool_id","id","tool_version","version","inputs","data","create","trigger","_validation","console","debug","request","type","url","galaxy_config","root","success","response","reciept","_refreshHdas","error","message","error_messages","matchResponse","input_id","highlight","modal","show","title","body","buttons","Close","hide","job_inputs","batch_n","batch_src","job_input_id","input_value","match","input_field","field_list","input_def","input_list","optional","batch","n","values","length","src","parent","Galaxy","currHistoryPanel","refreshContents"],"mappings":"AAGAA,QAAQ,cAAe,4BAA6B,SAASC,EAAOC,GACpE,OACIC,OAAQ,SAASC,EAAMC,EAASC,GAE5B,GAAIC,GAAOC,KAGPC,GACAC,QAAkBL,EAAQM,GAC1BC,aAAkBP,EAAQQ,QAC1BC,OAAkBV,EAAKW,KAAKC,SAOhC,OAHAZ,GAAKa,QAAQ,SAGRT,KAAKU,YAAYd,EAAMK,IAO5BU,QAAQC,MAAMX,OAGdR,GAAMoB,SACFC,KAAU,OACVC,IAAUC,cAAcC,KAAO,YAC/BV,KAAUN,EACViB,QAAU,SAASC,GACfrB,GAAYA,IACZF,EAAKwB,QAAQ1B,EAAawB,QAAQC,IAClCpB,EAAKsB,gBAETC,MAAU,SAASH,GAEf,GADArB,GAAYA,IACRqB,GAAYA,EAASI,SAAWJ,EAASI,QAAQhB,KAAM,CACvD,GAAIiB,GAAiB5B,EAAKW,KAAKkB,cAAcN,EAASI,QAAQhB,KAC9D,KAAK,GAAImB,KAAYF,GAAgB,CACjC5B,EAAK+B,UAAUD,EAAUF,EAAeE,GACxC,YAIJf,SAAQC,MAAMO,GACdA,GAAYvB,EAAKgC,MAAMC,MACnBC,MAAU,wBACVC,KAAUrC,EAAa4B,MAAMrB,GAC7B+B,SACIC,MAAU,WACNrC,EAAKgC,MAAMM,gBAlC/BvB,QAAQC,MAAM,qEACdd,GAAYA,OA4CpBY,YAAa,SAASd,EAAMK,GAExB,GAAIkC,GAAalC,EAAQK,OAGrB8B,EAAU,GACVC,EAAY,IAGhB,KAAK,GAAIC,KAAgBH,GAAY,CAEjC,GAAII,GAAcJ,EAAWG,GAGzBZ,EAAW9B,EAAKW,KAAKiC,MAAMF,GAC3BG,EAAc7C,EAAK8C,WAAWhB,GAC9BiB,EAAY/C,EAAKgD,WAAWlB,EAGhC,IAAKA,GAAaiB,GAAcF,EAAhC,CAMA,IAAKE,EAAUE,UAA2B,MAAfN,EAEvB,MADA3C,GAAK+B,UAAUD,IACR,CAIX,IAAIa,GAAeA,EAAYO,MAAO,CAElC,GAAIC,GAAIR,EAAYS,OAAOC,OAGvBC,EAAM,IAMV,IALIH,EAAI,IACJG,EAAMX,EAAYS,OAAO,IAAMT,EAAYS,OAAO,GAAGE,KAIrDA,EACA,GAAkB,OAAdb,EACAA,EAAYa,MAEZ,IAAIb,IAAca,EAEd,MADAtD,GAAK+B,UAAUD,EAAU,mFAClB,CAMnB,IAAgB,KAAZU,EACAA,EAAUW,MAEV,IAAIX,IAAYW,EAEZ,MADAnD,GAAK+B,UAAUD,EAAU,gHAAkHqB,EAAI,wDAA0DX,EAAU,UAC5M,OAvCfzB,SAAQC,MAAM,8DA8CtB,OAAO,GAKXS,aAAc,WACN8B,OAAOC,QAAUD,OAAOC,OAAOC,kBAC/BF,OAAOC,OAAOC,iBAAiBC"}
{"version":3,"file":"tools-jobs.js","sources":["../../../src/mvc/tools/tools-jobs.js"],"names":["define","Utils","ToolTemplate","submit","form","options","callback","self","this","job_def","tool_id","id","tool_version","version","inputs","data","create","trigger","_validation","console","debug","request","type","url","galaxy_config","root","success","response","reciept","_refreshHdas","error","message","error_messages","matchResponse","input_id","highlight","modal","show","title","body","buttons","Close","hide","job_inputs","batch_n","batch_src","job_input_id","input_value","match","input_field","field_list","input_def","input_list","optional","batch","n","values","length","src","detailIds","parent","Galaxy","currHistoryPanel","refreshContents"],"mappings":"AAGAA,QAAQ,cAAe,4BAA6B,SAASC,EAAOC,GACpE,OACIC,OAAQ,SAASC,EAAMC,EAASC,GAE5B,GAAIC,GAAOC,KAGPC,GACAC,QAAkBL,EAAQM,GAC1BC,aAAkBP,EAAQQ,QAC1BC,OAAkBV,EAAKW,KAAKC,SAOhC,OAHAZ,GAAKa,QAAQ,SAGRT,KAAKU,YAAYd,EAAMK,IAO5BU,QAAQC,MAAMX,OAGdR,GAAMoB,SACFC,KAAU,OACVC,IAAUC,cAAcC,KAAO,YAC/BV,KAAUN,EACViB,QAAU,SAASC,GACfrB,GAAYA,IACZF,EAAKwB,QAAQ1B,EAAawB,QAAQC,IAElCpB,EAAKsB,gBAETC,MAAU,SAASH,GAEf,GADArB,GAAYA,IACRqB,GAAYA,EAASI,SAAWJ,EAASI,QAAQhB,KAAM,CACvD,GAAIiB,GAAiB5B,EAAKW,KAAKkB,cAAcN,EAASI,QAAQhB,KAC9D,KAAK,GAAImB,KAAYF,GAAgB,CACjC5B,EAAK+B,UAAUD,EAAUF,EAAeE,GACxC,YAIJf,SAAQC,MAAMO,GACdA,GAAYvB,EAAKgC,MAAMC,MACnBC,MAAU,wBACVC,KAAUrC,EAAa4B,MAAMrB,GAC7B+B,SACIC,MAAU,WACNrC,EAAKgC,MAAMM,gBAnC/BvB,QAAQC,MAAM,qEACdd,GAAYA,OA6CpBY,YAAa,SAASd,EAAMK,GAExB,GAAIkC,GAAalC,EAAQK,OAGrB8B,EAAU,GACVC,EAAY,IAGhB,KAAK,GAAIC,KAAgBH,GAAY,CAEjC,GAAII,GAAcJ,EAAWG,GAGzBZ,EAAW9B,EAAKW,KAAKiC,MAAMF,GAC3BG,EAAc7C,EAAK8C,WAAWhB,GAC9BiB,EAAY/C,EAAKgD,WAAWlB,EAGhC,IAAKA,GAAaiB,GAAcF,EAAhC,CAMA,IAAKE,EAAUE,UAA2B,MAAfN,EAEvB,MADA3C,GAAK+B,UAAUD,IACR,CAIX,IAAIa,GAAeA,EAAYO,MAAO,CAElC,GAAIC,GAAIR,EAAYS,OAAOC,OAGvBC,EAAM,IAMV,IALIH,EAAI,IACJG,EAAMX,EAAYS,OAAO,IAAMT,EAAYS,OAAO,GAAGE,KAIrDA,EACA,GAAkB,OAAdb,EACAA,EAAYa,MAEZ,IAAIb,IAAca,EAEd,MADAtD,GAAK+B,UAAUD,EAAU,mFAClB,CAMnB,IAAgB,KAAZU,EACAA,EAAUW,MAEV,IAAIX,IAAYW,EAEZ,MADAnD,GAAK+B,UAAUD,EAAU,gHAAkHqB,EAAI,wDAA0DX,EAAU,UAC5M,OAvCfzB,SAAQC,MAAM,8DA8CtB,OAAO,GAKXS,aAAc,SAAS8B,EAAWtD,GAC1BuD,OAAOC,QAAUD,OAAOC,OAAOC,kBAC/BF,OAAOC,OAAOC,iBAAiBC,gBAAgBJ,EAAWtD"}
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
define(["mvc/dataset/dataset-model","mvc/base-mvc","utils/localization"],function(a,b){var c={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(a){return _.extend(a,a.object,{element_id:a.id}),delete a.object,a},constructor:function(a){a=this._mergeObject(a),this.idAttribute="element_id",Backbone.Model.apply(this,arguments)},parse:function(a){var b=a;return b=this._mergeObject(b)}},d=Backbone.Model.extend(b.LoggableMixin).extend(c),e=Backbone.Collection.extend(b.LoggableMixin).extend({model:d,initialize:function(a,b){this.debug(this+"(DCECollection).initialize:",a,b),b=b||{}},toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),f=a.DatasetAssociation.extend(b.mixin(c,{defaults:_.extend({},a.DatasetAssociation.prototype.defaults,c.defaults),constructor:function(a,b){this.debug(" DatasetDCE.constructor:",a,b),c.constructor.call(this,a,b)},initialize:function(b,c){this.debug(this+"(DatasetDCE).initialize:",b,c),a.DatasetAssociation.prototype.initialize.call(this,b,c)},toString:function(){var a=this.get("element_identifier");return["DatasetDCE(",a,")"].join("")}})),g=e.extend({model:f,initialize:function(a,b){this.debug(this+"(DatasetDCECollection).initialize:",a,b),e.prototype.initialize.call(this,a,b)},toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),h=Backbone.Model.extend(b.LoggableMixin).extend(b.SearchableModelMixin).extend({defaults:{collection_type:null,deleted:!1},collectionClass:e,initialize:function(a,b){this.debug(this+"(DatasetCollection).initialize:",a,b,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var a=this.get("elements")||[];return this.unset("elements",{silent:!0}),this.elements=new this.collectionClass(a),this.elements},toJSON:function(){var a=Backbone.Model.prototype.toJSON.call(this);return this.elements&&(a.elements=this.elements.toJSON()),a},inReadyState:function(){return!0},hasDetails:function(){return this.debug("hasDetails:",this.elements.length),0!==this.elements.length},getVisibleContents:function(){return this.elements},"delete":function(a){return this.get("deleted")?jQuery.when():this.save({deleted:!0},a)},undelete:function(a){return!this.get("deleted")||this.get("purged")?jQuery.when():this.save({deleted:!1},a)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var a=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+a.join(",")+")"}}),i=h.extend({collectionClass:g,initialize:function(a,b){this.debug(this+"(ListDatasetCollection).initialize:",a,b),h.prototype.initialize.call(this,a,b)},toString:function(){return["ListDatasetCollection(",this.get("name"),")"].join("")}}),j=i.extend({initialize:function(a,b){this.debug(this+"(PairDatasetCollection).initialize:",a,b),i.prototype.initialize.call(this,a,b)},toString:function(){return["PairDatasetCollection(",this.get("name"),")"].join("")}}),k=h.extend(b.mixin(c,{constructor:function(a,b){this.debug(" NestedDCDCE.constructor:",a,b),c.constructor.call(this,a,b)},toString:function(){var a=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",a,")"].join("")}})),l=e.extend({model:k,initialize:function(a,b){this.debug(this+"(NestedDCDCECollection).initialize:",a,b),e.prototype.initialize.call(this,a,b)},toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),m=j.extend(b.mixin(c,{constructor:function(a,b){this.debug(" NestedPairDCDCE.constructor:",a,b),c.constructor.call(this,a,b)},toString:function(){var a=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",a,")"].join("")}})),n=l.extend({model:m,initialize:function(a,b){this.debug(this+"(NestedPairDCDCECollection).initialize:",a,b),l.prototype.initialize.call(this,a,b)},toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),o=h.extend({collectionClass:n,initialize:function(a,b){this.debug(this+"(ListPairedDatasetCollection).initialize:",a,b),h.prototype.initialize.call(this,a,b)},toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:i,PairDatasetCollection:j,ListPairedDatasetCollection:o}});
define(["mvc/dataset/dataset-model","mvc/base-mvc","utils/localization"],function(a,b){var c={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(a){return _.extend(a,a.object,{element_id:a.id}),delete a.object,a},constructor:function(a){a=this._mergeObject(a),this.idAttribute="element_id",Backbone.Model.apply(this,arguments)},parse:function(a){var b=a;return b=this._mergeObject(b)}},d=Backbone.Model.extend(b.LoggableMixin).extend(c),e=Backbone.Collection.extend(b.LoggableMixin).extend({model:d,initialize:function(a,b){this.debug(this+"(DCECollection).initialize:",a,b),b=b||{}},toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),f=a.DatasetAssociation.extend(b.mixin(c,{defaults:_.extend({},a.DatasetAssociation.prototype.defaults,c.defaults),constructor:function(a,b){this.debug(" DatasetDCE.constructor:",a,b),c.constructor.call(this,a,b)},initialize:function(b,c){this.debug(this+"(DatasetDCE).initialize:",b,c),a.DatasetAssociation.prototype.initialize.call(this,b,c)},toString:function(){var a=this.get("element_identifier");return["DatasetDCE(",a,")"].join("")}})),g=e.extend({model:f,initialize:function(a,b){this.debug(this+"(DatasetDCECollection).initialize:",a,b),e.prototype.initialize.call(this,a,b)},toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),h=Backbone.Model.extend(b.LoggableMixin).extend(b.SearchableModelMixin).extend({defaults:{collection_type:null,deleted:!1},collectionClass:e,initialize:function(a,b){this.debug(this+"(DatasetCollection).initialize:",a,b,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var a=this.get("elements")||[];return this.unset("elements",{silent:!0}),this.elements=new this.collectionClass(a),this.elements},toJSON:function(){var a=Backbone.Model.prototype.toJSON.call(this);return this.elements&&(a.elements=this.elements.toJSON()),a},inReadyState:function(){var a=this.get("populated");return this.isDeletedOrPurged()||a},hasDetails:function(){return this.debug("hasDetails:",this.elements.length),0!==this.elements.length},getVisibleContents:function(){return this.elements},"delete":function(a){return this.get("deleted")?jQuery.when():this.save({deleted:!0},a)},undelete:function(a){return!this.get("deleted")||this.get("purged")?jQuery.when():this.save({deleted:!1},a)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var a=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+a.join(",")+")"}}),i=h.extend({collectionClass:g,initialize:function(a,b){this.debug(this+"(ListDatasetCollection).initialize:",a,b),h.prototype.initialize.call(this,a,b)},toString:function(){return["ListDatasetCollection(",this.get("name"),")"].join("")}}),j=i.extend({initialize:function(a,b){this.debug(this+"(PairDatasetCollection).initialize:",a,b),i.prototype.initialize.call(this,a,b)},toString:function(){return["PairDatasetCollection(",this.get("name"),")"].join("")}}),k=h.extend(b.mixin(c,{constructor:function(a,b){this.debug(" NestedDCDCE.constructor:",a,b),c.constructor.call(this,a,b)},toString:function(){var a=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",a,")"].join("")}})),l=e.extend({model:k,initialize:function(a,b){this.debug(this+"(NestedDCDCECollection).initialize:",a,b),e.prototype.initialize.call(this,a,b)},toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),m=j.extend(b.mixin(c,{constructor:function(a,b){this.debug(" NestedPairDCDCE.constructor:",a,b),c.constructor.call(this,a,b)},toString:function(){var a=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",a,")"].join("")}})),n=l.extend({model:m,initialize:function(a,b){this.debug(this+"(NestedPairDCDCECollection).initialize:",a,b),l.prototype.initialize.call(this,a,b)},toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),o=h.extend({collectionClass:n,initialize:function(a,b){this.debug(this+"(ListPairedDatasetCollection).initialize:",a,b),h.prototype.initialize.call(this,a,b)},toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:i,PairDatasetCollection:j,ListPairedDatasetCollection:o}});
//# sourceMappingURL=../../../maps/mvc/collection/collection-model.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["mvc/dataset/states","mvc/collection/collection-li","mvc/collection/collection-panel","mvc/base-mvc","utils/localization"],function(a,b,c,d,e){var f=b.DCListItemView,g=f.extend({className:f.prototype.className+" history-content",_setUpListeners:function(){f.prototype._setUpListeners.call(this),this.model.on("change",function(a){_.isEqual(_.keys(a.changed),["visible"])&&this.render()},this)},_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return c.ListCollectionPanel;case"paired":return c.PairCollectionPanel;case"list:paired":return c.ListOfPairsCollectionPanel}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_swapNewRender:function(b){f.prototype._swapNewRender.call(this,b);var c=this.model.get("state")||a.OK;return this.$el.addClass("state-"+c),this.$el},toString:function(){var a=this.model?this.model+"":"(no model)";return"HDCAListItemView("+a+")"}});return g.prototype.templates=function(){var a=_.extend({},f.prototype.templates.warnings,{hidden:d.wrapTemplate(["<% if( !collection.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',e("This collection has been hidden"),"</div>","<% } %>"],"collection")}),b=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- collection.hid %></span> ','<span class="name"><%- collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},f.prototype.templates,{warnings:a,titleBar:b})}(),{HDCAListItemView:g}});
define(["mvc/dataset/states","mvc/collection/collection-li","mvc/collection/collection-panel","mvc/base-mvc","utils/localization"],function(a,b,c,d,e){var f=b.DCListItemView,g=f.extend({className:f.prototype.className+" history-content",_setUpListeners:function(){f.prototype._setUpListeners.call(this),this.model.on("change",function(){this.render()},this)},_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return c.ListCollectionPanel;case"paired":return c.PairCollectionPanel;case"list:paired":return c.ListOfPairsCollectionPanel}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_swapNewRender:function(b){f.prototype._swapNewRender.call(this,b);var c=this.model.get("populated")?a.OK:a.RUNNING;return this.$el.addClass("state-"+c),this.$el},toString:function(){var a=this.model?this.model+"":"(no model)";return"HDCAListItemView("+a+")"}});return g.prototype.templates=function(){var a=_.extend({},f.prototype.templates.warnings,{hidden:d.wrapTemplate(["<% if( !collection.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',e("This collection has been hidden"),"</div>","<% } %>"],"collection")}),b=d.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- collection.hid %></span> ','<span class="name"><%- collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection");return _.extend({},f.prototype.templates,{warnings:a,titleBar:b})}(),{HDCAListItemView:g}});
//# sourceMappingURL=../../../maps/mvc/history/hdca-li.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","mvc/tools/tools-template","mvc/citation/citation-model","mvc/citation/citation-view"],function(a,b,c,d,e,f,g){return Backbone.View.extend({initialize:function(c){this.options=a.merge(c,{}),this.setElement("<div/>"),this.deferred=new b,c.inputs?this._buildForm(c):this._buildModel(c,!0)},_buildForm:function(b){var c=this;this.options=a.merge(b,this.options),this.options=a.merge({icon:"fa-wrench",title:"<b>"+b.name+"</b> "+b.description+" (Galaxy Tool Version "+b.version+")",operations:this._operations(),onchange:function(){c.deferred.reset(),c.deferred.execute(function(){c._updateModel()})}},this.options),this.form=new d(this.options),this._footer(),this.$el.empty(),this.$el.append(this.form.$el)},_buildModel:function(b,c){var e=this;if(this.options.id=b.id,this.options.version=b.version,b.job_id)f=Galaxy.root+"api/jobs/"+b.job_id+"/build_for_rerun";else{var f=Galaxy.root+"api/tools/"+b.id+"/build?";if(b.dataset_id)f+="dataset_id="+b.dataset_id;else{f+="tool_version="+b.version+"&";var g=top.location.href,h=g.indexOf("?");-1!=g.indexOf("tool_id=")&&-1!==h&&(f+=g.slice(h+1))}}var i=this.deferred.register();a.request({type:"GET",url:f,success:function(a){e._buildForm(a.tool_model||a),!c&&e.form.message.update({status:"success",message:"Now you are using '"+e.options.name+"' version "+e.options.version+".",persistent:!1}),e.deferred.done(i),console.debug("tools-form::initialize() - Initial tool model ready."),console.debug(a)},error:function(a){e.deferred.done(i),console.debug("tools-form::initialize() - Initial tool model request failed."),console.debug(a);var b=a.error||a.err_msg||"Uncaught error.";void 0==e.form&&(e.form=new d),e.form.modal.show({title:"Tool cannot be executed",body:b,buttons:{Close:function(){e.form.modal.hide()}}})}})},_updateModel:function(){var b=this.options.update_url||Galaxy.root+"api/tools/"+this.options.id+"/build",c=this,d=this.form,e={tool_id:this.options.id,tool_version:this.options.version,inputs:$.extend(!0,{},c.form.data.create())};d.wait(!0);var f=this.deferred.register();console.debug("tools-form-base::_updateModel() - Sending current state (see below)."),console.debug(e),a.request({type:"POST",url:b,data:e,success:function(a){c.form.update(a.tool_model||a),c.options.update&&c.options.update(a),d.wait(!1),console.debug("tools-form-base::_updateModel() - Received new model (see below)."),console.debug(a),c.deferred.done(f)},error:function(a){c.deferred.done(f),console.debug("tools-form-base::_updateModel() - Refresh request failed."),console.debug(a)}})},_operations:function(){var a=this,b=this.options,d=new c.ButtonMenu({icon:"fa-cubes",title:!b.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!b.is_workflow&&b.versions&&b.versions.length>1)for(var f in b.versions){var g=b.versions[f];g!=b.version&&d.addMenu({title:"Switch to "+g,version:g,icon:"fa-cube",onclick:function(){var c=b.id.replace(b.version,this.version),d=this.version;a.deferred.reset(),a.deferred.execute(function(){a._buildModel({id:c,version:d})})}})}else d.$el.hide();var h=new c.ButtonMenu({icon:"fa-caret-down",title:!b.narrow&&"Options"||null,tooltip:"View available options"});return b.biostar_url&&(h.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/p/new/post/")}}),h.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/local/search/page/?q="+b.name)}})),h.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+b.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&h.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=Galaxy.root+"api/tools/"+b.id+"/download"}}),b.requirements&&b.requirements.length>0&&h.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){this.visible?(this.visible=!1,a.form.message.update({message:""})):(this.visible=!0,a.form.message.update({persistent:!0,message:e.requirements(b),status:"info"}))}}),b.sharable_url&&h.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(b.sharable_url)}}),{menu:h,versions:d}},_footer:function(){var a=this.options;if(""!=a.help&&this.form.$el.append(e.help(a)),a.citations){var b=$("<div/>"),c=new f.ToolCitationCollection;c.tool_id=a.id;var d=new g.CitationListView({el:b,collection:c});d.render(),c.fetch(),this.form.$el.append(b)}}})});
define(["utils/utils","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","mvc/tools/tools-template","mvc/citation/citation-model","mvc/citation/citation-view"],function(a,b,c,d,e,f,g){return Backbone.View.extend({initialize:function(c){this.options=a.merge(c,{}),this.setElement("<div/>"),this.deferred=new b,c.inputs?this._buildForm(c):this._buildModel(c,!0)},_buildForm:function(b){var c=this;this.options=a.merge(b,this.options),this.options=a.merge({icon:"fa-wrench",title:"<b>"+b.name+"</b> "+b.description+" (Galaxy Tool Version "+b.version+")",operations:this._operations(),onchange:function(){c.deferred.reset(),c.deferred.execute(function(){c._updateModel()})}},this.options),this.form=new d(this.options),this._footer(),this.$el.empty(),this.$el.append(this.form.$el)},_buildModel:function(b,c){var e=this;if(this.options.id=b.id,this.options.version=b.version,b.job_id)f=Galaxy.root+"api/jobs/"+b.job_id+"/build_for_rerun";else{var f=Galaxy.root+"api/tools/"+b.id+"/build?";if(b.dataset_id)f+="dataset_id="+b.dataset_id;else{f+="tool_version="+b.version+"&";var g=top.location.href,h=g.indexOf("?");-1!=g.indexOf("tool_id=")&&-1!==h&&(f+=g.slice(h+1))}}var i=this.deferred.register();a.request({type:"GET",url:f,success:function(a){e._buildForm(a.tool_model||a),!c&&e.form.message.update({status:"success",message:"Now you are using '"+e.options.name+"' version "+e.options.version+".",persistent:!1}),e.deferred.done(i),console.debug("tools-form::initialize() - Initial tool model ready."),console.debug(a)},error:function(a){e.deferred.done(i),console.debug("tools-form::initialize() - Initial tool model request failed."),console.debug(a);var b=a.error||a.err_msg||"Uncaught error.";void 0==e.form&&(e.form=new d),Galaxy.modal.show({title:"Tool cannot be executed",body:b,buttons:{Close:function(){Galaxy.modal.hide()}}})}})},_updateModel:function(){var b=this.options.update_url||Galaxy.root+"api/tools/"+this.options.id+"/build",c=this,d=this.form,e={tool_id:this.options.id,tool_version:this.options.version,inputs:$.extend(!0,{},c.form.data.create())};d.wait(!0);var f=this.deferred.register();console.debug("tools-form-base::_updateModel() - Sending current state (see below)."),console.debug(e),a.request({type:"POST",url:b,data:e,success:function(a){c.form.update(a.tool_model||a),c.options.update&&c.options.update(a),d.wait(!1),console.debug("tools-form-base::_updateModel() - Received new model (see below)."),console.debug(a),c.deferred.done(f)},error:function(a){c.deferred.done(f),console.debug("tools-form-base::_updateModel() - Refresh request failed."),console.debug(a)}})},_operations:function(){var a=this,b=this.options,d=new c.ButtonMenu({icon:"fa-cubes",title:!b.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!b.is_workflow&&b.versions&&b.versions.length>1)for(var f in b.versions){var g=b.versions[f];g!=b.version&&d.addMenu({title:"Switch to "+g,version:g,icon:"fa-cube",onclick:function(){var c=b.id.replace(b.version,this.version),d=this.version;a.deferred.reset(),a.deferred.execute(function(){a._buildModel({id:c,version:d})})}})}else d.$el.hide();var h=new c.ButtonMenu({icon:"fa-caret-down",title:!b.narrow&&"Options"||null,tooltip:"View available options"});return b.biostar_url&&(h.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/p/new/post/")}}),h.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(b.biostar_url+"/local/search/page/?q="+b.name)}})),h.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+b.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&h.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=Galaxy.root+"api/tools/"+b.id+"/download"}}),b.requirements&&b.requirements.length>0&&h.addMenu({icon:"fa-info-circle",title:"Requirements",tooltip:"Display tool requirements",onclick:function(){this.visible?(this.visible=!1,a.form.message.update({message:""})):(this.visible=!0,a.form.message.update({persistent:!0,message:e.requirements(b),status:"info"}))}}),b.sharable_url&&h.addMenu({icon:"fa-external-link",title:"See in Tool Shed",tooltip:"Access the repository",onclick:function(){window.open(b.sharable_url)}}),{menu:h,versions:d}},_footer:function(){var a=this.options;if(""!=a.help&&this.form.$el.append(e.help(a)),a.citations){var b=$("<div/>"),c=new f.ToolCitationCollection;c.tool_id=a.id;var d=new g.CitationListView({el:b,collection:c});d.render(),c.fetch(),this.form.$el.append(b)}}})});
//# sourceMappingURL=../../../maps/mvc/tools/tools-form-base.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/tools/tools-template"],function(a,b){return{submit:function(c,d,e){var f=this,g={tool_id:d.id,tool_version:d.version,inputs:c.data.create()};return c.trigger("reset"),this._validation(c,g)?(console.debug(g),void a.request({type:"POST",url:galaxy_config.root+"api/tools",data:g,success:function(a){e&&e(),c.reciept(b.success(a)),f._refreshHdas()},error:function(a){if(e&&e(),a&&a.message&&a.message.data){var d=c.data.matchResponse(a.message.data);for(var f in d){c.highlight(f,d[f]);break}}else console.debug(a),a&&c.modal.show({title:"Job submission failed",body:b.error(g),buttons:{Close:function(){c.modal.hide()}}})}})):(console.debug("tools-jobs::submit - Submission canceled. Validation failed."),void(e&&e()))},_validation:function(a,b){var c=b.inputs,d=-1,e=null;for(var f in c){var g=c[f],h=a.data.match(f),i=a.field_list[h],j=a.input_list[h];if(h&&j&&i){if(!j.optional&&null==g)return a.highlight(h),!1;if(g&&g.batch){var k=g.values.length,l=null;if(k>0&&(l=g.values[0]&&g.values[0].src),l)if(null===e)e=l;else if(e!==l)return a.highlight(h,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===d)d=k;else if(d!==k)return a.highlight(h,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+k+"</b> selection(s) while a previous field contains <b>"+d+"</b>."),!1}}else console.debug("tools-jobs::_validation - Retrieving input objects failed.")}return!0},_refreshHdas:function(){parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()}}});
define(["utils/utils","mvc/tools/tools-template"],function(a,b){return{submit:function(c,d,e){var f=this,g={tool_id:d.id,tool_version:d.version,inputs:c.data.create()};return c.trigger("reset"),this._validation(c,g)?(console.debug(g),void a.request({type:"POST",url:galaxy_config.root+"api/tools",data:g,success:function(a){e&&e(),c.reciept(b.success(a)),f._refreshHdas()},error:function(a){if(e&&e(),a&&a.message&&a.message.data){var d=c.data.matchResponse(a.message.data);for(var f in d){c.highlight(f,d[f]);break}}else console.debug(a),a&&c.modal.show({title:"Job submission failed",body:b.error(g),buttons:{Close:function(){c.modal.hide()}}})}})):(console.debug("tools-jobs::submit - Submission canceled. Validation failed."),void(e&&e()))},_validation:function(a,b){var c=b.inputs,d=-1,e=null;for(var f in c){var g=c[f],h=a.data.match(f),i=a.field_list[h],j=a.input_list[h];if(h&&j&&i){if(!j.optional&&null==g)return a.highlight(h),!1;if(g&&g.batch){var k=g.values.length,l=null;if(k>0&&(l=g.values[0]&&g.values[0].src),l)if(null===e)e=l;else if(e!==l)return a.highlight(h,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===d)d=k;else if(d!==k)return a.highlight(h,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+k+"</b> selection(s) while a previous field contains <b>"+d+"</b>."),!1}}else console.debug("tools-jobs::_validation - Retrieving input objects failed.")}return!0},_refreshHdas:function(a,b){parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents(a,b)}}});
//# sourceMappingURL=../../../maps/mvc/tools/tools-jobs.js.map
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.
+15 -3
View File
@@ -100,10 +100,14 @@ class BaseDatasetPopulator( object ):
file_type = kwds.get( "file_type", 'txt' )
upload_params = {
'files_0|NAME': name,
'files_0|url_paste': content,
'dbkey': dbkey,
'file_type': file_type,
}
if isinstance( content, file ):
upload_params[ "files_0|file_data"] = content
else:
upload_params[ 'files_0|url_paste' ] = content
if "to_posix_lines" in kwds:
upload_params[ "files_0|to_posix_lines"] = kwds[ "to_posix_lines" ]
if "space_to_tab" in kwds:
@@ -116,6 +120,10 @@ class BaseDatasetPopulator( object ):
)
def run_tool_payload( self, tool_id, inputs, history_id, **kwds ):
if "files_0|file_data" in inputs:
kwds[ "__files" ] = { "files_0|file_data": inputs[ "files_0|file_data" ] }
del inputs[ "files_0|file_data" ]
return dict(
tool_id=tool_id,
inputs=json.dumps(inputs),
@@ -174,8 +182,12 @@ class DatasetPopulator( BaseDatasetPopulator ):
def __init__( self, galaxy_interactor ):
self.galaxy_interactor = galaxy_interactor
def _post( self, route, data={} ):
return self.galaxy_interactor.post( route, data )
def _post( self, route, data={}, files=None ):
files = data.get( "__files", None )
if files is not None:
del data[ "__files" ]
return self.galaxy_interactor.post( route, data, files=files )
def _get( self, route ):
return self.galaxy_interactor.get( route )
+1
View File
@@ -87,6 +87,7 @@ class DatasetCollectionApiTestCase( api.ApiTestCase ):
pair_1_object = pair_1_element[ "object" ]
self._assert_has_keys( pair_1_object, "collection_type", "elements" )
self.assertEquals( pair_1_object[ "collection_type" ], "paired" )
self.assertEquals( pair_1_object[ "populated" ], True )
pair_elements = pair_1_object[ "elements" ]
assert len( pair_elements ) == 2
pair_1_element_1 = pair_elements[ 0 ]
+28 -1
View File
@@ -5,6 +5,7 @@ from .helpers import DatasetPopulator
from .helpers import DatasetCollectionPopulator
from .helpers import LibraryPopulator
from .helpers import skip_without_tool
from base.test_data import TestDataResolver
class ToolsTestCase( api.ApiTestCase ):
@@ -109,6 +110,12 @@ class ToolsTestCase( api.ApiTestCase ):
result_content = self._upload_and_get_content( table )
self.assertEquals( result_content, table )
def test_rdata_not_decompressed( self ):
# Prevent regression of https://github.com/galaxyproject/galaxy/issues/753
rdata_path = TestDataResolver().get_filename("1.RData")
rdata_metadata = self._upload_and_get_details( open(rdata_path, "rb"), file_type="auto" )
self.assertEquals( rdata_metadata[ "file_ext" ], "rdata" )
@skip_without_tool( "multi_select" )
def test_multi_select_as_list( self ):
history_id = self.dataset_populator.new_history()
@@ -230,6 +237,18 @@ class ToolsTestCase( api.ApiTestCase ):
response = self._run( "validation_default", history_id, inputs )
self._assert_status_code_is( response, 400 )
@skip_without_tool( "validation_repeat" )
def test_validation_in_repeat( self ):
history_id = self.dataset_populator.new_history()
inputs = {
'r1_0|text': "123",
'r2_0|text': "",
}
response = self._run( "validation_repeat", history_id, inputs )
import time
time.sleep(10)
self._assert_status_code_is( response, 400 )
@skip_without_tool( "multi_select" )
def test_select_legal_values( self ):
history_id = self.dataset_populator.new_history()
@@ -1042,12 +1061,20 @@ class ToolsTestCase( api.ApiTestCase ):
else:
return create_response
def _upload_and_get_content( self, content, **upload_kwds ):
def _upload( self, content, **upload_kwds ):
history_id = self.dataset_populator.new_history()
new_dataset = self.dataset_populator.new_dataset( history_id, content=content, **upload_kwds )
self.dataset_populator.wait_for_history( history_id, assert_ok=True )
return history_id, new_dataset
def _upload_and_get_content( self, content, **upload_kwds ):
history_id, new_dataset = self._upload( content, **upload_kwds )
return self.dataset_populator.get_history_dataset_content( history_id, dataset=new_dataset )
def _upload_and_get_details( self, content, **upload_kwds ):
history_id, new_dataset = self._upload( content, **upload_kwds )
return self.dataset_populator.get_history_dataset_details( history_id, dataset=new_dataset )
def __tool_ids( self ):
index = self._get( "tools" )
tools_index = index.json()
+42
View File
@@ -575,6 +575,48 @@ class WorkflowsApiTestCase( BaseWorkflowsApiTestCase ):
content = self.dataset_populator.get_history_dataset_content( history_id, hid=0 )
self.assertEquals("10.0\n30.0\n20.0\n40.0\n", content )
@skip_without_tool( "collection_split_on_column" )
@skip_without_tool( "min_repeat" )
def test_workflow_run_dynamic_output_collections_2( self ):
# A more advanced output collection workflow, testing regression of
# https://github.com/galaxyproject/galaxy/issues/776
history_id = self.dataset_populator.new_history()
workflow_id = self._upload_yaml_workflow("""
- label: test_input_1
type: input
- label: test_input_2
type: input
- label: test_input_3
type: input
- label: split_up
tool_id: collection_split_on_column
state:
input1:
$link: test_input_2
- label: min_repeat
tool_id: min_repeat
state:
queries:
- input:
$link: test_input_1
queries2:
- input2:
$link: split_up#split_output
""")
hda1 = self.dataset_populator.new_dataset( history_id, content="samp1\t10.0\nsamp2\t20.0\n" )
hda2 = self.dataset_populator.new_dataset( history_id, content="samp1\t20.0\nsamp2\t40.0\n" )
hda3 = self.dataset_populator.new_dataset( history_id, content="samp1\t30.0\nsamp2\t60.0\n" )
self.dataset_populator.wait_for_history( history_id, assert_ok=True )
inputs = {
'0': self._ds_entry(hda1),
'1': self._ds_entry(hda2),
'2': self._ds_entry(hda3),
}
invocation_id = self.__invoke_workflow( history_id, workflow_id, inputs )
self.wait_for_invocation_and_jobs( history_id, workflow_id, invocation_id )
content = self.dataset_populator.get_history_dataset_content( history_id, hid=7 )
self.assertEquals(content.strip(), "samp1\t10.0\nsamp2\t20.0")
def test_workflow_request( self ):
workflow = self.workflow_populator.load_workflow( name="test_for_queue" )
workflow_request, history_id = self._setup_workflow_run( workflow )
+1 -1
View File
@@ -23,7 +23,7 @@ LIST_SEP = re.compile("\s*,\s*")
class TestDataResolver(object):
def __init__(self, env_var, environ=os.environ):
def __init__(self, env_var='GALAXY_TEST_FILE_DIR', environ=os.environ):
file_dirs = environ.get(env_var, None)
if file_dirs:
self.resolvers = map(lambda u: build_resolver(u, environ), LIST_SEP.split(file_dirs))
+1 -1
View File
@@ -50,7 +50,7 @@ class TwillTestCase( unittest.TestCase ):
self.host = os.environ.get( 'GALAXY_TEST_HOST' )
self.port = os.environ.get( 'GALAXY_TEST_PORT' )
self.url = "http://%s:%s" % ( self.host, self.port )
self.test_data_resolver = TestDataResolver( 'GALAXY_TEST_FILE_DIR' )
self.test_data_resolver = TestDataResolver( )
self.tool_shed_test_file = os.environ.get( 'GALAXY_TOOL_SHED_TEST_FILE', None )
if self.tool_shed_test_file:
f = open( self.tool_shed_test_file, 'r' )
@@ -38,8 +38,10 @@
<when value="true">
<param type="data" name="file" />
</when>
<when value="false" />
</conditional>
</when>
<when value="false" />
</conditional>
</inputs>
<outputs>
+3 -3
View File
@@ -1,4 +1,4 @@
<tool id="min_repeat" name="min_repeat">
<tool id="min_repeat" name="min_repeat" version="0.1.0">
<command>
cat #for $q in $queries# ${q.input} #end for# > $out_file1 ;
cat #for $q in $queries2# ${q.input2} #end for# > $out_file2
@@ -12,8 +12,8 @@
</repeat>
</inputs>
<outputs>
<data name="out_file1" format="txt" />
<data name="out_file2" format="txt" />
<data name="out_file1" format="txt" label="Repeat 1 Datasets on ${on_string}" />
<data name="out_file2" format="txt" label="Repeat 2 Datasets on ${on_string}" />
</outputs>
<tests>
<test>
@@ -6,7 +6,6 @@
<tool file="boolean_conditional.xml" />
<tool file="composite.xml" />
<tool file="environment_variables.xml" />
<tool file="compare_bam_as_sam.xml" />
<tool file="code_file.xml" />
<tool file="disambiguate_cond.xml" />
<tool file="multi_repeats.xml"/>
@@ -13,6 +13,7 @@
</repeat>
<repeat name="r2" label="Repeat 2">
<param name="text" type="text" label="text input">
<validator type="empty_field" />
<sanitizer>
<valid initial="none">
<add value="a"/>
+1 -1
View File
@@ -119,7 +119,7 @@ class JobConfXmlParserTestCase( unittest.TestCase ):
env_dest = self.job_config.destinations[ "java_cluster" ][ 0 ]
assert len( env_dest.env ) == 4, len( env_dest.env )
assert env_dest.env[ 0 ][ "name" ] == "_JAVA_OPTIONS"
assert env_dest.env[ 0 ][ "value" ] == '-Xmx=6GB'
assert env_dest.env[ 0 ][ "value" ] == '-Xmx6G'
assert env_dest.env[ 1 ][ "name" ] == "ANOTHER_OPTION"
assert env_dest.env[ 1 ][ "raw" ] is True