galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2014
- 2 participants
- 174 discussions
5 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/75304086e0b9/
Changeset: 75304086e0b9
Branch: docker-work
User: davebgx
Date: 2014-10-06 13:10:58+00:00
Summary: Close merged branch docker-work.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/89c5e7289942/
Changeset: 89c5e7289942
Branch: tool-autoload
User: davebgx
Date: 2014-10-06 13:11:16+00:00
Summary: Close merged branch tool-autoload.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/92ccf23d883c/
Changeset: 92ccf23d883c
Branch: tool-extract
User: davebgx
Date: 2014-10-06 13:11:28+00:00
Summary: Close merged branch tool-extract.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/1f36c142db9c/
Changeset: 1f36c142db9c
Branch: jjohnson/sqlite-needs-to-import-re-and-sqlite-in--1412274859337
User: davebgx
Date: 2014-10-06 13:11:40+00:00
Summary: Close merged branch jjohnson/sqlite-needs-to-import-re-and-sqlite-in--1412274859337.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/8f746975db66/
Changeset: 8f746975db66
User: davebgx
Date: 2014-10-06 13:12:06+00:00
Summary: Add api method to reload a tool's configuration.
Affected #: 2 files
diff -r d252ac015734d6e382ff07a0497a84ac575059e2 -r 8f746975db66785dcec2ef16f943052d767b01d4 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -3,6 +3,7 @@
from galaxy import exceptions
from galaxy import web, util
from galaxy.web import _future_expose_api_anonymous
+from galaxy.web import _future_expose_api
from galaxy.web.base.controller import BaseAPIController
from galaxy.web.base.controller import UsesVisualizationMixin
from galaxy.web.base.controller import UsesHistoryMixin
@@ -12,6 +13,8 @@
from galaxy.managers.collections_util import dictify_dataset_collection_instance
+import galaxy.queue_worker
+
import logging
log = logging.getLogger( __name__ )
@@ -58,6 +61,18 @@
tool = self._get_tool( id )
return tool.to_dict( trans, io_details=io_details, link_details=link_details )
+ @_future_expose_api
+ @web.require_admin
+ def reload( self, trans, tool_id, **kwd ):
+ """
+ GET /api/tools/{tool_id}/reload
+ Reload specified tool.
+ """
+ toolbox = trans.app.toolbox
+ galaxy.queue_worker.send_control_task( trans, 'reload_tool', noop_self=True, kwargs={ 'tool_id': tool_id } )
+ message, status = trans.app.toolbox.reload_tool_by_id( tool_id )
+ return { status: message }
+
@_future_expose_api_anonymous
def citations( self, trans, id, **kwds ):
tool = self._get_tool( id )
diff -r d252ac015734d6e382ff07a0497a84ac575059e2 -r 8f746975db66785dcec2ef16f943052d767b01d4 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -179,6 +179,7 @@
webapp.mapper.resource( 'ftp_file', 'ftp_files', path_prefix='/api' )
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
+ webapp.mapper.connect( '/api/tools/{id:.+?}/reload', action='reload', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}/citations', action='citations', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}/download', action='download', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
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.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm/docker-work (pull request #516)
by commits-noreply@bitbucket.org 05 Oct '14
by commits-noreply@bitbucket.org 05 Oct '14
05 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d252ac015734/
Changeset: d252ac015734
User: jmchilton
Date: 2014-10-06 01:45:08+00:00
Summary: Merged in kellrott/galaxy-farm/docker-work (pull request #516)
Running docker with 'auto-remove' be default
Affected #: 3 files
diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 config/job_conf.xml.sample_advanced
--- a/config/job_conf.xml.sample_advanced
+++ b/config/job_conf.xml.sample_advanced
@@ -77,7 +77,7 @@
of old LWR job runner. If your Pulsar server is running on a
Windows machine for instance this runner should still be used.
- These destinations still needs to target a Pulsar server,
+ These destinations still needs to target a Pulsar server,
older LWR plugins and destinations still work in Galaxy can
target LWR servers, but this support should be considered
deprecated and will disappear with a future release of Galaxy.
@@ -110,7 +110,7 @@
<destination id="local" runner="local"/><destination id="multicore_local" runner="local"><param id="local_slots">4</param><!-- Specify GALAXY_SLOTS for local jobs. -->
- <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over
+ <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over
allocating machine define a second local runner with different name and fewer workers
to run this destination. --><param id="embed_metadata_in_job">True</param>
@@ -119,7 +119,7 @@
try it early - it will slightly speed up local jobs by
embedding metadata calculation in job script itself.
-->
- <job_metrics />
+ <job_metrics /><!-- Above element demonstrates embedded job metrics definition - see
job_metrics_conf.xml.sample for full documentation on possible nested
elements. This empty block will simply disable job metrics for the
@@ -134,12 +134,12 @@
destination - but be sure to add any library paths or data incides
that may be needed read-only.
-->
- <!--
+ <!--
<param id="docker_volumes">$defaults,/mnt/galaxyData/libraries:ro,/mnt/galaxyData/indices:ro</param>
--><!-- For a stock Galaxy instance and traditional job runner $defaults will
expand out as:
-
+
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw
This assumes most of what is needed is available under Galaxy's root directory,
@@ -153,7 +153,7 @@
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:ro
- If using the Pulsar, defaults will be even further restricted because the
+ If using the Pulsar, defaults will be even further restricted because the
Pulsar will (by default) stage all needed inputs into the job's job_directory
(so there is not need to allow the docker container to read all the
files - let alone write over them). Defaults in this case becomes:
@@ -173,15 +173,15 @@
<!-- Control memory allocatable by docker container with following option:
--><!-- <param id="docker_memory">24G</param> -->
- <!-- By default Docker will need to runnable by Galaxy using
+ <!-- By default Docker will need to runnable by Galaxy using
password-less sudo - this can be configured by adding the
following line to the sudoers file of all compute nodes
with docker enabled:
-
+
galaxy ALL = (root) NOPASSWD: SETENV: /usr/bin/docker
- The follow option is set to false to disable sudo (docker
- must likewise be configured to allow this).
+ The follow option is set to false to disable sudo (docker
+ must likewise be configured to allow this).
--><!-- <param id="docker_sudo">false</param> --><!-- Following option can be used to tweak sudo command used by
@@ -192,6 +192,11 @@
http://docs.docker.io/reference/run/#network-settings
--><!-- <param id="docker_net">bridge</param> -->
+ <!-- By default, a container will live on past its run. By
+ adding the '--rm' flag to the command line, the container
+ will be removed automatically after the program is complete.
+ -->
+ <!-- <param id="docker_auto_rm">false</param> --><!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different
@@ -265,7 +270,7 @@
<!-- Burst out from static destination local_cluster_8_core to
static destination shared_cluster_8_core when there are about
50 Galaxy jobs assigned to any of the local_cluster_XXX
- destinations (either running or queued). If there are fewer
+ destinations (either running or queued). If there are fewer
than 50 jobs, just use local_cluster_8_core destination.
Uncomment job_state parameter to make this bursting happen when
@@ -294,8 +299,8 @@
configuration. --><param id="private_token">123456789changeme</param><!-- Uncomment the following statement to disable file staging (e.g.
- if there is a shared file system between Galaxy and the Pulsar
- server). Alternatively action can be set to 'copy' - to replace
+ if there is a shared file system between Galaxy and the Pulsar
+ server). Alternatively action can be set to 'copy' - to replace
http transfers with file system copies, 'remote_transfer' to cause
the Pulsar to initiate HTTP transfers instead of Galaxy, or
'remote_copy' to cause Pulsar to initiate file system copies.
@@ -337,7 +342,7 @@
instead. This may be required if remote host is Windows machine
but probably not otherwise.
-->
- <!-- <param id="rewrite_parameters">false</params> -->
+ <!-- <param id="rewrite_parameters">false</params> --></destination><destination id="pulsar_mq_dest" runner="amqp_pulsar" ><!-- The RESTful Pulsar client sends a request to Pulsar
diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 lib/galaxy/tools/deps/containers.py
--- a/lib/galaxy/tools/deps/containers.py
+++ b/lib/galaxy/tools/deps/containers.py
@@ -208,6 +208,7 @@
env_directives=env_directives,
working_directory=working_directory,
net=prop("net", "none"), # By default, docker instance has networking disabled
+ auto_rm=prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE),
**docker_host_props
)
return "%s\n%s" % (cache_command, run_command)
diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -8,6 +8,7 @@
DEFAULT_NET = None
DEFAULT_MEMORY = None
DEFAULT_VOLUMES_FROM = None
+DEFAULT_AUTO_REMOVE = True
class DockerVolume(object):
@@ -82,6 +83,7 @@
docker_cmd=DEFAULT_DOCKER_COMMAND,
sudo=DEFAULT_SUDO,
sudo_cmd=DEFAULT_SUDO_COMMAND,
+ auto_rm=DEFAULT_AUTO_REMOVE,
host=DEFAULT_HOST,
):
command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
@@ -100,6 +102,8 @@
command_parts.extend(["-w", working_directory])
if net:
command_parts.extend(["--net", net])
+ if auto_rm:
+ command_parts.append("--rm")
full_image = image
if tag:
full_image = "%s:%s" % (full_image, tag)
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/db93990f8def/
Changeset: db93990f8def
Branch: docker-work
User: kell...(a)gmail.com
Date: 2014-10-05 23:23:55+00:00
Summary: Adding behavior that docker is called with '--rm' flag by default, so containers will automatically be removed. This can be disabled via job_config
Affected #: 3 files
diff -r 4aca849f229f538770376d091fac30e4a76854a8 -r db93990f8def9e20c979337dbca0ef1e7e06f400 config/job_conf.xml.sample_advanced
--- a/config/job_conf.xml.sample_advanced
+++ b/config/job_conf.xml.sample_advanced
@@ -77,7 +77,7 @@
of old LWR job runner. If your Pulsar server is running on a
Windows machine for instance this runner should still be used.
- These destinations still needs to target a Pulsar server,
+ These destinations still needs to target a Pulsar server,
older LWR plugins and destinations still work in Galaxy can
target LWR servers, but this support should be considered
deprecated and will disappear with a future release of Galaxy.
@@ -110,7 +110,7 @@
<destination id="local" runner="local"/><destination id="multicore_local" runner="local"><param id="local_slots">4</param><!-- Specify GALAXY_SLOTS for local jobs. -->
- <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over
+ <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over
allocating machine define a second local runner with different name and fewer workers
to run this destination. --><param id="embed_metadata_in_job">True</param>
@@ -119,7 +119,7 @@
try it early - it will slightly speed up local jobs by
embedding metadata calculation in job script itself.
-->
- <job_metrics />
+ <job_metrics /><!-- Above element demonstrates embedded job metrics definition - see
job_metrics_conf.xml.sample for full documentation on possible nested
elements. This empty block will simply disable job metrics for the
@@ -134,12 +134,12 @@
destination - but be sure to add any library paths or data incides
that may be needed read-only.
-->
- <!--
+ <!--
<param id="docker_volumes">$defaults,/mnt/galaxyData/libraries:ro,/mnt/galaxyData/indices:ro</param>
--><!-- For a stock Galaxy instance and traditional job runner $defaults will
expand out as:
-
+
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw
This assumes most of what is needed is available under Galaxy's root directory,
@@ -153,7 +153,7 @@
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:ro
- If using the Pulsar, defaults will be even further restricted because the
+ If using the Pulsar, defaults will be even further restricted because the
Pulsar will (by default) stage all needed inputs into the job's job_directory
(so there is not need to allow the docker container to read all the
files - let alone write over them). Defaults in this case becomes:
@@ -173,15 +173,15 @@
<!-- Control memory allocatable by docker container with following option:
--><!-- <param id="docker_memory">24G</param> -->
- <!-- By default Docker will need to runnable by Galaxy using
+ <!-- By default Docker will need to runnable by Galaxy using
password-less sudo - this can be configured by adding the
following line to the sudoers file of all compute nodes
with docker enabled:
-
+
galaxy ALL = (root) NOPASSWD: SETENV: /usr/bin/docker
- The follow option is set to false to disable sudo (docker
- must likewise be configured to allow this).
+ The follow option is set to false to disable sudo (docker
+ must likewise be configured to allow this).
--><!-- <param id="docker_sudo">false</param> --><!-- Following option can be used to tweak sudo command used by
@@ -192,6 +192,11 @@
http://docs.docker.io/reference/run/#network-settings
--><!-- <param id="docker_net">bridge</param> -->
+ <!-- By default, a container will live on past its run. By
+ adding the '--rm' flag to the command line, the container
+ will be removed automatically after the program is complete.
+ -->
+ <!-- <param id="docker_auto_rm">false</param> --><!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different
@@ -265,7 +270,7 @@
<!-- Burst out from static destination local_cluster_8_core to
static destination shared_cluster_8_core when there are about
50 Galaxy jobs assigned to any of the local_cluster_XXX
- destinations (either running or queued). If there are fewer
+ destinations (either running or queued). If there are fewer
than 50 jobs, just use local_cluster_8_core destination.
Uncomment job_state parameter to make this bursting happen when
@@ -294,8 +299,8 @@
configuration. --><param id="private_token">123456789changeme</param><!-- Uncomment the following statement to disable file staging (e.g.
- if there is a shared file system between Galaxy and the Pulsar
- server). Alternatively action can be set to 'copy' - to replace
+ if there is a shared file system between Galaxy and the Pulsar
+ server). Alternatively action can be set to 'copy' - to replace
http transfers with file system copies, 'remote_transfer' to cause
the Pulsar to initiate HTTP transfers instead of Galaxy, or
'remote_copy' to cause Pulsar to initiate file system copies.
@@ -337,7 +342,7 @@
instead. This may be required if remote host is Windows machine
but probably not otherwise.
-->
- <!-- <param id="rewrite_parameters">false</params> -->
+ <!-- <param id="rewrite_parameters">false</params> --></destination><destination id="pulsar_mq_dest" runner="amqp_pulsar" ><!-- The RESTful Pulsar client sends a request to Pulsar
diff -r 4aca849f229f538770376d091fac30e4a76854a8 -r db93990f8def9e20c979337dbca0ef1e7e06f400 lib/galaxy/tools/deps/containers.py
--- a/lib/galaxy/tools/deps/containers.py
+++ b/lib/galaxy/tools/deps/containers.py
@@ -208,6 +208,7 @@
env_directives=env_directives,
working_directory=working_directory,
net=prop("net", "none"), # By default, docker instance has networking disabled
+ auto_rm=prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE),
**docker_host_props
)
return "%s\n%s" % (cache_command, run_command)
diff -r 4aca849f229f538770376d091fac30e4a76854a8 -r db93990f8def9e20c979337dbca0ef1e7e06f400 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -8,6 +8,7 @@
DEFAULT_NET = None
DEFAULT_MEMORY = None
DEFAULT_VOLUMES_FROM = None
+DEFAULT_AUTO_REMOVE = True
class DockerVolume(object):
@@ -82,6 +83,7 @@
docker_cmd=DEFAULT_DOCKER_COMMAND,
sudo=DEFAULT_SUDO,
sudo_cmd=DEFAULT_SUDO_COMMAND,
+ auto_rm=DEFAULT_AUTO_REMOVE,
host=DEFAULT_HOST,
):
command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
@@ -100,6 +102,8 @@
command_parts.extend(["-w", working_directory])
if net:
command_parts.extend(["--net", net])
+ if auto_rm:
+ command_parts.append("--rm")
full_image = image
if tag:
full_image = "%s:%s" % (full_image, tag)
https://bitbucket.org/galaxy/galaxy-central/commits/d252ac015734/
Changeset: d252ac015734
User: jmchilton
Date: 2014-10-06 01:45:08+00:00
Summary: Merged in kellrott/galaxy-farm/docker-work (pull request #516)
Running docker with 'auto-remove' be default
Affected #: 3 files
diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 config/job_conf.xml.sample_advanced
--- a/config/job_conf.xml.sample_advanced
+++ b/config/job_conf.xml.sample_advanced
@@ -77,7 +77,7 @@
of old LWR job runner. If your Pulsar server is running on a
Windows machine for instance this runner should still be used.
- These destinations still needs to target a Pulsar server,
+ These destinations still needs to target a Pulsar server,
older LWR plugins and destinations still work in Galaxy can
target LWR servers, but this support should be considered
deprecated and will disappear with a future release of Galaxy.
@@ -110,7 +110,7 @@
<destination id="local" runner="local"/><destination id="multicore_local" runner="local"><param id="local_slots">4</param><!-- Specify GALAXY_SLOTS for local jobs. -->
- <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over
+ <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over
allocating machine define a second local runner with different name and fewer workers
to run this destination. --><param id="embed_metadata_in_job">True</param>
@@ -119,7 +119,7 @@
try it early - it will slightly speed up local jobs by
embedding metadata calculation in job script itself.
-->
- <job_metrics />
+ <job_metrics /><!-- Above element demonstrates embedded job metrics definition - see
job_metrics_conf.xml.sample for full documentation on possible nested
elements. This empty block will simply disable job metrics for the
@@ -134,12 +134,12 @@
destination - but be sure to add any library paths or data incides
that may be needed read-only.
-->
- <!--
+ <!--
<param id="docker_volumes">$defaults,/mnt/galaxyData/libraries:ro,/mnt/galaxyData/indices:ro</param>
--><!-- For a stock Galaxy instance and traditional job runner $defaults will
expand out as:
-
+
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw
This assumes most of what is needed is available under Galaxy's root directory,
@@ -153,7 +153,7 @@
$galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:ro
- If using the Pulsar, defaults will be even further restricted because the
+ If using the Pulsar, defaults will be even further restricted because the
Pulsar will (by default) stage all needed inputs into the job's job_directory
(so there is not need to allow the docker container to read all the
files - let alone write over them). Defaults in this case becomes:
@@ -173,15 +173,15 @@
<!-- Control memory allocatable by docker container with following option:
--><!-- <param id="docker_memory">24G</param> -->
- <!-- By default Docker will need to runnable by Galaxy using
+ <!-- By default Docker will need to runnable by Galaxy using
password-less sudo - this can be configured by adding the
following line to the sudoers file of all compute nodes
with docker enabled:
-
+
galaxy ALL = (root) NOPASSWD: SETENV: /usr/bin/docker
- The follow option is set to false to disable sudo (docker
- must likewise be configured to allow this).
+ The follow option is set to false to disable sudo (docker
+ must likewise be configured to allow this).
--><!-- <param id="docker_sudo">false</param> --><!-- Following option can be used to tweak sudo command used by
@@ -192,6 +192,11 @@
http://docs.docker.io/reference/run/#network-settings
--><!-- <param id="docker_net">bridge</param> -->
+ <!-- By default, a container will live on past its run. By
+ adding the '--rm' flag to the command line, the container
+ will be removed automatically after the program is complete.
+ -->
+ <!-- <param id="docker_auto_rm">false</param> --><!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different
@@ -265,7 +270,7 @@
<!-- Burst out from static destination local_cluster_8_core to
static destination shared_cluster_8_core when there are about
50 Galaxy jobs assigned to any of the local_cluster_XXX
- destinations (either running or queued). If there are fewer
+ destinations (either running or queued). If there are fewer
than 50 jobs, just use local_cluster_8_core destination.
Uncomment job_state parameter to make this bursting happen when
@@ -294,8 +299,8 @@
configuration. --><param id="private_token">123456789changeme</param><!-- Uncomment the following statement to disable file staging (e.g.
- if there is a shared file system between Galaxy and the Pulsar
- server). Alternatively action can be set to 'copy' - to replace
+ if there is a shared file system between Galaxy and the Pulsar
+ server). Alternatively action can be set to 'copy' - to replace
http transfers with file system copies, 'remote_transfer' to cause
the Pulsar to initiate HTTP transfers instead of Galaxy, or
'remote_copy' to cause Pulsar to initiate file system copies.
@@ -337,7 +342,7 @@
instead. This may be required if remote host is Windows machine
but probably not otherwise.
-->
- <!-- <param id="rewrite_parameters">false</params> -->
+ <!-- <param id="rewrite_parameters">false</params> --></destination><destination id="pulsar_mq_dest" runner="amqp_pulsar" ><!-- The RESTful Pulsar client sends a request to Pulsar
diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 lib/galaxy/tools/deps/containers.py
--- a/lib/galaxy/tools/deps/containers.py
+++ b/lib/galaxy/tools/deps/containers.py
@@ -208,6 +208,7 @@
env_directives=env_directives,
working_directory=working_directory,
net=prop("net", "none"), # By default, docker instance has networking disabled
+ auto_rm=prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE),
**docker_host_props
)
return "%s\n%s" % (cache_command, run_command)
diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -8,6 +8,7 @@
DEFAULT_NET = None
DEFAULT_MEMORY = None
DEFAULT_VOLUMES_FROM = None
+DEFAULT_AUTO_REMOVE = True
class DockerVolume(object):
@@ -82,6 +83,7 @@
docker_cmd=DEFAULT_DOCKER_COMMAND,
sudo=DEFAULT_SUDO,
sudo_cmd=DEFAULT_SUDO_COMMAND,
+ auto_rm=DEFAULT_AUTO_REMOVE,
host=DEFAULT_HOST,
):
command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
@@ -100,6 +102,8 @@
command_parts.extend(["-w", working_directory])
if net:
command_parts.extend(["--net", net])
+ if auto_rm:
+ command_parts.append("--rm")
full_image = image
if tag:
full_image = "%s:%s" % (full_image, tag)
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/054d8af08f09/
Changeset: 054d8af08f09
Branch: next-stable
User: jmchilton
Date: 2014-10-06 01:36:27+00:00
Summary: Backport Kyle's fix to docker's host argument from default.
See https://bitbucket.org/galaxy/galaxy-central/pull-request/515/fixing-how-doc….
Affected #: 1 file
diff -r 12497a97f7d22d08c6fdafe0c544b4f7a906da98 -r 054d8af08f098c76b9b64eb5d60835956abc8ae1 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -116,5 +116,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
https://bitbucket.org/galaxy/galaxy-central/commits/37cf5505992b/
Changeset: 37cf5505992b
User: jmchilton
Date: 2014-10-06 01:36:43+00:00
Summary: Merge next-stable.
Affected #: 1 file
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.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm (pull request #515)
by commits-noreply@bitbucket.org 05 Oct '14
by commits-noreply@bitbucket.org 05 Oct '14
05 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b42fee58bc40/
Changeset: b42fee58bc40
User: jmchilton
Date: 2014-10-06 01:35:01+00:00
Summary: Merged in kellrott/galaxy-farm (pull request #515)
Fixing how docker_utils.__docker_prefix adds host info to command line
Affected #: 1 file
diff -r 3aa7288f5a97970df22fd38c400237028fe33e4b -r b42fee58bc402de82fb4667baa575cb81ab55f4b lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -116,5 +116,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b94303434f03/
Changeset: b94303434f03
User: kell...(a)gmail.com
Date: 2014-10-05 05:01:12+00:00
Summary: Fixing how docker_util.__docker_prefix sets the host information
Affected #: 1 file
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r b94303434f031569a3484edb14e5d1b7a29c36d5 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -59,6 +59,7 @@
):
inspect_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
inspect_command_parts.extend(["inspect", image])
+ print inspect_command_parts
inspect_image_command = " ".join(inspect_command_parts)
pull_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
@@ -116,5 +117,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
https://bitbucket.org/galaxy/galaxy-central/commits/4aca849f229f/
Changeset: 4aca849f229f
User: kell...(a)gmail.com
Date: 2014-10-05 05:05:38+00:00
Summary: Removing stray print statement
Affected #: 1 file
diff -r b94303434f031569a3484edb14e5d1b7a29c36d5 -r 4aca849f229f538770376d091fac30e4a76854a8 lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -59,7 +59,6 @@
):
inspect_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
inspect_command_parts.extend(["inspect", image])
- print inspect_command_parts
inspect_image_command = " ".join(inspect_command_parts)
pull_command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host)
https://bitbucket.org/galaxy/galaxy-central/commits/b42fee58bc40/
Changeset: b42fee58bc40
User: jmchilton
Date: 2014-10-06 01:35:01+00:00
Summary: Merged in kellrott/galaxy-farm (pull request #515)
Fixing how docker_utils.__docker_prefix adds host info to command line
Affected #: 1 file
diff -r 3aa7288f5a97970df22fd38c400237028fe33e4b -r b42fee58bc402de82fb4667baa575cb81ab55f4b lib/galaxy/tools/deps/docker_util.py
--- a/lib/galaxy/tools/deps/docker_util.py
+++ b/lib/galaxy/tools/deps/docker_util.py
@@ -116,5 +116,5 @@
command_parts.append(sudo_cmd)
command_parts.append(docker_cmd)
if host:
- command_parts.append(["-H", host])
+ command_parts.extend(["-H", host])
return command_parts
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.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm/tool-autoload (pull request #512)
by commits-noreply@bitbucket.org 05 Oct '14
by commits-noreply@bitbucket.org 05 Oct '14
05 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3aa7288f5a97/
Changeset: 3aa7288f5a97
User: jmchilton
Date: 2014-10-06 01:31:21+00:00
Summary: Merged in kellrott/galaxy-farm/tool-autoload (pull request #512)
Adding tool_library_dir to tool_conf parser
Affected #: 3 files
diff -r 342ee791fe55b3bca0bbbe86c2e58509a9f96df6 -r 3aa7288f5a97970df22fd38c400237028fe33e4b lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -235,7 +235,8 @@
elif elem.tag == 'label':
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
- self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ self.load_tooldir_tag_set( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -687,7 +688,7 @@
elif sub_elem.tag == 'label':
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
- self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ self.load_tooldir_tag_set( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -696,8 +697,12 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
+
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
def quick_load( tool_file, async=True ):
try:
@@ -717,16 +722,21 @@
# will be False when things like functional tests are the caller.
self.fix_integrated_tool_panel_dict()
self.write_integrated_tool_panel_config_file()
-
return tool.id
except Exception:
log.exception("Failed to load potential tool %s." % tool_file)
return None
+ tool_loaded = False
for name in os.listdir( directory ):
- if name.endswith( ".xml" ):
- quick_load( os.path.join( directory, name), async=False )
- self.tool_watcher.watch_directory( directory, quick_load )
+ child_path = os.path.join(directory, name)
+ if os.path.isdir(child_path) and recursive:
+ self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
+ elif name.endswith( ".xml" ):
+ quick_load( child_path, async=False )
+ tool_loaded = True
+ if tool_loaded:
+ self.tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
"""Load a single tool from the file named by `config_file` and return an instance of `Tool`."""
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.
1
0
7 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7666506937e2/
Changeset: 7666506937e2
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-09-25 22:24:31+00:00
Summary: Adding in the ability to configure a tool 'auto-load' directory.
Affected #: 3 files
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 7666506937e21d70856474a9406f444799579349 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -120,7 +120,7 @@
# tool shed install data. There are many situtations in which it is
# valuable to seperate these - for instance bootstrapping fresh Galaxy
# instances with pretested installs. The following optin can be used to
-# separate the tool shed install database (all other options listed above
+# separate the tool shed install database (all other options listed above
# but prefixed with install_ are also available).
#install_database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE
@@ -160,6 +160,14 @@
# Other tool config files must include the tool_path as an attribute in the <toolbox> tag.
#tool_path = tools
+# Path to autoload tools from.
+# Every directory inside the autoload directory will be scanned for *.xml files
+# and those will be loaded as tool descriptors
+#tool_autoload_dir = ./tool-autoload
+
+# Autoload Panel, for all tools that are autoloaded, they are placed in this tool section
+#tool_autoload_section = Development
+
# Path to the directory in which tool dependencies are placed. This is used by
# the tool shed to install dependencies and can also be used by administrators
# to manually install or link to dependencies. For details, see:
@@ -173,7 +181,7 @@
#tool_sheds_config_file = config/tool_sheds_conf.xml
# Enable automatic polling of relative tool sheds to see if any updates
-# are available for installed repositories. Ideally only one Galaxy
+# are available for installed repositories. Ideally only one Galaxy
# server process should be able to check for repository updates. The
# setting for hours_between_check should be an integer between 1 and 24.
#enable_tool_shed_check = False
@@ -238,7 +246,7 @@
#citation_cache_data_dir = database/citations/data
#citation_cache_lock_dir = database/citations/lock
-# External service types config file, defines what types of external_services configurations
+# External service types config file, defines what types of external_services configurations
# are available in Galaxy (.sample is used if default does not exist).
#external_service_type_config_file = config/external_service_types_conf.xml
@@ -347,15 +355,15 @@
# -- Account activation
-# This is user account activation feature global flag. If set to "False" the rest of the Account
+# This is user account activation feature global flag. If set to "False" the rest of the Account
# activation configuration is ignored and user activation is disabled (a.k.a. accounts are active since registration).
# Note the activation is also not working in case the smtp server is not defined.
#user_activation_on = False
-# Activation grace period. Activation is not forced (login is not disabled) until
+# Activation grace period. Activation is not forced (login is not disabled) until
# grace period has passed. Users under grace period can't run jobs (see inactivity_box_content).
-# In hours. Default is 3. Enter 0 to disable grace period.
-# Users with OpenID logins have grace period forever.
+# In hours. Default is 3. Enter 0 to disable grace period.
+# Users with OpenID logins have grace period forever.
#activation_grace_period = 0
# Used for warning box for inactive accounts (unable to run jobs).
@@ -415,7 +423,7 @@
# - $iso8601 (complete format string as specified by ISO 8601 international standard).
# pretty_datetime_format = $locale (UTC)
-# The URL of the page to display in Galaxy's middle pane when loaded. This can be
+# The URL of the page to display in Galaxy's middle pane when loaded. This can be
# an absolute or relative URL.
#welcome_url = /static/welcome.html
@@ -447,7 +455,7 @@
# The URL linked by the "Galaxy Q&A" link in the "Help" menu
# The Galaxy Q&A site is under development; when the site is done, this URL
# will be set and uncommented.
-#qa_url =
+#qa_url =
# Serve static content, which must be enabled if you're not serving it via a
# proxy server. These options should be self explanatory and so are not
@@ -600,7 +608,7 @@
# if testing shows that Galaxy is able to create files using these formats.
# Specific formats can be disabled with this option, separate more than one
# format with commas. Available formats are currently 'zip', 'gz', and 'bz2'.
-#disable_library_comptypes =
+#disable_library_comptypes =
# Some sequencer integration features in beta allow you to automatically
# transfer datasets. This is done using a lightweight transfer manager which
@@ -750,7 +758,7 @@
# File where Data Managers are configured (.sample used if default does not
# exist)
#data_manager_config_file = config/data_manager_conf.xml
-# File where Tool Shed based Data Managers are configured
+# File where Tool Shed based Data Managers are configured
#shed_data_manager_config_file = config/shed_data_manager_conf.xml
# Directory to store Data Manager based tool-data; defaults to tool_data_path
#galaxy_data_manager_data_path = tool-data
@@ -869,11 +877,11 @@
# ---- Galaxy External Message Queue -------------------------------------------------
-# Galaxy uses AMQ protocol to receive messages from external sources like
+# Galaxy uses AMQ protocol to receive messages from external sources like
# bar code scanners. Galaxy has been tested against RabbitMQ AMQP implementation.
-# For Galaxy to receive messages from a message queue the RabbitMQ server has
+# For Galaxy to receive messages from a message queue the RabbitMQ server has
# to be set up with a user account and other parameters listed below. The 'host'
-# and 'port' fields should point to where the RabbitMQ server is running.
+# and 'port' fields should point to where the RabbitMQ server is running.
[galaxy_amqp]
@@ -886,4 +894,3 @@
#exchange = galaxy_exchange
#routing_key = bar_code_scanner
#rabbitmqctl_path = /path/to/rabbitmqctl
-
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 7666506937e21d70856474a9406f444799579349 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -88,6 +88,9 @@
self.user_label_filters = listify( kwargs.get( "user_tool_label_filters", [] ), do_strip=True )
self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True )
+ self.tool_autoload_dir = kwargs.get( "tool_autoload_dir", None )
+ self.tool_autoload_section = kwargs.get( "tool_autoload_section", None )
+
# Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have
# been migrated from the Galaxy code distribution to the Tool Shed.
self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) )
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r 7666506937e21d70856474a9406f444799579349 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -157,6 +157,23 @@
self.init_tools( config_filename )
except:
log.exception( "Error loading tools defined in config %s", config_filename )
+ if self.app.config.tool_autoload_dir is not None:
+ log.info("Autoloading tool directory: %s" % (self.app.config.tool_autoload_dir))
+
+ auto_load_section = ToolSection({
+ 'id' : "__tool_autoload__",
+ 'version' : "1.0.0",
+ 'name' : self.app.config.tool_autoload_section})
+
+ for tool_xml_path in glob.glob(os.path.join(self.app.config.tool_autoload_dir, "*", "*.xml")):
+ log.info("AutoLoading: %s" % (tool_xml_path))
+ tool = self.load_tool(tool_xml_path)
+ self.tools_by_id[ tool.id ] = tool
+ self.__add_tool_to_tool_panel( tool, auto_load_section, section=True )
+
+ self.tool_panel[ "__tool_autoload__" ] = auto_load_section
+ #self.__add_tool_to_tool_panel( auto_load_section, self.tool_panel, section=False )
+
if self.app.name == 'galaxy' and self.integrated_tool_panel_config_has_contents:
# Load self.tool_panel based on the order in self.integrated_tool_panel.
self.load_tool_panel()
@@ -816,7 +833,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
https://bitbucket.org/galaxy/galaxy-central/commits/3a03061c4a85/
Changeset: 3a03061c4a85
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-10-01 06:10:09+00:00
Summary: Default Merge
Affected #: 116 files
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/galaxy.frame.js
--- a/client/galaxy/scripts/galaxy.frame.js
+++ b/client/galaxy/scripts/galaxy.frame.js
@@ -1,9 +1,8 @@
// dependencies
define(["galaxy.masthead", "mvc/ui/ui-frames"], function(mod_masthead, Frames) {
-// frame manager
-var GalaxyFrame = Backbone.View.extend(
-{
+/** Frame manager uses the ui-frames to create the scratch book masthead icon and functionality **/
+var GalaxyFrame = Backbone.View.extend({
// base element
el_main: 'body',
@@ -17,8 +16,7 @@
button_load : null,
// initialize
- initialize : function(options)
- {
+ initialize : function(options) {
// add to masthead menu
var self = this;
@@ -28,8 +26,7 @@
});
// add activate icon
- this.button_active = new mod_masthead.GalaxyMastheadIcon (
- {
+ this.button_active = new mod_masthead.GalaxyMastheadIcon({
icon : 'fa-th',
tooltip : 'Enable/Disable Scratchbook',
onclick : function() { self._activate(); },
@@ -44,8 +41,7 @@
Galaxy.masthead.append(this.button_active);
// add load icon
- this.button_load = new mod_masthead.GalaxyMastheadIcon (
- {
+ this.button_load = new mod_masthead.GalaxyMastheadIcon({
icon : 'fa-eye',
tooltip : 'Show/Hide Scratchbook',
onclick : function(e) {
@@ -122,35 +118,77 @@
});
},
+
+ /**
+ * Add a trackster visualization to the frames.
+ */
+ add_trackster_viz: function(viz_id) {
+ var self = this;
+ require(['viz/visualization', 'viz/trackster'], function(visualization, trackster) {
+ var viz = new visualization.Visualization({id: viz_id});
+ $.when( viz.fetch() ).then( function() {
+ var ui = new trackster.TracksterUI(galaxy_config.root);
+
+ // Construct frame config based on dataset's type.
+ var frame_config = {
+ title: viz.get('name'),
+ type: 'other',
+ content: function(parent_elt) {
+ // Create view config.
+ var view_config = {
+ container: parent_elt,
+ name: viz.get('title'),
+ id: viz.id,
+ // FIXME: this will not work with custom builds b/c the dbkey needed to be encoded.
+ dbkey: viz.get('dbkey'),
+ stand_alone: false
+ },
+ latest_revision = viz.get('latest_revision'),
+ drawables = latest_revision.config.view.drawables;
+
+ // Set up datasets in drawables.
+ _.each(drawables, function(d) {
+ d.dataset = {
+ hda_ldda: d.hda_ldda,
+ id: d.dataset_id
+ };
+ });
+
+ view = ui.create_visualization(view_config,
+ latest_revision.config.viewport,
+ latest_revision.config.view.drawables,
+ latest_revision.config.bookmarks,
+ false);
+ }
+ };
+
+ self.add(frame_config);
+ });
+ });
+ },
/**
* Add and display a new frame/window based on options.
*/
- add: function(options)
- {
+ add: function(options){
// open new tab
- if (options.target == '_blank')
- {
+ if (options.target == '_blank'){
window.open(options.content);
return;
}
// reload entire window
- if (options.target == '_top' || options.target == '_parent' || options.target == '_self')
- {
+ if (options.target == '_top' || options.target == '_parent' || options.target == '_self'){
window.location = options.content;
return;
}
// validate
- if (!this.active)
- {
+ if (!this.active){
// fix url if main frame is unavailable
var $galaxy_main = $(window.parent.document).find('#galaxy_main');
- if (options.target == 'galaxy_main' || options.target == 'center')
- {
- if ($galaxy_main.length === 0)
- {
+ if (options.target == 'galaxy_main' || options.target == 'center'){
+ if ($galaxy_main.length === 0){
var href = options.content;
if (href.indexOf('?') == -1)
href += '?';
@@ -173,11 +211,9 @@
},
// activate/disable panel
- _activate: function ()
- {
+ _activate: function (){
// check
- if (this.active)
- {
+ if (this.active){
// disable
this.active = false;
@@ -196,8 +232,7 @@
},
// update frame counter
- _refresh: function()
- {
+ _refresh: function(){
// update on screen counter
this.button_load.number(this.frames.length());
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/galaxy.masthead.js
--- a/client/galaxy/scripts/galaxy.masthead.js
+++ b/client/galaxy/scripts/galaxy.masthead.js
@@ -1,9 +1,8 @@
// dependencies
define([], function() {
-// masthead
-var GalaxyMasthead = Backbone.View.extend(
-{
+/** Masthead **/
+var GalaxyMasthead = Backbone.View.extend({
// base element
el_masthead: '#everything',
@@ -17,8 +16,7 @@
list: [],
// initialize
- initialize : function(options)
- {
+ initialize : function(options) {
// update options
this.options = options;
@@ -51,27 +49,23 @@
},
// configure events
- events:
- {
+ events: {
'click' : '_click',
'mousedown' : function(e) { e.preventDefault() }
},
// adds a new item to the masthead
- append : function(item)
- {
+ append : function(item) {
return this._add(item, true);
},
// adds a new item to the masthead
- prepend : function(item)
- {
+ prepend : function(item) {
return this._add(item, false);
},
// activate
- highlight: function(id)
- {
+ highlight: function(id) {
var current = $(this.el).find('#' + id + '> li');
if (current) {
current.addClass('active');
@@ -79,11 +73,9 @@
},
// adds a new item to the masthead
- _add : function(item, append)
- {
+ _add : function(item, append) {
var $loc = $(this.el).find('#' + item.location);
- if ($loc)
- {
+ if ($loc){
// create frame for new item
var $current = $(item.el);
@@ -106,8 +98,7 @@
},
// handle click event
- _click: function(e)
- {
+ _click: function(e) {
// close all popups
var $all = $(this.el).find('.popup');
if ($all) {
@@ -129,8 +120,7 @@
*/
// fill template
- _template: function(options)
- {
+ _template: function(options) {
var brand_text = options.brand ? ("/ " + options.brand) : "" ;
return '<div><div id="masthead" class="navbar navbar-fixed-top navbar-inverse">' +
'<div style="position: relative; right: -50%; float: left;">' +
@@ -150,12 +140,10 @@
}
});
-// icon
-var GalaxyMastheadIcon = Backbone.View.extend(
-{
+/** Masthead icon **/
+var GalaxyMastheadIcon = Backbone.View.extend({
// icon options
- options:
- {
+ options:{
id : '',
icon : 'fa-cog',
tooltip : '',
@@ -169,8 +157,7 @@
location: 'iconbar',
// initialize
- initialize: function (options)
- {
+ initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
@@ -189,20 +176,17 @@
},
// show
- show: function()
- {
+ show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
- hide: function()
- {
+ hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// switch icon
- icon: function (new_icon)
- {
+ icon: function (new_icon){
// update icon class
$(this.el).find('.icon').removeClass(this.options.icon)
.addClass(new_icon);
@@ -212,26 +196,22 @@
},
// toggle
- toggle: function()
- {
+ toggle: function(){
$(this.el).addClass('toggle');
},
// untoggle
- untoggle: function()
- {
+ untoggle: function(){
$(this.el).removeClass('toggle');
},
// set/get number
- number: function(new_number)
- {
+ number: function(new_number){
$(this.el).find('.number').text(new_number);
},
// fill template icon
- _template: function (options)
- {
+ _template: function (options){
var tmpl = '<div id="' + options.id + '" class="symbol">' +
'<div class="icon fa fa-2x ' + options.icon + '"></div>';
if (options.with_number)
@@ -243,12 +223,10 @@
}
});
-// tab
-var GalaxyMastheadTab = Backbone.View.extend(
-{
+/** Masthead tab **/
+var GalaxyMastheadTab = Backbone.View.extend({
// main options
- options:
- {
+ options:{
id : '',
title : '',
target : '_parent',
@@ -268,14 +246,12 @@
$menu: null,
// events
- events:
- {
+ events:{
'click .head' : '_head'
},
// initialize
- initialize: function (options)
- {
+ initialize: function (options){
// read in defaults
if (options)
this.options = _.defaults(options, this.options);
@@ -300,20 +276,17 @@
},
// show
- show: function()
- {
+ show: function(){
$(this.el).css({visibility : 'visible'});
},
// show
- hide: function()
- {
+ hide: function(){
$(this.el).css({visibility : 'hidden'});
},
// add menu item
- add: function (options)
- {
+ add: function (options){
// menu option defaults
var menuOptions = {
title : 'Title',
@@ -333,8 +306,7 @@
menuOptions.content = galaxy_config.root + menuOptions.content;
// check if submenu element is available
- if (!this.$menu)
- {
+ if (!this.$menu){
// insert submenu element into root
$(this.el).find('.root').append(this._templateMenu());
@@ -353,8 +325,7 @@
// add events
var self = this;
- $item.on('click', function(e)
- {
+ $item.on('click', function(e){
// prevent default
e.preventDefault();
@@ -372,8 +343,7 @@
},
// show menu on header click
- _head: function(e)
- {
+ _head: function(e){
// prevent default
e.preventDefault();
@@ -387,8 +357,7 @@
}
},
- _attachPopover : function()
- {
+ _attachPopover : function(){
var $popover_element = $(this.el).find('.head');
$popover_element.popover({
html: true,
@@ -402,25 +371,21 @@
},
// fill template header
- _templateMenuItem: function (options)
- {
+ _templateMenuItem: function (options){
return '<li><a href="' + options.content + '" target="' + options.target + '">' + options.title + '</a></li>';
},
// fill template header
- _templateMenu: function ()
- {
+ _templateMenu: function (){
return '<ul class="popup dropdown-menu"></ul>';
},
- _templateDivider: function()
- {
+ _templateDivider: function(){
return '<li class="divider"></li>';
},
// fill template
- _template: function (options)
- {
+ _template: function (options){
// start template
var tmpl = '<ul id="' + options.id + '" class="nav navbar-nav" border="0" cellspacing="0">' +
'<li class="root dropdown" style="">' +
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/galaxy.menu.js
--- a/client/galaxy/scripts/galaxy.menu.js
+++ b/client/galaxy/scripts/galaxy.menu.js
@@ -1,13 +1,8 @@
-/*
- galaxy menu
-*/
-
// dependencies
define(["galaxy.masthead"], function(mod_masthead) {
-// frame manager
-var GalaxyMenu = Backbone.Model.extend(
-{
+/** GalaxyMenu uses the GalaxyMasthead class in order to add menu items and icons to the Masthead **/
+var GalaxyMenu = Backbone.Model.extend({
// options
options: null,
@@ -15,16 +10,14 @@
masthead: null,
// initialize
- initialize: function(options)
- {
+ initialize: function(options) {
this.options = options.config;
this.masthead = options.masthead;
this.create();
},
// default menu
- create: function()
- {
+ create: function(){
//
// Analyze data tab.
//
@@ -137,8 +130,7 @@
var tab_visualization = new mod_masthead.GalaxyMastheadTab(visualization_options);
- if (this.options.user.valid) //add submenu only when user is logged in
- {
+ if (this.options.user.valid){ //add submenu only when user is logged in
tab_visualization.add({
title : "New Track Browser",
content : "visualization/trackster",
@@ -155,8 +147,7 @@
//
// Cloud menu.
//
- if (this.options.enable_cloud_launch)
- {
+ if (this.options.enable_cloud_launch){
var tab_cloud = new mod_masthead.GalaxyMastheadTab({
id : "cloud",
title : "Cloud",
@@ -172,8 +163,7 @@
//
// Admin.
//
- if (this.options.is_admin_user)
- {
+ if (this.options.is_admin_user) {
var tab_admin = new mod_masthead.GalaxyMastheadTab({
id : "admin",
title : "Admin",
@@ -192,8 +182,7 @@
title : "Help",
title_attribute : 'Support, contact, and community hubs'
});
- if (this.options.biostar_url)
- {
+ if (this.options.biostar_url){
tab_help.add({
title : "Galaxy Biostar",
content : this.options.biostar_url_redirect,
@@ -235,8 +224,7 @@
content : this.options.citation_url,
target : "_blank"
});
- if (this.options.terms_url)
- {
+ if (this.options.terms_url){
tab_help.add({
title : "Terms and Conditions",
content : this.options.terms_url,
@@ -248,8 +236,7 @@
//
// User tab.
//
- if (!this.options.user.valid)
- {
+ if (!this.options.user.valid){
var tab_user = new mod_masthead.GalaxyMastheadTab({
id : "user",
title : "User",
@@ -265,8 +252,7 @@
});
// register
- if (this.options.allow_user_creation)
- {
+ if (this.options.allow_user_creation){
tab_user.add({
title : "Register",
content : "user/create",
@@ -331,8 +317,7 @@
target : "galaxy_main"
});
- if (this.options.use_remote_user)
- {
+ if (this.options.use_remote_user){
tab_user.add({
title : "Public Name",
content : "user/edit_username?cntrller=user",
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/base-mvc.js
--- a/client/galaxy/scripts/mvc/base-mvc.js
+++ b/client/galaxy/scripts/mvc/base-mvc.js
@@ -380,11 +380,6 @@
/** allow the view to be dragged, set up event handlers */
draggableOn : function(){
this.draggable = true;
- //TODO: I have no idea why this doesn't work with the events hash or jq.on()...
- //this.$el.find( '.title-bar' )
- // .attr( 'draggable', true )
- // .bind( 'dragstart', this.dragStartHandler, false )
- // .bind( 'dragend', this.dragEndHandler, false );
this.dragStartHandler = _.bind( this._dragStartHandler, this );
this.dragEndHandler = _.bind( this._dragEndHandler, this );
@@ -402,23 +397,22 @@
},
/** sets the dataTransfer data to the model's toJSON
- * @fires dragstart (bbone event) which is passed this view
+ * @fires draggable:dragstart (bbone event) which is passed the event and this view
*/
_dragStartHandler : function( event ){
- //this.debug( 'dragStartHandler:', this, event, arguments )
- this.trigger( 'dragstart', this );
event.dataTransfer.effectAllowed = 'move';
+ //ASSUMES: this.model
//TODO: all except IE: should be 'application/json', IE: must be 'text'
event.dataTransfer.setData( 'text', JSON.stringify( this.model.toJSON() ) );
+ this.trigger( 'draggable:dragstart', event, this );
return false;
},
/** handle the dragend
- * @fires dragend (bbone event) which is passed this view
+ * @fires draggable:dragend (bbone event) which is passed the event and this view
*/
_dragEndHandler : function( event ){
- this.trigger( 'dragend', this );
- //this.debug( 'dragEndHandler:', event )
+ this.trigger( 'draggable:dragend', event, this );
return false;
}
};
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js
@@ -181,6 +181,8 @@
}
var $visualizations = $( this.templates.visualizations( visualizations, this ) );
+ //HACK: need to re-write those directed at galaxy_main with linkTarget
+ $visualizations.find( '[target="galaxy_main"]').attr( 'target', this.linkTarget );
// use addBack here to include the root $visualizations elem (for the case of 1 visualization)
this._addScratchBookFn( $visualizations.find( '.visualization-link' ).addBack( '.visualization-link' ) );
return $visualizations;
@@ -188,6 +190,7 @@
/** add scratchbook functionality to visualization links */
_addScratchBookFn : function( $links ){
+ var li = this;
$links.click( function( ev ){
if( Galaxy.frame && Galaxy.frame.active ){
Galaxy.frame.add({
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/dataset/dataset-li.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-li.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-li.js
@@ -160,7 +160,7 @@
// add frame manager option onclick event
var self = this;
displayBtnData.onclick = function( ev ){
- if( Galaxy.frame && Galaxy.frame.active ){
+ if (Galaxy.frame && Galaxy.frame.active) {
// Add dataset to frames.
Galaxy.frame.add_dataset(self.model.get('id'));
ev.preventDefault();
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/dataset/dataset-model.js
--- a/client/galaxy/scripts/mvc/dataset/dataset-model.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-model.js
@@ -359,74 +359,11 @@
Backbone.Collection.prototype.set.call( this, models, options );
},
-// /** Convert this ad-hoc collection of hdas to a formal collection tracked
-// by the server.
-// **/
-// promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
-////TODO: seems like this would be better in mvc/collections
-// options = options || {};
-// options.url = this.url();
-// options.type = "POST";
-// var full_collection_type = collection_type;
-// var element_identifiers = [],
-// name = null;
-//
-// // This mechanism is rough - no error handling, allows invalid selections, no way
-// // for user to pick/override element identifiers. This is only really meant
-// if( collection_type === "list" ) {
-// this.chain().each( function( hda ) {
-// // TODO: Handle duplicate names.
-// var name = hda.attributes.name;
-// var id = hda.get('id');
-// var content_type = hda.attributes.history_content_type;
-// if( content_type === "dataset" ) {
-// if( full_collection_type !== "list" ) {
-// this.log( "Invalid collection type" );
-// }
-// element_identifiers.push( { name: name, src: "hda", id: id } );
-// } else {
-// if( full_collection_type === "list" ) {
-// full_collection_type = "list:" + hda.attributes.collection_type;
-// } else {
-// if( full_collection_type !== "list:" + hda.attributes.collection_type ) {
-// this.log( "Invalid collection type" );
-// }
-// }
-// element_identifiers.push( { name: name, src: "hdca", id: id } );
-// }
-// });
-// name = "New Dataset List";
-// } else if( collection_type === "paired" ) {
-// var ids = this.ids();
-// if( ids.length !== 2 ){
-// // TODO: Do something...
-// }
-// element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } );
-// element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } );
-// name = "New Dataset Pair";
-// }
-// options.data = {
-// type: "dataset_collection",
-// name: name,
-// collection_type: full_collection_type,
-// element_identifiers: JSON.stringify( element_identifiers )
-// };
-//
-// var xhr = jQuery.ajax( options );
-// xhr.done( function( message, status, responseObj ){
-// history.refresh( );
-// });
-// xhr.fail( function( xhr, status, message ){
-// if( xhr.responseJSON && xhr.responseJSON.error ){
-// error = xhr.responseJSON.error;
-// } else {
-// error = xhr.responseJSON;
-// }
-// xhr.responseText = error;
-// // Do something?
-// });
-// return xhr;
-// },
+ ///** Convert this ad-hoc collection of hdas to a formal collection tracked
+ // by the server.
+ //**/
+ //promoteToHistoryDatasetCollection : function _promote( history, collection_type, options ){
+ //},
/** String representation. */
toString : function(){
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-contents.js
--- a/client/galaxy/scripts/mvc/history/history-contents.js
+++ b/client/galaxy/scripts/mvc/history/history-contents.js
@@ -187,6 +187,7 @@
/** copy an existing, accessible hda into this collection */
copy : function( id ){
+//TODO: incorp collections
var collection = this,
xhr = jQuery.post( this.url(), {
source : 'hda',
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-model.js
--- a/client/galaxy/scripts/mvc/history/history-model.js
+++ b/client/galaxy/scripts/mvc/history/history-model.js
@@ -14,7 +14,7 @@
* @constructs
*/
var History = Backbone.Model.extend( BASE_MVC.LoggableMixin ).extend(
-/** @lends History.prototype */{
+ BASE_MVC.mixin( BASE_MVC.SearchableModelMixin, /** @lends History.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
@@ -117,7 +117,19 @@
return _.reduce( _.values( this.get( 'state_details' ) ), function( memo, num ){ return memo + num; }, 0 );
},
- // ........................................................................ ajax
+ // ........................................................................ search
+ /** What model fields to search with */
+ searchAttributes : [
+ 'name', 'annotation', 'tags'
+ ],
+
+ /** Adding title and singular tag */
+ searchAliases : {
+ title : 'name',
+ tag : 'tags'
+ },
+
+ // ........................................................................ updates
/** does the contents collection indicate they're still running and need to be updated later?
* delay + update if needed
* @param {Function} onReadyCallback function to run when all contents are in the ready state
@@ -187,6 +199,18 @@
return xhr;
},
+ // ........................................................................ ajax
+ /** save this history, _Mark_ing it as deleted (just a flag) */
+ _delete : function( options ){
+ if( this.get( 'deleted' ) ){ return jQuery.when(); }
+ return this.save( { deleted: true }, options );
+ },
+ /** save this history, _Mark_ing it as undeleted */
+ undelete : function( options ){
+ if( !this.get( 'deleted' ) ){ return jQuery.when(); }
+ return this.save( { deleted: false }, options );
+ },
+
/** Make a copy of this history on the server
* @param {Boolean} current if true, set the copy as the new current history (default: true)
* @param {String} name name of new history (default: none - server sets to: Copy of <current name>)
@@ -210,9 +234,28 @@
//TODO:?? all datasets?
var history = this,
- xhr = jQuery.post( this.urlRoot, postData );
- xhr.done( function( newData ){
- history.trigger( 'copied', history, newData );
+ copy = jQuery.post( this.urlRoot, postData );
+ // if current - queue to setAsCurrent before firing 'copied'
+ if( current ){
+ return copy.then( function( response ){
+ var newHistory = new History( response );
+ return newHistory.setAsCurrent()
+ .done( function(){
+ history.trigger( 'copied', history, response );
+ });
+ });
+ }
+ return copy.done( function( response ){
+ history.trigger( 'copied', history, response );
+ });
+ },
+
+ setAsCurrent : function(){
+ var history = this,
+ xhr = jQuery.getJSON( '/history/set_as_current?id=' + this.id );
+
+ xhr.done( function(){
+ history.trigger( 'set-as-current', history );
});
return xhr;
},
@@ -221,7 +264,7 @@
toString : function(){
return 'History(' + this.get( 'id' ) + ',' + this.get( 'name' ) + ')';
}
-});
+}));
//------------------------------------------------------------------------------ CLASS VARS
/** When the history has running hdas,
@@ -351,12 +394,15 @@
create : function create( data, hdas, historyOptions, xhrOptions ){
var collection = this,
- history = new History( data || {}, hdas || [], historyOptions || {} );
- return history.save( xhrOptions ).done( function( newData ){
+ xhr = jQuery.getJSON( galaxy_config.root + 'history/create_new_current' );
+ return xhr.done( function( newData ){
+ var history = new History( newData, [], historyOptions || {} );
// new histories go in the front
//TODO: (implicit ordering by update time...)
collection.unshift( history );
+ collection.trigger( 'new-current' );
});
+//TODO: move back to using history.save (via Deferred.then w/ set_as_current)
},
toString: function toString(){
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-panel-edit-current.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit-current.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit-current.js
@@ -398,14 +398,17 @@
//TODO: move show_deleted/hidden into panel from opt menu and remove this
/** add listeners to an external options menu (templates/webapps/galaxy/root/index.mako) */
connectToOptionsMenu : function( optionsMenu ){
+ var panel = this;
if( !optionsMenu ){
- return this;
+ return panel;
}
// set a visible indication in the popupmenu for show_hidden/deleted based on the currHistoryPanel's settings
- this.on( 'new-storage', function( storage, panel ){
- if( optionsMenu && storage ){
- optionsMenu.findItemByHtml( _l( 'Include Deleted Datasets' ) ).checked = storage.get( 'show_deleted' );
- optionsMenu.findItemByHtml( _l( 'Include Hidden Datasets' ) ).checked = storage.get( 'show_hidden' );
+ this.on( 'new-storage show-deleted show-hidden', function(){
+//TODO: global
+ var menu = ( Galaxy && Galaxy.historyOptionsMenu )? Galaxy.historyOptionsMenu : undefined;
+ if( menu ){
+ menu.findItemByHtml( _l( 'Include Deleted Datasets' ) ).checked = panel.showDeleted;
+ menu.findItemByHtml( _l( 'Include Hidden Datasets' ) ).checked = panel.showHidden;
}
});
return this;
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-panel-edit.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit.js
@@ -69,6 +69,17 @@
this.multiselectActions = attributes.multiselectActions || this._getActions();
},
+ /** Override to handle history as drag-drop target */
+ _setUpListeners : function(){
+ _super.prototype._setUpListeners.call( this );
+
+ this.on( 'drop', function( ev, data ){
+ this.dataDropped( data );
+ // remove the drop target
+ this.dropTargetOff();
+ });
+ },
+
// ------------------------------------------------------------------------ listeners
/** listening for collection events */
_setUpCollectionListeners : function(){
@@ -104,6 +115,42 @@
return $newRender;
},
+ /** override to render counts when the items are rendered */
+ renderItems : function( $whereTo ){
+ var views = _super.prototype.renderItems.call( this, $whereTo );
+ this._renderCounts( $whereTo );
+ return views;
+ },
+
+ /** override to show counts, what's deleted/hidden, and links to toggle those */
+ _renderCounts : function( $whereTo ){
+//TODO: too complicated
+ function toggleLink( _class, text ){
+ return [ '<a class="', _class, '" href="javascript:void(0);">', text, '</a>' ].join( '' );
+ }
+ $whereTo = $whereTo || this.$el;
+ var deleted = this.collection.where({ deleted: true }),
+ hidden = this.collection.where({ visible: false }),
+ msgs = [];
+
+ if( this.views.length ){
+ msgs.push( [ this.views.length, _l( 'shown' ) ].join( ' ' ) );
+ }
+ if( deleted.length ){
+ msgs.push( ( !this.showDeleted )?
+ ([ deleted.length, toggleLink( 'toggle-deleted-link', _l( 'deleted' ) ) ].join( ' ' ))
+ :( toggleLink( 'toggle-deleted-link', _l( 'hide deleted' ) ) )
+ );
+ }
+ if( hidden.length ){
+ msgs.push( ( !this.showHidden )?
+ ([ hidden.length, toggleLink( 'toggle-hidden-link', _l( 'hidden' ) ) ].join( ' ' ))
+ :( toggleLink( 'toggle-hidden-link', _l( 'hide hidden' ) ) )
+ );
+ }
+ return $whereTo.find( '.subtitle' ).html( msgs.join( ', ' ) );
+ },
+
/** render the tags sub-view controller */
_renderTags : function( $where ){
var panel = this;
@@ -296,10 +343,18 @@
return options;
},
+ ///** Override to alter data in drag based on multiselection */
+ //_setUpItemViewListeners : function( view ){
+ // var panel = this;
+ // _super.prototype._setUpItemViewListeners.call( panel, view );
+ //
+ //},
+
/** If this item is deleted and we're not showing deleted items, remove the view
* @param {Model} the item model to check
*/
_handleHdaDeletionChange : function( itemModel ){
+ this._renderCounts();
if( itemModel.get( 'deleted' ) && !this.showDeleted ){
this.removeItemView( itemModel );
}
@@ -309,6 +364,7 @@
* @param {Model} the item model to check
*/
_handleHdaVisibleChange : function( itemModel ){
+ this._renderCounts();
if( itemModel.hidden() && !this.storage.showHidden ){
this.removeItemView( itemModel );
}
@@ -337,7 +393,9 @@
// ------------------------------------------------------------------------ panel events
/** event map */
events : _.extend( _.clone( _super.prototype.events ), {
- 'click .show-selectors-btn' : 'toggleSelectors'
+ 'click .show-selectors-btn' : 'toggleSelectors',
+ 'click .toggle-deleted-link' : function( ev ){ this.toggleShowDeleted(); },
+ 'click .toggle-hidden-link' : function( ev ){ this.toggleShowHidden(); }
}),
/** Update the history size display (curr. upper right of panel).
@@ -346,6 +404,132 @@
this.$el.find( '.history-size' ).text( this.model.get( 'nice_size' ) );
},
+ // ------------------------------------------------------------------------ as drop target
+ /** */
+ dropTargetOn : function(){
+ if( this.dropTarget ){ return this; }
+ this.dropTarget = true;
+
+ //TODO: to init
+ var dropHandlers = {
+ 'dragenter' : _.bind( this.dragenter, this ),
+ 'dragover' : _.bind( this.dragover, this ),
+ 'dragleave' : _.bind( this.dragleave, this ),
+ 'drop' : _.bind( this.drop, this )
+ };
+//TODO: scroll to top
+ var $dropTarget = this._renderDropTarget();
+ this.$list().before([ this._renderDropTargetHelp(), $dropTarget ]);
+ for( var evName in dropHandlers ){
+ if( dropHandlers.hasOwnProperty( evName ) ){
+ //console.debug( evName, dropHandlers[ evName ] );
+ $dropTarget.on( evName, dropHandlers[ evName ] );
+ }
+ }
+ return this;
+ },
+
+ /** */
+ _renderDropTarget : function(){
+ return $( '<div/>' ).addClass( 'history-drop-target' )
+ .css({
+ 'height': '64px',
+ 'margin': '0px 10px 10px 10px',
+ 'border': '1px dashed black',
+ 'border-radius' : '3px'
+ });
+ },
+
+ /** */
+ _renderDropTargetHelp : function(){
+ return $( '<div/>' ).addClass( 'history-drop-target-help' )
+ .css({
+ 'margin' : '10px 10px 4px 10px',
+ 'color' : 'grey',
+ 'font-size' : '80%',
+ 'font-style' : 'italic'
+ })
+ .text( _l( 'Drag datasets here to copy them to the current history' ) );
+ },
+
+ /** */
+ dropTargetOff : function(){
+ if( !this.dropTarget ){ return this; }
+ //this.log( 'dropTargetOff' );
+ this.dropTarget = false;
+ //
+ //var dropTarget = this.$( '.history-drop-target' ).get(0);
+ //for( var evName in this._dropHandlers ){
+ // if( this._dropHandlers.hasOwnProperty( evName ) ){
+ // console.debug( evName, this._dropHandlers[ evName ] );
+ // dropTarget.off( evName, this._dropHandlers[ evName ] );
+ // }
+ //}
+ this.$( '.history-drop-target' ).remove();
+ this.$( '.history-drop-target-help' ).remove();
+ return this;
+ },
+ /** */
+ dropTargetToggle : function(){
+ if( this.dropTarget ){
+ this.dropTargetOff();
+ } else {
+ this.dropTargetOn();
+ }
+ return this;
+ },
+
+ /** */
+ dragenter : function( ev ){
+ //console.debug( 'dragenter:', this, ev );
+ ev.preventDefault();
+ ev.stopPropagation();
+ this.$( '.history-drop-target' ).css( 'border', '2px solid black' );
+ },
+ /** */
+ dragover : function( ev ){
+ ev.preventDefault();
+ ev.stopPropagation();
+ },
+ /** */
+ dragleave : function( ev ){
+ //console.debug( 'dragleave:', this, ev );
+ ev.preventDefault();
+ ev.stopPropagation();
+ this.$( '.history-drop-target' ).css( 'border', '1px dashed black' );
+ },
+ /** */
+ drop : function( ev ){
+ //console.warn( 'dataTransfer:', ev.dataTransfer.getData( 'text' ) );
+ //console.warn( 'dataTransfer:', ev.originalEvent.dataTransfer.getData( 'text' ) );
+ ev.preventDefault();
+ //ev.stopPropagation();
+ ev.dataTransfer.dropEffect = 'move';
+
+ //console.debug( 'ev.dataTransfer:', ev.dataTransfer );
+
+ var panel = this,
+ data = ev.dataTransfer.getData( "text" );
+ try {
+ data = JSON.parse( data );
+
+ } catch( err ){
+ this.warn( 'error parsing JSON from drop:', data );
+ }
+ this.trigger( 'droptarget:drop', ev, data, panel );
+ return false;
+ },
+
+ /** */
+ dataDropped : function( data ){
+ var panel = this;
+ // HDA: dropping will copy it to the history
+ if( _.isObject( data ) && data.model_class === 'HistoryDatasetAssociation' && data.id ){
+ return panel.model.contents.copy( data.id );
+ }
+ return jQuery.when();
+ },
+
// ........................................................................ misc
/** Return a string rep of the history */
toString : function(){
diff -r 7666506937e21d70856474a9406f444799579349 -r 3a03061c4a858d4a1607114e77ab90793b0e5520 client/galaxy/scripts/mvc/history/history-panel.js
--- a/client/galaxy/scripts/mvc/history/history-panel.js
+++ b/client/galaxy/scripts/mvc/history/history-panel.js
@@ -395,6 +395,7 @@
if( store ){
this.storage.set( 'show_deleted', show );
}
+ this.trigger( 'show-hidden', show );
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
return this.showDeleted;
@@ -412,6 +413,7 @@
if( store ){
this.storage.set( 'show_hidden', show );
}
+ this.trigger( 'show-hidden', show );
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
return this.showHidden;
@@ -606,9 +608,7 @@
'<div class="title">',
'<div class="name"><%= history.name %></div>',
'</div>',
- '<div class="subtitle">',
- //'<%= view.collection.length %>', _l( ' items' ),
- '</div>',
+ '<div class="subtitle"></div>',
'<div class="history-size"><%= history.nice_size %></div>',
'<div class="actions"></div>',
This diff is so big that we needed to truncate the remainder.
https://bitbucket.org/galaxy/galaxy-central/commits/b8db34a82175/
Changeset: b8db34a82175
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-10-01 06:12:47+00:00
Summary: Reverting back to default
Affected #: 3 files
diff -r 3a03061c4a858d4a1607114e77ab90793b0e5520 -r b8db34a82175099ad7e52bde344dd356c7199bb4 config/galaxy.ini.sample
--- a/config/galaxy.ini.sample
+++ b/config/galaxy.ini.sample
@@ -120,7 +120,7 @@
# tool shed install data. There are many situtations in which it is
# valuable to seperate these - for instance bootstrapping fresh Galaxy
# instances with pretested installs. The following optin can be used to
-# separate the tool shed install database (all other options listed above
+# separate the tool shed install database (all other options listed above
# but prefixed with install_ are also available).
#install_database_connection = sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE
@@ -160,14 +160,6 @@
# Other tool config files must include the tool_path as an attribute in the <toolbox> tag.
#tool_path = tools
-# Path to autoload tools from.
-# Every directory inside the autoload directory will be scanned for *.xml files
-# and those will be loaded as tool descriptors
-#tool_autoload_dir = ./tool-autoload
-
-# Autoload Panel, for all tools that are autoloaded, they are placed in this tool section
-#tool_autoload_section = Development
-
# Path to the directory in which tool dependencies are placed. This is used by
# the tool shed to install dependencies and can also be used by administrators
# to manually install or link to dependencies. For details, see:
@@ -187,7 +179,7 @@
#watch_tools = False
# Enable automatic polling of relative tool sheds to see if any updates
-# are available for installed repositories. Ideally only one Galaxy
+# are available for installed repositories. Ideally only one Galaxy
# server process should be able to check for repository updates. The
# setting for hours_between_check should be an integer between 1 and 24.
#enable_tool_shed_check = False
@@ -252,7 +244,7 @@
#citation_cache_data_dir = database/citations/data
#citation_cache_lock_dir = database/citations/lock
-# External service types config file, defines what types of external_services configurations
+# External service types config file, defines what types of external_services configurations
# are available in Galaxy (.sample is used if default does not exist).
#external_service_type_config_file = config/external_service_types_conf.xml
@@ -361,15 +353,15 @@
# -- Account activation
-# This is user account activation feature global flag. If set to "False" the rest of the Account
+# This is user account activation feature global flag. If set to "False" the rest of the Account
# activation configuration is ignored and user activation is disabled (a.k.a. accounts are active since registration).
# Note the activation is also not working in case the smtp server is not defined.
#user_activation_on = False
-# Activation grace period. Activation is not forced (login is not disabled) until
+# Activation grace period. Activation is not forced (login is not disabled) until
# grace period has passed. Users under grace period can't run jobs (see inactivity_box_content).
-# In hours. Default is 3. Enter 0 to disable grace period.
-# Users with OpenID logins have grace period forever.
+# In hours. Default is 3. Enter 0 to disable grace period.
+# Users with OpenID logins have grace period forever.
#activation_grace_period = 0
# Used for warning box for inactive accounts (unable to run jobs).
@@ -429,7 +421,7 @@
# - $iso8601 (complete format string as specified by ISO 8601 international standard).
# pretty_datetime_format = $locale (UTC)
-# The URL of the page to display in Galaxy's middle pane when loaded. This can be
+# The URL of the page to display in Galaxy's middle pane when loaded. This can be
# an absolute or relative URL.
#welcome_url = /static/welcome.html
@@ -461,7 +453,7 @@
# The URL linked by the "Galaxy Q&A" link in the "Help" menu
# The Galaxy Q&A site is under development; when the site is done, this URL
# will be set and uncommented.
-#qa_url =
+#qa_url =
# Serve static content, which must be enabled if you're not serving it via a
# proxy server. These options should be self explanatory and so are not
@@ -614,7 +606,7 @@
# if testing shows that Galaxy is able to create files using these formats.
# Specific formats can be disabled with this option, separate more than one
# format with commas. Available formats are currently 'zip', 'gz', and 'bz2'.
-#disable_library_comptypes =
+#disable_library_comptypes =
# Some sequencer integration features in beta allow you to automatically
# transfer datasets. This is done using a lightweight transfer manager which
@@ -764,7 +756,7 @@
# File where Data Managers are configured (.sample used if default does not
# exist)
#data_manager_config_file = config/data_manager_conf.xml
-# File where Tool Shed based Data Managers are configured
+# File where Tool Shed based Data Managers are configured
#shed_data_manager_config_file = config/shed_data_manager_conf.xml
# Directory to store Data Manager based tool-data; defaults to tool_data_path
#galaxy_data_manager_data_path = tool-data
@@ -883,11 +875,11 @@
# ---- Galaxy External Message Queue -------------------------------------------------
-# Galaxy uses AMQ protocol to receive messages from external sources like
+# Galaxy uses AMQ protocol to receive messages from external sources like
# bar code scanners. Galaxy has been tested against RabbitMQ AMQP implementation.
-# For Galaxy to receive messages from a message queue the RabbitMQ server has
+# For Galaxy to receive messages from a message queue the RabbitMQ server has
# to be set up with a user account and other parameters listed below. The 'host'
-# and 'port' fields should point to where the RabbitMQ server is running.
+# and 'port' fields should point to where the RabbitMQ server is running.
[galaxy_amqp]
@@ -900,3 +892,4 @@
#exchange = galaxy_exchange
#routing_key = bar_code_scanner
#rabbitmqctl_path = /path/to/rabbitmqctl
+
diff -r 3a03061c4a858d4a1607114e77ab90793b0e5520 -r b8db34a82175099ad7e52bde344dd356c7199bb4 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -88,9 +88,6 @@
self.user_label_filters = listify( kwargs.get( "user_tool_label_filters", [] ), do_strip=True )
self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True )
- self.tool_autoload_dir = kwargs.get( "tool_autoload_dir", None )
- self.tool_autoload_section = kwargs.get( "tool_autoload_section", None )
-
# Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have
# been migrated from the Galaxy code distribution to the Tool Shed.
self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) )
diff -r 3a03061c4a858d4a1607114e77ab90793b0e5520 -r b8db34a82175099ad7e52bde344dd356c7199bb4 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -159,23 +159,6 @@
self.init_tools( config_filename )
except:
log.exception( "Error loading tools defined in config %s", config_filename )
- if self.app.config.tool_autoload_dir is not None:
- log.info("Autoloading tool directory: %s" % (self.app.config.tool_autoload_dir))
-
- auto_load_section = ToolSection({
- 'id' : "__tool_autoload__",
- 'version' : "1.0.0",
- 'name' : self.app.config.tool_autoload_section})
-
- for tool_xml_path in glob.glob(os.path.join(self.app.config.tool_autoload_dir, "*", "*.xml")):
- log.info("AutoLoading: %s" % (tool_xml_path))
- tool = self.load_tool(tool_xml_path)
- self.tools_by_id[ tool.id ] = tool
- self.__add_tool_to_tool_panel( tool, auto_load_section, section=True )
-
- self.tool_panel[ "__tool_autoload__" ] = auto_load_section
- #self.__add_tool_to_tool_panel( auto_load_section, self.tool_panel, section=False )
-
if self.app.name == 'galaxy' and self.integrated_tool_panel_config_has_contents:
# Load self.tool_panel based on the order in self.integrated_tool_panel.
self.load_tool_panel()
@@ -880,7 +863,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
https://bitbucket.org/galaxy/galaxy-central/commits/890d470c5a61/
Changeset: 890d470c5a61
Branch: tool-autoload
User: kell...(a)gmail.com
Date: 2014-10-01 06:57:03+00:00
Summary: Adding tool_library_dir to tool_conf parser. This will cause all the child directories of a given directory to be watched for tools.
Affected #: 1 file
diff -r b8db34a82175099ad7e52bde344dd356c7199bb4 -r 890d470c5a618cfcb6f53b2f457f8d461ef71fd5 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -236,6 +236,8 @@
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ elif elem.tag == 'tool_library_dir':
+ self.__watch_directory_children( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -688,6 +690,8 @@
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ elif sub_elem.tag == 'tool_library_dir':
+ self.__watch_directory_children( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -696,8 +700,16 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def __watch_directory_children( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ for sub in os.listdir( directory ):
+ child = os.path.join(directory, sub)
+ if os.path.isdir(child):
+ self.__watch_directory(None, elems, tool_path, integrated_elems, load_panel_dict, child)
+
+ def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict, directory=None ):
+ if directory is None:
+ directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
def quick_load( tool_file, async=True ):
try:
@@ -863,7 +875,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
https://bitbucket.org/galaxy/galaxy-central/commits/a55060d94308/
Changeset: a55060d94308
Branch: tool-autoload
User: kellrott
Date: 2014-10-01 17:15:43+00:00
Summary: Changing tool_library_repo to work off of tool_dir with attr recursive=True
Affected #: 1 file
diff -r 890d470c5a618cfcb6f53b2f457f8d461ef71fd5 -r a55060d943081345db52ed74f8564d98af5d501a lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -235,9 +235,8 @@
elif elem.tag == 'label':
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
- self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
- elif elem.tag == 'tool_library_dir':
- self.__watch_directory_children( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ self.load_tooldir_tag_set( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -689,9 +688,7 @@
elif sub_elem.tag == 'label':
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
- self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
- elif sub_elem.tag == 'tool_library_dir':
- self.__watch_directory_children( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ self.load_tooldir_tag_set( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -700,16 +697,12 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory_children( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
- for sub in os.listdir( directory ):
- child = os.path.join(directory, sub)
- if os.path.isdir(child):
- self.__watch_directory(None, elems, tool_path, integrated_elems, load_panel_dict, child)
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", False) )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict, directory=None ):
- if directory is None:
- directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
def quick_load( tool_file, async=True ):
try:
@@ -729,16 +722,21 @@
# will be False when things like functional tests are the caller.
self.fix_integrated_tool_panel_dict()
self.write_integrated_tool_panel_config_file()
-
return tool.id
except Exception:
log.exception("Failed to load potential tool %s." % tool_file)
return None
+ tool_loaded = False
for name in os.listdir( directory ):
- if name.endswith( ".xml" ):
- quick_load( os.path.join( directory, name), async=False )
- self.tool_watcher.watch_directory( directory, quick_load )
+ child_path = os.path.join(directory, name)
+ if os.path.isdir(child_path) and recursive:
+ self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
+ elif name.endswith( ".xml" ):
+ quick_load( child_path, async=False )
+ tool_loaded = True
+ if tool_loaded:
+ self.tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
"""Load a single tool from the file named by `config_file` and return an instance of `Tool`."""
https://bitbucket.org/galaxy/galaxy-central/commits/041438f8b528/
Changeset: 041438f8b528
Branch: tool-autoload
User: kellrott
Date: 2014-10-02 17:06:53+00:00
Summary: Changing tool_dir in tool_conf to be recursive by default
Affected #: 1 file
diff -r a55060d943081345db52ed74f8564d98af5d501a -r 041438f8b5281d2ff6618208ff72463b5eeebf52 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -699,7 +699,7 @@
def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
- recursive = string_as_bool( sub_elem.attrib.get("recursive", False) )
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
https://bitbucket.org/galaxy/galaxy-central/commits/3aa7288f5a97/
Changeset: 3aa7288f5a97
User: jmchilton
Date: 2014-10-06 01:31:21+00:00
Summary: Merged in kellrott/galaxy-farm/tool-autoload (pull request #512)
Adding tool_library_dir to tool_conf parser
Affected #: 3 files
diff -r 342ee791fe55b3bca0bbbe86c2e58509a9f96df6 -r 3aa7288f5a97970df22fd38c400237028fe33e4b lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -235,7 +235,8 @@
elif elem.tag == 'label':
self.load_label_tag_set( elem, self.tool_panel, self.integrated_tool_panel, load_panel_dict, index=index )
elif elem.tag == 'tool_dir':
- self.__watch_directory( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+ self.load_tooldir_tag_set( elem, self.tool_panel, self.integrated_tool_panel, tool_path, load_panel_dict )
+
if parsing_shed_tool_conf:
shed_tool_conf_dict = dict( config_filename=config_filename,
tool_path=tool_path,
@@ -687,7 +688,7 @@
elif sub_elem.tag == 'label':
self.load_label_tag_set( sub_elem, elems, integrated_elems, load_panel_dict, index=sub_index )
elif sub_elem.tag == 'tool_dir':
- self.__watch_directory( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
+ self.load_tooldir_tag_set( sub_elem, elems, tool_path, integrated_elems, load_panel_dict )
if load_panel_dict:
self.tool_panel[ key ] = section
# Always load sections into the integrated_tool_panel.
@@ -696,8 +697,12 @@
else:
self.integrated_tool_panel.insert( index, key, integrated_section )
- def __watch_directory( self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict ):
+ def load_tooldir_tag_set(self, sub_elem, elems, tool_path, integrated_elems, load_panel_dict):
directory = os.path.join( tool_path, sub_elem.attrib.get("dir") )
+ recursive = string_as_bool( sub_elem.attrib.get("recursive", True) )
+ self.__watch_directory( directory, elems, integrated_elems, load_panel_dict, recursive )
+
+ def __watch_directory( self, directory, elems, integrated_elems, load_panel_dict, recursive):
def quick_load( tool_file, async=True ):
try:
@@ -717,16 +722,21 @@
# will be False when things like functional tests are the caller.
self.fix_integrated_tool_panel_dict()
self.write_integrated_tool_panel_config_file()
-
return tool.id
except Exception:
log.exception("Failed to load potential tool %s." % tool_file)
return None
+ tool_loaded = False
for name in os.listdir( directory ):
- if name.endswith( ".xml" ):
- quick_load( os.path.join( directory, name), async=False )
- self.tool_watcher.watch_directory( directory, quick_load )
+ child_path = os.path.join(directory, name)
+ if os.path.isdir(child_path) and recursive:
+ self.__watch_directory(child_path, elems, integrated_elems, load_panel_dict, recursive)
+ elif name.endswith( ".xml" ):
+ quick_load( child_path, async=False )
+ tool_loaded = True
+ if tool_loaded:
+ self.tool_watcher.watch_directory( directory, quick_load )
def load_tool( self, config_file, guid=None, repository_id=None, **kwds ):
"""Load a single tool from the file named by `config_file` and return an instance of `Tool`."""
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/12497a97f7d2/
Changeset: 12497a97f7d2
Branch: next-stable
User: jmchilton
Date: 2014-10-06 01:20:05+00:00
Summary: Back port Kyle's tool download fixes from default.
Affected #: 1 file
diff -r 105a53b01211993297b7ee64251cf3c1677883f7 -r 12497a97f7d22d08c6fdafe0c544b4f7a906da98 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -742,20 +742,21 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
- tool_help = tool.help._source
image_found = False
- # Check each line of the rendered tool help for an image tag that points to a location under static/
- for help_line in tool_help.split( '\n' ):
- image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
- matches = re.search( image_regex, help_line )
- if matches is not None:
- tool_help_image = matches.group(1)
- tarball_path = tool_help_image
- filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
- if os.path.exists( filesystem_path ):
- tarball_files.append( ( filesystem_path, tarball_path ) )
- image_found = True
- tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
+ if tool.help is not None:
+ tool_help = tool.help._source
+ # Check each line of the rendered tool help for an image tag that points to a location under static/
+ for help_line in tool_help.split( '\n' ):
+ image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
+ matches = re.search( image_regex, help_line )
+ if matches is not None:
+ tool_help_image = matches.group(1)
+ tarball_path = tool_help_image
+ filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
+ if os.path.exists( filesystem_path ):
+ tarball_files.append( ( filesystem_path, tarball_path ) )
+ image_found = True
+ tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
# If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
if image_found:
fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
@@ -767,7 +768,7 @@
tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.split( ' ' )[0]
+ tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
https://bitbucket.org/galaxy/galaxy-central/commits/342ee791fe55/
Changeset: 342ee791fe55
User: jmchilton
Date: 2014-10-06 01:25:01+00:00
Summary: Merge next-stable fixes to tool downloader.
Affected #: 1 file
diff -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 -r 342ee791fe55b3bca0bbbe86c2e58509a9f96df6 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -789,9 +789,9 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
+ image_found = False
if tool.help is not None:
tool_help = tool.help._source
- image_found = False
# Check each line of the rendered tool help for an image tag that points to a location under static/
for help_line in tool_help.split( '\n' ):
image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
@@ -804,16 +804,16 @@
tarball_files.append( ( filesystem_path, tarball_path ) )
image_found = True
tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
- # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
- if image_found:
- fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
- os.close( fd )
- file( new_tool_config, 'w' ).write( tool_xml )
- tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
- temp_files.append( os.path.abspath( new_tool_config ) )
- else:
- tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
- tarball_files.append( tool_tup )
+ # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
+ if image_found:
+ fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
+ os.close( fd )
+ file( new_tool_config, 'w' ).write( tool_xml )
+ tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
+ temp_files.append( os.path.abspath( new_tool_config ) )
+ else:
+ tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
+ tarball_files.append( tool_tup )
# TODO: This feels hacky.
tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
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.
1
0
commit/galaxy-central: jmchilton: Merged in kellrott/galaxy-farm/tool-extract (pull request #508)
by commits-noreply@bitbucket.org 05 Oct '14
by commits-noreply@bitbucket.org 05 Oct '14
05 Oct '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1daa729f4e72/
Changeset: 1daa729f4e72
User: jmchilton
Date: 2014-10-06 01:05:59+00:00
Summary: Merged in kellrott/galaxy-farm/tool-extract (pull request #508)
Adding the tool package download function to the API. Also fixing a few issues in the packaging code.
Affected #: 3 files
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -789,32 +789,33 @@
tool_xml = file( os.path.abspath( tool.config_file ), 'r' ).read()
# Retrieve tool help images and rewrite the tool's xml into a temporary file with the path
# modified to be relative to the repository root.
- tool_help = tool.help._source
- image_found = False
- # Check each line of the rendered tool help for an image tag that points to a location under static/
- for help_line in tool_help.split( '\n' ):
- image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
- matches = re.search( image_regex, help_line )
- if matches is not None:
- tool_help_image = matches.group(1)
- tarball_path = tool_help_image
- filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
- if os.path.exists( filesystem_path ):
- tarball_files.append( ( filesystem_path, tarball_path ) )
- image_found = True
- tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
- # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
- if image_found:
- fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
- os.close( fd )
- file( new_tool_config, 'w' ).write( tool_xml )
- tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
- temp_files.append( os.path.abspath( new_tool_config ) )
- else:
- tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
- tarball_files.append( tool_tup )
+ if tool.help is not None:
+ tool_help = tool.help._source
+ image_found = False
+ # Check each line of the rendered tool help for an image tag that points to a location under static/
+ for help_line in tool_help.split( '\n' ):
+ image_regex = re.compile( 'img alt="[^"]+" src="\${static_path}/([^"]+)"' )
+ matches = re.search( image_regex, help_line )
+ if matches is not None:
+ tool_help_image = matches.group(1)
+ tarball_path = tool_help_image
+ filesystem_path = os.path.abspath( os.path.join( trans.app.config.root, 'static', tool_help_image ) )
+ if os.path.exists( filesystem_path ):
+ tarball_files.append( ( filesystem_path, tarball_path ) )
+ image_found = True
+ tool_xml = tool_xml.replace( '${static_path}/%s' % tarball_path, tarball_path )
+ # If one or more tool help images were found, add the modified tool XML to the tarball instead of the original.
+ if image_found:
+ fd, new_tool_config = tempfile.mkstemp( suffix='.xml' )
+ os.close( fd )
+ file( new_tool_config, 'w' ).write( tool_xml )
+ tool_tup = ( os.path.abspath( new_tool_config ), os.path.split( tool.config_file )[-1] )
+ temp_files.append( os.path.abspath( new_tool_config ) )
+ else:
+ tool_tup = ( os.path.abspath( tool.config_file ), os.path.split( tool.config_file )[-1] )
+ tarball_files.append( tool_tup )
# TODO: This feels hacky.
- tool_command = tool.command.split( ' ' )[0]
+ tool_command = tool.command.strip().split( ' ' )[0]
tool_path = os.path.dirname( os.path.abspath( tool.config_file ) )
# Add the tool XML to the tuple that will be used to populate the tarball.
if os.path.exists( os.path.join( tool_path, tool_command ) ):
@@ -823,6 +824,8 @@
for external_file in tool.get_externally_referenced_paths( os.path.abspath( tool.config_file ) ):
external_file_abspath = os.path.abspath( os.path.join( tool_path, external_file ) )
tarball_files.append( ( external_file_abspath, external_file ) )
+ if os.path.exists( os.path.join( tool_path, "Dockerfile" ) ):
+ tarball_files.append( ( os.path.join( tool_path, "Dockerfile" ), "Dockerfile" ) )
# Find tests, and check them for test data.
tests = tool.tests
if tests is not None:
@@ -863,7 +866,7 @@
if len( data_table_definitions ) > 0:
# Put the data table definition XML in a temporary file.
table_definition = '<?xml version="1.0" encoding="utf-8"?>\n<tables>\n %s</tables>'
- table_definition = table_definition % '\n'.join( data_table_definitions )
+ table_definition = table_definition % '\n'.join( data_table_definitions )
fd, table_conf = tempfile.mkstemp()
os.close( fd )
file( table_conf, 'w' ).write( table_definition )
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -66,6 +66,18 @@
rval.append( citation.to_dict( 'bibtex' ) )
return rval
+ @web.expose_api_raw
+ @web.require_admin
+ def download( self, trans, id, **kwds ):
+ tool_tarball, success, message = trans.app.toolbox.package_tool( trans, id )
+ if success:
+ trans.response.set_content_type( 'application/x-gzip' )
+ download_file = open( tool_tarball )
+ os.unlink( tool_tarball )
+ tarball_path, filename = os.path.split( tool_tarball )
+ trans.response.headers[ "Content-Disposition" ] = 'attachment; filename="%s.tgz"' % ( id )
+ return download_file
+
@web.expose_api_anonymous
def create( self, trans, payload, **kwd ):
"""
diff -r e7708503e1aacf07dfbbd3fa116de5bd54353b17 -r 1daa729f4e72be6e6b3670b78bc652f857bbe933 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -180,6 +180,7 @@
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
webapp.mapper.connect( '/api/tools/{id:.+?}/citations', action='citations', controller="tools" )
+ webapp.mapper.connect( '/api/tools/{id:.+?}/download', action='download', controller="tools" )
webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
webapp.mapper.resource( 'tool', 'tools', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' )
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.
1
0