Skip to content

Conversation

@Mikejmnez
Copy link
Collaborator

@Mikejmnez Mikejmnez commented Apr 30, 2024

The following Pull Request is a continuation of PR #286 started by @raphaeljolivet (Thanks for the contribution!)

>>> pydap -h
A file-based pydap server running on Gunicorn.

Usage:
  pydap [options]

Options:
  -h --help                     Show this help message and exit
  --version                     Show pydap version
  -i --init DIR                 Create directory with templates
  -b ADDRESS --bind ADDRESS     The ip to listen to [default: 127.0.0.1]
  -p PORT --port PORT           The port to connect [default: 8001]
  -d DIR --data DIR             The directory with files [default: .]
  -t DIR --templates DIR        The directory with templates
  --workers INT                 Number of workers [default: 1]
  --threads INT                 Number of threads [default: 1]
  --worker-class=CLASS          Gunicorn worker class [default: sync]

With these changes, and gunicorn installed (any version), the following updated line in the README file works again:

import multiprocessing
ncores = multiprocessing.cpu_count() * 2
pydap --data ./myserver/data/ --port 8001 --workers ncores

@Mikejmnez Mikejmnez requested a review from jgallagher59701 May 1, 2024 23:15
Copy link
Member

@jgallagher59701 jgallagher59701 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my question about the WSGI interface (?) class comment.

But, this looks good. And I think it can be merged.

Do you think we can read data from DMR++ documents using this framework?



class PyDapApplication(WSGIApplication):
"""An application interface for configuring and loading
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the interface class for loading a WSGI application into the WSGI framework?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. PyDapApplication inherits from WSGIApplication in a way that we can customize it. I did some bare minimum for now.

@Mikejmnez
Copy link
Collaborator Author

Do you think we can read data from DMR++ documents using this framework?

That's a good question. probably... Definitely an avenue worth exploring. I not super familiar with WSGI applications, nor Gunicorn, but I know that Gunicorn is lightweight, customizable, and that can handle concurrent requests efficiently. Definitely a good starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImportError: cannot import name 'PasterServerApplication' from 'gunicorn.app.pasterapp'

2 participants