Skip to content

Commit

Permalink
Allow starting Galaxy under gunicorn when using galaxy.ini
Browse files Browse the repository at this point in the history
and starting Galaxy with `APP_WEBSERVER=gunicorn sh run.sh`.
Additional gunicorn cmdline arguments can be passed using
`GUNICORN_CMD_ARGS`. In a first pass this will allow
running planemo {server, test} under python 3, as Paste
has some problems under python 3:

```
galaxy.web.stack INFO 2018-09-29 22:16:00,216 Galaxy server instance 'main' is running
Traceback (most recent call last):
  File "./scripts/paster.py", line 27, in <module>
    serve.run()
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/serve.py", line 1055, in run
    invoke(command, command_name, options, args[1:])
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/serve.py", line 1061, in invoke
    exit_code = runner.run(args)
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/serve.py", line 226, in run
    result = self.command()
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/serve.py", line 676, in command
    serve()
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/serve.py", line 653, in serve
    server(app)
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/loadwsgi.py", line 232, in server_wrapper
    **context.local_conf)
  File "/tmp/tmpv5tow6c8/galaxy-dev/lib/galaxy/util/pastescript/loadwsgi.py", line 90, in fix_call
    val = callable(*args, **kw)
  File "/home/travis/.planemo/gx_venv_3_release_18.09/lib/python3.6/site-packages/paste/httpserver.py", line 1353, in server_runner
    for name, value in kwargs.items():
RuntimeError: dictionary changed size during iteration
```

That said gunicorn is a nice pure-python alternative to paste going
forward.
  • Loading branch information
mvdbeek committed Sep 30, 2018
1 parent 1e7677c commit 702870c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/galaxy/dependencies/pipfiles/default/Pipfile
Expand Up @@ -41,6 +41,7 @@ bleach = "*"
"bz2file" = {version = "*", markers = "python_version < '3.3'"}
ipaddress = {version = "*", markers = "python_version < '3.3'"}
boltons = "*"
gunicorn = "*"
Paste = "*"
docutils = "*"
Routes = "*"
Expand Down
Expand Up @@ -54,6 +54,7 @@ functools32==3.2.3.post2; python_version == '2.7'
future==0.16.0
futures==3.2.0; python_version == '2.6' or python_version == '2.7'
galaxy-sequence-utils==1.1.3
gunicorn==19.9.0
h5py==2.8.0
html5lib==1.0.1
idna==2.7
Expand Down
4 changes: 4 additions & 0 deletions scripts/common_startup_functions.sh
Expand Up @@ -157,6 +157,10 @@ find_server() {
fi
server_args="$server_args $uwsgi_args"
pid_log_paster_args=""
elif [ "$APP_WEBSERVER" = "gunicorn" ];
then
export GUNICORN_CMD_ARGS=${GUNICORN_CMD_ARGS:-"--bind=localhost:8080"}
server_args="$APP_WEBSERVER --pythonpath lib --paste \"$server_config\""
else
run_server="python"
server_args="./scripts/paster.py serve \"$server_config\" $paster_args"
Expand Down

0 comments on commit 702870c

Please sign in to comment.