-
Notifications
You must be signed in to change notification settings - Fork 5
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
Gunicorn update #414
Gunicorn update #414
Conversation
Codecov Report
@@ Coverage Diff @@
## master #414 +/- ##
==========================================
- Coverage 76.01% 75.97% -0.05%
==========================================
Files 66 66
Lines 8056 8221 +165
Branches 1133 1154 +21
==========================================
+ Hits 6124 6246 +122
- Misses 1644 1683 +39
- Partials 288 292 +4
Continue to review full report at Codecov.
|
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.
Some minor quirks to be answered, but good overall.
COPY ./config/magpie.ini $MAGPIE_CONFIG_DIR/magpie.ini | ||
COPY ./env/*.env.example $MAGPIE_ENV_DIR/ | ||
COPY ./magpie $MAGPIE_DIR/magpie/ | ||
# equivalent of `make install` without conda env and pre-installed packages | ||
RUN pip install --no-dependencies -e $MAGPIE_DIR | ||
|
||
# equivalent of `make cron start` without conda env | ||
CMD crond -c $CRON_DIR && gunicorn -b 0.0.0.0:2001 --paste $MAGPIE_CONFIG_DIR/magpie.ini --workers 10 --preload | ||
# bind to '0.0.0.0' such that any IP employed by the server will retrieve the application endpoint by default | ||
CMD crond -c $CRON_DIR && pserve "$MAGPIE_CONFIG_DIR/magpie.ini" |
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.
Number of workers was override to 10 here while set to 3 in the ini file.
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.
It should now be done in the INI. It didn't make much sense to be in the command in the first place.
It is very hard to track that this value was overridden here, and the first impression is usally that whatever was in the INI is the 'truth'.
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.
Yeah, I'm fine with the fact that the INI is the 'truth'. I'm more concerned about the fact that we go from 10 to 3 workers. I would not have said a word if the INI set workers to 10 too.
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.
I can set it by default to 10, so that it will be transparent for anyone that used the image without override of the command.
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.
Yes that's the kind of backward compatibility that we must keep in mind and avoid unnecessary changes when possible.
@@ -84,7 +84,7 @@ prefix = /magpie | |||
|
|||
[server:main] | |||
use = egg:gunicorn#main | |||
host = localhost | |||
host = 0.0.0.0 | |||
port = 2001 |
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.
We have the now required environment variable MAGPIE_PORT and it is not used.
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.
Yes. I have yet to find a way to simplify this. I have tried defining a "shared" section where magpie.port
, and [server:main]
's port
would use the same reference, but it was not working.
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.
Ok, then I suggest that you add a small comment telling users that port must be defined at both place.
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.
I still wonder though why MAGPIE_PORT
even needs to be defined in your case ?
It is important to remember that MAGPIE_PORT
, MAGPIE_URL
, etc. are only variable to set the "exposed" URL.
So an application running on http://my-pavics-server.ca
should define exactly that value in MAGPIE_URL
only.
The port
of [server:main]
still remains 2001
because it is where the local app is accessible from the docker.
The MAGPIE_PORT
should only be 2001
when running locally.
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.
From my perspective I wonder why you did not saw this error on your side 😜, I guess that MAGPIE_URL is not set properly somewhere. But with #418 I'm not worried anymore.
I also suggest that you remove MAGPIE_PORT and fix MAGPIE_URL if required in bird-house/birdhouse-deploy#143 before running tests.
For example, these default values should work with ``docker-compose``:: | ||
For example, these default values should work with ``docker-compose``: | ||
|
||
.. code-block:: console | ||
|
||
export MAGPIE_TEST_REMOTE_SERVER_URL=http://localhost:2001 |
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 it still valid since we also need the MAGPIE_PORT variable?
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.
This one is only for tests.
MAGPIE_PORT
is needed only if MAGPIE_URL
or magpie.url
in the INI was not defined.
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.
Everything is set. Thank you.
important
needs to be properly updated in daccs/pavics, as the necessary binding changes using
pserve
config INI with
host = localhost
does not workrelates to bird-house/birdhouse-deploy#143