Skip to content

Commit b0b42ed

Browse files
committed
Merge pull request #6 from cbrainerd/feat_public_dev
Move development to the public repo
2 parents 6102e10 + 1430a82 commit b0b42ed

35 files changed

+1174
-59799
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
*.pyc
3+
dist
4+
env
5+
.coverage
6+
.cache
7+
stat_key_browser/data/key_cats.json
8+
stat_key_browser/data/key_tags.json
9+
web_app/js/keys.js
10+
web_app/index.html
11+
isilon_stat_browser_*.zip

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: python
2+
python:
3+
- "2.7"
4+
- "3.3"
5+
- "3.4"
6+
- "3.5"
7+
8+
virtualenv:
9+
system_site_packages: false
10+
11+
install:
12+
- pip install -r requirements-dev.txt
13+
- git clone https://github.com/Isilon/isilon_sdk_7_2_python.git
14+
- cd isilon_sdk_7_2_python
15+
- python setup.py install
16+
- cd ..
17+
18+
script:
19+
- make travis-ci

Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
PYTHON=`which python`
2+
PIP=`which pip`
3+
PYLINT=`which pylint`
4+
HEXAPARSE=./hexaparse.py
5+
6+
DIST_DIR=dist
7+
8+
clean:
9+
-rm -rf $(DIST_DIR)
10+
-rm -rf test_results
11+
-rm stat_key_browser/data/key_tags.json
12+
-rm stat_key_browser/data/key_cats.json
13+
-rm web_app/js/keys.js
14+
-rm web_app/index.html
15+
-rm isilon_stat_browser_v*.zip
16+
17+
tags:
18+
$(HEXAPARSE) stat_key_browser/data/key_tags.hexa > stat_key_browser/data/key_tags.json
19+
$(HEXAPARSE) stat_key_browser/data/key_cats.hexa > stat_key_browser/data/key_cats.json
20+
21+
lint:
22+
$(PYLINT) -E -f colorized -r n stat_key_browser bin/ tests/
23+
24+
unittests: lint
25+
$(PYTHON) -m pytest -v tests/unit/ *.py
26+
27+
coverage: lint
28+
$(PYTHON) -m pytest -v --cov=stat_key_browser --cov-report term-missing --cov-config tests/unit/.coveragerc tests/unit/ *.py
29+
30+
travis-ci: tags lint
31+
$(PYTHON) -m pytest -v tests/unit/ hexaparse.py
32+
33+
check_cluster:
34+
if [ -z $$BUILD_BROWSER_ARGS ]; then echo BUILD_BROWSER_ARGS not set, builder will pause for input; fi
35+
36+
functional_tests: check_cluster clean unittests tags
37+
$(PYTHON) -m pytest -v tests/functional/
38+
39+
dist: check_cluster clean unittests tags
40+
./build_stat_browser.py -x $(BUILD_BROWSER_ARGS)
41+
mkdir -p $(DIST_DIR)
42+
cp build_stat_browser.py $(DIST_DIR)
43+
cp requirements.txt $(DIST_DIR)
44+
cp README.md $(DIST_DIR)
45+
cp -r stat_key_browser $(DIST_DIR)
46+
cp -r web_app $(DIST_DIR)
47+
zip -r isilon_stat_browser_$$(git describe --exact-match --abbrev=0).zip dist/*

README-dev.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
[![Master Build Status](https://travis-ci.org/Isilon/isilon_stat_browser.svg?branch=master)](https://travis-ci.org/Isilon/isilon_stat_browser)
2+
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/isilon/isilon_stat_browser.svg)](http://isitmaintained.com/project/isilon/isilon_stat_browser "Average time to resolve an issue")
3+
[![Percentage of issues still open](http://isitmaintained.com/badge/open/isilon/isilon_stat_browser.svg)](http://isitmaintained.com/project/isilon/isilon_stat_browser "Percentage of issues still open")
4+
5+
#Statistics Key Browser Development
6+
7+
A single page web app that provides a browsable, searchable view of Isilon statistics keys. A Python script generates the html by querying an Isilon cluster for the list of statistics keys, then organizing and categorizing the keys before outputting the html app to web_app.
8+
9+
##Requirements
10+
Python: 2.7, 3.3, 3.4, 3.5
11+
12+
Dependencies listed in requirements-dev.txt
13+
14+
Isilon SDK Python language bindings
15+
16+
[`https://github.com/isilon/`](https://github.com/isilon)
17+
18+
##Development getting started
19+
20+
###Clone this repo:
21+
22+
`git clone <repo>`
23+
24+
`cd isilon_stat_browser`
25+
26+
### Install the dependencies:
27+
28+
`pip install -r requirements-dev.txt`
29+
30+
### Run unit tests:
31+
32+
`make unittests`
33+
34+
### Check unit test coverage:
35+
36+
`make coverage`
37+
38+
### Run functional tests:
39+
The functional tests are only a stub currently.
40+
41+
`make functional_tests`
42+
43+
###Run the page building tool
44+
45+
`./build_stat_browser.py -c <cluster IP>`
46+
47+
### Generate a distributable zip file:
48+
The build will pause to request cluster IP, username and password.
49+
50+
`make dist`
51+
52+
### Generate a distributable zip file non-interactively:
53+
54+
Supply the cluster IP, username and password when building via automation.
55+
56+
`make dist BUILD_BROWSER_ARGS='-c <cluster IP> -u <username> -p <password>'`
57+
58+
# Release process
59+
60+
**Note:**
61+
This is a temporary manual process to be used by repo owners to cut a release until automated build/release is implemented.
62+
63+
64+
Once the master branch is in a state ready for a release, tag the current commit
65+
with a version number.
66+
67+
`git tag -a v0.0.1 -m 'version 0.0.1'`
68+
69+
Push the tag to git
70+
71+
`git push origin v0.0.1`
72+
73+
This creates a release in [isilon\_stat\_browser/releases](../../releases)
74+
75+
Create the distribution for release
76+
77+
`make dist BUILD_BROWSER_ARGS='-c <cluster IP> -u <username> -p <password>'`
78+
79+
This creates a .zip file in the top-level project directory. The file will be
80+
automatically named with the version specified in the tag. If no version number
81+
appears in the file name something has gone wrong.
82+
83+
Go to [isilon\_stat\_browser/releases](../../releases) and draft a new release.
84+
Enter the tag into the tag version box and the tag should be recognized as an
85+
existing tag.
86+
87+
Enter any needed release notes
88+
89+
Attach the zipped release distribution to the release.
90+
91+
Publish the release.
92+
93+
# Files
94+
95+
* `README-dev.md`
96+
97+
The developer facing readme that you are reading now.
98+
99+
* `README.md`
100+
101+
The user-facing readme that gets packaged into the distributable zip.
102+
103+
* `stat_key_browser/data/key_cats.hexa`
104+
105+
A human written and readable file that defines which categories and subcategories are to be applied to lists of key names. Parsed into json by hexaparse.py during `make tags`.
106+
107+
* `stat_key_browser/data/key_cats.json`:
108+
109+
The automatically generated JSON that results when hexaparse.py parses key\_cats.hexa during the build process. This file is referenced by build\_stat\_browser.py to categorize stat keys received from PAPI.
110+
111+
* `stat_key_browser/data/key_tags.hexa`
112+
113+
A human written and readable file that defines which tags are to be applied to lists of key names. Parsed into json by hexaparse.py during the build process.
114+
115+
* `stat_key_browser/data/key_tags.json`:
116+
117+
The automatically generated JSON that results when hexaparse.py parsed key\_tags.hexa during the build process. This file is referenced by build\_stat\_browser.py to tag stat keys received from PAPI and is part of the distributable zip.
118+
119+
* `keys.js`
120+
121+
JSON formatted stat keys with tags and categories attached. This is created by build\_stat\_browser.py and read by the html app's JavaScript.
122+
123+
* `stat_key_browser/templates/app_template.html`
124+
125+
The main template for the app. Contains the main html plus categories.
126+
127+
* `stat_key_browser/template/key_template.html`
128+
129+
Contains a template representing a single key and all of its info, including its extra info.
130+
131+
* `web_app/index.html`
132+
133+
This is the file opened by the user to view the stat browser. This file is rendered by build_stat_browser.py from the templates, the definitions in key_tags.json and from the PAPI supplied list of keys.

README.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
1+
[![Master Build Status](https://travis-ci.org/Isilon/isilon_stat_browser.svg?branch=master)](https://travis-ci.org/Isilon/isilon_stat_browser)
2+
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/isilon/isilon_stat_browser.svg)](http://isitmaintained.com/project/isilon/isilon_stat_browser "Average time to resolve an issue")
3+
[![Percentage of issues still open](http://isitmaintained.com/badge/open/isilon/isilon_stat_browser.svg)](http://isitmaintained.com/project/isilon/isilon_stat_browser "Percentage of issues still open")
4+
15
#Statistics Key Browser
26

37
This repository is part of the Isilon SDK, which is an evolving package of documents and files. This README describes how to use the statistics key browser (stat browser) to browse the statistics keys that an Isilon cluster exposes. The stat browser is a Python script-generated web browser that provides a searchable list of OneFS statistics keys, organized by functional categories.
48

59
##Requirements
6-
Python 2.7 or 3.5
10+
11+
A compatible web browser:
12+
13+
* Google Chrome
14+
* Firefox
15+
* Safari
16+
* Internet Explorer 11
17+
* Microsoft Edge
718

819
##Installation
9-
You can obtain the files for the stat browser by cloning this Github repository:
20+
You can obtain the files for the stat browser by downloading a release zip file from this Github repository:
1021

11-
`git clone git@github.com/isilon/isilon_stat_browser.git`
22+
[isilon\_stat\_browser/releases](../../releases)
1223

13-
or by downloading the isilon_stat_browser zip file through the "Download ZIP" link and extracting the files.
24+
## Development
25+
26+
Developers can view the development readme for information about stat browser development.
27+
28+
[isilon\_stat\_browser/README-dev.md](README-dev.md)
1429

15-
`unzip <branch-name>.zip`
1630

1731
##View statistics keys with the stat browser
1832
Once the files and directories in the zip file are extracted, you will see a stat_key_browser directory. Open the web_app/index.html file in a web browser to browse the statistics keys available in the distribution package.
1933

2034
##Generate the stat browser
2135

22-
You can also generate the stat browser from your OneFS cluster by running the build_stat_browser.py Python script. You may want to perform this step on your version of OneFS because available statistics keys can vary between OneFS versions, so generating the keys will provide the most accurate list for your implementation.
36+
You can also generate the stat browser from your OneFS cluster by running the build\_stat\_browser.py Python script. You may want to perform this step on your version of OneFS because available statistics keys can vary between OneFS versions, so generating the keys will provide the most accurate list for your implementation. During the generation process, your cluster will be queried for its list of statistc keys to generate the stat browser.
37+
38+
### Requirements
39+
Python: 2.7, 3.3, 3.4, 3.5
40+
41+
Isilon SDK Python Language Bindings installed
42+
43+
### Generating the stat browser
2344

2445
First unpack the zip file as described above and then install the requirements.
2546

@@ -29,16 +50,19 @@ Next run the page builder:
2950

3051
`./build_stat_browser.py --cluster <hostname-or-ip-address>`
3152

32-
For help on the build_stat_browser.py usage, run:
53+
For help on build\_stat\_browser.py usage, run:
3354

3455
`./build_stat_browser.py --help`
3556

36-
The script will prompt you for a username and password, and will create the browsable web_app/index.html page and key_cats.json Java script which contains the statistics keys categories.
57+
The script will prompt you for a username and password, and will create the browsable web\_app/index.html page and key\_cats.json Java script which contains the statistics keys categories.
3758

3859
##Install SDK Python language bindings
3960

40-
You can use the SDK Python language bindings to automate the configuration, maintenance, and monitoring of your Isilon cluster. For information on how to install the Python language bindings and write Python scripts to access the OneFS API, refer to the following Github site:
41-
[`https://github.west.isilon.com/eng-axp/isi_sdk_python`](https://github.west.isilon.com/eng-axp/isi_sdk_python)
61+
You can use the SDK Python language bindings to automate the configuration, maintenance, and monitoring of your Isilon cluster. For information on how to install the Python language bindings and write Python scripts to access the OneFS API, refer to the following Github sites:
62+
63+
[`https://github.com/Isilon/isilon_sdk_7_2_python`](https://github.com/Isilon/isilon_sdk_7_2_python)
64+
[`https://github.com/Isilon/isilon_sdk_8_0_python`](https://github.com/Isilon/isilon_sdk_8_0_python)
65+
4266

4367
Copyright (c) 2016 EMC Corporation
4468

@@ -59,4 +83,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5983
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
6084
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
6185
SOFTWARE.
62-

build_stat_browser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def build_browser():
3838
(opts, args) = parser.parse_args()
3939

4040
if opts.cluster is None:
41-
print('--cluster <IP> is required')
42-
sys.exit(1)
41+
opts.cluster = input('Cluster IP or hostname: ')
4342

4443
if opts.debug:
4544
log_lvl = logging.DEBUG

0 commit comments

Comments
 (0)