From 7dcbe06182de70d158835e400d61fa026eac6384 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Thu, 21 Oct 2021 15:16:14 -0300 Subject: [PATCH] 17944: Updates config knobs and documentation. Workbench.VocabularyURL will be auto-exported providing the new vocabulary endpoint, for backwards compatibility. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- doc/_config.yml | 2 +- ...uid => _metadata_vocabulary_example.liquid} | 6 ++++++ ...=> metadata-vocabulary.html.textile.liquid} | 18 ++++++++++-------- doc/admin/upgrading.html.textile.liquid | 2 +- .../install-workbench2-app.html.textile.liquid | 2 +- lib/config/config.default.yml | 7 ++++++- lib/config/export.go | 2 +- lib/config/generated_config.go | 7 ++++++- sdk/go/arvados/config.go | 2 +- 9 files changed, 33 insertions(+), 15 deletions(-) rename doc/_includes/{_wb2_vocabulary_example.liquid => _metadata_vocabulary_example.liquid} (90%) rename doc/admin/{workbench2-vocabulary.html.textile.liquid => metadata-vocabulary.html.textile.liquid} (79%) diff --git a/doc/_config.yml b/doc/_config.yml index 31db9c41d5..dde87323d7 100644 --- a/doc/_config.yml +++ b/doc/_config.yml @@ -194,7 +194,7 @@ navbar: - admin/keep-balance.html.textile.liquid - admin/controlling-container-reuse.html.textile.liquid - admin/logs-table-management.html.textile.liquid - - admin/workbench2-vocabulary.html.textile.liquid + - admin/metadata-vocabulary.html.textile.liquid - admin/storage-classes.html.textile.liquid - admin/keep-recovering-data.html.textile.liquid - admin/keep-measuring-deduplication.html.textile.liquid diff --git a/doc/_includes/_wb2_vocabulary_example.liquid b/doc/_includes/_metadata_vocabulary_example.liquid similarity index 90% rename from doc/_includes/_wb2_vocabulary_example.liquid rename to doc/_includes/_metadata_vocabulary_example.liquid index ee2ac97ef3..016b48c6ae 100644 --- a/doc/_includes/_wb2_vocabulary_example.liquid +++ b/doc/_includes/_metadata_vocabulary_example.liquid @@ -1,3 +1,9 @@ +{% comment %} +Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: CC-BY-SA-3.0 +{% endcomment %} + { "strict_tags": false, "tags": { diff --git a/doc/admin/workbench2-vocabulary.html.textile.liquid b/doc/admin/metadata-vocabulary.html.textile.liquid similarity index 79% rename from doc/admin/workbench2-vocabulary.html.textile.liquid rename to doc/admin/metadata-vocabulary.html.textile.liquid index 9a8d7fcd01..e615fa3c89 100644 --- a/doc/admin/workbench2-vocabulary.html.textile.liquid +++ b/doc/admin/metadata-vocabulary.html.textile.liquid @@ -1,7 +1,7 @@ --- layout: default navsection: admin -title: User properties vocabulary +title: Metadata vocabulary ... {% comment %} @@ -12,17 +12,19 @@ SPDX-License-Identifier: CC-BY-SA-3.0 Many Arvados objects (like collections and projects) can store metadata as properties that in turn can be used in searches allowing a flexible way of organizing data inside the system. -The Workbench2 user interface enables the site adminitrator to set up a properties vocabulary formal definition so that users can select from predefined key/value pairs of properties, offering the possibility to add different terms for the same concept. +Arvados enables the site administrator to set up a formal metadata vocabulary definition so that users can select from predefined key/value pairs of properties, offering the possibility to add different terms for the same concept on clients' UI such as workbench2. -h2. Workbench2 configuration +The Controller service loads and caches the configured vocabulary file in memory at startup time, exporting it on a particular endpoint. From time to time, it'll check for updates in the local copy and refresh its cache if validation passes. -Workbench2 retrieves the vocabulary file URL from the cluster config as shown: +h2. Configuration + +The site administrator should place the JSON vocabulary file on the same host as the controller service and set up the config file as follows:
Cluster:
   zzzzz:
-    Workbench:
-      VocabularyURL: https://site.example.com/vocabulary.json
+    API:
+      VocabularyPath: /etc/arvados/vocabulary.json
 
@@ -35,10 +37,10 @@ Keys and values are indexed by identifiers so that the concept of a term is pres The following is an example of a vocabulary definition: {% codeblock as json %} -{% include 'wb2_vocabulary_example' %} +{% include 'metadata_vocabulary_example' %} {% endcodeblock %} -If the @strict_tags@ flag at the root level is @true@, it will restrict the users from saving property keys other than the ones defined in the vocabulary. Take notice that this restriction is at the client level on Workbench2, it doesn't limit the user's ability to set any arbitrary property via other means (e.g. Python SDK or CLI commands) +If the @strict_tags@ flag at the root level is @true@, it will restrict the users from saving property keys other than the ones defined in the vocabulary. This restriction is enforced at the backend level to ensure consistency across different clients. Inside the @tags@ member, IDs are defined (@IDTAGANIMALS@, @IDTAGCOMMENT@, @IDTAGIMPORTANCES@) and can have any format that the current application requires. Every key will declare at least a @labels@ list with zero or more label objects. diff --git a/doc/admin/upgrading.html.textile.liquid b/doc/admin/upgrading.html.textile.liquid index 0aea90bd0d..c4299746e0 100644 --- a/doc/admin/upgrading.html.textile.liquid +++ b/doc/admin/upgrading.html.textile.liquid @@ -292,7 +292,7 @@ Workbench 2 is now ready for regular use. Follow the instructions to "install w h3. New property vocabulary format for Workbench2 -(feature "#14151":https://dev.arvados.org/issues/14151) Workbench2 supports a new vocabulary format and it isn't compatible with the previous one, please read the "workbench2 vocabulary format admin page":{{site.baseurl}}/admin/workbench2-vocabulary.html for more information. +(feature "#14151":https://dev.arvados.org/issues/14151) Workbench2 supports a new vocabulary format and it isn't compatible with the previous one, please read the "metadata vocabulary format admin page":{{site.baseurl}}/admin/metadata-vocabulary.html for more information. h3. Cloud installations only: node manager replaced by arvados-dispatch-cloud diff --git a/doc/install/install-workbench2-app.html.textile.liquid b/doc/install/install-workbench2-app.html.textile.liquid index f3a320b102..c9a1c70126 100644 --- a/doc/install/install-workbench2-app.html.textile.liquid +++ b/doc/install/install-workbench2-app.html.textile.liquid @@ -75,7 +75,7 @@ server { h2. Vocabulary configuration (optional) -Workbench2 can load a vocabulary file which lists available metadata properties for groups and collections. To configure the property vocabulary definition, please visit the "Workbench2 Vocabulary Format":{{site.baseurl}}/admin/workbench2-vocabulary.html page in the Admin section. +Workbench2 can load a vocabulary file which lists available metadata properties for groups and collections. To configure the property vocabulary definition, please visit the "Metadata Vocabulary Format":{{site.baseurl}}/admin/metadata-vocabulary.html page in the Admin section. {% assign arvados_component = 'arvados-workbench2' %} diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml index 97ded6bf68..378690ad5a 100644 --- a/lib/config/config.default.yml +++ b/lib/config/config.default.yml @@ -234,6 +234,12 @@ Clusters: # Timeout on requests to internal Keep services. KeepServiceRequestTimeout: 15s + # Vocabulary file path, local to the node running the controller. + # This JSON file should contain the description of what's allowed + # as object's metadata. Its format is described at: + # https://doc.arvados.org/admin/metadata-vocabulary.html + VocabularyPath: "" + Users: # Config parameters to automatically setup new users. If enabled, # this users will be able to self-activate. Enable this if you want @@ -1566,7 +1572,6 @@ Clusters: DefaultOpenIdPrefix: "https://www.google.com/accounts/o8/id" # Workbench2 configs - VocabularyURL: "" FileViewersConfigURL: "" # Idle time after which the user's session will be auto closed. diff --git a/lib/config/export.go b/lib/config/export.go index e36d6e76ca..fe8d45509e 100644 --- a/lib/config/export.go +++ b/lib/config/export.go @@ -72,6 +72,7 @@ var whitelist = map[string]bool{ "API.MaxTokenLifetime": false, "API.RequestTimeout": true, "API.SendTimeout": true, + "API.VocabularyPath": false, "API.WebsocketClientEventQueue": false, "API.WebsocketServerEventQueue": false, "AuditLogs": false, @@ -276,7 +277,6 @@ var whitelist = map[string]bool{ "Workbench.UserProfileFormFields.*.*": true, "Workbench.UserProfileFormFields.*.*.*": true, "Workbench.UserProfileFormMessage": true, - "Workbench.VocabularyURL": true, "Workbench.WelcomePageHTML": true, } diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go index f7849d6142..a1bb2330df 100644 --- a/lib/config/generated_config.go +++ b/lib/config/generated_config.go @@ -240,6 +240,12 @@ Clusters: # Timeout on requests to internal Keep services. KeepServiceRequestTimeout: 15s + # Vocabulary file path, local to the node running the controller. + # This JSON file should contain the description of what's allowed + # as object's metadata. Its format is described at: + # https://doc.arvados.org/admin/metadata-vocabulary.html + VocabularyPath: "" + Users: # Config parameters to automatically setup new users. If enabled, # this users will be able to self-activate. Enable this if you want @@ -1572,7 +1578,6 @@ Clusters: DefaultOpenIdPrefix: "https://www.google.com/accounts/o8/id" # Workbench2 configs - VocabularyURL: "" FileViewersConfigURL: "" # Idle time after which the user's session will be auto closed. diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go index e736f79fd7..2df0b90577 100644 --- a/sdk/go/arvados/config.go +++ b/sdk/go/arvados/config.go @@ -102,6 +102,7 @@ type Cluster struct { WebsocketClientEventQueue int WebsocketServerEventQueue int KeepServiceRequestTimeout Duration + VocabularyPath string } AuditLogs struct { MaxAge Duration @@ -273,7 +274,6 @@ type Cluster struct { Options map[string]struct{} } UserProfileFormMessage string - VocabularyURL string WelcomePageHTML string InactivePageHTML string SSHHelpPageHTML string -- 2.30.2