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

Share common docker-compose.yml configurations (PROD and DEV enviroments) #79

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

Raruto
Copy link
Collaborator

@Raruto Raruto commented Sep 27, 2022

List of changes:

  • remove docker-compose-consumer.yml
  • add new enviroment variable within .env.example (G3WSUITE_RUN_HUEY) in order to enable batch processing
  • add new service within docker-compose.yml (g3w-suite-consumer)
  • remove scripts/docker-entrypoint-dev.sh
  • refactor docker-compose-consumer-dev.yml in order to extend the base docker-compose.yml
  • update scripts/docker-entrypoint.sh in order to support gunicorn.conf.py configuration file (PROD and DEV server)
  • update scripts/docker-consumer-entrypoint.sh (ref. G3WSUITE_RUN_HUEY)
  • update README.md instructions related to batch processing usage
  • update README_DEV.md instructions related to development usage
  • update docker-compose.yml version from v3 to v3.4
  • update docker-compose-dev.yml version from v3 to v3.4
  • move DISPLAY and QGIS_SERVER_PARALLEL_RENDERING environment variables definitions from scripts/docker-entrypoint.sh to docker-compose.yml

Closes: #66

- remove `docker-compose-consumer.yml`
- add `G3WSUITE_RUN_HUEY` enviroment variable within `.env.example` (batch processing)
- add `g3w-suite-consumer` within `docker-compose.yml`
- refactor `docker-compose-consumer-dev.yml`  in order to extend the base `docker-compose.yml`
- remove `scripts/docker-entrypoint-dev.sh`
- add support for `gunicorn.conf.py` within `scripts/docker-entrypoint.sh` (in order to share same server in various enviroments: PROD / DEV)
- refactor `scripts/docker-consumer-entrypoint.sh` (ref. `G3WSUITE_RUN_HUEY`)
- update `README.md` instructions related to batch processing usage
- update `docker-compose.yml` version from `v3` to `v3.4`
@Raruto Raruto added the refactoring Anything which could result in a API change label Sep 27, 2022
@Raruto Raruto changed the title Share common docker-compose.yml configurations (PROD / DEV) Share common docker-compose.yml configurations (PROD and DEV enviroments) Sep 27, 2022
workers = os.getenv('G3WSUITE_GUNICORN_NUM_WORKERS', 8)
max_requests = os.getenv('G3WSUITE_GUNICORN_MAX_REQUESTS', 200)
bind = '0.0.0.0:8000'
reload = False if os.getenv('G3WSUITE_DEBUG', 'False') == 'False' else True
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

- FRONTEND
- G3WSUITE_GUNICORN_MAX_REQUESTS
- G3WSUITE_GUNICORN_NUM_WORKERS
- G3WSUITE_GUNICORN_TIMEOUT
Copy link
Collaborator Author

@Raruto Raruto Sep 27, 2022

Choose a reason for hiding this comment

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

Check if the huey service requires setting a different / greater value for the timeout (ref: G3WSUITE_GUNICORN_TIMEOUT).

G3W-SUITE use `huey` for bach processing (https://github.com/coleifer/huey), so if you want to use it,
use `docker-compose-consumer.yml` file on deploy:
G3W-SUITE use `huey` for batch processing (https://github.com/coleifer/huey), so if you want to use it,
set `G3WSUITE_RUN_HUEY=True` enviroment variable and then deploy as usual:
Copy link
Collaborator Author

@Raruto Raruto Sep 27, 2022

Choose a reason for hiding this comment

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

rewrite this in a better English

@@ -1,19 +1,22 @@
#!/bin/bash
# Entrypoint script fro deploy production
# Entrypoint script for deploy production
# ---------------------------------------

# Start XVfb
if [[ -f /tmp/.X99-lock ]]; then
rm /tmp/.X99-lock
fi
Copy link
Collaborator Author

@Raruto Raruto Nov 7, 2022

Choose a reason for hiding this comment

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

Isn't the docker container stateless? (why we are trying to remove the /tmp/.X99-lock file from a previous run / reboot?)

See also: g3w-suite-docker/cmd.sh (commit history)

- G3WSUITE_TILECACHE_PATH
- BITBUCKET_TOKEN
- G3WSUITE_DEBUG=${G3WSUITE_DEBUG:-True}
- G3WSUITE_GUNICORN_NUM_WORKERS=${G3WSUITE_GUNICORN_NUM_WORKERS:-1}
- G3WSUITE_QDJANGO_SERVER_URL
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check if the G3WSUITE_QDJANGO_SERVER_URL variable is still in use nowadays, currently it doesn't seem to have any production purpose (just forgotten to delete that also inside the docker-compose-dev.yml?)

@Raruto Raruto mentioned this pull request Dec 30, 2022
1 task
Raruto added a commit to g3w-suite/g3w-client that referenced this pull request Feb 7, 2023
…ProjectsRegistry~createProject(projectConfig)`

Start addressing: #67

As a result of: #150 we intend to bring the development environment ever closer to the production one.

Related to: #89, #292 and g3w-suite/g3w-suite-docker#79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Anything which could result in a API change
Projects
None yet
2 participants