Hi everybody.

I'm working on the issue

https://github.com/apache/openserverless/issues/40

which is about creating an interactive tool to allow the use to
configure openserverless parameters.

The tool must communicate with the ops CLI which can be used to CRUN
the current configuration parameters.

The tool I'm creating is an interactive TUI (Terminal User Interface)
that based on a configuration file
asks the user the parameters hw wants.



The example below shows a simple configuration about redis and postgress

┌   ops configurator
│
◆  Select a component to configure (use ↑/↓ arrows, ENTER to select):
│  ● redis (4 parameters)
│  ○ postgres (4 parameters)
│  ○ Exit Configuration


if the user chooses redis they can see


================================================================================
Component: redis
================================================================================
KEY                  | Label                | Initial Value        |
Previous Value       | Current Value
------------------------------------------------------------------------------------------------------------
REDIS_URL            | Redis URL            | <EMPTY>              |
<EMPTY>              | <EMPTY>
REDIS_SERVICE        | Redis Service        | <EMPTY>              |
<EMPTY>              | <EMPTY>
REDIS_PREFIX         | Redis Prefix         | <EMPTY>              |
<EMPTY>              | <EMPTY>
REDIS_PASSWORD       | Redis password       | <EMPTY>              |
<EMPTY>              | <EMPTY>
================================================================================

│
◆  Select a parameter to edit (use ↑/↓ arrows, ENTER to select):
│  ● REDIS_URL = <EMPTY>
│  ○ REDIS_SERVICE = <EMPTY>
│  ○ REDIS_PREFIX = <EMPTY>
│  ○ REDIS_PASSWORD = <EMPTY>
│  ○ ← Back to components


and so on.


A configuration file is shown below.

--------------------------------------------------------------------------------------
# Content: for all the components that Openserverless needs in its
configuration,
# we create a suitable configuration
# This is a TOML document
# To obtain some of these arguments, use the command
# ops -config -d | awk -F= '/=/{print $1}'

[components.redis]
REDIS_URL= {label="Redis URL", initialValue="", userInputValue=""}
REDIS_SERVICE= {label="Redis Service", initialValue="", userInputValue=""}
REDIS_PREFIX= {label="Redis Prefix", initialValue="", userInputValue=""}
REDIS_PASSWORD= {label="Redis password", initialValue="", userInputValue=""}
# SECRET_REDIS_DEFAULT
# REDIS_PORT
# OPSTUTORIAL_SECRET_REDIS
# REDIS_PROVIDER
# REDIS_ALT_URL
# SECRET_REDIS_NUVOLARIS
# OPERATOR_COMPONENT_REDIS
# DEVEL_SECRET_REDIS

