Merge branch 'release_20.09' into dev

This commit is contained in:
mvdbeek
2020-11-24 10:07:19 +01:00
13 changed files with 45 additions and 39 deletions
@@ -1,6 +1,10 @@
<template>
<div>
<img v-if="imgUrl" :src="imgUrl" />
<div v-if="imageUrl" class="w-50 p-2 float-left">
<b-card nobody body-class="p-1">
<b-img :src="imageUrl" fluid />
</b-card>
</div>
<div v-else>
<b>Image is not found</b>
</div>
@@ -26,13 +30,13 @@ export default {
if (this.path) {
this.fetchPathDestination({ history_dataset_id: this.history_dataset_id, path: this.path }).then(() => {
const pathDestination = this.$store.getters.pathDestination(this.history_dataset_id, this.path);
this.imgUrl = pathDestination.fileLink;
this.imageUrl = pathDestination.fileLink;
});
} else this.imgUrl = `${getAppRoot()}dataset/display?dataset_id=${this.history_dataset_id}`;
} else this.imageUrl = `${getAppRoot()}dataset/display?dataset_id=${this.history_dataset_id}`;
},
data() {
return {
imgUrl: undefined,
imageUrl: undefined,
};
},
methods: {
@@ -1,8 +1,6 @@
<template>
<div class="w-50 p-2 float-left">
<b-card nobody body-class="p-1">
<b-img :src="imageUrl" fluid />
</b-card>
<div>
<DatasetAsImage :path="args.path" :history_dataset_id="args.history_dataset_id" />
</div>
</template>
@@ -10,10 +8,14 @@
import Vue from "vue";
import BootstrapVue from "bootstrap-vue";
import { getAppRoot } from "onload/loadConfig";
import DatasetAsImage from "components/Dataset/DatasetAsImage/DatasetAsImage";
Vue.use(BootstrapVue);
export default {
components: {
DatasetAsImage,
},
props: {
args: {
type: Object,
@@ -170,16 +170,7 @@ export default {
return params;
},
selectedToolIds() {
const toolIds = [];
for (const item of this.items) {
if (item["selected"]) {
const toolId = item["tool"];
if (toolId) {
toolIds.push(toolId[0]);
}
}
}
return toolIds;
return this.items.filter((item) => item.selected).map((item) => item.tool_id);
},
},
watch: {
@@ -1971,7 +1971,7 @@ var PeptideView = (function (pv) {
option.scoreSummary = true;
psmDetailDP = new AjaxDataProvider(option);
let psmDetailDP = new AjaxDataProvider(option);
psmDetailDP.generateTable();
//Move to table
$("html, body").animate(
+1 -3
View File
@@ -54,11 +54,9 @@ The following configuration options have been changed
New Configuration Files
-----------------------
The following files are new, or recently converted to yaml
The following configuration file is new:
- ``config/trs_servers_conf.yml.sample``
- ``config/build_mulled_singularity_mapping_file.yml.sample``
- ``config/singularity_mapping.yml.sample``
Get Galaxy
@@ -99,7 +99,7 @@ class CollectlPlugin(InstrumentPlugin):
pid = open(self.__pid_file(job_directory)).read().strip()
contents = os.listdir(job_directory)
try:
rel_path = filter(self._is_instrumented_collectl_log, contents)[0]
rel_path = next(iter(filter(self._is_instrumented_collectl_log, contents)))
path = os.path.join(job_directory, rel_path)
except IndexError:
message = f"Failed to find collectl log in directory {job_directory}, files were {contents}"
@@ -234,7 +234,7 @@ def singularity_cached_container_description(targets, cache_directory, hash_func
return container
def targets_to_mulled_name(targets, hash_func, namespace, resolution_cache=None):
def targets_to_mulled_name(targets, hash_func, namespace, resolution_cache=None, session=None):
unresolved_cache_key = "galaxy.tool_util.deps.container_resolvers.mulled:unresolved"
if resolution_cache is not None:
if unresolved_cache_key not in resolution_cache:
@@ -265,7 +265,7 @@ def targets_to_mulled_name(targets, hash_func, namespace, resolution_cache=None)
if name:
return name
tags = mulled_tags_for(namespace, target.package_name, resolution_cache=resolution_cache)
tags = mulled_tags_for(namespace, target.package_name, resolution_cache=resolution_cache, session=session)
if tags:
for tag in tags:
@@ -284,7 +284,7 @@ def targets_to_mulled_name(targets, hash_func, namespace, resolution_cache=None)
else:
repo_name = image_name
tag_prefix = None
tags = mulled_tags_for(namespace, repo_name, tag_prefix=tag_prefix, resolution_cache=resolution_cache)
tags = mulled_tags_for(namespace, repo_name, tag_prefix=tag_prefix, resolution_cache=resolution_cache, session=session)
return tags[0] if tags else None
if hash_func == "v2":
@@ -388,7 +388,7 @@ class MulledDockerContainerResolver(ContainerResolver):
command = container.build_pull_command()
shell(command)
def resolve(self, enabled_container_types, tool_info, install=False, **kwds):
def resolve(self, enabled_container_types, tool_info, install=False, session=None, **kwds):
resolution_cache = kwds.get("resolution_cache")
if tool_info.requires_galaxy_python_environment or self.container_type not in enabled_container_types:
return None
@@ -397,7 +397,7 @@ class MulledDockerContainerResolver(ContainerResolver):
if len(targets) == 0:
return None
name = targets_to_mulled_name(targets=targets, hash_func=self.hash_func, namespace=self.namespace, resolution_cache=resolution_cache)
name = targets_to_mulled_name(targets=targets, hash_func=self.hash_func, namespace=self.namespace, resolution_cache=resolution_cache, session=session)
if name:
container_id = f"quay.io/{self.namespace}/{name}"
if self.protocol:
@@ -447,7 +447,7 @@ class MulledSingularityContainerResolver(MulledDockerContainerResolver):
self.hash_func = hash_func
self.auto_install = string_as_bool(auto_install)
def cached_container_description(self, targets, namespace, hash_func):
def cached_container_description(self, targets, namespace, hash_func, resolution_cache):
return singularity_cached_container_description(targets,
cache_directory=self.cache_directory,
hash_func=hash_func)
+2 -2
View File
@@ -243,7 +243,7 @@ class ContainerRegistry:
return None
return None if resolved_container_description is None else resolved_container_description.container_description
def resolve(self, enabled_container_types, tool_info, index=None, resolver_type=None, install=True, resolution_cache=None):
def resolve(self, enabled_container_types, tool_info, index=None, resolver_type=None, install=True, resolution_cache=None, session=None):
resolution_cache = resolution_cache or self.mulled_resolution_cache
for i, container_resolver in enumerate(self.container_resolvers):
if index is not None and i != index:
@@ -259,7 +259,7 @@ class ContainerRegistry:
if not install and container_resolver.builds_on_resolution:
continue
container_description = container_resolver.resolve(enabled_container_types, tool_info, resolution_cache=resolution_cache)
container_description = container_resolver.resolve(enabled_container_types, tool_info, resolution_cache=resolution_cache, session=session)
log.info(f"Checking with container resolver [{container_resolver}] found description [{container_description}]")
if container_description:
assert container_description.type in enabled_container_types
@@ -22,6 +22,8 @@ import subprocess
import sys
import time
import requests
from ._cli import arg_parser
from .mulled_build import (
add_build_arguments,
@@ -58,6 +60,7 @@ def _new_versions(quay, conda):
def run_channel(args, build_last_n_versions=1):
"""Build list of involucro commands (as shell snippet) to run."""
session = requests.session()
for pkg_name, pkg_tests in get_affected_packages(args):
repo_data = _fetch_repo_data(args)
c = conda_versions(pkg_name, repo_data)
@@ -66,7 +69,7 @@ def run_channel(args, build_last_n_versions=1):
if not args.force_rebuild:
time.sleep(1)
q = quay_versions(args.namespace, pkg_name)
q = quay_versions(args.namespace, pkg_name, session)
versions = _new_versions(q, c)
else:
versions = c
+8 -6
View File
@@ -32,9 +32,9 @@ def create_repository(namespace, repo_name, oauth_token):
requests.post("https://quay.io/api/v1/repository", json=data, headers=headers, timeout=QUAY_IO_TIMEOUT)
def quay_versions(namespace, pkg_name):
def quay_versions(namespace, pkg_name, session=None):
"""Get all version tags for a Docker image stored on quay.io for supplied package name."""
data = quay_repository(namespace, pkg_name)
data = quay_repository(namespace, pkg_name, session=session)
if 'error_type' in data and data['error_type'] == "invalid_token":
return []
@@ -45,11 +45,13 @@ def quay_versions(namespace, pkg_name):
return [tag for tag in data['tags'].keys() if tag != 'latest']
def quay_repository(namespace, pkg_name):
def quay_repository(namespace, pkg_name, session=None):
assert namespace is not None
assert pkg_name is not None
url = f'https://quay.io/api/v1/repository/{namespace}/{pkg_name}'
response = requests.get(url, timeout=QUAY_IO_TIMEOUT)
if not session:
session = requests.session()
response = session.get(url, timeout=QUAY_IO_TIMEOUT)
data = response.json()
return data
@@ -74,7 +76,7 @@ def _namespace_has_repo_name(namespace, repo_name, resolution_cache):
return repo_name in repo_names
def mulled_tags_for(namespace, image, tag_prefix=None, resolution_cache=None):
def mulled_tags_for(namespace, image, tag_prefix=None, resolution_cache=None, session=None):
"""Fetch remote tags available for supplied image name.
The result will be sorted so newest tags are first.
@@ -101,7 +103,7 @@ def mulled_tags_for(namespace, image, tag_prefix=None, resolution_cache=None):
tags_cached = True
if not tags_cached:
tags = quay_versions(namespace, image)
tags = quay_versions(namespace, image, session)
tag_cache[namespace][image] = tags
if tag_prefix is not None:
+1
View File
@@ -333,6 +333,7 @@ class ContainerResolutionView:
'install': False,
'enabled_container_types': ['docker', 'singularity'],
'resolution_cache': kwds.get("resolution_cache"),
'session': kwds.get('session'),
}
if 'index' in kwds:
+1 -1
View File
@@ -2791,7 +2791,7 @@ class DatabaseOperationTool(Tool):
if self.require_dataset_ok:
if state != model.Dataset.states.OK:
raise ValueError("Tool requires inputs to be in valid state.")
raise ValueError("Tool requires inputs to be in valid state, but dataset {} is in state '{}'".format(input_dataset, input_dataset.state))
for input_dataset in input_datasets.values():
check_dataset_state(input_dataset.state)
@@ -3,6 +3,8 @@ API operations allowing clients to manage container resolution.
"""
import logging
import requests
from galaxy.tool_util.deps import views
from galaxy.web import (
expose_api,
@@ -62,6 +64,7 @@ class ContainerResolutionAPIController(BaseAPIController):
:returns: a dictified description of the container dependency, with attribute
``dependency_type: None`` if no match was found.
"""
kwds['session'] = requests.session()
return self._view.resolve(index=index, **kwds)
@expose_api
@@ -81,6 +84,7 @@ class ContainerResolutionAPIController(BaseAPIController):
:rtype: list
:returns: list of items returned from resolve()
"""
kwds['session'] = requests.session()
return self._view.resolve_toolbox(**kwds)
@expose_api
@@ -99,6 +103,7 @@ class ContainerResolutionAPIController(BaseAPIController):
"""
kwds.update(payload)
kwds["install"] = True
kwds['session'] = requests.session()
return self._view.resolve_toolbox(**kwds)
@expose_api