mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #13163 from ic4f/dev_migrate_tools_cleanup
Remove migrate tools-related code
This commit is contained in:
@@ -111,12 +111,6 @@
|
||||
</strong>
|
||||
- A view of a version lineages for all installed tools. Useful for debugging.
|
||||
</li>
|
||||
<li>
|
||||
<strong>
|
||||
<a :href="migrationStagesUrl">View Migration Stages</a>
|
||||
</strong>
|
||||
- See the list of migration stages that moved sets of tools from the distribution to the Tool Shed.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
@@ -145,7 +139,6 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
migrationStagesUrl: () => `${root}admin/review_tool_migration_stages`, // NOT ROUTER
|
||||
adminDataTypesUrl: () => `${root}admin/data_types`,
|
||||
adminDataTablesUrl: () => `${root}admin/data_tables`,
|
||||
adminDisplayApplicationsUrl: () => `${root}admin/display_applications`,
|
||||
|
||||
@@ -130,11 +130,6 @@ const AdminPanel = Backbone.View.extend({
|
||||
target: "__use_router__",
|
||||
id: "admin-link-tool-versions",
|
||||
},
|
||||
{
|
||||
title: _l("View Migration Stages"),
|
||||
url: "admin/review_tool_migration_stages",
|
||||
id: "admin-link-migrations",
|
||||
},
|
||||
{
|
||||
title: _l("View Error Logs"),
|
||||
url: "admin/error_stack",
|
||||
|
||||
@@ -496,7 +496,6 @@ define({
|
||||
"Download local tool": "Descargar herramienta local",
|
||||
"Tool lineage": "Linaje de herramientas",
|
||||
"Reload a tool's configuration": "Volver a cargar la configuración de una herramienta",
|
||||
"Review tool migration stages": "Revisar las etapas de migración de la herramienta",
|
||||
"View Tool Error Logs": "Ver registros de error de la herramienta",
|
||||
"Manage Allowlist": "Administrar lista de permisos",
|
||||
"Manage Tool Dependencies": "Administrar dependencias de herramienta",
|
||||
@@ -730,7 +729,6 @@ define({
|
||||
"Refresh history": "Actualizar historial",
|
||||
// ---------------------------------------------------------------------------- admin-panel
|
||||
"View error logs": "Ver registros de error",
|
||||
"View migration stages": "Ver etapas de migración",
|
||||
"View lineage": "Ver linaje",
|
||||
"Manage dependencies": "Administrar dependencias",
|
||||
"Manage allowlist": "Administrar lista de permitidos",
|
||||
|
||||
@@ -218,7 +218,6 @@ define({
|
||||
"Download local tool": "Télécharger un outil en local",
|
||||
"Tool lineage": "Affiliation des outils",
|
||||
"Reload a tool's configuration": "Recharger une configuration d'outils",
|
||||
"Review tool migration stages": "Vérifier les étapes de migration d'outils",
|
||||
"View Tool Error Logs": "Voir les logs d'erreur d'outils",
|
||||
"Manage Allowlist": "Gérer la liste autorisée d'outils graphiques",
|
||||
"Manage Tool Dependencies": "Gérer les dépendances d'outils",
|
||||
@@ -370,7 +369,6 @@ define({
|
||||
"Refresh history": false,
|
||||
// ---------------------------------------------------------------------------- admin-panel
|
||||
"View error logs": false,
|
||||
"View migration stages": false,
|
||||
"View lineage": false,
|
||||
"Manage dependencies": false,
|
||||
"Manage allowlist": false,
|
||||
|
||||
@@ -251,7 +251,6 @@ define({
|
||||
"Download local tool": "ローカルツールのダウンロード",
|
||||
"Tool lineage": "ツール系統",
|
||||
"Reload a tool's configuration": "ツールのコンフィグのリロード",
|
||||
"Review tool migration stages": "ツール移行ステージのレビュー",
|
||||
"View Tool Error Logs": "ツールのエラーログ",
|
||||
"Manage Allowlist": "表示ホワイトリストの管理",
|
||||
"Manage Tool Dependencies": "ツール依存関係の管理",
|
||||
|
||||
@@ -218,7 +218,6 @@ define({
|
||||
"Download local tool": false,
|
||||
"Tool lineage": false,
|
||||
"Reload a tool's configuration": false,
|
||||
"Review tool migration stages": false,
|
||||
"View Tool Error Logs": false,
|
||||
"Manage Allowlist": false,
|
||||
"Manage Tool Dependencies": false,
|
||||
@@ -368,7 +367,6 @@ define({
|
||||
"Refresh history": false,
|
||||
// ---------------------------------------------------------------------------- admin-panel
|
||||
"View error logs": false,
|
||||
"View migration stages": false,
|
||||
"View lineage": false,
|
||||
"Manage dependencies": false,
|
||||
"Manage allowlist": false,
|
||||
|
||||
@@ -227,7 +227,6 @@ define({
|
||||
"Download local tool": false,
|
||||
"Tool lineage": false,
|
||||
"Reload a tool's configuration": false,
|
||||
"Review tool migration stages": false,
|
||||
"View Tool Error Logs": false,
|
||||
"Manage Display Whitelist": false,
|
||||
"Manage Tool Dependencies": false,
|
||||
@@ -384,7 +383,6 @@ define({
|
||||
"Refresh history": "刷新历史记录",
|
||||
// ---------------------------------------------------------------------------- admin-panel
|
||||
"View error logs": false,
|
||||
"View migration stages": false,
|
||||
"View lineage": false,
|
||||
"Manage dependencies": false,
|
||||
"Manage whitelist": false,
|
||||
|
||||
@@ -692,7 +692,6 @@ admin:
|
||||
jobs: '#admin-link-jobs'
|
||||
local_data: '#admin-link-local-data'
|
||||
metadata: '#admin-link-metadata'
|
||||
migrations: '#admin-link-migrations'
|
||||
tool_versions: '#admin-link-tool-versions'
|
||||
toolshed: '#admin-link-toolshed'
|
||||
users: '#admin-link-users'
|
||||
|
||||
@@ -12,11 +12,6 @@ from galaxy.util.tool_shed import encoding_util, xml_util
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
REPOSITORY_OWNER = 'devteam'
|
||||
# not valid for installed Galaxy, fix
|
||||
MIGRATE_DIR = os.path.abspath(os.path.join(
|
||||
os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'galaxy', 'tool_shed', 'galaxy_install', 'migrate'))
|
||||
TOOL_MIGRATION_SCRIPTS_DIR = os.path.join(MIGRATE_DIR, 'scripts')
|
||||
TOOL_MIGRATION_VERSIONS_DIR = os.path.join(MIGRATE_DIR, 'versions')
|
||||
|
||||
|
||||
def accumulate_tool_dependencies(tool_shed_accessible, tool_dependencies, all_tool_dependencies):
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import imp
|
||||
import logging
|
||||
import os
|
||||
|
||||
from sqlalchemy import false, func
|
||||
|
||||
@@ -18,9 +16,7 @@ from galaxy.util import (
|
||||
nice_size,
|
||||
pretty_print_time_interval,
|
||||
sanitize_text,
|
||||
url_get
|
||||
)
|
||||
from galaxy.util.tool_shed import common_util, encoding_util
|
||||
from galaxy.web import url_for
|
||||
from galaxy.web.framework.helpers import grids, time_ago
|
||||
from galaxy.webapps.base import controller
|
||||
@@ -861,62 +857,6 @@ class AdminGalaxy(controller.JSAppLauncher):
|
||||
action='users',
|
||||
message="Invalid user selected", status="error"))
|
||||
|
||||
def check_for_tool_dependencies(self, trans, migration_stage):
|
||||
# Get the 000x_tools.xml file associated with migration_stage.
|
||||
tools_xml_file_path = os.path.abspath(os.path.join(common_util.TOOL_MIGRATION_SCRIPTS_DIR, '%04d_tools.xml' % migration_stage))
|
||||
tree = util.parse_xml(tools_xml_file_path)
|
||||
root = tree.getroot()
|
||||
tool_shed = root.get('name')
|
||||
shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(trans.app, tool_shed)
|
||||
repo_name_dependency_tups = []
|
||||
if shed_url:
|
||||
for elem in root:
|
||||
if elem.tag == 'repository':
|
||||
tool_dependencies = []
|
||||
tool_dependencies_dict = {}
|
||||
repository_name = elem.get('name')
|
||||
changeset_revision = elem.get('changeset_revision')
|
||||
params = dict(name=repository_name, owner='devteam', changeset_revision=changeset_revision)
|
||||
pathspec = ['repository', 'get_tool_dependencies']
|
||||
text = url_get(shed_url, auth=self.app.tool_shed_registry.url_auth(shed_url), pathspec=pathspec, params=params)
|
||||
if text:
|
||||
tool_dependencies_dict = encoding_util.tool_shed_decode(text)
|
||||
for requirements_dict in tool_dependencies_dict.values():
|
||||
tool_dependency_name = requirements_dict['name']
|
||||
tool_dependency_version = requirements_dict['version']
|
||||
tool_dependency_type = requirements_dict['type']
|
||||
tool_dependency_readme = requirements_dict.get('readme', '')
|
||||
tool_dependencies.append((tool_dependency_name, tool_dependency_version, tool_dependency_type, tool_dependency_readme))
|
||||
repo_name_dependency_tups.append((repository_name, tool_dependencies))
|
||||
return repo_name_dependency_tups
|
||||
|
||||
@web.expose
|
||||
@web.require_admin
|
||||
def review_tool_migration_stages(self, trans, **kwd):
|
||||
message = escape(util.restore_text(kwd.get('message', '')))
|
||||
status = util.restore_text(kwd.get('status', 'done'))
|
||||
migration_stages_dict = {}
|
||||
# FIXME: this isn't valid in an installed context
|
||||
migration_scripts_dir = os.path.abspath(os.path.join(trans.app.config.root, 'lib', 'galaxy', 'tool_shed', 'galaxy_install', 'migrate', 'versions'))
|
||||
modules = os.listdir(migration_scripts_dir)
|
||||
modules.sort()
|
||||
modules.reverse()
|
||||
for item in modules:
|
||||
if not item.endswith('_tools.py') or item.startswith('0001_tools'):
|
||||
continue
|
||||
module = item.replace('.py', '')
|
||||
migration_stage = int(module.replace('_tools', ''))
|
||||
repo_name_dependency_tups = self.check_for_tool_dependencies(trans, migration_stage)
|
||||
open_file_obj, file_name, description = imp.find_module(module, [migration_scripts_dir])
|
||||
imported_module = imp.load_module('upgrade', open_file_obj, file_name, description)
|
||||
migration_info = imported_module.__doc__
|
||||
open_file_obj.close()
|
||||
migration_stages_dict[migration_stage] = (migration_info, repo_name_dependency_tups)
|
||||
return trans.fill_template('admin/review_tool_migration_stages.mako',
|
||||
migration_stages_dict=migration_stages_dict,
|
||||
message=message,
|
||||
status=status)
|
||||
|
||||
@web.legacy_expose_api
|
||||
@web.require_admin
|
||||
def tool_versions_list(self, trans, **kwd):
|
||||
|
||||
@@ -1173,11 +1173,6 @@ class ShedTwillTestCase(DrivenFunctionalTestCase):
|
||||
self.visit_url('/repository/display_tool', params=params)
|
||||
self.check_for_strings(strings_displayed, strings_not_displayed)
|
||||
|
||||
def load_galaxy_tool_migrations_page(self, strings_displayed=None, strings_not_displayed=None):
|
||||
url = '/admin/review_tool_migration_stages'
|
||||
self.visit_galaxy_url(url)
|
||||
self.check_for_strings(strings_displayed, strings_not_displayed)
|
||||
|
||||
def load_invalid_tool_page(self, repository, tool_xml, changeset_revision, strings_displayed=None, strings_not_displayed=None):
|
||||
params = {
|
||||
'repository_id': self.security.encode_id(repository.id),
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<%namespace file="/message.mako" import="render_msg" />
|
||||
|
||||
%if message:
|
||||
${render_msg( message, status )}
|
||||
%endif
|
||||
<%
|
||||
from markupsafe import escape
|
||||
%>
|
||||
<div class="card">
|
||||
<div class="card-header">Tool migrations that can be performed on this Galaxy instance</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<p>
|
||||
The list of tool migration stages below, displayed most recent to oldest, provides information about the repositories in the
|
||||
main Galaxy tool shed that will be cloned at each stage if you run the shell command for that stage. This enables you to execute
|
||||
the migration process for any stage at any time.
|
||||
</p>
|
||||
<p>
|
||||
Keep in mind that tools included in a repository that you want to be displayed in the Galaxy tool panel when the repository is
|
||||
installed must be defined in the <b>tool_conf.xml</b> (or equivalent) config file prior to execution of the migration process for a
|
||||
stage. Executing a migration process multiple times will have no affect unless the repositories associated with that stage have been
|
||||
uninstalled prior to the execution of the migration process.
|
||||
</p>
|
||||
<p>
|
||||
When you initiate a migration process, the associated repositories will be cloned from the Galaxy tool shed at
|
||||
<a href="http://toolshed.g2.bx.psu.edu" target="_blank">http://toolshed.g2.bx.psu.edu</a>. The location in which the tool repositories
|
||||
will be installed is the value of the 'tool_path' attribute in the <tool> tag of the file named ./migrated_tool_conf.xml
|
||||
(i.e., <b><toolbox tool_path="../shed_tools"></b>). The default location setting is <b>'../shed_tools'</b>, which may be problematic
|
||||
for some cluster environments, so make sure to change it before you execute the installation process if appropriate. The configured location
|
||||
must be outside of the Galaxy installation directory or it must be in a sub-directory protected by a properly configured <b>.hgignore</b>
|
||||
file if the directory is within the Galaxy installation directory hierarchy. This is because tool shed repositories will be installed using
|
||||
mercurial's clone feature, which creates .hg directories and associated mercurial repository files. Not having <b>.hgignore</b> properly
|
||||
configured could result in undesired behavior when modifying or updating your local Galaxy instance or the tool shed repositories if they are
|
||||
in directories that pose conflicts. See mercurial's .hgignore documentation at
|
||||
<a href="http://mercurial.selenic.com/wiki/.hgignore" target="_blank">http://mercurial.selenic.com/wiki/.hgignore</a> for details.
|
||||
</p>
|
||||
</div>
|
||||
<table class="grid">
|
||||
<% from tool_shed.util.basic_util import to_html_string %>
|
||||
%for stage in migration_stages_dict.keys():
|
||||
<%
|
||||
migration_command = 'sh ./scripts/migrate_tools/%04d_tools.sh' % stage
|
||||
install_dependencies = '%s install_dependencies' % migration_command
|
||||
migration_tup = migration_stages_dict[ stage ]
|
||||
migration_info, repo_name_dependency_tups = migration_tup
|
||||
repository_names = []
|
||||
for repo_name_dependency_tup in repo_name_dependency_tups:
|
||||
repository_name, tool_dependencies = repo_name_dependency_tup
|
||||
if repository_name not in repository_names:
|
||||
repository_names.append( repository_name )
|
||||
if repository_names:
|
||||
repository_names.sort()
|
||||
repository_names = ', '.join( repository_names )
|
||||
%>
|
||||
<tr><td bgcolor="#D8D8D8"><b>Tool migration stage ${stage} - repositories: ${repository_names|h}</b></td></tr>
|
||||
<tr>
|
||||
<td bgcolor="#FFFFCC">
|
||||
<div class="form-row">
|
||||
<p>${to_html_string(migration_info)} <b>Run commands from the Galaxy installation directory!</b></p>
|
||||
<p>
|
||||
%if tool_dependencies:
|
||||
This migration stage includes tools that have tool dependencies that can be automatically installed. To install them, run:<br/>
|
||||
<b>${install_dependencies|h}</b><br/><br/>
|
||||
To skip tool dependency installation run:<br/>
|
||||
<b>${migration_command|h}</b>
|
||||
%else:
|
||||
<b>${migration_command|h}</b>
|
||||
%endif
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
%for repo_name_dependency_tup in repo_name_dependency_tups:
|
||||
<% repository_name, tool_dependencies = repo_name_dependency_tup %>
|
||||
<tr>
|
||||
<td bgcolor="#DADFEF">
|
||||
<div class="form-row">
|
||||
<b>Repository:</b> ${repository_name|h}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
%if tool_dependencies:
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-row">
|
||||
<b>Tool dependencies</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
%for tool_dependencies_tup in tool_dependencies:
|
||||
<%
|
||||
tool_dependency_name = escape( tool_dependencies_tup[0] )
|
||||
tool_dependency_version = escape( tool_dependencies_tup[1] )
|
||||
tool_dependency_type = escape( tool_dependencies_tup[2] )
|
||||
installation_requirements = escape( tool_dependencies_tup[3] ).replace( '\n', '<br/>' )
|
||||
%>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-row">
|
||||
<b>Name:</b> ${tool_dependency_name} <b>Version:</b> ${tool_dependency_version} <b>Type:</b> ${tool_dependency_type}
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<b>Requirements and installation information:</b><br/>
|
||||
${installation_requirements}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
%endfor
|
||||
%else:
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-row">
|
||||
No tool dependencies have been defined for this repository.
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
%endif
|
||||
%endfor
|
||||
%endfor
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user