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

Configurable servers #485

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Configurable servers #485

wants to merge 18 commits into from

Conversation

Zeitsperre
Copy link
Contributor

@Zeitsperre Zeitsperre commented Sep 22, 2023

Overview

FYI @fmigneault

Changes:

  • Allow for configurable GeoServer
  • Remove mentions of flyingpigeon in docs

Additional Information

Additional Information (2024-10)

I've opted to remove the Docker-based port overrides, as I was never able to get this to work (even with ENTRYPOINTS). I think that if we were to do this, it should be coordinated and cover the scope of all Birdhouse services at the same time.

Meanwhile, the other features in here (like having a more configurable GeoServer URL) are useful/valuable.

… environment variables, allow for configurable GeoServer, remove mentions of flyingpigeon in docs
@Zeitsperre Zeitsperre added the enhancement New feature or request label Sep 22, 2023
@Zeitsperre Zeitsperre self-assigned this Sep 22, 2023
Copy link

@fmigneault fmigneault left a comment

Choose a reason for hiding this comment

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

What would be the combination of env-var and config overrides that you found to fix bird-house/birdhouse-deploy#14 would you recommend?

A sample docker run showing different bind/host/port for certain results would be useful.

Dockerfile Outdated
Comment on lines 31 to 33
EXPOSE $RAVEN_BIND_PORT

CMD ["gunicorn", "--bind=0.0.0.0:9099", "raven.wsgi:application"]
CMD ["gunicorn", "--bind=$RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT", "raven.wsgi:application"]

Choose a reason for hiding this comment

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

I am pretty sure $<env> format does not work in CMD.
Not sure about EXPOSE.

The workaround is to use an entrypoint shell script, which then uses the variables.

Copy link
Contributor

Choose a reason for hiding this comment

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

One easy way to confirm env var works in CMD and EXPOSE is to build the docker image and test it in the PAVICS stack.

Copy link

@fmigneault fmigneault Sep 25, 2023

Choose a reason for hiding this comment

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

I did that and as I remembered, docker run raises something related to $RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT being invalid because $RAVEN_BIND_PORT doesn't get replaced by the provided integer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given ENV RAVEN_BIND_PORT=${RAVEN_BIND_PORT:-9099}, if we can make the launching command "see" the env var, it should work. So probably use ENTRYPOINT instead of CMD. If needed, force starting a new shell to "see" the env var with bash -c "gunicorn --bind=$RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT raven.wsgi:application".

Or research a recipe for how to properly start gunicorn inside a Docker image.

docs/source/dev_guide.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@tlvu tlvu left a comment

Choose a reason for hiding this comment

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

Cool change, thanks. I simply would like to have backward compat with GEO_URL and ensure the new Docker image works.

Makefile Show resolved Hide resolved
raven/utilities/geoserver.py Outdated Show resolved Hide resolved
raven/utilities/geoserver.py Outdated Show resolved Hide resolved
Dockerfile Outdated
Comment on lines 31 to 33
EXPOSE $RAVEN_BIND_PORT

CMD ["gunicorn", "--bind=0.0.0.0:9099", "raven.wsgi:application"]
CMD ["gunicorn", "--bind=$RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT", "raven.wsgi:application"]
Copy link
Contributor

Choose a reason for hiding this comment

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

One easy way to confirm env var works in CMD and EXPOSE is to build the docker image and test it in the PAVICS stack.

@Zeitsperre Zeitsperre requested a review from tlvu October 10, 2023 13:48
docker-compose.yml Outdated Show resolved Hide resolved
docs/source/dev_guide.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@tlvu tlvu left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants