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

Merged
merged 5 commits into from
Feb 27, 2025

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

Copy link
Contributor

@doublebyte1 doublebyte1 Feb 25, 2025

Choose a reason for hiding this comment

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

It is failing a test now, but I am not sure its related

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, CI failures are related to #1940

@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?

@tomkralidis tomkralidis added this to the 0.20.0 milestone Feb 27, 2025
@tomkralidis tomkralidis merged commit fa735ec into geopython:master Feb 27, 2025
4 checks passed
@webb-ben webb-ben deleted the hotreload branch February 28, 2025 15:40
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.

4 participants