[ARVADOS-WORKBENCH2] created: 2.3.0-4-gfc4b2b28

Git user git at public.arvados.org
Tue Nov 2 23:08:26 UTC 2021


        at  fc4b2b280ad3e9f332844116a4c9e57eb843def0 (commit)


commit fc4b2b280ad3e9f332844116a4c9e57eb843def0
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Tue Nov 2 18:10:05 2021 -0300

    17944: Configures a vocabulary file previous to the Cypress run.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/store/vocabulary/vocabulary-actions.ts b/src/store/vocabulary/vocabulary-actions.ts
index 2ca344bb..d73c01fe 100644
--- a/src/store/vocabulary/vocabulary-actions.ts
+++ b/src/store/vocabulary/vocabulary-actions.ts
@@ -10,7 +10,6 @@ import { isVocabulary } from 'models/vocabulary';
 
 export const loadVocabulary = async (dispatch: Dispatch, _: {}, { vocabularyService }: ServiceRepository) => {
     const vocabulary = await vocabularyService.getVocabulary();
-
     dispatch(propertiesActions.SET_PROPERTY({
         key: VOCABULARY_PROPERTY_NAME,
         value: isVocabulary(vocabulary)
diff --git a/tools/arvados_config.yml b/tools/arvados_config.yml
index 369046e6..55dc8a02 100644
--- a/tools/arvados_config.yml
+++ b/tools/arvados_config.yml
@@ -4,6 +4,7 @@ Clusters:
     SystemRootToken: systemusertesttoken1234567890aoeuidhtnsqjkxbmwvzpy
     API:
       RequestTimeout: 30s
+      VocabularyPath: ""
     TLS:
       Insecure: true
     Collections:
diff --git a/tools/example-vocabulary.json b/tools/example-vocabulary.json
new file mode 100644
index 00000000..59d4de7a
--- /dev/null
+++ b/tools/example-vocabulary.json
@@ -0,0 +1,213 @@
+{
+    "strict_tags": false,
+    "tags": {
+        "IDTAGFRUITS": {
+            "strict": false,
+            "labels": [
+                {"label": "Fruit"}
+            ],
+            "values": {
+                "IDVALFRUITS1": {
+                    "labels": [
+                        {"label": "Pineapple"}
+                    ]
+                },
+                "IDVALFRUITS2": {
+                    "labels": [
+                        {"label": "Tomato"}
+                    ]
+                },
+                "IDVALFRUITS3": {
+                    "labels": [
+                        {"label": "Orange"}
+                    ]
+                },
+                "IDVALFRUITS4": {
+                    "labels": [
+                        {"label": "Banana"}
+                    ]
+                },
+                "IDVALFRUITS5": {
+                    "labels": [
+                        {"label": "Advocado"}
+                    ]
+                },
+                "IDVALFRUITS6": {
+                    "labels": [
+                        {"label": "Lemon"}
+                    ]
+                },
+                "IDVALFRUITS7": {
+                    "labels": [
+                        {"label": "Apple"}
+                    ]
+                },
+                "IDVALFRUITS8": {
+                    "labels": [
+                        {"label": "Peach"}
+                    ]
+                },
+                "IDVALFRUITS9": {
+                    "labels": [
+                        {"label": "Strawberry"}
+                    ]
+                }
+            }
+        },
+        "IDTAGANIMALS": {
+            "strict": false,
+            "labels": [
+                {"label": "Animal" },
+                {"label": "Creature"}
+            ],
+            "values": {
+                "IDVALANIMALS1": {
+                    "labels": [
+                        {"label": "Human"},
+                        {"label": "Homo sapiens"}
+                    ]
+                },
+                "IDVALANIMALS2": {
+                    "labels": [
+                        {"label": "Dog"},
+                        {"label": "Canis lupus familiaris"}
+                    ]
+                },
+                "IDVALANIMALS3": {
+                    "labels": [
+                        {"label": "Elephant"},
+                        {"label": "Loxodonta"}
+                    ]
+                },
+                "IDVALANIMALS4": {
+                    "labels": [
+                        {"label": "Eagle"},
+                        {"label": "Haliaeetus leucocephalus"}
+                    ]
+                }
+            }
+        },
+        "IDTAGCOLORS": {
+            "strict": false,
+            "labels": [
+                {"label": "Color"}
+            ],
+            "values": {
+                "IDVALCOLORS1": {
+                    "labels": [
+                        {"label": "Yellow"}
+                    ]
+                },
+                "IDVALCOLORS2": {
+                    "labels": [
+                        {"label": "Red"}
+                    ]
+                },
+                "IDVALCOLORS3": {
+                    "labels": [
+                        {"label": "Magenta"}
+                    ]
+                },
+                "IDVALCOLORS4": {
+                    "labels": [
+                        {"label": "Green"}
+                    ]
+                }
+            }
+        },
+        "IDTAGCOMMENT": {
+            "labels": [
+                {"label": "Comment"},
+                {"label": "Text"}
+            ]
+        },
+        "IDTAGCATEGORIES": {
+            "strict": true,
+            "labels": [
+                {"label": "Category"}
+            ],
+            "values": {
+                "IDTAGCAT1": {
+                    "labels": [
+                        {"label": "Experimental"}
+                    ]
+                },
+                "IDTAGCAT2": {
+                    "labels": [
+                        {"label": "Development"}
+                    ]
+                },
+                "IDTAGCAT3": {
+                    "labels": [
+                        {"label": "Production"}
+                    ]
+                }
+            }
+        },
+        "IDTAGIMPORTANCES": {
+            "strict": true,
+            "labels": [
+                {"label": "Importance"},
+                {"label": "Priority"}
+            ],
+            "values": {
+                "IDVALIMPORTANCES1": {
+                    "labels": [
+                        {"label": "Critical"},
+                        {"label": "Urgent"},
+                        {"label": "High"}
+                    ]
+                },
+                "IDVALIMPORTANCES2": {
+                    "labels": [
+                        {"label": "Normal"},
+                        {"label": "Moderate"}
+                    ]
+                },
+                "IDVALIMPORTANCES3": {
+                    "labels": [
+                        {"label": "Low"}
+                    ]
+                }
+            }
+        },
+        "IDTAGSIZES": {
+            "strict": true,
+            "labels": [
+                {"label": "Size"}
+            ],
+            "values": {
+                "IDVALSIZES1": {
+                    "labels": [
+                        {"label": "XS"},
+                        {"label": "x-small"}
+                    ]
+                },
+                "IDVALSIZES2": {
+                    "labels": [
+                        {"label": "S"},
+                        {"label": "small"}
+                    ]
+                },
+                "IDVALSIZES3": {
+                    "labels": [
+                        {"label": "M"},
+                        {"label": "medium"}
+                    ]
+                },
+                "IDVALSIZES4": {
+                    "labels": [
+                        {"label": "L"},
+                        {"label": "large"}
+                    ]
+                },
+                "IDVALSIZES5": {
+                    "labels": [
+                        {"label": "XL"},
+                        {"label": "x-large"}
+                    ]
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/tools/run-integration-tests.sh b/tools/run-integration-tests.sh
index 159bfc1c..bf4c3ba4 100755
--- a/tools/run-integration-tests.sh
+++ b/tools/run-integration-tests.sh
@@ -70,6 +70,7 @@ echo "ARVADOS_DIR is ${ARVADOS_DIR}"
 
 ARVADOS_LOG=${ARVADOS_DIR}/arvados.log
 ARVADOS_CONF=${WB2_DIR}/tools/arvados_config.yml
+VOCABULARY_CONF=${WB2_DIR}/tools/example-vocabulary.json
 
 if [ ! -f "${WB2_DIR}/src/index.tsx" ]; then
     echo "ERROR: '${WB2_DIR}' isn't workbench2's directory"
@@ -104,6 +105,9 @@ echo "Installing dev dependencies..."
 ~/go/bin/arvados-server install -type test || exit 1
 
 echo "Launching arvados in test mode..."
+VOC_DIR=$(mktemp -d | cut -d \/ -f3) # Removes the /tmp/ part
+cp ${VOCABULARY_CONF} /tmp/${VOC_DIR}/voc.json
+sed -i "s/VocabularyPath: \".*\"/VocabularyPath: \"\/tmp\/${VOC_DIR}\/voc.json\"/" ${ARVADOS_CONF}
 coproc arvboot (~/go/bin/arvados-server boot \
     -type test \
     -config ${ARVADOS_CONF} \

commit 748c1377880459b66b6d84f483cc81e10f61dbf8
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Tue Nov 2 15:22:02 2021 -0300

    17944: Request the vocabulary exclusively from the new controller's endpoint.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/README.md b/README.md
index 8bb50dbe..4ec4bd1c 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,6 @@ Currently this configuration schema is supported:
 ```
 {
     "API_HOST": "string",
-    "VOCABULARY_URL": "string",
     "FILE_VIEWERS_CONFIG_URL": "string",
 }
 ```
@@ -93,12 +92,6 @@ The Arvados base URL.
 
 The `REACT_APP_ARVADOS_API_HOST` environment variable can be used to set the default URL if the run time configuration is unreachable.
 
-### VOCABULARY_URL
-Local path, or any URL that allows cross-origin requests. See
-[Vocabulary JSON file example](public/vocabulary-example.json).
-
-To use the URL defined in the Arvados cluster configuration, remove the entire `VOCABULARY_URL` entry from the runtime configuration. Found in `/config.json` by default.
-
 ## FILE_VIEWERS_CONFIG_URL
 Local path, or any URL that allows cross-origin requests. See:
 
diff --git a/public/vocabulary-example.json b/public/vocabulary-example.json
deleted file mode 100644
index 59d4de7a..00000000
--- a/public/vocabulary-example.json
+++ /dev/null
@@ -1,213 +0,0 @@
-{
-    "strict_tags": false,
-    "tags": {
-        "IDTAGFRUITS": {
-            "strict": false,
-            "labels": [
-                {"label": "Fruit"}
-            ],
-            "values": {
-                "IDVALFRUITS1": {
-                    "labels": [
-                        {"label": "Pineapple"}
-                    ]
-                },
-                "IDVALFRUITS2": {
-                    "labels": [
-                        {"label": "Tomato"}
-                    ]
-                },
-                "IDVALFRUITS3": {
-                    "labels": [
-                        {"label": "Orange"}
-                    ]
-                },
-                "IDVALFRUITS4": {
-                    "labels": [
-                        {"label": "Banana"}
-                    ]
-                },
-                "IDVALFRUITS5": {
-                    "labels": [
-                        {"label": "Advocado"}
-                    ]
-                },
-                "IDVALFRUITS6": {
-                    "labels": [
-                        {"label": "Lemon"}
-                    ]
-                },
-                "IDVALFRUITS7": {
-                    "labels": [
-                        {"label": "Apple"}
-                    ]
-                },
-                "IDVALFRUITS8": {
-                    "labels": [
-                        {"label": "Peach"}
-                    ]
-                },
-                "IDVALFRUITS9": {
-                    "labels": [
-                        {"label": "Strawberry"}
-                    ]
-                }
-            }
-        },
-        "IDTAGANIMALS": {
-            "strict": false,
-            "labels": [
-                {"label": "Animal" },
-                {"label": "Creature"}
-            ],
-            "values": {
-                "IDVALANIMALS1": {
-                    "labels": [
-                        {"label": "Human"},
-                        {"label": "Homo sapiens"}
-                    ]
-                },
-                "IDVALANIMALS2": {
-                    "labels": [
-                        {"label": "Dog"},
-                        {"label": "Canis lupus familiaris"}
-                    ]
-                },
-                "IDVALANIMALS3": {
-                    "labels": [
-                        {"label": "Elephant"},
-                        {"label": "Loxodonta"}
-                    ]
-                },
-                "IDVALANIMALS4": {
-                    "labels": [
-                        {"label": "Eagle"},
-                        {"label": "Haliaeetus leucocephalus"}
-                    ]
-                }
-            }
-        },
-        "IDTAGCOLORS": {
-            "strict": false,
-            "labels": [
-                {"label": "Color"}
-            ],
-            "values": {
-                "IDVALCOLORS1": {
-                    "labels": [
-                        {"label": "Yellow"}
-                    ]
-                },
-                "IDVALCOLORS2": {
-                    "labels": [
-                        {"label": "Red"}
-                    ]
-                },
-                "IDVALCOLORS3": {
-                    "labels": [
-                        {"label": "Magenta"}
-                    ]
-                },
-                "IDVALCOLORS4": {
-                    "labels": [
-                        {"label": "Green"}
-                    ]
-                }
-            }
-        },
-        "IDTAGCOMMENT": {
-            "labels": [
-                {"label": "Comment"},
-                {"label": "Text"}
-            ]
-        },
-        "IDTAGCATEGORIES": {
-            "strict": true,
-            "labels": [
-                {"label": "Category"}
-            ],
-            "values": {
-                "IDTAGCAT1": {
-                    "labels": [
-                        {"label": "Experimental"}
-                    ]
-                },
-                "IDTAGCAT2": {
-                    "labels": [
-                        {"label": "Development"}
-                    ]
-                },
-                "IDTAGCAT3": {
-                    "labels": [
-                        {"label": "Production"}
-                    ]
-                }
-            }
-        },
-        "IDTAGIMPORTANCES": {
-            "strict": true,
-            "labels": [
-                {"label": "Importance"},
-                {"label": "Priority"}
-            ],
-            "values": {
-                "IDVALIMPORTANCES1": {
-                    "labels": [
-                        {"label": "Critical"},
-                        {"label": "Urgent"},
-                        {"label": "High"}
-                    ]
-                },
-                "IDVALIMPORTANCES2": {
-                    "labels": [
-                        {"label": "Normal"},
-                        {"label": "Moderate"}
-                    ]
-                },
-                "IDVALIMPORTANCES3": {
-                    "labels": [
-                        {"label": "Low"}
-                    ]
-                }
-            }
-        },
-        "IDTAGSIZES": {
-            "strict": true,
-            "labels": [
-                {"label": "Size"}
-            ],
-            "values": {
-                "IDVALSIZES1": {
-                    "labels": [
-                        {"label": "XS"},
-                        {"label": "x-small"}
-                    ]
-                },
-                "IDVALSIZES2": {
-                    "labels": [
-                        {"label": "S"},
-                        {"label": "small"}
-                    ]
-                },
-                "IDVALSIZES3": {
-                    "labels": [
-                        {"label": "M"},
-                        {"label": "medium"}
-                    ]
-                },
-                "IDVALSIZES4": {
-                    "labels": [
-                        {"label": "L"},
-                        {"label": "large"}
-                    ]
-                },
-                "IDVALSIZES5": {
-                    "labels": [
-                        {"label": "XL"},
-                        {"label": "x-large"}
-                    ]
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/common/config.ts b/src/common/config.ts
index 56f7c488..2518c95e 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -51,7 +51,6 @@ export interface ClusterConfigJSON {
     };
     Workbench: {
         ArvadosDocsite: string;
-        VocabularyURL: string;
         FileViewersConfigURL: string;
         WelcomePageHTML: string;
         InactivePageHTML: string;
@@ -204,15 +203,10 @@ remove the entire ${varName} entry from ${WORKBENCH_CONFIG_URL}`);
                 }
                 config.fileViewersConfigUrl = fileViewerConfigUrl;
 
-                let vocabularyUrl;
                 if (workbenchConfig.VOCABULARY_URL !== undefined) {
-                    warnLocalConfig("VOCABULARY_URL");
-                    vocabularyUrl = workbenchConfig.VOCABULARY_URL;
+                    console.warn(`A value for VOCABULARY_URL was found in ${WORKBENCH_CONFIG_URL}. It will be ignored as the cluster already provides its own endpoint, you can safely remove it.`)
                 }
-                else {
-                    vocabularyUrl = config.clusterConfig.Workbench.VocabularyURL || "/vocabulary-example.json";
-                }
-                config.vocabularyUrl = vocabularyUrl;
+                config.vocabularyUrl = getVocabularyURL(workbenchConfig.API_HOST);
 
                 return { config, apiHost: workbenchConfig.API_HOST };
             });
@@ -240,7 +234,6 @@ export const mockClusterConfigJSON = (config: Partial<ClusterConfigJSON>): Clust
     },
     Workbench: {
         ArvadosDocsite: "",
-        VocabularyURL: "",
         FileViewersConfigURL: "",
         WelcomePageHTML: "",
         InactivePageHTML: "",
@@ -315,5 +308,7 @@ const getDefaultConfig = (): WorkbenchConfig => {
 
 export const ARVADOS_API_PATH = "arvados/v1";
 export const CLUSTER_CONFIG_PATH = "arvados/v1/config";
+export const VOCABULARY_PATH = "arvados/v1/vocabulary";
 export const DISCOVERY_DOC_PATH = "discovery/v1/apis/arvados/v1/rest";
-export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_PATH}?nocache=${(new Date()).getTime()}`;
+export const getClusterConfigURL = (apiHost: string) => `https://${apiHost}/${CLUSTER_CONFIG_PATH}?nocache=${(new Date()).getTime()}`;
+export const getVocabularyURL = (apiHost: string) => `https://${apiHost}/${VOCABULARY_PATH}?nocache=${(new Date()).getTime()}`;
diff --git a/src/services/vocabulary-service/vocabulary-service.ts b/src/services/vocabulary-service/vocabulary-service.ts
index ff2de159..38163f77 100644
--- a/src/services/vocabulary-service/vocabulary-service.ts
+++ b/src/services/vocabulary-service/vocabulary-service.ts
@@ -10,9 +10,9 @@ export class VocabularyService {
         private url: string
     ) { }
 
-    getVocabulary() {
-        return Axios
-            .get<Vocabulary>(this.url)
-            .then(response => response.data);
+    async getVocabulary() {
+        const response = await Axios
+            .get<Vocabulary>(this.url);
+        return response.data;
     }
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list