-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile improvements #548
Conversation
It seems I've messed up this PR with the documentation one #547. Sorry about that. |
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
=======================================
Coverage 55.93% 55.93%
=======================================
Files 29 29
Lines 6338 6338
Branches 1342 1342
=======================================
Hits 3545 3545
Misses 2413 2413
Partials 380 380
Continue to review full report at Codecov.
|
bd6996f
to
a0ebb61
Compare
OK, all good now. Please review at your convenience. |
+1 |
@@ -8,5 +8,4 @@ pytest==3.0.3 | |||
pytest-cov==2.4.0 | |||
pytest-flake8==0.8.1 | |||
pytest-timeout==1.2.0 | |||
requests==2.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this removal related to this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually (and strangely) yes it is.
The requests
dependency does not seem to be needed for pycsw - I've done some grep'ing in the codebase and I don't think we are using it anywhere (I might be wrong though).
In addition to that (and hence why it is related here), the gunicorn wsgi server, which is being used in the docker image, depends on a more recent version of requests.
When I was testing the workflow for getting a development environment based on docker (as described in the docs on the other PR) I realized that when one would do
pip install -r requirements-dev.txt
inside a running container it would uninstall the version of requests required by gunicorn and downgrade it to the one pinned in our requirements-dev.txt. This would lead to a crash in gunicorn when reloading/restarting the server's worker processes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Overview
This PR improves the existing
Dockerfile
by adding a few missing stuff from the first implementation. Namely:--reload
flag that makes the web server automatically reload whenever the code changes. This is only useful for development purposes, as it simplifies the dev workflow;os.execlp
function, which behaves similarly to bash'sexec
. This causes the entrypoint script to be replaced by the web server (in this case gunicorn) in such a way that the same environment and PID is used. This effectively means that gunicorn is now PID1 of the docker container, making it easier to interact with it. It also means that a running pycsw container will now exit cleanly without errors when it is stopped or removed.Related Issue / Discussion
#530
#534
Additional Information
I have another also PR #547, which is related to this one. It adds documentation on how to use the docker image.
Contributions and Licensing
(as per https://github.com/geopython/pycsw/blob/master/CONTRIBUTING.rst#contributions-and-licensing)