[components.postgres]
POSTGRES_PORT=""
POSTGRES_DATABASE=""
POSTGRES_USERNAME=""
POSTGRES_PASSWORD=""
#SECRET_POSTGRES_REPLICA=""
#OPSTUTORIAL_SECRET_POSTGRES=""
#OPERATOR_CONFIG_ALERTGMAIL
#OPENWHISK_TIME_LIMIT_MAX
#POSTGRES_PORT
#OPERATOR_COMPONENT_CRON
#REDIS_PORT
#S3_BUCKET_STATIC
#S3_PORT
#OPERATOR_COMPONENT_INVOKER
#OPERATOR_COMPONENT_REDIS
#OPERATOR_CONFIG_TLSEMAIL
#OPENWHISK_INVOKER_CONTAINER_POOL_MEMORY
#DEVEL_SECRET_MILVUS
#OPSTUTORIAL_SECRET_MONGODB
#IMAGES_STREAMER
#OPSTUTORIAL_SECRET_MILVUS
#IMAGES_INVOKER
#SECRET_NUVOLARIS_METADATA
#OPERATOR_COMPONENT_ETCD
#SECRET_MILVUS_ROOT
#S3_ACCESS_KEY
#OPSTUTORIAL_SECRET_COUCHDB
#AUTH
#SECRET_MONGODB_ADMIN
#MILVUS_PORT
#MILVUS_TOKEN
#SECRET_REDIS_DEFAULT
#OPERATOR_COMPONENT_KAFKA
#OPERATOR_CONFIG_HOSTPROTOCOL
#DEVEL_SECRET_REDIS
#IMAGES_OPERATOR
#SECRET_OPENWHISK_SYSTEM
#MILVUS_HOST
#S3_API_URL
#OPERATOR_COMPONENT_TLS
#DEVEL_SECRET_OPENWHISK
#OPSDEV_APIHOST
#OPERATOR_CONFIG_TOLERATIONS
#MINIO_CONFIG_INGRESS_S3
#SECRET_COUCHDB_INVOKER
#OPERATOR_COMPONENT_ZOOKEEPER
#SECRET_MINIO_NUVOLARIS
#OPERATOR_COMPONENT_AM
#CONFIGURED
#DEVEL_SECRET_MINIO
#HELLO
#OPSTUTORIAL_SECRET_MINIO
#STATUS_LAST
#OPERATOR_COMPONENT_MILVUS
#REDIS_PROVIDER
#SECRET_MONGODB_NUVOLARIS
#OPERATOR_COMPONENT_STATIC
#SECRET_ETCD_ROOT
#OPERATOR_CONFIG_APIHOST
#OPS_COREUTILS
#SECRET_COUCHDB_ADMIN
#USER_V1_API_URL
#OPSDEV_USERNAME
#SECRET_POSTGRES_NUVOLARIS
#S3_PROVIDER
#ANOTHER
#OPERATOR_CONFIG_AFFINITY
#OPERATOR_COMPONENT_POSTGRES
#S3_HOST
#SECRET_MILVUS_S3
#REDIS_URL
#S3_SECRET_KEY
#DEVEL_SECRET_POSTGRES
#SECRET_MILVUS_NUVOLARIS
#OPERATOR_COMPONENT_MINIO
#OPERATOR_CONFIG_SLIM
#POSTGRES_CONFIG_REPLICAS
#REDIS_PREFIX
#ETCD_CONFIG_REPLICAS
#OPERATOR_CONFIG_ALERTSLACK
#OPSTUTORIAL_SECRET_REDIS
#STATIC_CONTENT_URL
#IMAGES_CONTROLLER
#USER_REST_API_URL
#DEVEL_SECRET_MONGODB
#MONGODB_URL
#HELLO3
#SECRET_POSTGRES_ADMIN
#OPERATOR_COMPONENT_MONGODB
#DEVEL_SECRET_COUCHDB
#POSTGRES_HOST
#OPERATOR_COMPONENT_PROMETHEUS
#REDIS_ALT_URL
#REDIS_PASSWORD
#OPERATOR_COMPONENT_REGISTRY
#OPSTUTORIAL_SECRET_OPENWHISK
#REGISTRY_CONFIG_SECRET_PUSH_PULL
#OPSDEV_HOST
#SECRET_MINIO_ADMIN
#SECRET_OPENWHISK_NUVOLARIS
#SECRET_REDIS_NUVOLARIS
#SECRET_COUCHDB_CONTROLLER
#OPERATOR_COMPONENT_QUOTA
#REDIS_SERVICE
#S3_BUCKET_DATA
#IMAGES_SYSTEMAPI
#MILVUS_DB_NAME
--------------------------------------------------------------------------------------


Another requirement I have to satisfy is the dependence of some
parameters on others. For example, because PostgreSQL is a requirement
for FerretDB, if FerretDB is chosen the tool must ask the user for
PostgreSQL parameters as well. This requirement is currently not
implemented in the tool, but this is a matter for a future
development.

Questions

1) Which one of the parameters below do we want to be configurable?
2) Do we miss some parameters in this list?

Daniele

Reply via email to