From 0335d88a0c8bec8d2236da313442ef90ca2cd3a6 Mon Sep 17 00:00:00 2001 From: kobergj Date: Fri, 16 Dec 2022 11:01:14 +0000 Subject: [PATCH] commit 341cdc9dd3fe3b61f6acd794b5f302d3d1ed5ed9 Merge: b75e97eef c762d9d9b Author: kobergj Date: Fri Dec 16 11:58:24 2022 +0100 Merge pull request #5207 from kobergj/AsyncPostprocessing [full-ci] Async Postprocessing --- .../adoc/postprocessing_configvars.adoc | 123 ++++++++++++++++++ .../adoc/storage-users_configvars.adoc | 36 +++++ .../postprocessing-config-example.yaml | 16 +++ .../_includes/postprocessing_configvars.md | 14 ++ .../storage-users-config-example.yaml | 4 + .../_includes/storage-users_configvars.md | 4 + 6 files changed, 197 insertions(+) create mode 100644 services/_includes/adoc/postprocessing_configvars.adoc create mode 100644 services/_includes/postprocessing-config-example.yaml create mode 100644 services/_includes/postprocessing_configvars.md diff --git a/services/_includes/adoc/postprocessing_configvars.adoc b/services/_includes/adoc/postprocessing_configvars.adoc new file mode 100644 index 00000000000..f972be1e1c4 --- /dev/null +++ b/services/_includes/adoc/postprocessing_configvars.adoc @@ -0,0 +1,123 @@ +// set the attribute to true or leave empty, true without any quotes. + +:show-deprecation: false + +ifeval::[{show-deprecation} == true] + +[[deprecation-note]] +[caption=] +[width="100%",cols="~,~,~,~",options="header"] +|=== +| Deprecation Info +| Deprecation Version +| Removal Version +| Deprecation Replacment +|=== + +endif::[] + +[caption=] +.Environment variables for the postprocessing service +[width="100%",cols="~,~,~,~",options="header"] +|=== +| Name +| Type +| Default Value +| Description + +a|`OCIS_LOG_LEVEL` + +`POSTPROCESSING_LOG_LEVEL` + + +a| [subs=-attributes] +++string ++ +a| [subs=-attributes] +++ ++ +a| [subs=-attributes] +The log level. Valid values are: "panic", "fatal", "error", "warn", "info", "debug", "trace". + +a|`OCIS_LOG_PRETTY` + +`POSTPROCESSING_LOG_PRETTY` + + +a| [subs=-attributes] +++bool ++ +a| [subs=-attributes] +++false ++ +a| [subs=-attributes] +Activates pretty log output. + +a|`OCIS_LOG_COLOR` + +`POSTPROCESSING_LOG_COLOR` + + +a| [subs=-attributes] +++bool ++ +a| [subs=-attributes] +++false ++ +a| [subs=-attributes] +Activates colorized log output. + +a|`OCIS_LOG_FILE` + +`POSTPROCESSING_LOG_FILE` + + +a| [subs=-attributes] +++string ++ +a| [subs=-attributes] +++ ++ +a| [subs=-attributes] +The path to the log file. Activates logging to this file if set. + +a|`POSTPROCESSING_EVENTS_ENDPOINT` + + +a| [subs=-attributes] +++string ++ +a| [subs=-attributes] +++127.0.0.1:9233 ++ +a| [subs=-attributes] +Endpoint of the event system. + +a|`POSTPROCESSING_EVENTS_CLUSTER` + + +a| [subs=-attributes] +++string ++ +a| [subs=-attributes] +++ocis-cluster ++ +a| [subs=-attributes] +Cluster ID of the event system. + +a|`OCIS_INSECURE` + +`SEARCH_EVENTS_TLS_INSECURE` + + +a| [subs=-attributes] +++bool ++ +a| [subs=-attributes] +++false ++ +a| [subs=-attributes] +Whether to verify the server TLS certificates. + +a|`SEARCH_EVENTS_TLS_ROOT_CA_CERTIFICATE` + + +a| [subs=-attributes] +++string ++ +a| [subs=-attributes] +++ ++ +a| [subs=-attributes] +The root CA certificate used to validate the server's TLS certificate. If provided SEARCH_EVENTS_TLS_INSECURE will be seen as false. + +a|`POSTPROCESSING_VIRUSSCAN` + + +a| [subs=-attributes] +++bool ++ +a| [subs=-attributes] +++false ++ +a| [subs=-attributes] +should the system do a virusscan? Needs antivirus service + +a|`POSTPROCESSING_DELAY` + + +a| [subs=-attributes] +++Duration ++ +a| [subs=-attributes] +++0s ++ +a| [subs=-attributes] +the sytem sleeps for this time while postprocessing +|=== + diff --git a/services/_includes/adoc/storage-users_configvars.adoc b/services/_includes/adoc/storage-users_configvars.adoc index e4f5948a785..26e06cfe97f 100644 --- a/services/_includes/adoc/storage-users_configvars.adoc +++ b/services/_includes/adoc/storage-users_configvars.adoc @@ -331,6 +331,15 @@ a| [subs=-attributes] a| [subs=-attributes] When trying to lock files, ocis will multiply the cycle with this factor and use it as a millisecond timeout. Values of 0 or below will be ignored and the default value of 30 will be used. +a|`STORAGE_USERS_OCIS_ASYNC_UPLOADS` + + +a| [subs=-attributes] +++bool ++ +a| [subs=-attributes] +++false ++ +a| [subs=-attributes] +Enable asynchronous file uploads. + a|`STORAGE_USERS_S3NG_ROOT` + a| [subs=-attributes] @@ -548,6 +557,24 @@ a| [subs=-attributes] a| [subs=-attributes] URL of the data server, needs to be reachable by the data gateway provided by the frontend service or the user if directly exposed. +a|`STORAGE_USERS_DATA_GATEWAY_URL` + + +a| [subs=-attributes] +++string ++ +a| [subs=-attributes] +++https://localhost:9200/data ++ +a| [subs=-attributes] +URL of the data gateway server + +a|`STORAGE_USERS_TRANSFER_EXPIRES` + + +a| [subs=-attributes] +++int64 ++ +a| [subs=-attributes] +++86400 ++ +a| [subs=-attributes] +the time after which the token for upload postprocessing expires + a|`STORAGE_USERS_EVENTS_ENDPOINT` + a| [subs=-attributes] @@ -595,6 +622,15 @@ a| [subs=-attributes] a| [subs=-attributes] Enable TLS for the connection to the events broker. The events broker is the ocis service which receives and delivers events between the services.. +a|`STORAGE_USERS_EVENTS_NUM_CONSUMERS` + + +a| [subs=-attributes] +++int ++ +a| [subs=-attributes] +++0 ++ +a| [subs=-attributes] +The amount of concurrent event consumers to start. Event consumers are used for post-processing files. Multiple consumers increase parallelisation, but will also increase CPU and memory demands. The setting has no effect when the STORAGE_USERS_OCIS_ASYNC_UPLOADS is set to false. The default and minimum value is 1. + a|`OCIS_CACHE_STORE_TYPE` + `STORAGE_USERS_CACHE_STORE_TYPE` + `STORAGE_USERS_CACHE_STORE` + diff --git a/services/_includes/postprocessing-config-example.yaml b/services/_includes/postprocessing-config-example.yaml new file mode 100644 index 00000000000..9f7f9337cdb --- /dev/null +++ b/services/_includes/postprocessing-config-example.yaml @@ -0,0 +1,16 @@ +# Autogenerated +# Filename: postprocessing-config-example.yaml + +log: + level: "" + pretty: false + color: false + file: "" +postprocessing: + events: + endpoint: 127.0.0.1:9233 + cluster: ocis-cluster + tls_insecure: false + tls_root_ca_certificate: "" + virusscan: false + delayprocessing: 0s diff --git a/services/_includes/postprocessing_configvars.md b/services/_includes/postprocessing_configvars.md new file mode 100644 index 00000000000..482b60377dd --- /dev/null +++ b/services/_includes/postprocessing_configvars.md @@ -0,0 +1,14 @@ +## Environment Variables + +| Name | Type | Default Value | Description | +|------|------|---------------|-------------| +| OCIS_LOG_LEVEL
POSTPROCESSING_LOG_LEVEL | string | | The log level. Valid values are: "panic", "fatal", "error", "warn", "info", "debug", "trace".| +| OCIS_LOG_PRETTY
POSTPROCESSING_LOG_PRETTY | bool | false | Activates pretty log output.| +| OCIS_LOG_COLOR
POSTPROCESSING_LOG_COLOR | bool | false | Activates colorized log output.| +| OCIS_LOG_FILE
POSTPROCESSING_LOG_FILE | string | | The path to the log file. Activates logging to this file if set.| +| POSTPROCESSING_EVENTS_ENDPOINT | string | 127.0.0.1:9233 | Endpoint of the event system.| +| POSTPROCESSING_EVENTS_CLUSTER | string | ocis-cluster | Cluster ID of the event system.| +| OCIS_INSECURE
SEARCH_EVENTS_TLS_INSECURE | bool | false | Whether to verify the server TLS certificates.| +| SEARCH_EVENTS_TLS_ROOT_CA_CERTIFICATE | string | | The root CA certificate used to validate the server's TLS certificate. If provided SEARCH_EVENTS_TLS_INSECURE will be seen as false.| +| POSTPROCESSING_VIRUSSCAN | bool | false | should the system do a virusscan? Needs antivirus service| +| POSTPROCESSING_DELAY | Duration | 0s | the sytem sleeps for this time while postprocessing| \ No newline at end of file diff --git a/services/_includes/storage-users-config-example.yaml b/services/_includes/storage-users-config-example.yaml index da60a003a8e..1158397c136 100644 --- a/services/_includes/storage-users-config-example.yaml +++ b/services/_includes/storage-users-config-example.yaml @@ -46,6 +46,7 @@ drivers: share_folder: /Shares max_acquire_lock_cycles: 20 lock_cycle_duration_factor: 30 + async_uploads: false s3ng: root: ~/.ocis/storage/users user_layout: '{{.Id.OpaqueId}}' @@ -72,12 +73,15 @@ drivers: db_name: owncloud users_provider_endpoint: localhost:9144 data_server_url: http://localhost:9158/data +data_gateway_url: https://localhost:9200/data +transfer_expires: 86400 events: endpoint: 127.0.0.1:9233 cluster: ocis-cluster tls_insecure: false tls_root_ca_cert_path: "" enable_tls: false + num_consumers: 0 cache: store: memory nodes: [] diff --git a/services/_includes/storage-users_configvars.md b/services/_includes/storage-users_configvars.md index 523f3682d57..219170230dc 100644 --- a/services/_includes/storage-users_configvars.md +++ b/services/_includes/storage-users_configvars.md @@ -35,6 +35,7 @@ | STORAGE_USERS_OCIS_SHARE_FOLDER | string | /Shares | Name of the folder jailing all shares.| | STORAGE_USERS_OCIS_MAX_ACQUIRE_LOCK_CYCLES | int | 20 | When trying to lock files, ocis will try this amount of times to acquire the lock before failing. After each try it will wait for an increasing amount of time. Values of 0 or below will be ignored and the default value of 20 will be used.| | STORAGE_USERS_OCIS_LOCK_CYCLE_DURATION_FACTOR | int | 30 | When trying to lock files, ocis will multiply the cycle with this factor and use it as a millisecond timeout. Values of 0 or below will be ignored and the default value of 30 will be used.| +| STORAGE_USERS_OCIS_ASYNC_UPLOADS | bool | false | Enable asynchronous file uploads.| | STORAGE_USERS_S3NG_ROOT | string | ~/.ocis/storage/users | The directory where the filesystem storage will store user files. If not definied, the root directory derives from $OCIS_BASE_DATA_PATH:/storage/users.| | STORAGE_USERS_S3NG_USER_LAYOUT | string | {{.Id.OpaqueId}} | Template string for the user storage layout in the user directory.| | STORAGE_USERS_PERMISSION_ENDPOINT
STORAGE_USERS_S3NG_PERMISSIONS_ENDPOINT | string | 127.0.0.1:9191 | Endpoint of the permissions service.| @@ -59,11 +60,14 @@ | STORAGE_USERS_OWNCLOUDSQL_DB_NAME | string | owncloud | Name of the database to be used.| | STORAGE_USERS_OWNCLOUDSQL_USERS_PROVIDER_ENDPOINT | string | localhost:9144 | Endpoint of the users provider.| | STORAGE_USERS_DATA_SERVER_URL | string | http://localhost:9158/data | URL of the data server, needs to be reachable by the data gateway provided by the frontend service or the user if directly exposed.| +| STORAGE_USERS_DATA_GATEWAY_URL | string | https://localhost:9200/data | URL of the data gateway server| +| STORAGE_USERS_TRANSFER_EXPIRES | int64 | 86400 | the time after which the token for upload postprocessing expires| | STORAGE_USERS_EVENTS_ENDPOINT | string | 127.0.0.1:9233 | The address of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture.| | STORAGE_USERS_EVENTS_CLUSTER | string | ocis-cluster | The clusterID of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture. Mandatory when using NATS as event system.| | OCIS_INSECURE
STORAGE_USERS_EVENTS_TLS_INSECURE | bool | false | Whether to verify the server TLS certificates.| | STORAGE_USERS_EVENTS_TLS_ROOT_CA_CERT | string | | The root CA certificate used to validate the server's TLS certificate. If provided STORAGE_USERS_EVENTS_TLS_INSECURE will be seen as false.| | OCIS_EVENTS_ENABLE_TLS
STORAGE_USERS_EVENTS_ENABLE_TLS | bool | false | Enable TLS for the connection to the events broker. The events broker is the ocis service which receives and delivers events between the services..| +| STORAGE_USERS_EVENTS_NUM_CONSUMERS | int | 0 | The amount of concurrent event consumers to start. Event consumers are used for post-processing files. Multiple consumers increase parallelisation, but will also increase CPU and memory demands. The setting has no effect when the STORAGE_USERS_OCIS_ASYNC_UPLOADS is set to false. The default and minimum value is 1.| | OCIS_CACHE_STORE_TYPE
STORAGE_USERS_CACHE_STORE_TYPE
STORAGE_USERS_CACHE_STORE | string | memory | Store implementation for the cache. Valid values are "memory" (default), "redis", and "etcd".| | OCIS_CACHE_STORE_ADDRESS
STORAGE_USERS_CACHE_STORE_ADDRESS
STORAGE_USERS_CACHE_NODES | []string | [] | Node addresses to use for the cache store.| | STORAGE_USERS_CACHE_DATABASE | string | users | Database name of the cache.|