Merge branch '17426-plug-ins' refs #17426
[arvados-workbench2.git] / README.md
1 [comment]: # (Copyright © The Arvados Authors. All rights reserved.)
2 [comment]: # ()
3 [comment]: # (SPDX-License-Identifier: CC-BY-SA-3.0)
4
5 # Arvados Workbench 2
6
7 ## Setup
8 ```
9 npm install yarn
10 yarn install
11 ```
12
13 Install [redux-devtools-extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd)
14
15 ## Start project for development
16 ```
17 yarn start
18 ```
19
20 ## Run unit tests
21 ```
22 make unit-tests
23 ```
24
25 ## Run end-to-end tests
26
27 ```
28 make integration-tests
29 ```
30
31 ## Run end-to-end tests in a Docker container
32
33 ```
34 make integration-tests-in-docker
35 ```
36
37 ## Run tests interactively in container
38
39 ```
40 $ xhost +local:root
41 $ ARVADOS_DIR=/path/to/arvados
42 $ docker run -ti -v$PWD:$PWD -v$ARVADOS_DIR:/usr/src/arvados -w$PWD --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" workbench2-build /bin/bash
43 (inside container)
44 # yarn run cypress install
45 # tools/run-integration-tests.sh -i -a /usr/src/arvados
46 ```
47
48 ## Production build
49 ```
50 yarn build
51 ```
52
53 ## Package build
54 ```
55 make packages
56 ```
57
58 ## Build time configuration
59 You can customize project global variables using env variables. Default values are placed in the `.env` file.
60
61 Example:
62 ```
63 REACT_APP_ARVADOS_CONFIG_URL=config.json yarn build
64 ```
65
66 ## Run time configuration
67 The app will fetch runtime configuration when starting. By default it will try to fetch `/config.json`.  In development mode, this can be found in the `public` directory.
68 You can customize this url using build time configuration.
69
70 Currently this configuration schema is supported:
71 ```
72 {
73     "API_HOST": "string",
74     "VOCABULARY_URL": "string",
75     "FILE_VIEWERS_CONFIG_URL": "string",
76 }
77 ```
78
79 ### API_HOST
80
81 The Arvados base URL.
82
83 The `REACT_APP_ARVADOS_API_HOST` environment variable can be used to set the default URL if the run time configuration is unreachable.
84
85 ### VOCABULARY_URL
86 Local path, or any URL that allows cross-origin requests. See
87 [Vocabulary JSON file example](public/vocabulary-example.json).
88
89 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.
90
91 ## FILE_VIEWERS_CONFIG_URL
92 Local path, or any URL that allows cross-origin requests. See:
93
94 [File viewers config file example](public/file-viewers-example.json)
95
96 [File viewers config scheme](src/models/file-viewers-config.ts)
97
98 To use the URL defined in the Arvados cluster configuration, remove the entire `FILE_VIEWERS_CONFIG_URL` entry from the runtime configuration. Found in `/config.json` by default.
99
100 ## Plugin support
101
102 Workbench supports plugins to add new functionality to the user
103 interface.  For information about installing plugins, the provided
104 example plugins, see [src/plugins/README.md](src/plugins/README.md).
105
106
107 ## Licensing
108
109 Arvados is Free Software. See COPYING for information about Arvados Free
110 Software licenses.