Remove files indicated by Bjoern.

No need to LICENSE this differently, INSTALL.md probably should be rewritten, and .gitignore is now pointless.

https://bitbucket.org/galaxy/galaxy-central/pull-request/533.
This commit is contained in:
John Chilton
2014-10-19 17:38:30 -04:00
parent 9ad5e12e1c
commit e8b4f8085f
6 changed files with 0 additions and 282 deletions
@@ -1,54 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Rope
.ropeproject
# Django stuff:
*.log
*.pot
# Sphinx documentation
docs/_build/
@@ -1,63 +0,0 @@
# Installation
We've developed the templates and containers such that they can be run through an Apache proxy using
SSL. This requires some non-trivial apache configuration to support.
## Requirements
* [mod_headers](http://httpd.apache.org/docs/2.4/mod/mod_headers.html)
* [mod_proxy](http://httpd.apache.org/docs/2.4/mod/mod_proxy.html)
* [mod_proxy_http](http://httpd.apache.org/docs/2.4/mod/mod_proxy_http.html)
* [mod_proxy_wstunnel](http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html)
* [mod_rewrite](http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html)
* [mod_setenvif](http://httpd.apache.org/docs/2.4/mod/mod_setenvif.html)
IPython makes use of WebSockets which we need to proxy in apache. Support was added to `apache2.4`
for this, which is available in `Ubuntu 14.04`. There are tutorials on the internet for backporting
the websockets module, and installing `apache2.4` PPAs.
## Apache Configuration
Here is the relevant configuration
```apache
RewriteEngine On
SetEnvIf Request_URI "/ipython/([0-9]+)/api/kernels/" DOCKER_PORT=$1
RewriteRule ^/ipython/([0-9]+)/api/kernels/(.*)$ ws://127.0.0.1:$1/ipython/$1/api/kernels/$2 [P,L]
RewriteRule ^/ipython/([0-9]+)/(.*)$ http://localhost:$1/ipython/$1/$2 [P,L]
<Location /ipython/>
# spoof headers to make notepad accept the request as coming from the same origin
Header set Origin "http://127.0.0.1:%{DOCKER_PORT}e"
RequestHeader set Origin "http://127.0.0.1:%{DOCKER_PORT}e"
</Location>
</VirtualHost>
```
We'll step through line-by-line for clarity.
```apache
SetEnvIf Request_URI "/ipython/([0-9]+)/api/kernels/" DOCKER_PORT=$1
```
Here we check the `Request_URI` for the presence for the kernel request. We do this only for the `api/kernel` subcall, as the only configuration which needs access to `DOCKER_PORT` is kernel calls.
```apache
RewriteRule ^/ipython/([0-9]+)/api/kernels/(.*)$ ws://127.0.0.1:$1/ipython/$1/api/kernels/$2 [P,L]
RewriteRule ^/ipython/([0-9]+)/(.*)$ http://localhost:$1/ipython/$1/$2 [P,L]
```
These two rules proxy `^/ipython/` requests to their correct locations. API requests for the IPython kernel are routed through the wstunnel (WebSocket) proxy, while all other requests go through HTTP. There are modified listed after both, `[P,L]`. `P` specifies a proxy, and `L` specifies this is the last rule, to prevent the second rewrite statement from matching all kernel calls.
```apache
<Location /ipython/>
# spoof headers to make notepad accept the request as coming from the same origin
Header set Origin "http://127.0.0.1:%{DOCKER_PORT}e"
RequestHeader set Origin "http://127.0.0.1:%{DOCKER_PORT}e"
</Location>
```
The WebSocket server in IPython pays attention to Cross-Origin-Requests and will through up a 500 Internal Server Error (in docker) if you attempt to send it bad data. Thus, we use the extracted port number from the earlier `SetEnvIf` request in order to obtain the port that IPython will actually receive connections from.
## Nginx Configuration
Please submit it if you write it!
@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014 Björn Grüning
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,144 +0,0 @@
Galaxy IPython Integration
==========================
This projects integrates [IPython Notebook](http://ipython.org/notebook.html), a interactive computational environment, with [Galaxy](http://galaxyproject.org).
We hope to make Galaxy more attractive for bioinformaticians and to combine the power of both projects to unlock creativity in data analysis, but also in Next-Generation-Training courses.
![IPython in Galaxy](https://raw.githubusercontent.com/bgruening/galaxy-ipython/master/static/images/ipython_in_galaxy.png)
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/jQDyTuYnn1k/0.jpg)](http://www.youtube.com/watch?v=jQDyTuYnn1k)
Requirements
============
The only requirement is to have [Docker](https://www.docker.com) installed on your system.
For a detailed instruction how to install docker, please look at the [docker website](https://docs.docker.com/installation/).
Installation
============
Copy the template and config folder in your ``GALAXY_ROOT/config/plugins/visualizations/ipython`` folder and restart Galaxy.
Alternatively, you can clone the repository with
```bash
git clone https://github.com/bgruening/galaxy-ipython.git config/plugins/visualizations/ipython
````
The IPython visualisation option should be visible next to the usual Charts or Trackster options in your visualisation menue.
![Starting IPython in Galaxy](https://raw.githubusercontent.com/bgruening/galaxy-ipython/master/static/images/start_ipython.png)
Features
========
* run IPython directly in your Galaxy main window or in Galaxy Scratchbook
* complete encapsulated python environment with matplotlib, pandas and friends installed
* access to all datasets from your current history via pre-defined IPython function
* manipulate and plot data as you like and export your new files back into the Galaxy history
* access your Galaxy instance from IPython with bioblend and redefined functions
* save the IPython Notebook into your Galaxy history
* notebook persistence across sessions
* saved IPython Notebook files can be viewed in HTML and re-opened
* self-closing and cleaning IPython docker container
How does it work
================
The mako template from the Galaxy visualisation framework renders the interface and builds all files and commands needed to lunch the docker container. A config file is saved under ``/import/`` inside the docker container. The IPython webpage running in docker will be included in a HTML object and displayed to the user.
Depending on your configuration some JavaScript magic is done to add an object to the DOM, which will be loaded by the browser and conditionally handles login.
Iside of docker TCP connections are monitored using cron. As soon as the user quits using the notebook, the dropping TCP connections are recognised and the cotainer cleans up after itself and kills itself.
Functions and variables
=======================
For your convience, we have added a few pre-defined functions to the IPython profile.
### get
The get function will copy a dataset, identified by the history_id, from your current Galaxy
into the docker container. It will return the file path to the copied file.
*Example*:
```python
with open( get( 44 ), 'r') as handle:
for line in handle:
print( line )
```
### put
The put function takes a file path and transfers the file to the current history of your Galaxy session.
*Example*:
```python
put( './my_file.tsv', file_type = 'tabular')
```
### HISTORY_ID
Accessing your current history is possible with the pre-defined HISTORY_ID variable.
### connect to Galaxy
If you want to communicate with Galaxy you can use ```get_galaxy_connection()``` to get an [bioblend GalaxyInstance object](http://bioblend.readthedocs.org/en/latest/api_docs/galaxy/all.html?highlight=galaxyinstance).
*Example*:
```python
from bioblend.galaxy.histories import HistoryClient
gi = get_galaxy_connection()
hc = HistoryClient( gi )
for dataset in hc.show_history( HISTORY_ID , contents=True) ):
print( dataset['id'] )
```
Security
========
By default, no security turned on. To do this, you must adjust two variables, `apache_urls` and
`password_auth` in the configuration file (`config/ipython.conf`).
The `apache_urls` variable should be set to `True`, and containers should be secured via Apache+SSL for production usage. Please see the [setup](INSTALL.md) document for more information.
The `password_auth` variable should be set to `True`. It functions by generating a random password which is only shared with the docker, and the user's browser through Galaxy. In theory this should be a secure system (or at least as secure as the weakest link), however if you find a vulnerability in the system we've devised, please contact us and we'll patch it as soon as possible!
Authors
=======
* Björn Grüning <bjoern.gruening@gmail.com>
* Eric Rasche <rasche.eric@yandex.ru>
History
=======
- v0.1: Initial public release (01.08.2014)
Licence (MIT)
=============
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB