diff --git a/config/plugins/interactive_environments/ipython/config/ipython.ini.sample b/config/plugins/interactive_environments/ipython/config/ipython.ini.sample index b8c9e8ed007..b52d5760911 100644 --- a/config/plugins/interactive_environments/ipython/config/ipython.ini.sample +++ b/config/plugins/interactive_environments/ipython/config/ipython.ini.sample @@ -12,10 +12,10 @@ command = docker # The docker image name that should be started. -image = bgruening/docker-ipython-notebook:0.2 +image = bgruening/docker-ipython-notebook:dev # Additional arguments that are passed to the `docker run` command. -command_inject = --sig-proxy=true +command_inject = --sig-proxy=true -e DEBUG=false # URL to access the Galaxy API with from the spawn Docker containter, if empty # this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the diff --git a/config/plugins/interactive_environments/ipython/templates/ipython.mako b/config/plugins/interactive_environments/ipython/templates/ipython.mako index 8f3a3d6655a..839e0328b33 100644 --- a/config/plugins/interactive_environments/ipython/templates/ipython.mako +++ b/config/plugins/interactive_environments/ipython/templates/ipython.mako @@ -11,8 +11,10 @@ ie_request.load_deploy_config() ie_request.attr.docker_port = 6789 # Create tempdir in galaxy temp_dir = os.path.abspath( tempfile.mkdtemp() ) -# Write out conf file...needs work -ie_request.write_conf_file(temp_dir) + +# Get all configurations +conf = ie_request.get_conf_dict() +ENV = ' '.join(['-e "%s=%s"' % (key.upper(), item) for key, item in conf.items()]) ## IPython Specific # Prepare an empty notebook @@ -34,9 +36,12 @@ else: notebook_access_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/notebooks/ipython_galaxy_notebook.ipynb') notebook_login_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/login?next=%2Fipython%2F${PORT}%2Ftree') -docker_cmd = ie_request.docker_cmd(temp_dir) + +# Add all environment variables collected from Galaxy's IE infrastructure +docker_cmd = ie_request.docker_cmd(temp_dir).replace('run', 'run %s' % ENV) ie_request.log.info("Starting IPython docker container with command [%s]" % docker_cmd) subprocess.call(docker_cmd, shell=True) + %>
diff --git a/config/plugins/interactive_environments/ipython/templates/notebook.ipynb b/config/plugins/interactive_environments/ipython/templates/notebook.ipynb index 97c8f2970f3..f44ffb39aec 100644 --- a/config/plugins/interactive_environments/ipython/templates/notebook.ipynb +++ b/config/plugins/interactive_environments/ipython/templates/notebook.ipynb @@ -20,7 +20,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can access your data via the dataset number. For example, ``handle = get(42)``.", + "You can access your data via the dataset number. For example, ``handle = open(get(42), 'r')``.", "To save data, write your data to a file, and then call ``put('filename.txt')``. The dataset will then be available in your galaxy history.", "Notebooks can be saved to Galaxy by clicking the large green button at the top right of the IPython interface.