Skip to content

Commit a05bf95

Browse files
committed
Fixing nvm issues
1 parent 6739dd4 commit a05bf95

File tree

3 files changed

+49
-34
lines changed

3 files changed

+49
-34
lines changed

docs/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ Currently we support ```GROUP``` aggregations on the following operations:
9797
| Operation | Meaning |
9898
| -------------- | ------- |
9999
| COUNT | Computes the number of the elements in the group |
100-
| SUM | Computes the sum of the elements in the group |
101-
| MIN | Returns the minimum of the elements in the group |
102-
| MAX | Returns the maximum of the elements in the group |
103-
| AVG | Computes the average of the elements in the group |
100+
| SUM | Computes the sum of the non-null values in the provided field for all elements in the group |
101+
| MIN | Returns the minimum of the non-null values in the provided field for all the elements in the group |
102+
| MAX | Returns the maximum of the non-null values in the provided field for all the elements in the group |
103+
| AVG | Computes the average of the non-null values in the provided field for all the elements in the group |
104104

105105
# Results
106106

docs/quick-start.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,21 @@ By the following the steps in this section, you will:
1010

1111
**Prerequisites**
1212

13-
* You will need to be on an Unix-based system (Mac OS X, Ubuntu ...)
14-
* You will need [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed.
15-
* You will need enough CPU and RAM on your machine to run about 8-10 JVMs. You will be setting up a Storm cluster with multiple components, a couple of Jetty instances and a Node server
13+
* You will need to be on an Unix-based system (Mac OS X, Ubuntu ...) with ```curl``` installed
14+
* You will need [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed
15+
* You will need enough CPU and RAM on your machine to run about 8-10 JVMs in ```server``` mode. You should have at least 2 GB free space on your disk. We will be setting up a Storm cluster with multiple components, a couple of Jetty instances and a Node server.
1616

1717
## Quicker Start
1818

19-
Don't want to follow all these Steps? Make sure you have your prerequisites installed and you can just run:
19+
Don't want to follow all these Steps? Make sure you have your prerequisites and you can just run:
2020

2121
```bash
22-
export BULLET_HOME=$(pwd)/bullet-quickstart
23-
curl -sLo- https://raw.githubusercontent.com/yahoo/bullet-docs/v0.1.3/examples/install-all.sh | bash
22+
curl -sLo- https://raw.githubusercontent.com/yahoo/bullet-docs/v0.1.4/examples/install-all.sh | bash
2423
```
2524

2625
This will run all the Steps for you. Once everything has launched, you should be able to go to the Bullet UI running locally at [http://localhost:8800](http://localhost:8800). You can then continue this guide from [here](#what-did-we-do).
2726

28-
If you want to manually run all the commands or if something failed above (might want to perform the [teardown](#teardown) first), you can continue below.
27+
If you want to manually run all the commands or if something failed above (might want to perform the [teardown](#teardown) first), you can continue below.
2928

3029
---
3130

@@ -42,7 +41,7 @@ mkdir -p $BULLET_HOME/backend/storm
4241
mkdir -p $BULLET_HOME/service
4342
mkdir -p $BULLET_HOME/ui
4443
cd $BULLET_HOME
45-
curl -LO https://github.com/yahoo/bullet-docs/releases/download/v0.1.3/examples_artifacts.tar.gz
44+
curl -LO https://github.com/yahoo/bullet-docs/releases/download/v0.1.4/examples_artifacts.tar.gz
4645
tar -xzf examples_artifacts.tar.gz
4746
export BULLET_EXAMPLES=$BULLET_HOME/bullet-examples
4847
```
@@ -221,7 +220,13 @@ Visit [http://localhost:8800](http://localhost:8800) to query your topology with
221220

222221
## Teardown
223222

224-
To cleanup all the components we bought up:
223+
If you were following the [Quicker Start](#quicker-start) or if you don't want to manually bring down everything, you can run:
224+
225+
```bash
226+
curl -sLo- https://raw.githubusercontent.com/yahoo/bullet-docs/v0.1.4/examples/install-all.sh | bash -s cleanup
227+
```
228+
229+
If you were performing the steps yourself, you can also manually cleanup all the components we bought up using:
225230

226231
| | |
227232
| -------------- | ----------------------------------------------------------------------------------- |
@@ -230,10 +235,7 @@ To cleanup all the components we bought up:
230235
| Storm | ```ps aux | grep [a]pache-storm-1.0.3 | awk '{print $2}' | xargs kill``` |
231236
| File System | ```rm -rf $BULLET_HOME /tmp/dev-storm-zookeeper /tmp/jetty-*``` |
232237

233-
You can also do:
234-
```bash
235-
curl -sLo- https://raw.githubusercontent.com/yahoo/bullet-docs/v0.1.3/examples/install-all.sh | bash -s cleanup
236-
```
238+
This does *not* delete ```$HOME/.nvm``` and some extra lines nvm may have added to your ```$HOME/{.profile, .bash_profile, .zshrc, .bashrc}```.
237239

238240
## What did we do?
239241

@@ -411,4 +413,6 @@ Finally, we configured the UI with the custom environment specific settings file
411413

412414
Since we served our schema through the same Web Service as our queries, both these point to our Web Service. Note that there is no ```schemaPath``` because it must be the constant string ```columns```. If you define a custom endpoint for your schema, you must ensure that it can be obtained by making a GET request to ```schemaHost/schemaNamespace/columns```.
413415

414-
The [UI Usage](ui/usage.md) page shows you some queries you can run using one such instance of the UI.
416+
## Playing around with the instance
417+
418+
The [UI Usage](ui/usage.md) page shows you some queries you can run using this UI.

examples/install-all.sh

+27-16
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
set -euo pipefail
44

5-
6-
BULLET_EXAMPLES_VERSION=0.1.3
5+
BULLET_EXAMPLES_VERSION=0.1.4
76
BULLET_UI_VERSION=0.1.0
87
BULLET_WS_VERSION=0.0.1
98
JETTY_VERSION=9.3.16.v20170120
@@ -15,7 +14,7 @@ println() {
1514
local DATE="$(date)"
1615
local FORMAT=$1
1716
shift
18-
printf "\n${DATE} [BULLET-QUICKSTART]: "
17+
printf "${DATE} [BULLET-QUICKSTART]: "
1918
printf "${FORMAT}\n" $*
2019
}
2120

@@ -51,7 +50,7 @@ setup() {
5150
install_bullet_examples() {
5251
cd "${BULLET_HOME}"
5352
println "Downloading Bullet Examples ${BULLET_EXAMPLES_VERSION}..."
54-
curl -#LO "https://github.com/yahoo/bullet-docs/releases/download/v${BULLET_EXAMPLES_VERSION}/examples_artifacts.tar.gz"
53+
curl --retry 2 -#LO "https://github.com/yahoo/bullet-docs/releases/download/v${BULLET_EXAMPLES_VERSION}/examples_artifacts.tar.gz"
5554
println "Installing Bullet Examples..."
5655
tar -xzf examples_artifacts.tar.gz
5756
println "Done!"
@@ -63,7 +62,7 @@ install_storm() {
6362
cd "${BULLET_HOME}/backend"
6463

6564
println "Downloading Storm ${STORM_VERSION}..."
66-
curl -#O "http://apache.org/dist/storm/${STORM}/${STORM}.zip"
65+
curl --retry 2 -#O "http://apache.org/dist/storm/${STORM}/${STORM}.zip"
6766

6867
println "Installing Storm ..."
6968
unzip -qq "${STORM}.zip"
@@ -94,9 +93,10 @@ launch_storm() {
9493
storm supervisor &
9594

9695
println "Sleeping for 60 s to ensure all components are up..."
97-
println "====================================================================================================="
96+
println "=============================================================================="
9897
sleep 60
99-
println "====================================================================================================="
98+
println "=============================================================================="
99+
println ""
100100
println "Done!"
101101
}
102102

@@ -110,6 +110,8 @@ launch_bullet_storm() {
110110
println "Sleeping for 30 s to ensure all Bullet Storm components are up..."
111111
sleep 30
112112

113+
println "Testing the Storm topology"
114+
println ""
113115
println "Getting one random record from the Bullet topology..."
114116
curl -s -X POST -d '{}' http://localhost:3774/drpc/bullet
115117
println "Done!"
@@ -119,7 +121,7 @@ install_jetty() {
119121
cd "${BULLET_HOME}/service"
120122

121123
println "Downloading Jetty ${JETTY_VERSION}..."
122-
curl -#O "http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/${JETTY_VERSION}/jetty-distribution-${JETTY_VERSION}.zip"
124+
curl --retry 2 -#O "http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/${JETTY_VERSION}/jetty-distribution-${JETTY_VERSION}.zip"
123125

124126
println "Installing Jetty..."
125127
unzip -qq "jetty-distribution-${JETTY_VERSION}.zip"
@@ -130,7 +132,7 @@ launch_bullet_web_service() {
130132
cd "${BULLET_HOME}/service/jetty-distribution-${JETTY_VERSION}"
131133

132134
println "Downloading Bullet Web Service ${BULLET_WS_VERSION}..."
133-
curl -#Lo webapps/bullet-service.war \
135+
curl --retry 2 -#Lo webapps/bullet-service.war \
134136
"http://jcenter.bintray.com/com/yahoo/bullet/bullet-service/${BULLET_WS_VERSION}/bullet-service-${BULLET_WS_VERSION}.war"
135137

136138
println "Configuring Bullet Web Service..."
@@ -143,22 +145,29 @@ launch_bullet_web_service() {
143145
println "Sleeping for 30 s to ensure Bullet Web Service is up..."
144146
sleep 30
145147

148+
println "Testing the Web Service"
149+
println ""
146150
println "Getting one random record from Bullet through the Web Service..."
147151
curl -s -X POST -d '{}' http://localhost:9999/bullet-service/api/drpc
152+
println ""
148153
println "Getting column schema from the Web Service..."
154+
println ""
149155
curl -s http://localhost:9999/bullet-service/api/columns
150156
println "Finished Bullet Web Service test"
151157
}
152158

153159
install_node() {
154160
println "Downloading and installing NVM ${NVM_VERSION}..."
155-
curl -s "https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh" | bash
156-
157-
source ~/.bashrc
158-
println "Installing Node ${NODE_VERSION}..."
161+
curl --retry 2 -s "https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh" | bash
159162

160163
# NVM unset var bug
161164
set +u
165+
println "Loading nvm into current environment if installation successful..."
166+
export NVM_DIR="$HOME/.nvm"
167+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
168+
println "Done!"
169+
170+
println "Installing Node ${NODE_VERSION}..."
162171
nvm install "v${NODE_VERSION}"
163172
nvm use "v${NODE_VERSION}"
164173
set -u
@@ -170,7 +179,7 @@ launch_bullet_ui() {
170179
cd "${BULLET_HOME}/ui"
171180

172181
println "Downloading Bullet UI ${BULLET_UI_VERSION}..."
173-
curl -#LO "https://github.com/yahoo/bullet-ui/releases/download/v${BULLET_UI_VERSION}/bullet-ui-v${BULLET_UI_VERSION}.tar.gz"
182+
curl --retry 2 -#LO "https://github.com/yahoo/bullet-ui/releases/download/v${BULLET_UI_VERSION}/bullet-ui-v${BULLET_UI_VERSION}.tar.gz"
174183

175184
println "Installing Bullet UI..."
176185
tar -xzf "bullet-ui-v${BULLET_UI_VERSION}.tar.gz"
@@ -189,11 +198,13 @@ launch_bullet_ui() {
189198
cleanup() {
190199
set +eo pipefail
191200

201+
ps aux | grep "[a]pache-storm-${STORM_VERSION}" | awk '{print $2}' | xargs kill
202+
192203
ps aux | grep "[e]xpress-server.js" | awk '{print $2}' | xargs kill
193204

194205
ps aux | grep "[e]xample_context.properties" | awk '{print $2}' | xargs kill
195206

196-
ps aux | grep "[a]pache-storm-${STORM_VERSION}" | awk '{print $2}' | xargs kill
207+
sleep 3
197208

198209
rm -rf "${BULLET_HOME}" /tmp/dev-storm-zookeeper /tmp/jetty-*
199210

@@ -203,7 +214,7 @@ cleanup() {
203214
teardown() {
204215
println "Killing and cleaning up all Bullet components..."
205216
cleanup &> /dev/null
206-
println "Done!"
217+
println "Done! Not deleting $HOME/.nvm..."
207218
}
208219

209220
unset_all() {

0 commit comments

Comments
 (0)