Skip to content

Commit

Permalink
Update Test and Main
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Feb 23, 2016
1 parent c9696f8 commit a63287b
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 7 deletions.
@@ -1 +1 @@
a95827751f463f35c67e76f84127f850972244c5
4c815a7d0589a00df8c8fffba730a79030ad7791
@@ -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
@@ -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>
@@ -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);
}

@@ -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>
@@ -1 +1 @@
a95827751f463f35c67e76f84127f850972244c5
4c815a7d0589a00df8c8fffba730a79030ad7791
2 changes: 1 addition & 1 deletion production/group_vars/all.yml
Expand Up @@ -2,5 +2,5 @@

deploy_env: production

galaxy_changeset_id: a95827751f463f35c67e76f84127f850972244c5
galaxy_changeset_id: 4c815a7d0589a00df8c8fffba730a79030ad7791
galaxy_vcs: git
@@ -1 +1 @@
d331b54b99cdc9f07bf0e53f284adf1fa4398ce0
f06b8205897a594b9d10e3f0aeb37f4858ca15c6
@@ -1 +1 @@
d331b54b99cdc9f07bf0e53f284adf1fa4398ce0
f06b8205897a594b9d10e3f0aeb37f4858ca15c6
2 changes: 1 addition & 1 deletion stage/group_vars/all.yml
Expand Up @@ -2,5 +2,5 @@

deploy_env: stage

galaxy_changeset_id: d331b54b99cdc9f07bf0e53f284adf1fa4398ce0
galaxy_changeset_id: f06b8205897a594b9d10e3f0aeb37f4858ca15c6
galaxy_vcs: git
2 changes: 1 addition & 1 deletion stage/inventory
Expand Up @@ -9,7 +9,7 @@ galaxy05.tacc.utexas.edu

[pulsarservers]
login5.stampede.tacc.utexas.edu ansible_ssh_host=login1.stampede.tacc.utexas.edu
greenfield.psc.xsede.org
;greenfield.psc.xsede.org

[toolshedservers]
radegast.galaxyproject.org
Expand Down

0 comments on commit a63287b

Please sign in to comment.