Merge branch '16811-public-favs' refs #16811
[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 <pre>
9 brew install yarn
10 yarn install
11 </pre>
12 Install [redux-devtools-extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd)
13
14 ### Start project
15 <code>yarn start</code>
16
17 ### Run unit tests
18 <pre>
19 make unit-tests
20 </pre>
21
22 ### Run end-to-end tests
23
24 <pre>
25 make integration-tests
26 </pre>
27
28 ### Run end-to-end tests in a Docker container
29
30 <pre>
31 make integration-tests-in-docker
32 </pre>
33
34 ### Run tests interactively in container
35
36 <pre>
37 $ xhost +local:root
38 $ ARVADOS_DIR=/path/to/arvados
39 $ 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
40 (inside container)
41 # yarn run cypress install
42 # tools/run-integration-tests.sh -i -a /usr/src/arvados
43 </pre>
44
45 ### Production build
46 <pre>
47 yarn install
48 yarn build
49 </pre>
50
51 ### Package build
52 <pre>
53 make workbench2-build-image
54 docker run -v$PWD:$PWD -w $PWD arvados/fpm make packages
55 </pre>
56
57 ### Build time configuration
58 You can customize project global variables using env variables. Default values are placed in the `.env` file.
59
60 Example:
61 ```
62 REACT_APP_ARVADOS_CONFIG_URL=config.json yarn build
63 ```
64
65 ### Run time configuration
66 The app will fetch runtime configuration when starting. By default it will try to fetch `/config.json`. You can customize this url using build time configuration.
67
68 Currently this configuration schema is supported:
69 ```
70 {
71     "API_HOST": "string",
72     "VOCABULARY_URL": "string",
73     "FILE_VIEWERS_CONFIG_URL": "string",
74 }
75 ```
76
77 #### API_HOST
78
79 The Arvados base URL.
80
81 The `REACT_APP_ARVADOS_API_HOST` environment variable can be used to set the default URL if the run time configuration is unreachable.
82
83 #### VOCABULARY_URL
84 Local path, or any URL that allows cross-origin requests. See
85 [Vocabulary JSON file example](public/vocabulary-example.json).
86
87 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.
88
89 ### FILE_VIEWERS_CONFIG_URL
90 Local path, or any URL that allows cross-origin requests. See:
91
92 [File viewers config file example](public/file-viewers-example.json)
93
94 [File viewers config scheme](src/models/file-viewers-config.ts)
95
96 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.
97
98 ### Licensing
99
100 Arvados is Free Software. See COPYING for information about Arvados Free
101 Software licenses.