From ff14a191c5426c43e06ae2804683a79eda5cf084 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 5 Jun 2023 08:01:56 +0300 Subject: issue: Proposition for more flexible configs. --- issues/CI-CD/configurations.gmi | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 issues/CI-CD/configurations.gmi (limited to 'issues') diff --git a/issues/CI-CD/configurations.gmi b/issues/CI-CD/configurations.gmi new file mode 100644 index 0000000..eed8935 --- /dev/null +++ b/issues/CI-CD/configurations.gmi @@ -0,0 +1,47 @@ +# Configurations + +## Tags + +* assigned: aruni, fredm +* priority: normal +* status: open +* keywords: CI, CD, configuration, config +* type: bug + +## Description + +There are configurations that change depending on the environment that one runs the CI/CD container. Some examples: + +* GN_SERVER_URL: on CI/CD it is set up as "http://cd.genenetwork.org/api3/" but this is not valid for, say, the development environments and eventually production. +* SQL_URI: This can change from environment to environment +* OAUTH2_CLIENT_ID: A identifier for an authorised client +* OAUTH2_CLIENT_SECRET: A password the client uses to authenticate itself + +Some of these, e.g. `OAUTH2_CLIENT_SECRET` are sensitive data that should not be exposed to the public. + +I propose, therefore that we provide, say, a +``` +... --share=/path/to/configs/directory/ +``` +from where the applications in the container can read their configurations from. The config file(s) in the directory can then contain relevant settings for the environment where the container is run. + +The applications (gn2, gn3, qc-app, etc) can then be pointed to the relevant config files in their g-exps: e.g. + +Instead of +=> https://github.com/genenetwork/genenetwork-machines/blob/67d3f5dc46422c6b1812547109680c147fdde341/genenetwork-development.scm#L317-L318 using the defaults that are overridden +we could have the code do something like: + +``` +... + +(define %configs-dir "/export/data/configs") + +... + + (with-directory-excursion "genenetwork2" + (invoke #$(file-append bash "/bin/sh") + "bin/genenetwork2" + #$(file-append %configs-dir "/gn2_config.conf") + "-gunicorn-prod")) +``` +where file `/export/data/configs/gn2_config.conf` holds the configurations for the application in the environment where the guix system container is run. -- cgit v1.2.3