Scout: Unable to start gunicorn server for production

Created on 23 Aug 2020  路  4Comments  路  Source: Clinical-Genomics/scout

Dear all,

I have installed scout on a local server to try it out for a class lab. I have gotten as far as I running it successfully through the demo or using the flask example. However, the command for running it with gunicorn does not seem to work. I get this error:

ModuleNotFoundError: No module named 'wsgi_gunicorn'

[... lots of Python messages ...]

I can not find the documented wsgi_gunicorn.py file anywhere among the files I checked out with git. Is it missing or am I doing something wrong?

In terms of production runs, do you continue using the docker mongodb instance? If so, how do you set up authentication on it?

enhancement docs

Most helpful comment

It works. I also got it up and running with my own key and certificate. Great!

All 4 comments

Hi @andreaswallberg , nice that you're trying out Scout!

Our current setup here at SciLifeLab Solna is not with Docker (for either Scout or the mongo database), but @ninanorgren managed a setup with Docker and LDAP authentication in a prod environment, she can give you some tips perhaps?

We are using Google authentication for our users at the moment, but we might be switching to a new system (LDAP as well?) in the future.

Regarding the gunicorn file, you are right, it's not included in the current repository, and I couldn't find any reference to a file named like that in the past.. We'll need to fix the documentation, sorry!

I think what is supposed to be in the missing file is in scout/scout/server/auto.py. What happens if you try to run

/path/to/gunicorn
    --workers=4                 # for production, 2 for staging
    --bind=":8080"              # port to listen on localhost
    --access-logfile=-          # redirect access log to STDOUT
    --error-logfile=-           # redirect errors to STDOUT
    scout.server.auto:app

?

Cool! We do have a locally adapted production config in our internal server repo; let's see if we can't edit that to be a bit more generic and add to this as well!

Thanks for the very rapid feedback!

This works for me:

  1. Make some edits to the example scoutconfig.py described in the main documentation. For example, put in or comment out the MONGO credentials. In my case, I was never able transform the non-authenticated mongo docker to an instance that accepts credentials when started with "--auth", although I added a user to the database. Only non-authenticated works for me (I guess this is fine for what we hope to do in class).
  2. Copy the scoutconfig.py into scout/server/
  3. Now run: SCOUT_CONFIG=./scoutconfig.py gunicorn --workers=4 --bind=":8080" --access-logfile=- --error-logfile=- scout.server.auto:app and it starts without error and stays up!

I can not actually check out the web server from where I am located atm but will do so asap later this evening.

It works. I also got it up and running with my own key and certificate. Great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

keyvanelhami picture keyvanelhami  路  5Comments

hassanfa picture hassanfa  路  3Comments

ViktorHy picture ViktorHy  路  4Comments

northwestwitch picture northwestwitch  路  5Comments

moonso picture moonso  路  4Comments