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

Add hot-reload option to docker entrypoint #1880

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

Conversation

webb-ben
Copy link
Member

Overview

Adds hot reload option to docker entrypoint. Thereby fully enabling the function of the Admin API in the Docker deployment of pygeoapi

Related Issue / discussion

#1753
#1636

Additional information

This is not a complete implementation, but enough for someone to start developing a pygeoapi-ui of the base docker image.

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

--reload-extra-file ${PYGEOAPI_CONFIG} \
pygeoapi.flask_app:APP

touch ${PYGEOAPI_CONFIG}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this touch is actually executed?
As far as I understand it, exec gunicorn replaces the bash process with gunicorn and thus stops any further execution of the script, or is this somehow different here?

Copy link
Contributor

Choose a reason for hiding this comment

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

pygeoapi_es   | [2025-02-18 18:01:04 +0000] [19] [INFO] Worker exiting (pid: 19)
pygeoapi_es   | [2025-02-18 18:01:04 +0000] [75] [INFO] Booting worker with pid: 75
pygeoapi_es   | [2025-02-18 18:01:08 +0000] [51] [INFO] Worker reloading: /pygeoapi/local.config.yml modified
pygeoapi_es   | [2025-02-18 18:01:08 +0000] [60] [INFO] Worker reloading: /pygeoapi/local.config.yml modified
pygeoapi_es   | [2025-02-18 18:01:08 +0000] [60] [INFO] Worker exiting (pid: 60)
pygeoapi_es   | [2025-02-18 18:01:09 +0000] [84] [INFO] Booting worker with pid: 84
apache-httpd  | 172.20.0.1 - - [18/Feb/2025:18:01:05 +0000] "POST /admin/config/resources HTTP/1.1" 201 67
pygeoapi_es   | [2025-02-18 18:01:13 +0000] [51] [INFO] Worker exiting (pid: 51)
pygeoapi_es   | [2025-02-18 18:01:13 +0000] [92] [INFO] Booting worker with pid: 92
pygeoapi_es   | [2025-02-18 18:01:16 +0000] [59] [INFO] Worker reloading: /pygeoapi/local.config.yml modified
pygeoapi_es   | [2025-02-18 18:01:16 +0000] [59] [INFO] Worker exiting (pid: 59)
pygeoapi_es   | [2025-02-18 18:01:16 +0000] [84] [INFO] Worker reloading: /pygeoapi/local.config.yml modified
pygeoapi_es   | [2025-02-18 18:01:16 +0000] [84] [INFO] Worker exiting (pid: 84)
pygeoapi_es   | [2025-02-18 18:01:16 +0000] [75] [INFO] Worker reloading: /pygeoapi/local.config.yml modified
pygeoapi_es   | [2025-02-18 18:01:16 +0000] [101] [INFO] Booting worker with pid: 101
pygeoapi_es   | [2025-02-18 18:01:17 +0000] [102] [INFO] Booting worker with pid: 102

Copy link
Contributor

Choose a reason for hiding this comment

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

@doublebyte1 this comment has already been addressed in a recent commit, the touch command is removed now.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a change I made after @doublebyte1 reviewed. All good

@doublebyte1
Copy link
Contributor

I have tested this and it seems to work. I think there are just some conflicts on the documentation that need to be resolved?

Create WSGI_APP for gunicorn entrypoint with default value of `pygeoapi.flask_app:APP`
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.

3 participants