openagri-eu / OpenAgri-Bootstrap-Deployment

This repository serves as a easy to use entry point, with a modular configuration and deployment of the OpenAgri services.
European Union Public License 1.2
0 stars 0 forks source link

Service Integration using OpenAgriBootstrap Deployment #2

Open fedjo opened 4 days ago

fedjo commented 4 days ago

This issue will serve as a guide to integrate each service with the Gatekeeper using the bootstrap app.

The steps will be needed for each of the services to be integrated

docker tag pyweather-srv ghcr.io/openagri-eu/pyweather-srv:latest
docker push ghcr.io/openagri-eu/pyweather-srv:latest

Note: Please validate for Packages page that the image is public

Note: The YAML file must receive as environment variables JWT_SIGNING_KEY, ALLOWED_HOSTS and APP_PORT

Disclaimer:

JWT_SIGNING_KEY: Is the key needed for each service to validate(decrypt) the jwt token received from incoming requests from Gatekeeper. 

ALLOWED_HOSTS: Refers to a middleware implementation to only allow gatekeeper as a host, but for demo purposes we must allow all hosts to have direct access to each service

APP_PORT: Is the port where the application runs

@arruda @pranavnbapat @vlf-stefan-drobic Please double check the process we discussed and give feedback

arruda commented 4 days ago

I would just suggest using the docker compose to build (and tag) and push the docker images, this avoid any mistakes in the naming of the tags, and instead you can just set it once in the docker-compose.yml file.

that is, along side the build option you put also the image option: https://github.com/openagri-eu/pest-and-disease-management/blob/main/compose.yaml#L19

then you can do docker compose build (backend in the case of the pest and disease management compose file) and then do a docker compose push

arruda commented 4 days ago

and if possible please try to have the container image names the same as the repository, it avoids confusion: so for example, for the https://github.com/openagri-eu/weather-service service this would mean the image name should be: ghcr.io/openagri-eu/weather-service:latest

arruda commented 4 days ago

And @fedjo, just to complement your detailed instructions, for the people using FastAPI the middleware you are looking for should be this one: https://fastapi.tiangolo.com/advanced/middleware/#trustedhostmiddleware

arruda commented 4 days ago

A part from these small details I would say the instructions are clear and precise :+1: