Skip to content
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

Improve openfisca serve documentation to make parameter name change inconsistency more obvious #593

Merged
merged 5 commits into from
Mar 12, 2018

Conversation

jvalduvieco
Copy link
Contributor

Breaking changes

None

New features

  • Better documentation for openfisca serve mainly raising awarness about inconsistency between parameter names in cmd line and config file.
  • gunicorn parameters can be used in openfisca serve. Make this VERY obvious.

Deprecations

  • None

Technical changes

  • None

Reinforce awarness about gunicorn parameter usage in config file and cmd line
@Anna-Livia
Copy link
Contributor

Seems good for me :) @sandcha ?

@sandcha sandcha assigned sandcha and unassigned sandcha Nov 22, 2017
Copy link
Collaborator

@sandcha sandcha left a comment

Choose a reason for hiding this comment

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

Thank you @jvalduvieco for these improvements!

There is only one change to be done on the config.py and minor comments.


.. code-block:: shell

gunicorn --help
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@@ -42,14 +48,16 @@ Serving reforms

Using a configuration file
^^^^^^^^^^^^^^^^^^^^^^^^^^
You can setup `openfisca serve` using a configuration file. Be careful as parameters with a '-' in their name change to an '_' when used from the config file.
Copy link
Collaborator

@sandcha sandcha Jan 4, 2018

Choose a reason for hiding this comment

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

Use same style as above by using double backticks on command name?

And, what do you think about describing the name changes as follows? :

You can setup ``openfisca serve`` using a configuration file. Be careful as it is a Python file using Python naming rules: parameters with a ``-`` in their name on command line change to an ``_`` when used from the config file.


**config.py:**

.. code-block:: py

port = 4000
workers = 4
country-package = 'openfisca_france'
bind = 0.0.0.0:4000
country_package = 'openfisca_france'
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 👍


**config.py:**

.. code-block:: py

port = 4000
workers = 4
country-package = 'openfisca_france'
bind = 0.0.0.0:4000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update to bind = '0.0.0.0:' + str(port) as bind takes a string value and port variable is defined above?

config.py is an extension of gunicorn configuration file. It manages openfisca specific configuration like port. port value will also update bind value (openfisca configuration has higher priority here than gunicorn's configuration).

@fpagnoux
Copy link
Member

fpagnoux commented Feb 15, 2018

It seems that all the comments have been taken into account. Is this PR good to merge @sandcha ?

@sandcha sandcha changed the base branch from master to serve-cmd-593 March 12, 2018 14:27
@sandcha sandcha merged commit 23a550c into openfisca:serve-cmd-593 Mar 12, 2018
@sandcha sandcha self-assigned this Mar 16, 2018
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.

6 participants