From 82516e3622618c40a0fcc1c00463a967d367a56a Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 7 May 2019 10:54:00 -0400 Subject: [PATCH 01/18] Add require.js directly to static as a temporary (remove after 19.05 w/ refactoring) fix for IE loading. --- static/scripts/libs/require.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 static/scripts/libs/require.js diff --git a/static/scripts/libs/require.js b/static/scripts/libs/require.js new file mode 100644 index 00000000000..75d9b0ebc2d --- /dev/null +++ b/static/scripts/libs/require.js @@ -0,0 +1 @@ +var requirejs,require,define;!function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.6",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i Date: Tue, 7 May 2019 11:18:58 -0400 Subject: [PATCH 02/18] Use primary (likely cached) libs here instead of direct access. --- .../interactive_environments/common/templates/ie.mako | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/plugins/interactive_environments/common/templates/ie.mako b/config/plugins/interactive_environments/common/templates/ie.mako index 63209322228..1342f089673 100644 --- a/config/plugins/interactive_environments/common/templates/ie.mako +++ b/config/plugins/interactive_environments/common/templates/ie.mako @@ -15,9 +15,10 @@ var ie_readiness_url = '${ h.url_for("/interactive_environments/ready") }'; <%def name="load_default_js()"> ${h.css( 'base' ) } -${h.js( 'libs/jquery/jquery', - 'libs/toastr', - 'libs/require')} +${h.js('libs/require', + 'bundled/libs.chunk', + 'bundled/base.chunk', + 'bundled/generic.bundled')} <%def name="plugin_require_config()"> From 15a954f4c3b2c15b9718fc5f44d5657730847e71 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 7 May 2019 16:22:07 -0400 Subject: [PATCH 03/18] Add IES to bundleEntries as an intermediate step --- client/galaxy/scripts/bundleEntries.js | 1 + .../galaxy.interactive_environments.js | 43 ++++++++++++------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/client/galaxy/scripts/bundleEntries.js b/client/galaxy/scripts/bundleEntries.js index 7b44c5245af..b6505d46fe6 100644 --- a/client/galaxy/scripts/bundleEntries.js +++ b/client/galaxy/scripts/bundleEntries.js @@ -32,6 +32,7 @@ export { default as HDAModel } from "mvc/history/hda-model"; export { default as LegacyGridView } from "legacy/grid/grid-view"; export { create_chart, create_histogram } from "reports/run_stats"; export { default as ToolshedGroups } from "toolshed/toolshed.groups"; +export { default as IES } from "galaxy.interactive_environments"; export function adminToolshed(options) { new AdminToolshed.GalaxyApp(options); diff --git a/client/galaxy/scripts/galaxy.interactive_environments.js b/client/galaxy/scripts/galaxy.interactive_environments.js index 6ae025c5bb7..c1d3b3509b9 100644 --- a/client/galaxy/scripts/galaxy.interactive_environments.js +++ b/client/galaxy/scripts/galaxy.interactive_environments.js @@ -1,6 +1,6 @@ -/* global $ */ -/* global toastr */ -// TODO: this file is transpiled and used directly without bundling; fix imports when that is no longer the case. +import $ from "jquery"; +import { Toast } from "ui/toast"; + /** * Internal function to remove content from the main area and add the notebook. * Not idempotent @@ -35,7 +35,7 @@ export function make_spin_state( sleep_step, log_attempts ) { - var s = { + return { type: typeof type !== "undefined" ? type : "GIE spin", ajax_timeout: typeof ajax_timeout_init !== "undefined" ? ajax_timeout_init : 2000, ajax_timeout_max: typeof ajax_timeout_max !== "undefined" ? ajax_timeout_max : 16000, @@ -46,7 +46,6 @@ export function make_spin_state( log_attempts: typeof log_attempts !== "undefined" ? log_attempts : true, count: 0 }; - return s; } /* Log/display an error when spinning fails. */ @@ -54,8 +53,8 @@ export function spin_error(console_msg, user_msg, clear) { console.log(console_msg); if (clear) clear_main_area(); if (typeof user_msg == "string") { - toastr.clear(); - toastr.error(user_msg, "Error", { + Toast.clear(); + Toast.error(user_msg, "Error", { closeButton: true, timeOut: 0, extendedTimeOut: 0, @@ -112,7 +111,7 @@ export function spin(url, bool_response, success_callback, timeout_callback, err } } }; - if (bool_response) ajax_params["dataType"] = "json"; + if (bool_response) ajax_params.dataType = "json"; $.ajax(ajax_params); }; console.log(`Setting up new spinner for ${spin_state.type} on ${url}`); @@ -131,7 +130,7 @@ function spin_until(url, bool_response, messages, success_callback, spin_state) var message_once = (message, spin_state) => { if (spin_state.count == 1) { display_spinner(); - toastr.info(message, null, { + Toast.info(message, null, { closeButton: true, timeOut: 0, extendedTimeOut: 0, @@ -141,22 +140,22 @@ function spin_until(url, bool_response, messages, success_callback, spin_state) }; var wrapped_success = data => { if (!bool_response || (bool_response && data == true)) { - console.log(messages["success"]); + console.log(messages.success); clear_main_area(); - toastr.clear(); + Toast.clear(); success_callback(); } else if (bool_response && data == false) { - message_once(messages["not_ready"], spin_state); + message_once(messages.not_ready, spin_state); return false; // keep spinning } else { - spin_error(`Invalid response to ${spin_state.type} request`, messages["invalid_response"], true); + spin_error(`Invalid response to ${spin_state.type} request`, messages.invalid_response, true); } return true; // stop spinning }; var timeout_error = (jqxhr, status, error) => { - message_once(messages["waiting"], spin_state); + message_once(messages.waiting, spin_state); if (spin_state.count == warn_at) { - toastr.warning(messages["wait_warn"], "Warning", { + Toast.warning(messages.wait_warn, "Warning", { closeButton: true, timeOut: 0, extendedTimeOut: 0, @@ -235,7 +234,7 @@ export function keepAlive(notebookAccessURL) { if (request_count > 30) { window.clearInterval(interval); clear_main_area(); - toastr.error("Could not connect to IE, contact your administrator", "Error", { + Toast.error("Could not connect to IE, contact your administrator", "Error", { closeButton: true, timeOut: 20000, tapToDismiss: false @@ -245,3 +244,15 @@ export function keepAlive(notebookAccessURL) { }); }, 10000); } + +export default { + append_notebook, + clear_main_area, + display_spinner, + make_spin_state, + spin_error, + spin, + test_ie_availability, + load_when_ready, + keepAlive +}; \ No newline at end of file From 38c2a809044f3b5eb6717da2d5683683af33dfc4 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 7 May 2019 16:44:15 -0400 Subject: [PATCH 04/18] Update IES to use bundleEntries-based JS entrypoint to avoid having to ship an extra file; incremental step towards removing require here, too. --- .../askomics/templates/askomics.mako | 4 ++-- .../bam_iobio/templates/bam_iobio.mako | 9 +++------ .../cellxgene/templates/cellxgene.mako | 10 ++++------ .../interactive_environments/common/templates/ie.mako | 1 - .../ethercalc/templates/ethercalc.mako | 4 ++-- .../hicbrowser/templates/hicbrowser.mako | 4 ++-- .../jupyter/templates/jupyter.mako | 4 ++-- .../interactive_environments/neo/templates/neo.mako | 4 ++-- .../phinch/templates/phinch.mako | 4 ++-- .../rstudio/templates/rstudio.mako | 4 ++-- doc/source/dev/interactive_environments.rst | 4 ++-- 11 files changed, 23 insertions(+), 29 deletions(-) diff --git a/config/plugins/interactive_environments/askomics/templates/askomics.mako b/config/plugins/interactive_environments/askomics/templates/askomics.mako index 29195f1baf5..5dfeca4d7f5 100644 --- a/config/plugins/interactive_environments/askomics/templates/askomics.mako +++ b/config/plugins/interactive_environments/askomics/templates/askomics.mako @@ -40,8 +40,8 @@ ${ ie.load_default_js() } ${ ie.default_javascript_variables() } var url = '${ url }'; ${ ie.plugin_require_config() } -requirejs(['galaxy.interactive_environments', 'plugin/askomics'], function(IES){ - window.IES = IES; +requirejs(['plugin/askomics'], function(){ + window.IES = bundleEntries.IES; load_askomics(url); }); diff --git a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako index 16115b2847a..9eda875e8c7 100644 --- a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako +++ b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako @@ -33,10 +33,8 @@ root = h.url_for( '/' ) var notebook_access_url = '${ notebook_access_url }'; ${ ie.plugin_require_config() } - requirejs(['galaxy.interactive_environments', 'plugin/bam_iobio'], function(IES){ - window.IES = IES; - IES.display_spinner(); - }); + window.IES = bundleEntries.IES; + IES.display_spinner(); toastr.info( "BAM io.bio is starting up!", @@ -46,8 +44,7 @@ root = h.url_for( '/' ) var startup = function(){ // Load notebook - requirejs(['galaxy.interactive_environments', 'plugin/bam_iobio'], function(IES){ - window.IES = IES; + requirejs(['plugin/bam_iobio'], function(){ IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); }); diff --git a/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako b/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako index 3d91ae1c9b5..699371dec62 100644 --- a/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako +++ b/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako @@ -23,12 +23,10 @@ var url = '${ url }'; ${ ie.plugin_require_config() } - requirejs(['galaxy.interactive_environments'], function (IES) { - $( document ).ready(function() { - IES.keepAlive(url); - IES.test_ie_availability(url, function() { - IES.append_notebook(url); - }); + $( document ).ready(function() { + IES.keepAlive(url); + IES.test_ie_availability(url, function() { + IES.append_notebook(url); }); }); diff --git a/config/plugins/interactive_environments/common/templates/ie.mako b/config/plugins/interactive_environments/common/templates/ie.mako index 1342f089673..ac968c9e933 100644 --- a/config/plugins/interactive_environments/common/templates/ie.mako +++ b/config/plugins/interactive_environments/common/templates/ie.mako @@ -26,7 +26,6 @@ require.config({ baseUrl: app_root, paths: { "plugin" : app_root + "js", - "galaxy.interactive_environments": "${h.url_for('/static/scripts/galaxy.interactive_environments')}", }, urlArgs: "v=${app.server_starttime}", }); diff --git a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako index 5f2e83bd63a..4a5cada29bd 100644 --- a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako +++ b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako @@ -26,8 +26,8 @@ var url = '${ url }'; ${ ie.plugin_require_config() } // Keep container running and load IE -requirejs(['galaxy.interactive_environments', 'plugin/ethercalc'], function(IES){ - window.IES = IES; +requirejs(['plugin/ethercalc'], function(){ + window.IES = bundleEntries.IES; IES.keepAlive(url); IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); diff --git a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako index cf69cc8f633..e203a3e4da3 100644 --- a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako +++ b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako @@ -38,8 +38,8 @@ ${ ie.plugin_require_config() } - requirejs(['galaxy.interactive_environments', 'plugin/hicbrowser'], function (IES) { - window.IES = IES; + requirejs(['plugin/hicbrowser'], function () { + window.IES = bundleEntries.IES; load_hicexplorer(url); }); diff --git a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako index fc8db1f3e5d..a54889c2975 100644 --- a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako +++ b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako @@ -62,9 +62,9 @@ ${ ie.plugin_require_config() } // Load notebook -requirejs(['galaxy.interactive_environments', 'plugin/jupyter'], function(IES){ +requirejs(['plugin/jupyter'], function(){ // This global is not awesome, get rid of it when possible (when IES are a part of the build process) - window.IES = IES; + window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(ie_password, notebook_login_url, notebook_access_url); }); diff --git a/config/plugins/interactive_environments/neo/templates/neo.mako b/config/plugins/interactive_environments/neo/templates/neo.mako index c1df7807375..b8eb4f5c99a 100644 --- a/config/plugins/interactive_environments/neo/templates/neo.mako +++ b/config/plugins/interactive_environments/neo/templates/neo.mako @@ -32,8 +32,8 @@ ${ ie.plugin_require_config() } - requirejs(['galaxy.interactive_environments', 'plugin/neo'], function (IES) { - window.IES = IES; + requirejs(['plugin/neo'], function () { + window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); }); diff --git a/config/plugins/interactive_environments/phinch/templates/phinch.mako b/config/plugins/interactive_environments/phinch/templates/phinch.mako index a98e1309cb3..6ccc0f19565 100644 --- a/config/plugins/interactive_environments/phinch/templates/phinch.mako +++ b/config/plugins/interactive_environments/phinch/templates/phinch.mako @@ -30,8 +30,8 @@ var url = '${ url }'; ${ ie.plugin_require_config() } // Keep container running and load notebook -requirejs(['galaxy.interactive_environments', 'plugin/phinch'], function(IES){ - window.IES = IES; +requirejs(['plugin/phinch'], function(){ + window.IES = bundleEntries.IES; keep_alive(url); IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); diff --git a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako index a9c0bf776db..d8188427405 100755 --- a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako +++ b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako @@ -34,8 +34,8 @@ ${ ie.load_default_js() } ${ ie.default_javascript_variables() } var notebook_access_url = '${ notebook_access_url }'; ${ ie.plugin_require_config() } -requirejs(['galaxy.interactive_environments', 'plugin/rstudio'], function(IES){ - window.IES = IES; +requirejs(['plugin/rstudio'], function(){ + window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); }); diff --git a/doc/source/dev/interactive_environments.rst b/doc/source/dev/interactive_environments.rst index a9372fdc228..420016c105a 100644 --- a/doc/source/dev/interactive_environments.rst +++ b/doc/source/dev/interactive_environments.rst @@ -224,8 +224,8 @@ We'll continue appending to our ``helloworld.mako`` the HTML code that's actuall // This will load code from static/helloworld.js, often used to handle // things like Login. The load_notebook function will eventually append // an IFrame to the
below. - requirejs(['galaxy.interactive_environments', 'plugin/helloworld'], function(IES){ - window.IES = IES + requirejs(['plugin/helloworld'], function(){ + window.IES = bundleEntries.IES IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); }); From dfa13efe634ca8feb61689d3107b889c7acf4ee2 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Mon, 6 May 2019 13:52:26 -0400 Subject: [PATCH 05/18] Update doc on NodeJS version compatibility (I updated proxy deps a while back, works with modern node now) --- .../special_topics/interactive_environments.rst | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/source/admin/special_topics/interactive_environments.rst b/doc/source/admin/special_topics/interactive_environments.rst index f075f041295..f7e7fce324c 100644 --- a/doc/source/admin/special_topics/interactive_environments.rst +++ b/doc/source/admin/special_topics/interactive_environments.rst @@ -36,17 +36,13 @@ and `Ansible Galaxy `__. Setting up the Proxy ^^^^^^^^^^^^^^^^^^^^ -Currently the Galaxy proxy is a NodeJS+Sqlite3 proxy. +The Galaxy IE Proxy is a NodeJS+Sqlite3 application. The NodeJS that is +installed by default into the Galaxy Virtualenv is suitable for an execution +environment for the Galaxy IE Proxy. -- Node has recently upgraded, and our proxy is pinned to an old version of - sqlite3. As such you'll currently need to have an older version of Node - available (0.10.X - 0.11.X vintage). -- One can use `NVM `__ to install and manage multiple versions of Node. -- We're working on solutions in this space to provide a better deployment - mechanism here and fewer dependencies. -- Please note that if you have NodeJS installed under Ubuntu, it often - installs to ``/usr/bin/nodejs``, whereas ``npm`` expects it to be - ``/usr/bin/node``. You will need to create that symlink yourself. +- Note that if you have NodeJS installed under Ubuntu, it often installs to + ``/usr/bin/nodejs``, whereas ``npm`` expects it to be ``/usr/bin/node``. You + may need to create that symlink yourself. Once Node and npm are ready to go, you'll need to install the dependencies From 418edbd8f40675307539b0b0dc44715fc2c817e8 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 10:51:30 -0400 Subject: [PATCH 06/18] Move IEs to a standard 'main.js' instead of --- .../askomics/static/js/{askomics.js => main.js} | 0 .../interactive_environments/askomics/templates/askomics.mako | 2 +- .../bam_iobio/static/js/{bam_iobio.js => main.js} | 0 .../interactive_environments/bam_iobio/templates/bam_iobio.mako | 2 +- .../ethercalc/static/js/{ethercalc.js => main.js} | 0 .../interactive_environments/ethercalc/templates/ethercalc.mako | 2 +- .../hicbrowser/static/js/{hicbrowser.js => main.js} | 0 .../hicbrowser/templates/hicbrowser.mako | 2 +- .../jupyter/static/js/{jupyter.js => main.js} | 0 .../interactive_environments/jupyter/templates/jupyter.mako | 2 +- .../interactive_environments/neo/static/js/{neo.js => main.js} | 0 config/plugins/interactive_environments/neo/templates/neo.mako | 2 +- .../phinch/static/js/{phinch.js => main.js} | 0 .../interactive_environments/phinch/templates/phinch.mako | 2 +- .../rstudio/static/js/{rstudio.js => main.js} | 0 .../interactive_environments/rstudio/templates/rstudio.mako | 2 +- 16 files changed, 8 insertions(+), 8 deletions(-) rename config/plugins/interactive_environments/askomics/static/js/{askomics.js => main.js} (100%) rename config/plugins/interactive_environments/bam_iobio/static/js/{bam_iobio.js => main.js} (100%) rename config/plugins/interactive_environments/ethercalc/static/js/{ethercalc.js => main.js} (100%) rename config/plugins/interactive_environments/hicbrowser/static/js/{hicbrowser.js => main.js} (100%) rename config/plugins/interactive_environments/jupyter/static/js/{jupyter.js => main.js} (100%) rename config/plugins/interactive_environments/neo/static/js/{neo.js => main.js} (100%) rename config/plugins/interactive_environments/phinch/static/js/{phinch.js => main.js} (100%) rename config/plugins/interactive_environments/rstudio/static/js/{rstudio.js => main.js} (100%) diff --git a/config/plugins/interactive_environments/askomics/static/js/askomics.js b/config/plugins/interactive_environments/askomics/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/askomics/static/js/askomics.js rename to config/plugins/interactive_environments/askomics/static/js/main.js diff --git a/config/plugins/interactive_environments/askomics/templates/askomics.mako b/config/plugins/interactive_environments/askomics/templates/askomics.mako index 5dfeca4d7f5..eb6603a17f3 100644 --- a/config/plugins/interactive_environments/askomics/templates/askomics.mako +++ b/config/plugins/interactive_environments/askomics/templates/askomics.mako @@ -40,7 +40,7 @@ ${ ie.load_default_js() } ${ ie.default_javascript_variables() } var url = '${ url }'; ${ ie.plugin_require_config() } -requirejs(['plugin/askomics'], function(){ +requirejs(['plugin/main'], function(){ window.IES = bundleEntries.IES; load_askomics(url); }); diff --git a/config/plugins/interactive_environments/bam_iobio/static/js/bam_iobio.js b/config/plugins/interactive_environments/bam_iobio/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/bam_iobio/static/js/bam_iobio.js rename to config/plugins/interactive_environments/bam_iobio/static/js/main.js diff --git a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako index 9eda875e8c7..ceeec5d465c 100644 --- a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako +++ b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako @@ -44,7 +44,7 @@ root = h.url_for( '/' ) var startup = function(){ // Load notebook - requirejs(['plugin/bam_iobio'], function(){ + requirejs(['plugin/main'], function(){ IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); }); diff --git a/config/plugins/interactive_environments/ethercalc/static/js/ethercalc.js b/config/plugins/interactive_environments/ethercalc/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/ethercalc/static/js/ethercalc.js rename to config/plugins/interactive_environments/ethercalc/static/js/main.js diff --git a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako index 4a5cada29bd..f23a7ffee4d 100644 --- a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako +++ b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako @@ -26,7 +26,7 @@ var url = '${ url }'; ${ ie.plugin_require_config() } // Keep container running and load IE -requirejs(['plugin/ethercalc'], function(){ +requirejs(['plugin/main'], function(){ window.IES = bundleEntries.IES; IES.keepAlive(url); IES.load_when_ready(ie_readiness_url, function(){ diff --git a/config/plugins/interactive_environments/hicbrowser/static/js/hicbrowser.js b/config/plugins/interactive_environments/hicbrowser/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/hicbrowser/static/js/hicbrowser.js rename to config/plugins/interactive_environments/hicbrowser/static/js/main.js diff --git a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako index e203a3e4da3..643bff2577b 100644 --- a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako +++ b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako @@ -38,7 +38,7 @@ ${ ie.plugin_require_config() } - requirejs(['plugin/hicbrowser'], function () { + requirejs(['plugin/main'], function () { window.IES = bundleEntries.IES; load_hicexplorer(url); }); diff --git a/config/plugins/interactive_environments/jupyter/static/js/jupyter.js b/config/plugins/interactive_environments/jupyter/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/jupyter/static/js/jupyter.js rename to config/plugins/interactive_environments/jupyter/static/js/main.js diff --git a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako index a54889c2975..6a0965e3152 100644 --- a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako +++ b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako @@ -62,7 +62,7 @@ ${ ie.plugin_require_config() } // Load notebook -requirejs(['plugin/jupyter'], function(){ +requirejs(['plugin/main'], function(){ // This global is not awesome, get rid of it when possible (when IES are a part of the build process) window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ diff --git a/config/plugins/interactive_environments/neo/static/js/neo.js b/config/plugins/interactive_environments/neo/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/neo/static/js/neo.js rename to config/plugins/interactive_environments/neo/static/js/main.js diff --git a/config/plugins/interactive_environments/neo/templates/neo.mako b/config/plugins/interactive_environments/neo/templates/neo.mako index b8eb4f5c99a..342ada1d652 100644 --- a/config/plugins/interactive_environments/neo/templates/neo.mako +++ b/config/plugins/interactive_environments/neo/templates/neo.mako @@ -32,7 +32,7 @@ ${ ie.plugin_require_config() } - requirejs(['plugin/neo'], function () { + requirejs(['plugin/main'], function () { window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); diff --git a/config/plugins/interactive_environments/phinch/static/js/phinch.js b/config/plugins/interactive_environments/phinch/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/phinch/static/js/phinch.js rename to config/plugins/interactive_environments/phinch/static/js/main.js diff --git a/config/plugins/interactive_environments/phinch/templates/phinch.mako b/config/plugins/interactive_environments/phinch/templates/phinch.mako index 6ccc0f19565..6a288f8a06c 100644 --- a/config/plugins/interactive_environments/phinch/templates/phinch.mako +++ b/config/plugins/interactive_environments/phinch/templates/phinch.mako @@ -30,7 +30,7 @@ var url = '${ url }'; ${ ie.plugin_require_config() } // Keep container running and load notebook -requirejs(['plugin/phinch'], function(){ +requirejs(['plugin/main'], function(){ window.IES = bundleEntries.IES; keep_alive(url); IES.load_when_ready(ie_readiness_url, function(){ diff --git a/config/plugins/interactive_environments/rstudio/static/js/rstudio.js b/config/plugins/interactive_environments/rstudio/static/js/main.js similarity index 100% rename from config/plugins/interactive_environments/rstudio/static/js/rstudio.js rename to config/plugins/interactive_environments/rstudio/static/js/main.js diff --git a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako index d8188427405..95121da5c09 100755 --- a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako +++ b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako @@ -34,7 +34,7 @@ ${ ie.load_default_js() } ${ ie.default_javascript_variables() } var notebook_access_url = '${ notebook_access_url }'; ${ ie.plugin_require_config() } -requirejs(['plugin/rstudio'], function(){ +requirejs(['plugin/main'], function(){ window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); From fd75ce5e4312efdb2121386443aa53bfefeabff7 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 10:59:34 -0400 Subject: [PATCH 07/18] Standardize (at least a step forward) access to IES lib via bundle --- .../askomics/templates/askomics.mako | 1 - .../bam_iobio/templates/bam_iobio.mako | 1 - .../common/templates/ie.mako | 24 ++++++++++--------- .../ethercalc/templates/ethercalc.mako | 1 - .../hicbrowser/templates/hicbrowser.mako | 1 - .../jupyter/templates/jupyter.mako | 1 - .../neo/templates/neo.mako | 1 - .../phinch/templates/phinch.mako | 1 - .../rstudio/templates/rstudio.mako | 1 - doc/source/dev/interactive_environments.rst | 1 - 10 files changed, 13 insertions(+), 20 deletions(-) diff --git a/config/plugins/interactive_environments/askomics/templates/askomics.mako b/config/plugins/interactive_environments/askomics/templates/askomics.mako index eb6603a17f3..acdbf60e3ef 100644 --- a/config/plugins/interactive_environments/askomics/templates/askomics.mako +++ b/config/plugins/interactive_environments/askomics/templates/askomics.mako @@ -41,7 +41,6 @@ ${ ie.default_javascript_variables() } var url = '${ url }'; ${ ie.plugin_require_config() } requirejs(['plugin/main'], function(){ - window.IES = bundleEntries.IES; load_askomics(url); }); diff --git a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako index ceeec5d465c..42cb7263b71 100644 --- a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako +++ b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako @@ -33,7 +33,6 @@ root = h.url_for( '/' ) var notebook_access_url = '${ notebook_access_url }'; ${ ie.plugin_require_config() } - window.IES = bundleEntries.IES; IES.display_spinner(); toastr.info( diff --git a/config/plugins/interactive_environments/common/templates/ie.mako b/config/plugins/interactive_environments/common/templates/ie.mako index ac968c9e933..0ccd24157c2 100644 --- a/config/plugins/interactive_environments/common/templates/ie.mako +++ b/config/plugins/interactive_environments/common/templates/ie.mako @@ -1,3 +1,11 @@ +<%def name="load_default_js()"> +${h.css( 'base' ) } +${h.js('libs/require', + 'bundled/libs.chunk', + 'bundled/base.chunk', + 'bundled/generic.bundled')} + + <%def name="default_javascript_variables()"> // Globals @@ -10,15 +18,12 @@ ie_password = '${ ie_request.notebook_pw }'; var galaxy_root = '${ ie_request.attr.root }'; var app_root = '${ ie_request.attr.app_root }'; var ie_readiness_url = '${ h.url_for("/interactive_environments/ready") }'; - +window.IES = bundleEntries.IES; -<%def name="load_default_js()"> -${h.css( 'base' ) } -${h.js('libs/require', - 'bundled/libs.chunk', - 'bundled/base.chunk', - 'bundled/generic.bundled')} +window.onbeforeunload = function() { + return 'You are leaving your Interactive Environment.'; +}; <%def name="plugin_require_config()"> @@ -30,8 +35,5 @@ require.config({ urlArgs: "v=${app.server_starttime}", }); -window.onbeforeunload = function() { - return 'You are leaving your Interactive Environment.'; -}; - + \ No newline at end of file diff --git a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako index f23a7ffee4d..58bf38be625 100644 --- a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako +++ b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako @@ -27,7 +27,6 @@ ${ ie.plugin_require_config() } // Keep container running and load IE requirejs(['plugin/main'], function(){ - window.IES = bundleEntries.IES; IES.keepAlive(url); IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); diff --git a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako index 643bff2577b..b6787b52581 100644 --- a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako +++ b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako @@ -39,7 +39,6 @@ requirejs(['plugin/main'], function () { - window.IES = bundleEntries.IES; load_hicexplorer(url); }); diff --git a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako index 6a0965e3152..c313c950d00 100644 --- a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako +++ b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako @@ -64,7 +64,6 @@ ${ ie.plugin_require_config() } requirejs(['plugin/main'], function(){ // This global is not awesome, get rid of it when possible (when IES are a part of the build process) - window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(ie_password, notebook_login_url, notebook_access_url); }); diff --git a/config/plugins/interactive_environments/neo/templates/neo.mako b/config/plugins/interactive_environments/neo/templates/neo.mako index 342ada1d652..c872f44bf9f 100644 --- a/config/plugins/interactive_environments/neo/templates/neo.mako +++ b/config/plugins/interactive_environments/neo/templates/neo.mako @@ -33,7 +33,6 @@ requirejs(['plugin/main'], function () { - window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); }); diff --git a/config/plugins/interactive_environments/phinch/templates/phinch.mako b/config/plugins/interactive_environments/phinch/templates/phinch.mako index 6a288f8a06c..b1f5c221091 100644 --- a/config/plugins/interactive_environments/phinch/templates/phinch.mako +++ b/config/plugins/interactive_environments/phinch/templates/phinch.mako @@ -31,7 +31,6 @@ ${ ie.plugin_require_config() } // Keep container running and load notebook requirejs(['plugin/main'], function(){ - window.IES = bundleEntries.IES; keep_alive(url); IES.load_when_ready(ie_readiness_url, function(){ load_notebook(url); diff --git a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako index 95121da5c09..922e012034e 100755 --- a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako +++ b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako @@ -35,7 +35,6 @@ ${ ie.default_javascript_variables() } var notebook_access_url = '${ notebook_access_url }'; ${ ie.plugin_require_config() } requirejs(['plugin/main'], function(){ - window.IES = bundleEntries.IES; IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); }); diff --git a/doc/source/dev/interactive_environments.rst b/doc/source/dev/interactive_environments.rst index 420016c105a..fcee51fe127 100644 --- a/doc/source/dev/interactive_environments.rst +++ b/doc/source/dev/interactive_environments.rst @@ -225,7 +225,6 @@ We'll continue appending to our ``helloworld.mako`` the HTML code that's actuall // things like Login. The load_notebook function will eventually append // an IFrame to the
below. requirejs(['plugin/helloworld'], function(){ - window.IES = bundleEntries.IES IES.load_when_ready(ie_readiness_url, function(){ load_notebook(notebook_access_url); }); From bc2a84a4dd9b7a2ee38a07b2ac0c350bfe7ec26e Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 11:40:05 -0400 Subject: [PATCH 08/18] Swap jupyter to require-free loading. --- .../common/templates/ie.mako | 17 ++++------------- .../jupyter/templates/jupyter.mako | 10 +++------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/config/plugins/interactive_environments/common/templates/ie.mako b/config/plugins/interactive_environments/common/templates/ie.mako index 0ccd24157c2..804d05c4ebc 100644 --- a/config/plugins/interactive_environments/common/templates/ie.mako +++ b/config/plugins/interactive_environments/common/templates/ie.mako @@ -1,7 +1,6 @@ <%def name="load_default_js()"> ${h.css( 'base' ) } -${h.js('libs/require', - 'bundled/libs.chunk', +${h.js('bundled/libs.chunk', 'bundled/base.chunk', 'bundled/generic.bundled')} @@ -26,14 +25,6 @@ window.onbeforeunload = function() { }; -<%def name="plugin_require_config()"> -require.config({ - baseUrl: app_root, - paths: { - "plugin" : app_root + "js", - }, - urlArgs: "v=${app.server_starttime}", -}); - - - \ No newline at end of file +<%def name="load_default_app()"> + + diff --git a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako index c313c950d00..eb26eb34fc7 100644 --- a/config/plugins/interactive_environments/jupyter/templates/jupyter.mako +++ b/config/plugins/interactive_environments/jupyter/templates/jupyter.mako @@ -50,6 +50,7 @@ notebook_keepalive_url = ie_request.url_template('${PROXY_URL}/ipython/tree') ${ ie.load_default_js() } +${ ie.load_default_app() } @@ -58,15 +59,10 @@ ${ ie.default_javascript_variables() } var notebook_login_url = '${ notebook_login_url }'; var notebook_access_url = '${ notebook_access_url }'; var notebook_keepalive_url = '${ notebook_keepalive_url }'; -${ ie.plugin_require_config() } // Load notebook - -requirejs(['plugin/main'], function(){ - // This global is not awesome, get rid of it when possible (when IES are a part of the build process) - IES.load_when_ready(ie_readiness_url, function(){ - load_notebook(ie_password, notebook_login_url, notebook_access_url); - }); +IES.load_when_ready(ie_readiness_url, function(){ + load_notebook(ie_password, notebook_login_url, notebook_access_url); }); From e391f241cd25db12767889f787082b0d2d9e2e0f Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 11:49:00 -0400 Subject: [PATCH 09/18] Swap all IES to require-less loading. --- .../askomics/templates/askomics.mako | 6 ++---- .../bam_iobio/templates/bam_iobio.mako | 8 +++----- .../cellxgene/templates/cellxgene.mako | 1 - .../ethercalc/templates/ethercalc.mako | 10 ++++------ .../hicbrowser/templates/hicbrowser.mako | 8 ++------ .../interactive_environments/neo/templates/neo.mako | 13 ++++--------- .../phinch/templates/phinch.mako | 12 +++++------- .../rstudio/templates/rstudio.mako | 8 +++----- 8 files changed, 23 insertions(+), 43 deletions(-) diff --git a/config/plugins/interactive_environments/askomics/templates/askomics.mako b/config/plugins/interactive_environments/askomics/templates/askomics.mako index acdbf60e3ef..e9dfb8441da 100644 --- a/config/plugins/interactive_environments/askomics/templates/askomics.mako +++ b/config/plugins/interactive_environments/askomics/templates/askomics.mako @@ -34,15 +34,13 @@ url = ie_request.url_template('${PROXY_URL}/login_api_gie?key=' + askomics_api_k ${ ie.load_default_js() } +${ ie.load_default_app() }
diff --git a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako index 42cb7263b71..4060fa9ff6a 100644 --- a/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako +++ b/config/plugins/interactive_environments/bam_iobio/templates/bam_iobio.mako @@ -24,6 +24,7 @@ root = h.url_for( '/' ) ${ ie.load_default_js() } + ${ ie.load_default_app() } @@ -31,7 +32,6 @@ root = h.url_for( '/' ) ${ ie.default_javascript_variables() } var notebook_access_url = '${ notebook_access_url }'; - ${ ie.plugin_require_config() } IES.display_spinner(); @@ -43,10 +43,8 @@ root = h.url_for( '/' ) var startup = function(){ // Load notebook - requirejs(['plugin/main'], function(){ - IES.load_when_ready(ie_readiness_url, function(){ - load_notebook(notebook_access_url); - }); + IES.load_when_ready(ie_readiness_url, function(){ + load_notebook(notebook_access_url); }); }; diff --git a/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako b/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako index 699371dec62..8651f5b50af 100644 --- a/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako +++ b/config/plugins/interactive_environments/cellxgene/templates/cellxgene.mako @@ -21,7 +21,6 @@ ${ ie.default_javascript_variables() } var url = '${ url }'; - ${ ie.plugin_require_config() } $( document ).ready(function() { IES.keepAlive(url); diff --git a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako index 58bf38be625..a9c6a60b3e5 100644 --- a/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako +++ b/config/plugins/interactive_environments/ethercalc/templates/ethercalc.mako @@ -18,19 +18,17 @@ url = ie_request.url_template('${PROXY_URL}/ethercalc/') ${ ie.load_default_js() } +${ ie.load_default_app() }
diff --git a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako index b6787b52581..b4ad8329dab 100644 --- a/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako +++ b/config/plugins/interactive_environments/hicbrowser/templates/hicbrowser.mako @@ -29,18 +29,14 @@ ${ ie.load_default_js() } + ${ ie.load_default_app() }
diff --git a/config/plugins/interactive_environments/neo/templates/neo.mako b/config/plugins/interactive_environments/neo/templates/neo.mako index c872f44bf9f..24f3e968cd8 100644 --- a/config/plugins/interactive_environments/neo/templates/neo.mako +++ b/config/plugins/interactive_environments/neo/templates/neo.mako @@ -23,19 +23,14 @@ ${ ie.load_default_js() } + ${ ie.load_default_app() } diff --git a/config/plugins/interactive_environments/phinch/templates/phinch.mako b/config/plugins/interactive_environments/phinch/templates/phinch.mako index b1f5c221091..fc84a905ae9 100644 --- a/config/plugins/interactive_environments/phinch/templates/phinch.mako +++ b/config/plugins/interactive_environments/phinch/templates/phinch.mako @@ -21,20 +21,18 @@ url = ie_request.url_template('${PROXY_URL}/phinch/') %> -${ ie.load_default_js() } + ${ ie.load_default_js() } + ${ ie.load_default_app() } diff --git a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako index 922e012034e..fd181ac41cc 100755 --- a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako +++ b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako @@ -27,17 +27,15 @@ notebook_access_url = ie_request.url_template('${PROXY_URL}/rstudio/') ${ ie.load_default_js() } +${ ie.load_default_app() }
From 9a8cd97379415ce66abc5262adf31d1bc88137e0 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 11:49:44 -0400 Subject: [PATCH 10/18] Delete temporary require.js --- static/scripts/libs/require.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 static/scripts/libs/require.js diff --git a/static/scripts/libs/require.js b/static/scripts/libs/require.js deleted file mode 100644 index 75d9b0ebc2d..00000000000 --- a/static/scripts/libs/require.js +++ /dev/null @@ -1 +0,0 @@ -var requirejs,require,define;!function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.6",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i Date: Wed, 8 May 2019 11:59:16 -0400 Subject: [PATCH 11/18] Update documentation for IES --- doc/source/dev/interactive_environments.rst | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/doc/source/dev/interactive_environments.rst b/doc/source/dev/interactive_environments.rst index fcee51fe127..7f457228c7e 100644 --- a/doc/source/dev/interactive_environments.rst +++ b/doc/source/dev/interactive_environments.rst @@ -205,9 +205,10 @@ We'll continue appending to our ``helloworld.mako`` the HTML code that's actuall - + ${ ie.load_default_js() } + + ${ ie.load_default_app() } @@ -217,17 +218,11 @@ We'll continue appending to our ``helloworld.mako`` the HTML code that's actuall var notebook_login_url = 'unused'; var notebook_access_url = '${ notebook_access_url }'; - // Load code with require.js - ${ ie.plugin_require_config() } // Load notebook - // This will load code from static/helloworld.js, often used to handle - // things like Login. The load_notebook function will eventually append - // an IFrame to the
below. - requirejs(['plugin/helloworld'], function(){ - IES.load_when_ready(ie_readiness_url, function(){ - load_notebook(notebook_access_url); - }); + // The load_notebook function will eventually append an IFrame to the
below. + IES.load_when_ready(ie_readiness_url, function(){ + load_notebook(notebook_access_url); });
@@ -261,7 +256,7 @@ authentication of users, so you don't have to worry about it, and can just assume that only the correct user will have access to a given notebook. In the ``static/`` directory, we generally create a ``js/`` directory below that, -and create a ``{gie}.js`` (so, ``static/js/helloworld.js``) file in there. +and create a ``main.js`` file in there. That file will have a function, ``load_notebook`` which will check if the GIE is available, and when it is, display it to the user. From be30834d90b3caa7a9f243b6f907f399de8ec8a9 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 12:32:01 -0400 Subject: [PATCH 12/18] Add bridge for Toast/toastr for use by IE plugins --- client/galaxy/scripts/bundleEntries.js | 2 ++ .../plugins/interactive_environments/common/templates/ie.mako | 1 + 2 files changed, 3 insertions(+) diff --git a/client/galaxy/scripts/bundleEntries.js b/client/galaxy/scripts/bundleEntries.js index b6505d46fe6..abc8be4d625 100644 --- a/client/galaxy/scripts/bundleEntries.js +++ b/client/galaxy/scripts/bundleEntries.js @@ -34,6 +34,8 @@ export { create_chart, create_histogram } from "reports/run_stats"; export { default as ToolshedGroups } from "toolshed/toolshed.groups"; export { default as IES } from "galaxy.interactive_environments"; +export { Toast } from "ui/toast"; // TODO: remove when external consumers are updated/gone (IES right now) + export function adminToolshed(options) { new AdminToolshed.GalaxyApp(options); } diff --git a/config/plugins/interactive_environments/common/templates/ie.mako b/config/plugins/interactive_environments/common/templates/ie.mako index 804d05c4ebc..98fe7919c46 100644 --- a/config/plugins/interactive_environments/common/templates/ie.mako +++ b/config/plugins/interactive_environments/common/templates/ie.mako @@ -19,6 +19,7 @@ var app_root = '${ ie_request.attr.app_root }'; var ie_readiness_url = '${ h.url_for("/interactive_environments/ready") }'; window.IES = bundleEntries.IES; +window.toastr = bundleEntries.Toast; window.onbeforeunload = function() { return 'You are leaving your Interactive Environment.'; From c90642d969c51b08adda9db5fd2c5f9ebc2aaadc Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 8 May 2019 12:43:21 -0400 Subject: [PATCH 13/18] Cleanup in IE javascript. --- .../askomics/static/js/main.js | 6 +- .../bam_iobio/static/js/main.js | 30 +++--- .../ethercalc/static/js/main.js | 4 +- .../hicbrowser/static/js/main.js | 6 +- .../jupyter/static/js/main.js | 102 ++++++++++-------- .../neo/static/js/main.js | 4 +- .../phinch/static/js/main.js | 42 ++++---- .../rstudio/static/js/main.js | 22 ++-- 8 files changed, 114 insertions(+), 102 deletions(-) diff --git a/config/plugins/interactive_environments/askomics/static/js/main.js b/config/plugins/interactive_environments/askomics/static/js/main.js index ad674394807..791dac16749 100644 --- a/config/plugins/interactive_environments/askomics/static/js/main.js +++ b/config/plugins/interactive_environments/askomics/static/js/main.js @@ -1,8 +1,8 @@ var IES = window.IES; -function load_askomics(url){ - $( document ).ready(function() { - IES.test_ie_availability(url, function(){ +function load_askomics(url) { + $(document).ready(function() { + IES.test_ie_availability(url, function() { IES.append_notebook(url); }); }); diff --git a/config/plugins/interactive_environments/bam_iobio/static/js/main.js b/config/plugins/interactive_environments/bam_iobio/static/js/main.js index d706be38d26..b9e69702abf 100644 --- a/config/plugins/interactive_environments/bam_iobio/static/js/main.js +++ b/config/plugins/interactive_environments/bam_iobio/static/js/main.js @@ -2,20 +2,20 @@ var IES = window.IES; var toastr = window.toastr; -function message_failed_auth(password){ - toastr.info( - "Automatic authorization failed.", - "Please login manually", - {'closeButton': true, 'timeOut': 100000, 'tapToDismiss': false} - ); +function message_failed_auth(password) { + toastr.info("Automatic authorization failed.", "Please login manually", { + closeButton: true, + timeOut: 100000, + tapToDismiss: false + }); } -function message_failed_connection(){ - toastr.error( - "Could not connect to BAM iobio. Please contact your administrator.", - "Security warning", - {'closeButton': true, 'timeOut': 20000, 'tapToDismiss': true} - ); +function message_failed_connection() { + toastr.error("Could not connect to BAM iobio. Please contact your administrator.", "Security warning", { + closeButton: true, + timeOut: 20000, + tapToDismiss: true + }); } /** @@ -25,10 +25,10 @@ function message_failed_connection(){ * @param {String} notebook_access_url: the URL embeded in the page and loaded * */ -function load_notebook(notebook_access_url){ +function load_notebook(notebook_access_url) { // Test notebook_login_url for accessibility, executing the login+load function whenever // we've successfully connected to the IE. - IES.test_ie_availability(notebook_access_url, function(){ + IES.test_ie_availability(notebook_access_url, function() { _handle_notebook_loading(notebook_access_url); }); } @@ -36,6 +36,6 @@ function load_notebook(notebook_access_url){ /** * Must be implemented by IEs */ -function _handle_notebook_loading(notebook_access_url){ +function _handle_notebook_loading(notebook_access_url) { IES.append_notebook(notebook_access_url); } diff --git a/config/plugins/interactive_environments/ethercalc/static/js/main.js b/config/plugins/interactive_environments/ethercalc/static/js/main.js index bcf564666ae..a9727622ad7 100644 --- a/config/plugins/interactive_environments/ethercalc/static/js/main.js +++ b/config/plugins/interactive_environments/ethercalc/static/js/main.js @@ -2,8 +2,8 @@ var IES = window.IES; var toastr = window.toastr; -function load_notebook(url){ - IES.test_ie_availability(url, function(){ +function load_notebook(url) { + IES.test_ie_availability(url, function() { IES.append_notebook(url); }); } diff --git a/config/plugins/interactive_environments/hicbrowser/static/js/main.js b/config/plugins/interactive_environments/hicbrowser/static/js/main.js index a7803b7d16a..f0164119b9a 100644 --- a/config/plugins/interactive_environments/hicbrowser/static/js/main.js +++ b/config/plugins/interactive_environments/hicbrowser/static/js/main.js @@ -3,12 +3,12 @@ var IES = window.IES; // Load an interactive environment (IE) from a remote URL // @param {String} hicexplorer_access_url: the URL embeded in the page and loaded -function load_hicexplorer(hicexplorer_access_url){ +function load_hicexplorer(hicexplorer_access_url) { // When the page has completely loaded... - $( document ).ready(function() { + $(document).ready(function() { // Test if we can access the GIE, and if so, execute the function // to load the GIE for the user. - IES.test_ie_availability(hicexplorer_access_url, function(){ + IES.test_ie_availability(hicexplorer_access_url, function() { IES.append_notebook(hicexplorer_access_url); }); }); diff --git a/config/plugins/interactive_environments/jupyter/static/js/main.js b/config/plugins/interactive_environments/jupyter/static/js/main.js index 3d386889dba..3d0ac5b7118 100644 --- a/config/plugins/interactive_environments/jupyter/static/js/main.js +++ b/config/plugins/interactive_environments/jupyter/static/js/main.js @@ -2,23 +2,25 @@ var IES = window.IES; var toastr = window.toastr; -function message_failed_auth(password){ +function message_failed_auth(password) { toastr.info( - "Automatic authorization failed. You can manually login with:
" + password + "
More details ...", + "Automatic authorization failed. You can manually login with:
" + + password + + "
More details ...", "Please login manually", - {'closeButton': true, 'timeOut': 100000, 'tapToDismiss': false} + { closeButton: true, timeOut: 100000, tapToDismiss: false } ); } -function message_failed_connection(){ +function message_failed_connection() { toastr.error( "Could not connect to Jupyter Notebook. Please contact your administrator. More details ...", - "Security warning", - {'closeButton': true, 'timeOut': 20000, 'tapToDismiss': true} + "Security warning", + { closeButton: true, timeOut: 20000, tapToDismiss: true } ); } -function message_no_auth(){ +function message_no_auth() { // No longer a security issue, proxy validates Galaxy session token. /* toastr.warning( @@ -29,7 +31,6 @@ function message_no_auth(){ */ } - /** * Load an interactive environment (IE) from a remote URL * @param {String} password: password used to authenticate to the remote resource @@ -37,68 +38,82 @@ function message_no_auth(){ * @param {String} notebook_access_url: the URL embeded in the page and loaded * */ -function load_notebook(password, notebook_login_url, notebook_access_url){ +function load_notebook(password, notebook_login_url, notebook_access_url) { // Test notebook_login_url for accessibility, executing the login+load function whenever // we've successfully connected to the IE. - IES.test_ie_availability(notebook_login_url, function(){ + IES.test_ie_availability(notebook_login_url, function() { _handle_notebook_loading(password, notebook_login_url, notebook_access_url); keep_alive(); }); } - -function keep_alive(){ +function keep_alive() { /** - * 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. - */ + * 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 warn_at = 4; var count_max = 60; // we sleep 15 seconds between requests and the default timeout for the Jupyter container is 120 seconds, so start // with a pretty high ajax timeout. sleep starts low because we want to get the warning up pretty quickly var spin_state = IES.make_spin_state("IE keepalive", 8000, 16000, 2000, 5000, 15000, 5000, false); - var success = function(){ + var success = function() { console.log("IE keepalive request succeeded"); toastr.clear(); - if(spin_state.count >= warn_at){ + if (spin_state.count >= warn_at) { toastr.clear(); - toastr.success( - "Interactive environment connection restored", - {'closeButton': true, 'timeOut': 5000, 'extendedTimeOut': 2000, 'tapToDismiss': true} - ); + toastr.success("Interactive environment connection restored", { + closeButton: true, + timeOut: 5000, + extendedTimeOut: 2000, + tapToDismiss: true + }); } spin_state.count = 0; spin_state.timeout_count = 0; spin_state.error_count = 0; - return false; // keep spinning + return false; // keep spinning }; - var timeout_error = function(jqxhr, status, error){ - console.log("IE keepalive request failed " + spin_state.count + " time(s) of " + count_max + " max: " + status + ": " + error); - if(spin_state.count == warn_at){ + var timeout_error = function(jqxhr, status, error) { + console.log( + "IE keepalive request failed " + + spin_state.count + + " time(s) of " + + count_max + + " max: " + + status + + ": " + + error + ); + if (spin_state.count == warn_at) { toastr.warning( - "Your browser has been unable to contact the interactive environment for " - + spin_state.count + " consecutive attempts, if you do not reestablish " - + "a connection, your IE container may be terminated.", + "Your browser has been unable to contact the interactive environment for " + + spin_state.count + + " consecutive attempts, if you do not reestablish " + + "a connection, your IE container may be terminated.", "Warning", - {'closeButton': true, 'timeOut': 0, 'extendedTimeOut': 0, 'tapToDismiss': false} + { closeButton: true, timeOut: 0, extendedTimeOut: 0, tapToDismiss: false } ); - return false; // keep spinning - }else if(spin_state.count >= count_max){ - IES.spin_error("IE keepalive failure limit reached", "Lost connection to interactive environment, contact your administrator", false); - return true; // stop spinning + return false; // keep spinning + } else if (spin_state.count >= count_max) { + IES.spin_error( + "IE keepalive failure limit reached", + "Lost connection to interactive environment, contact your administrator", + false + ); + return true; // stop spinning } }; console.log("IE keepalive worker starting"); IES.spin(notebook_keepalive_url, false, success, timeout_error, timeout_error, spin_state); } - /** * Must be implemented by IEs */ -function _handle_notebook_loading(password, notebook_login_url, notebook_access_url){ - if ( ie_password_auth ) { +function _handle_notebook_loading(password, notebook_login_url, notebook_access_url) { + if (ie_password_auth) { // Make an AJAX POST $.ajax({ type: "POST", @@ -106,29 +121,28 @@ function _handle_notebook_loading(password, notebook_login_url, notebook_access_ url: notebook_login_url, // With our password data: { - 'password': password + password: password }, xhrFields: { withCredentials: true }, // If that is successful, load the notebook - success: function(){ + success: function() { IES.append_notebook(notebook_access_url); }, - error: function(jqxhr, status, error){ - if(ie_password_auth){ + error: function(jqxhr, status, error) { + if (ie_password_auth) { // Failure happens due to CORS message_failed_auth(password); IES.append_notebook(notebook_access_url); - }else{ + } else { message_failed_connection(); // Do we want to try and load the notebook anyway? Just in case? IES.append_notebook(notebook_access_url); } } }); - } - else { + } else { // Not using password auth, just embed it to avoid content-origin issues. message_no_auth(); IES.append_notebook(notebook_access_url); diff --git a/config/plugins/interactive_environments/neo/static/js/main.js b/config/plugins/interactive_environments/neo/static/js/main.js index 37244a7dd6e..06571d8328a 100644 --- a/config/plugins/interactive_environments/neo/static/js/main.js +++ b/config/plugins/interactive_environments/neo/static/js/main.js @@ -3,10 +3,10 @@ var IES = window.IES; // Load an interactive environment (IE) from a remote URL // @param {String} notebook_access_url: the URL embeded in the page and loaded -function load_notebook(notebook_access_url){ +function load_notebook(notebook_access_url) { // Test if we can access the GIE, and if so, execute the function // to load the GIE for the user. - IES.test_ie_availability(notebook_access_url, function(){ + IES.test_ie_availability(notebook_access_url, function() { IES.append_notebook(notebook_access_url); }); } diff --git a/config/plugins/interactive_environments/phinch/static/js/main.js b/config/plugins/interactive_environments/phinch/static/js/main.js index 1fea1fc08fc..be12aeecca2 100644 --- a/config/plugins/interactive_environments/phinch/static/js/main.js +++ b/config/plugins/interactive_environments/phinch/static/js/main.js @@ -2,29 +2,30 @@ var IES = window.IES; var toastr = window.toastr; -function load_notebook(url){ - IES.test_ie_availability(url, function(){ +function load_notebook(url) { + IES.test_ie_availability(url, function() { append_notebook(url); }); } -function append_notebook(url){ +function append_notebook(url) { IES.clear_main_area(); - $('#main').append( - '' + $("#main").append( + '' ); } - -function keep_alive(notebook_access_url){ +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. - */ + * 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; - var interval = window.setInterval(function(){ + var interval = window.setInterval(function() { $.ajax({ url: notebook_access_url, xhrFields: { @@ -32,23 +33,22 @@ function keep_alive(notebook_access_url){ }, type: "GET", timeout: 500, - success: function(){ + success: function() { console.log("Connected to IE, returning"); }, - error: function(jqxhr, status, error){ + error: function(jqxhr, status, error) { request_count++; console.log("Request " + request_count); - if(request_count > 30){ + if (request_count > 30) { window.clearInterval(interval); IES.clear_main_area(); - toastr.error( - "Could not connect to IE, contact your administrator", - "Error", - {'closeButton': true, 'timeOut': 20000, 'tapToDismiss': false} - ); + toastr.error("Could not connect to IE, contact your administrator", "Error", { + closeButton: true, + timeOut: 20000, + tapToDismiss: false + }); } } }); }, 10000); } - diff --git a/config/plugins/interactive_environments/rstudio/static/js/main.js b/config/plugins/interactive_environments/rstudio/static/js/main.js index c8be493fd5c..63a6aa03b8f 100755 --- a/config/plugins/interactive_environments/rstudio/static/js/main.js +++ b/config/plugins/interactive_environments/rstudio/static/js/main.js @@ -2,31 +2,29 @@ var IES = window.IES; var toastr = window.toastr; -function message_failed_connection(){ - toastr.error( - "Could not connect to RStudio. Please contact your administrator.", - "Security warning", - {'closeButton': true, 'timeOut': 20000, 'tapToDismiss': true} - ); +function message_failed_connection() { + toastr.error("Could not connect to RStudio. Please contact your administrator.", "Security warning", { + closeButton: true, + timeOut: 20000, + tapToDismiss: true + }); } - /** * Load an interactive environment (IE) from a remote URL * @param {String} notebook_access_url: the URL embeded in the page and loaded * */ -function load_notebook(notebook_access_url){ +function load_notebook(notebook_access_url) { // Test notebook_login_url for accessibility, executing the login+load function whenever // we've successfully connected to the IE. - IES.test_ie_availability(notebook_access_url, function(){ + IES.test_ie_availability(notebook_access_url, function() { $.ajax({ - type: 'GET', + type: "GET", url: notebook_access_url, - success: function(response_text){ + success: function(response_text) { IES.append_notebook(notebook_access_url); } }); - }); } From c7bc50f6d10081d433e325e9ee0ed5d4ce6ee7e9 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 9 May 2019 14:24:19 -0400 Subject: [PATCH 14/18] Drop redundant GET (test_ie_avail already does this to check for access) for RStudio custom js --- .../interactive_environments/rstudio/static/js/main.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/config/plugins/interactive_environments/rstudio/static/js/main.js b/config/plugins/interactive_environments/rstudio/static/js/main.js index 63a6aa03b8f..bf4bcac3dfc 100755 --- a/config/plugins/interactive_environments/rstudio/static/js/main.js +++ b/config/plugins/interactive_environments/rstudio/static/js/main.js @@ -19,12 +19,6 @@ function load_notebook(notebook_access_url) { // Test notebook_login_url for accessibility, executing the login+load function whenever // we've successfully connected to the IE. IES.test_ie_availability(notebook_access_url, function() { - $.ajax({ - type: "GET", - url: notebook_access_url, - success: function(response_text) { - IES.append_notebook(notebook_access_url); - } - }); + IES.append_notebook(notebook_access_url); }); } From 502bbb453b4a867e2922acbe33e2c6dda3d9fe28 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 9 May 2019 21:11:14 +0200 Subject: [PATCH 15/18] Fix byte-unicode issue when using Popen --- .../visualization/plugins/interactive_environments.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/visualization/plugins/interactive_environments.py b/lib/galaxy/visualization/plugins/interactive_environments.py index b7c1016f41c..180345c7c1b 100644 --- a/lib/galaxy/visualization/plugins/interactive_environments.py +++ b/lib/galaxy/visualization/plugins/interactive_environments.py @@ -19,7 +19,10 @@ from galaxy import model, web from galaxy.containers import ContainerPort from galaxy.containers.docker_model import DockerVolume from galaxy.managers import api_keys -from galaxy.util import string_as_bool_or_none +from galaxy.util import ( + string_as_bool_or_none, + unicodify +) from galaxy.util.bunch import Bunch @@ -432,6 +435,8 @@ class InteractiveEnvironmentRequest(object): )) p = Popen(raw_cmd, stdout=PIPE, stderr=PIPE, close_fds=True) stdout, stderr = p.communicate() + stdout = unicodify(stdout) + stderr = unicodify(stderr) if p.returncode != 0: log.error("Container Launch error\n\n%s\n%s" % (stdout, stderr)) return None From 6bc802307fb77686e6268e605b99d4d056188722 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 10 May 2019 10:04:08 -0400 Subject: [PATCH 16/18] Document the modern docker networking special DNS 'host.docker.internal' for use with GIES. Fix another typo I saw. --- config/galaxy.yml.sample | 11 +++++------ doc/source/admin/galaxy_options.rst | 11 +++++------ lib/galaxy/webapps/galaxy/config_schema.yml | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/config/galaxy.yml.sample b/config/galaxy.yml.sample index c911ebe358f..b89d0919357 100644 --- a/config/galaxy.yml.sample +++ b/config/galaxy.yml.sample @@ -333,7 +333,7 @@ galaxy: # be used for job destinations with Docker enabled. #enable_beta_mulled_containers: false - # Container resolvers configuration (beta). Setup a file describing + # Container resolvers configuration (beta). Set up a file describing # container resolvers to use when discovering containers for Galaxy. # If this is set to None, the default containers loaded is determined # by enable_beta_mulled_containers. @@ -693,11 +693,10 @@ galaxy: # URL (with schema http/https) of the Galaxy instance as accessible # within your local network - if specified used as a default by pulsar # file staging and Jupyter Docker container for communicating back - # with Galaxy via the API. If you are attempting to setup GIEs on Mac - # OS X with Docker for Mac - this should likely be the IP address of - # your machine on the virtualbox network (vboxnet0) setup for the - # Docker host VM. This can found by running ifconfig and using the IP - # address of the network vboxnet0. + # with Galaxy via the API. If you are attempting to set up GIEs on + # Mac OS X with Docker Desktop for Mac this should be + # 'http://host.docker.internal:8080'. For more details see + # https://docs.docker.com/docker-for-mac/networking/ #galaxy_infrastructure_url: http://localhost:8080 # If the above URL cannot be determined ahead of time in dynamic diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 82791c59d71..2867b64e0c8 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -517,7 +517,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Description: - Container resolvers configuration (beta). Setup a file describing + Container resolvers configuration (beta). Set up a file describing container resolvers to use when discovering containers for Galaxy. If this is set to None, the default containers loaded is determined by enable_beta_mulled_containers. @@ -1301,11 +1301,10 @@ URL (with schema http/https) of the Galaxy instance as accessible within your local network - if specified used as a default by pulsar file staging and Jupyter Docker container for communicating - back with Galaxy via the API. If you are attempting to setup GIEs - on Mac OS X with Docker for Mac - this should likely be the IP - address of your machine on the virtualbox network (vboxnet0) setup - for the Docker host VM. This can found by running ifconfig and - using the IP address of the network vboxnet0. + back with Galaxy via the API. If you are attempting to set up + GIEs on Mac OS X with Docker Desktop for Mac this should be + 'http://host.docker.internal:8080'. For more details see + https://docs.docker.com/docker-for-mac/networking/ :Default: ``http://localhost:8080`` :Type: str diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index 7447f18be59..527eb1fbe06 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -397,9 +397,9 @@ mapping: default: '' required: false desc: | - Container resolvers configuration (beta). Setup a file describing container - resolvers to use when discovering containers for Galaxy. If this is set to - None, the default containers loaded is determined by + Container resolvers configuration (beta). Set up a file describing + container resolvers to use when discovering containers for Galaxy. If + this is set to None, the default containers loaded is determined by enable_beta_mulled_containers. involucro_path: @@ -970,14 +970,14 @@ mapping: default: http://localhost:8080 required: false desc: | - URL (with schema http/https) of the Galaxy instance as accessible within your - local network - if specified used as a default by pulsar file staging and - Jupyter Docker container for communicating back with Galaxy via the API. + URL (with schema http/https) of the Galaxy instance as accessible + within your local network - if specified used as a default by pulsar + file staging and Jupyter Docker container for communicating back with + Galaxy via the API. - If you are attempting to setup GIEs on Mac OS X with Docker for Mac - this - should likely be the IP address of your machine on the virtualbox network (vboxnet0) - setup for the Docker host VM. This can found by running ifconfig and using the - IP address of the network vboxnet0. + If you are attempting to set up GIEs on Mac OS X with Docker Desktop + for Mac this should be 'http://host.docker.internal:8080'. For more + details see https://docs.docker.com/docker-for-mac/networking/ galaxy_infrastructure_web_port: type: int From a1487d733a53df64b3851c3271575b0b9fb3d8c3 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 10 May 2019 10:09:10 -0400 Subject: [PATCH 17/18] Fix a few more random typos in config, rebuild --- config/galaxy.yml.sample | 8 ++++---- doc/source/admin/galaxy_options.rst | 14 ++++++-------- lib/galaxy/webapps/galaxy/config_schema.yml | 14 +++++++------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/config/galaxy.yml.sample b/config/galaxy.yml.sample index b89d0919357..3db0ae51d95 100644 --- a/config/galaxy.yml.sample +++ b/config/galaxy.yml.sample @@ -144,7 +144,7 @@ galaxy: # than 5 milliseconds. #slow_query_log_threshold: 0 - # Enable's a per request sql debugging option. If this is set to true, + # Enables a per request sql debugging option. If this is set to true, # append ?sql_debug=1 to web request URLs to enable detailed logging # on the backend of SQL queries generated during that request. This is # useful for debugging slow endpoints during development. @@ -632,7 +632,7 @@ galaxy: # Galaxy can display data at various external browsers. These options # specify which browsers should be available. URLs and builds - # available at these browsers are defined in the specifield files. If + # available at these browsers are defined in the specified files. If # use_remote_user = True, display application servers will be denied # access to Galaxy and so displaying datasets in these sites will # fail. display_servers contains a list of hostnames which should be @@ -876,11 +876,11 @@ galaxy: # for IPC, set that here. #dynamic_proxy_session_map: database/session_map.sqlite - # Set the port and IP for the the dynamic proxy to bind to, this must + # Set the port and IP for the dynamic proxy to bind to, this must # match the external configuration if dynamic_proxy_manage is False. #dynamic_proxy_bind_port: 8800 - # Set the port and IP for the the dynamic proxy to bind to, this must + # Set the port and IP for the dynamic proxy to bind to, this must # match the external configuration if dynamic_proxy_manage is False. #dynamic_proxy_bind_ip: 0.0.0.0 diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 2867b64e0c8..e8f05424f1b 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -105,7 +105,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Description: - Enable's a per request sql debugging option. If this is set to + Enables a per request sql debugging option. If this is set to true, append ?sql_debug=1 to web request URLs to enable detailed logging on the backend of SQL queries generated during that request. This is useful for debugging slow endpoints during @@ -1175,7 +1175,7 @@ :Description: Galaxy can display data at various external browsers. These options specify which browsers should be available. URLs and - builds available at these browsers are defined in the specifield + builds available at these browsers are defined in the specified files. If use_remote_user = True, display application servers will be denied access to Galaxy and so displaying datasets in these sites will fail. display_servers contains a list of @@ -1731,9 +1731,8 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Description: - Set the port and IP for the the dynamic proxy to bind to, this - must match the external configuration if dynamic_proxy_manage is - False. + Set the port and IP for the dynamic proxy to bind to, this must + match the external configuration if dynamic_proxy_manage is False. :Default: ``8800`` :Type: int @@ -1743,9 +1742,8 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ :Description: - Set the port and IP for the the dynamic proxy to bind to, this - must match the external configuration if dynamic_proxy_manage is - False. + Set the port and IP for the dynamic proxy to bind to, this must + match the external configuration if dynamic_proxy_manage is False. :Default: ``0.0.0.0`` :Type: str diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index 527eb1fbe06..b418146d92e 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -102,10 +102,10 @@ mapping: default: false required: false desc: | - Enable's a per request sql debugging option. If this is set to true, append - ?sql_debug=1 to web request URLs to enable detailed logging on the backend of SQL - queries generated during that request. This is useful for debugging slow endpoints - during development. + Enables a per request sql debugging option. If this is set to true, + append ?sql_debug=1 to web request URLs to enable detailed logging on + the backend of SQL queries generated during that request. This is + useful for debugging slow endpoints during development. install_database_connection: type: str @@ -874,7 +874,7 @@ mapping: desc: | Galaxy can display data at various external browsers. These options specify which browsers should be available. URLs and builds available at these - browsers are defined in the specifield files. + browsers are defined in the specified files. If use_remote_user = True, display application servers will be denied access to Galaxy and so displaying datasets in these sites will fail. @@ -1292,7 +1292,7 @@ mapping: default: 8800 required: false desc: | - Set the port and IP for the the dynamic proxy to bind to, this must match + Set the port and IP for the dynamic proxy to bind to, this must match the external configuration if dynamic_proxy_manage is False. dynamic_proxy_bind_ip: @@ -1300,7 +1300,7 @@ mapping: default: 0.0.0.0 required: false desc: | - Set the port and IP for the the dynamic proxy to bind to, this must match + Set the port and IP for the dynamic proxy to bind to, this must match the external configuration if dynamic_proxy_manage is False. dynamic_proxy_debug: From 349ac80412ca4a247bbff4eeedc312b40c3c1f50 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 10 May 2019 10:12:27 -0400 Subject: [PATCH 18/18] Include suggestion from Marius to make port specification more clear. --- config/galaxy.yml.sample | 6 +++--- doc/source/admin/galaxy_options.rst | 3 ++- lib/galaxy/webapps/galaxy/config_schema.yml | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/galaxy.yml.sample b/config/galaxy.yml.sample index 3db0ae51d95..3d33fff38da 100644 --- a/config/galaxy.yml.sample +++ b/config/galaxy.yml.sample @@ -694,9 +694,9 @@ galaxy: # within your local network - if specified used as a default by pulsar # file staging and Jupyter Docker container for communicating back # with Galaxy via the API. If you are attempting to set up GIEs on - # Mac OS X with Docker Desktop for Mac this should be - # 'http://host.docker.internal:8080'. For more details see - # https://docs.docker.com/docker-for-mac/networking/ + # Mac OS X with Docker Desktop for Mac and your Galaxy instance runs + # on port 8080 this should be 'http://host.docker.internal:8080'. For + # more details see https://docs.docker.com/docker-for-mac/networking/ #galaxy_infrastructure_url: http://localhost:8080 # If the above URL cannot be determined ahead of time in dynamic diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index e8f05424f1b..1347cc1aae5 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -1302,7 +1302,8 @@ within your local network - if specified used as a default by pulsar file staging and Jupyter Docker container for communicating back with Galaxy via the API. If you are attempting to set up - GIEs on Mac OS X with Docker Desktop for Mac this should be + GIEs on Mac OS X with Docker Desktop for Mac and your Galaxy + instance runs on port 8080 this should be 'http://host.docker.internal:8080'. For more details see https://docs.docker.com/docker-for-mac/networking/ :Default: ``http://localhost:8080`` diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index b418146d92e..70630a407aa 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -976,8 +976,9 @@ mapping: Galaxy via the API. If you are attempting to set up GIEs on Mac OS X with Docker Desktop - for Mac this should be 'http://host.docker.internal:8080'. For more - details see https://docs.docker.com/docker-for-mac/networking/ + for Mac and your Galaxy instance runs on port 8080 this should be + 'http://host.docker.internal:8080'. For more details see + https://docs.docker.com/docker-for-mac/networking/ galaxy_infrastructure_web_port: type: int