Skip to content

Conversation

@chreman
Copy link
Member

@chreman chreman commented Jun 9, 2021

This PR is a refactoring/enhancement of the dockerized API layer and includes following changes:

  • Make Docker-containers more configurable
    • Move files that are used within containers to their respective folders
    • Port that API container is listening on is now a configurable env variable
    • Dataprocessing, getPapers containers and API container now take parameter for redis-host (and redis-port) from env
    • API container should take parameter for pgsql-host and -port, flask-API now reads pgsql info from env
  • Get rid of network mode “host” and use docker-networks (service resolution) instead
  • Change how containers are built:
    • Tag built docker-images with the git commit ID they were built from
    • Make compose-file aware of explicit container versions/hashes
  • Tell the nginx-proxy in the about multiple flavors of similar services in docker-compose
  • Separate volumes for postgres containers
  • Add some endpoint /api/service_version that reads SERVICE_VERSION from env and returns a json object from the container
  • Break flask-app in two and split off persistence layer
    • Re-route persistence requests from api-app via a new namespace/endpoint to the persistence-app in a different container (but same flavor)
  • Prepare for higher load:
    • Add some rate-limiting for API requests or max_n concurrent connections (bots, one-user saturation, workshop-peaks)
    • in legacy code: wrap performCalculation - done
    • in Api code: on service-access level: check queue length, return status message and error reason - done
  • Create a lightweight-PHP apiclient as PHP class that is re-usable in search.php and the various GET phps

@chreman chreman merged commit 55481ff into master Jun 18, 2021
chreman added a commit to chreman/Headstart that referenced this pull request Oct 13, 2021
…r-refactoring

Docker refactoring

Former-commit-id: 55481ff
@chreman chreman deleted the docker-refactoring branch October 14, 2021 12:29
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.

2 participants