Open
Description
I have been playing to deploy it in the ephemeral environment (wip) and I suggest this ticket to read configurations provided by clowder operator.
When it is deployed with an openshift template using clowderapp resource, it injects into the pod a secret with several configurations; in this particular scenario, the redis configuration (host, port) are provided into a json file which is pointed out by ACG_CONFIG environment variable. Currently exists app-common-python
to help to read this parameters.
at appservice/config.py
it could be something like:
from app_common_python import LoadedConfig, isClowderEnabled
# https://github.com/RedHatInsights/app-common-python
if isClowderEnabled():
REDIS_SERVICE_HOST = LoadedConfig.inMemoryDb.hostname
REDIS_SERVICE_PORT = int(LoadedConfig.inMemoryDb.port)
else:
REDIS_SERVICE_HOST = environ.get('REDIS_SERVICE_HOST', 'localhost')
REDIS_SERVICE_PORT = int(environ.get('REDIS_SERVICE_PORT', '6379'))
and use it at appservice/multiplexor.py
by addding the app-common-python
package:
REDIS = redis.asyncio.Redis(host=config.REDIS_SERVICE_HOST,
port=config.REDIS_SERVICE_PORT)
Finally at appservice/Containerfile
I added the dependency.
RUN pip3 install redis starlette httpx websockets uvicorn app-common-python
Additional Information:
- I have tried to deploy with this: https://github.com/avisiedo/cockpit-ephemeral (wip)
- https://github.com/RedHatInsights/app-common-python
- https://pypi.org/project/app-common-python/
Metadata
Metadata
Assignees
Labels
No labels