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

Allow the usage of gunicorn.conf.py config file in gunicorn applications #684

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hrnciar
Copy link
Member

@hrnciar hrnciar commented Jun 3, 2024

No description provided.

@hrnciar hrnciar changed the title Gunicorn defaults Allow the usage of gunicorn.conf.py config file in gunicorn applications Jun 3, 2024
@hrnciar
Copy link
Member Author

hrnciar commented Jun 3, 2024

[test-all]

@hrnciar hrnciar marked this pull request as ready for review June 3, 2024 13:48
@hrnciar hrnciar changed the title Allow the usage of gunicorn.conf.py config file in gunicorn applications [DNM WIP] Allow the usage of gunicorn.conf.py config file in gunicorn applications Jun 3, 2024
@hrnciar
Copy link
Member Author

hrnciar commented Jun 3, 2024

[test-all]

@hrnciar hrnciar force-pushed the gunicorn-defaults branch 2 times, most recently from bf832ff to 5f8a345 Compare June 4, 2024 07:45
@hrnciar
Copy link
Member Author

hrnciar commented Jun 4, 2024

[test-all]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 11, 2024

[test-all]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 12, 2024

[test]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 12, 2024

[test]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 21, 2024

[test]

1 similar comment
@hrnciar
Copy link
Member Author

hrnciar commented Jun 21, 2024

[test]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 25, 2024

[test]

1 similar comment
@hrnciar
Copy link
Member Author

hrnciar commented Jun 25, 2024

[test]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 25, 2024

[test]

@hrnciar
Copy link
Member Author

hrnciar commented Jun 26, 2024

[test-all]

Copy link
Member

@befeleme befeleme left a comment

Choose a reason for hiding this comment

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

The diff looks good to me, in the tests you can see the configfile is used.

Should this test be only added to those running on Python 3? I see there's a test failure on the newly added tests in RHEL8-2.7 container but not sure how it is related.

I assume openshift tests are expected to fail outside of the internal network?

Copy link
Member

@frenzymadness frenzymadness left a comment

Choose a reason for hiding this comment

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

One nitpick and one last fix for Python 2 and I think we are ready. Thank you!

src/s2i/bin/run Outdated
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0) if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else print(1)')
Copy link
Member

Choose a reason for hiding this comment

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

This can be a little bit shorter:

Suggested change
print(0) if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else print(1)')
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')

test/run Outdated
@@ -6,7 +6,7 @@
# IMAGE_NAME specifies a name of the candidate image used for testing.
# The image has to be available before this script is executed.
#
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index{% endif %}}-test-app)
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,gunicorn-python-configfile-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index{% endif %}}-test-app)
Copy link
Member

Choose a reason for hiding this comment

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

Because the test requires gunicorn 20.1+ it will never work with Python 2 because the last gunicorn compatible with Python 2 is version 19.

Therefore we need to move the test to the section for python-3-only.

Suggested change
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,gunicorn-python-configfile-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index{% endif %}}-test-app)
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port{% endif %}}-test-app)

@hrnciar hrnciar changed the title [DNM WIP] Allow the usage of gunicorn.conf.py config file in gunicorn applications Allow the usage of gunicorn.conf.py config file in gunicorn applications Jun 27, 2024
@hrnciar
Copy link
Member Author

hrnciar commented Jun 27, 2024

[test]

1 similar comment
@hrnciar
Copy link
Member Author

hrnciar commented Jun 27, 2024

[test]

test/run Outdated
@@ -6,7 +6,7 @@
# IMAGE_NAME specifies a name of the candidate image used for testing.
# The image has to be available before this script is executed.
#
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index{% endif %}}-test-app)
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,gunicorn-python-configfile-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port{% endif %}}-test-app)
Copy link
Member

Choose a reason for hiding this comment

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

The first occurrence of gunicorn-python-configfile-different-port should be removed from here.

@hrnciar
Copy link
Member Author

hrnciar commented Jun 27, 2024

[test]

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.

None yet

3 participants