This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless.git


The following commit(s) were added to refs/heads/main by this push:
     new 4778809  Implements apache/openserverless#31 (#32)
4778809 is described below

commit 477880999cc589b1c076b9c732396e64d8ab84c8
Author: Francesco Timperi Tiberi <[email protected]>
AuthorDate: Tue Aug 6 12:07:59 2024 +0200

    Implements apache/openserverless#31 (#32)
    
    * chore: proposal for OPS tasks variables
    
    * chore: typos in variable.md
---
 VARIABLES.md | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/VARIABLES.md b/VARIABLES.md
new file mode 100644
index 0000000..76f1a53
--- /dev/null
+++ b/VARIABLES.md
@@ -0,0 +1,42 @@
+# Variables in OpenServerless Task
+
+This document lists general guidelines to define OpenServerless Tasks variable 
via the `ops` cli.
+
+## General info:
+
+OpenServerless Tasks variable are tipically set issuing a command like `ops 
config VARIABLE=<value>`. These variable are stored under the 
`~/.nuv/config.json` file. Variables name are splitted over the `_` character 
and the resulting parts are used to compose a json nested object having all the 
parts, that is given a variable with value `OPERATOR_COMPONENT_MINIO=true` the 
resulting json persisted into the configuration file will be something like
+
+```json
+{
+    "operator":{
+        "component":{
+            "minio":true
+        }
+    }
+}
+```
+
+## General guidelines:
+
+With the above described behavior we have defined some general rules to be 
adopted when developing/updating OpenServerless Taks variables
+
+- Avoid to define variable starting with `OPS_` prefix. This prefix is 
reserved to the `ops` general config itself, and normally defined inside the 
`nuvroot.json`. It is better to clearly distinguish task variable from the 
`ops` generated/reserved ones.
+- Considering the `_` splitting rules, prefer variable names composed by a 
maximum of 4 parts to avoid too much nested `json` structure. This is to 
simplify readability of the config.json if manually inspected.
+- Do not override variable used for configuration, with values obtained after 
the configuration has been applied (to create/update an Apache OpenServerless 
instance). This is to guarantee that we can always reconstruct the original 
`config.json` file. For instance OPS tasks defines an `OPERATOR_CONFIG_APIHOST` 
that should not be overridden. It is better to define a  `OUTPUT_APIHOST` 
instead.
+- Specify volume size parameters with numerical value expressed as GB
+- Specify memory size parameters with numerical value expressed as GB
+
+## Variable prefixes category
+
+This is a comprehensive list of variable prefix used in Ops tasks describing 
their purpose
+
+| Variable Prefix | Purpose |
+|---|---|
+| OPERATOR_COMPONENT_  | Used to defined which OpenServerless Components needs 
to be deployed by the Operator   |
+| OPERATOR_CONFIG_  | Global Ops Operator configuration parameters   |
+| OPENWHISK_CONTROLLER_  | OpenWhisk Controller Configuration |
+| OPENWHISK_INVOKER_  | OpenWhisk Invoker Configuration |
+| OPENWHISK_  | OpenWhisk General configuration for limits, triggers etc etc |
+| STORAGE_SIZE_  | Used to define various component allocated volumes size |
+| SECRET_  | Used to define autogenerated secret |
+| OUTPUT_  | Used to define calculated configuration parameters that are 
result of applying ops tasks against a running OpenServerless instance, if 
applies (APIHOST is one of them) |
\ No newline at end of file

Reply via email to