Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
140 additions
and
7 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
production/files/interactive_environments/plugins/.ansible_ie_role_current_version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
a95827751f463f35c67e76f84127f850972244c5 | ||
4c815a7d0589a00df8c8fffba730a79030ad7791 |
21 changes: 21 additions & 0 deletions
21
production/files/interactive_environments/plugins/phinch/config/phinch.ini.sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[main] | ||
# Unused | ||
|
||
[docker] | ||
# Command to execute docker. For example `sudo docker` or `docker-lxc`. | ||
command = docker {docker_args} | ||
|
||
# The docker image name that should be started. | ||
image = shiltemann/docker-phinch-galaxy:16.04 | ||
|
||
# Additional arguments that are passed to the `docker run` command. | ||
#command_inject = --sig-proxy=true -e DEBUG=false | ||
|
||
# URL to access the Galaxy API with from the spawn Docker container, if empty | ||
# this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the | ||
# Docker host of the spawned container if that is also not set. | ||
#galaxy_url = | ||
|
||
# The Docker hostname. It can be useful to run the Docker daemon on a different | ||
# host than Galaxy. | ||
#docker_hostname = localhost |
15 changes: 15 additions & 0 deletions
15
production/files/interactive_environments/plugins/phinch/config/phinch.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE interactive_environment SYSTEM "../../interactive_environments.dtd"> | ||
<interactive_environment name="Phinch"> | ||
<data_sources> | ||
<data_source> | ||
<model_class>HistoryDatasetAssociation</model_class> | ||
<test type="isinstance" test_attr="datatype" result_type="datatype">Biom1</test> | ||
<to_param param_attr="id">dataset_id</to_param> | ||
</data_source> | ||
</data_sources> | ||
<params> | ||
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> | ||
</params> | ||
<entry_point entry_point_type="mako">phinch.mako</entry_point> | ||
</interactive_environment> |
51 changes: 51 additions & 0 deletions
51
production/files/interactive_environments/plugins/phinch/static/js/phinch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function load_notebook(url){ | ||
$( document ).ready(function() { | ||
test_ie_availability(url, function(){ | ||
append_notebook(url) | ||
}); | ||
}); | ||
} | ||
|
||
function append_notebook(url){ | ||
clear_main_area(); | ||
$('#main').append('<iframe frameBorder="0" seamless="seamless" style="width: 100%; height: 100%; overflow:auto;" scrolling="yes" src="'+ url +'"></iframe>' | ||
); | ||
} | ||
|
||
|
||
function keep_alive(notebook_access_url){ | ||
/** | ||
* This is needed to keep the container alive. If the user leaves this site | ||
* this function is not constantly pinging the container, the container will | ||
* terminate itself. | ||
*/ | ||
|
||
var request_count = 0; | ||
interval = setInterval(function(){ | ||
$.ajax({ | ||
url: notebook_access_url, | ||
xhrFields: { | ||
withCredentials: true | ||
}, | ||
type: "GET", | ||
timeout: 500, | ||
success: function(){ | ||
console.log("Connected to IE, returning"); | ||
}, | ||
error: function(jqxhr, status, error){ | ||
request_count++; | ||
console.log("Request " + request_count); | ||
if(request_count > 30){ | ||
clearInterval(interval); | ||
clear_main_area(); | ||
toastr.error( | ||
"Could not connect to IE, contact your administrator", | ||
"Error", | ||
{'closeButton': true, 'timeOut': 20000, 'tapToDismiss': false} | ||
); | ||
} | ||
} | ||
}); | ||
}, 10000); | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
production/files/interactive_environments/plugins/phinch/templates/phinch.mako
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<%namespace name="ie" file="ie.mako" /> | ||
<% | ||
import os | ||
# Sets ID and sets up a lot of other variables | ||
ie_request.load_deploy_config() | ||
# Launch the IE. This builds and runs the docker command in the background. | ||
ie_request.launch(env_override={ | ||
'dataset_hid': hda.hid, | ||
'dataset_filename': hda.file_name | ||
}) | ||
# Only once the container is launched can we template our URLs. The ie_request | ||
# doesn't have all of the information needed until the container is running. | ||
url = ie_request.url_template('${PROXY_URL}/phinch/') | ||
%> | ||
<html> | ||
<head> | ||
${ ie.load_default_js() } | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
${ ie.default_javascript_variables() } | ||
var url = '${ url }'; | ||
${ ie.plugin_require_config() } | ||
// Keep container running | ||
requirejs(['interactive_environments', 'plugin/phinch'], function(){ | ||
keep_alive(url); | ||
}); | ||
// Load notebook | ||
requirejs(['interactive_environments', 'plugin/phinch'], function(){ | ||
load_notebook(url); | ||
}); | ||
</script> | ||
<div id="main" style="width: 100%; height: 100%; overflow:hidden;"> | ||
</div> | ||
</body> | ||
</html> |
2 changes: 1 addition & 1 deletion
2
production/files/interactive_environments/proxy/.ansible_ie_role_current_version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
a95827751f463f35c67e76f84127f850972244c5 | ||
4c815a7d0589a00df8c8fffba730a79030ad7791 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
stage/files/interactive_environments/plugins/.ansible_ie_role_current_version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d331b54b99cdc9f07bf0e53f284adf1fa4398ce0 | ||
f06b8205897a594b9d10e3f0aeb37f4858ca15c6 |
2 changes: 1 addition & 1 deletion
2
stage/files/interactive_environments/proxy/.ansible_ie_role_current_version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d331b54b99cdc9f07bf0e53f284adf1fa4398ce0 | ||
f06b8205897a594b9d10e3f0aeb37f4858ca15c6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters