forked from ooici/ion-ux
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
103 lines (62 loc) · 3.47 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
ION-UX Setup
============
Getting ION-UX up and running is straightforward once you have a Capability Container running. In a nutshell, there are three steps with an optional fourth step:
1.) Create virtualenv and install dependencies
2.) Configure FLASK, GATEWAY and PORTAL_ROOT settings
3.) Launch Flask web application
4.) Load "preload data" (test data) into COI Servies
1. Environment Setup
--------------------
It is best to setup a virtualenv to install the dependencies (Flask, requests).
virtualenv --no-site-packages venv
pip install Flask -E venv/
source venv/bin/activate
pip install requests
2. Deploy Local
---------------
First, copy the config template file and enter appropriate values for your local machine.
cp config.py.template config.py
For the most common scenario (i.e. running the UI on your development environment), the settings will look like this:
* FLASK_HOST = 'localhost'
* FLASK_PORT = 3000
* GATEWAY_HOST = 'localhost'
* GATEWAY_PORT = 5000
* PORTAL_ROOT = 'working/path/to/ion-ux/'
Next, make sure to create a log file (ion-ux.log) in the root directory.
3. Run Local
------------
To run locally, simply execute the main module, be sure that PORTAL_ROOT is specified in config.py.
python main.py
Point your browser to http://localhost:3000 and enjoy.
### Current features (in progress)
* Flask powered API (using mock data and calls to the service gateway)
* Continued development of JavaScript/CSS.
* Development of dynamic layouts defined by JSON
4. Load Data into COI Services
------------------------------
See also: ION-UX Guide for COI Developers
https://confluence.oceanobservatories.org/display/CIDev/ION-UX+Guide+for+COI+Developers
It will be a better browsing experience to have data preloaded into your COI Services Capability Container. The first thing you will want to do is create pyon.local.yml:
coi-services/res/config/pylon.local.yml
In pyon.local.yml:
system:
force_clean: False
name: ionux
The name above ensures that your Capability Container will always use the same system name for creating, clearing and loading the data in CouchDB. After lauching you Capability Container with pyon.local.yml enabled, enter one of the following commands in another terminal window:
Beta Preload
bin/pycc -x ion.processes.bootstrap.ion_loader.IONLoader op=load loadui=true scenario=BASE,BETA path=master ui_path='https://userexperience.oceanobservatories.org/database-exports' attachments=res/preload/r2_ioc/attachments
To clear preload data, exit out of the running Capability Container and enter:
bin/pycc -x ion.processes.bootstrap.datastore_loader.DatastoreLoader op=clear
5. Release
----------------
A fab script has been provided to tag specific releases of this software. You need to be in a virtualenv with 'fabric' installed before running following command:
fab -f fabrelease.py release
6. Deploy Remote
----------------
A fab script has been provided to facilitate deployment to a remote VM. To prepare to run the fab script, be sure to install fabric.
easy_install fabric
Now you run the fab script, which will prompt you for necessary information to complete the deployment. Currently, the script supports deployment to ion systems listed below. You should deploy as the 'ux' user which needs to be configured by operations (with your ssh key). Utilize one of the following command lines to deploy.
> fab ion_dev deploy
> fab ion_alpha deploy
> fab ion_beta deploy
> fab ion_stage deploy