Spaces:
Paused
Paused
Create run.sh
Browse files
run.sh
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
|
3 |
+
|
4 |
+
set -e
|
5 |
+
|
6 |
+
export VESPA_CONFIGSERVER_JVMARGS="-Xms32M -Xmx128M"
|
7 |
+
export VESPA_CONFIGPROXY_JVMARGS="-Xms32M -Xmx32M"
|
8 |
+
export VESPA_CONFIGSERVERS=$(hostname)
|
9 |
+
export VESPA_CLI_HOME=/tmp/.vespa
|
10 |
+
export VESPA_CLI_CACHE_DIR=/tmp/.cache/vespa
|
11 |
+
|
12 |
+
trap cleanup TERM INT
|
13 |
+
|
14 |
+
cleanup() {
|
15 |
+
/opt/vespa/bin/vespa-stop-services
|
16 |
+
exit $?
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
/opt/vespa/bin/vespa-start-configserver
|
21 |
+
/opt/vespa/bin/vespa-start-services
|
22 |
+
|
23 |
+
export HOME=/tmp/
|
24 |
+
cd $HOME
|
25 |
+
/opt/vespa/bin/vespa clone use-case-shopping myapp && cd myapp
|
26 |
+
|
27 |
+
export MAVEN_HOME=/opt/maven
|
28 |
+
export JAVA_HOME=/usr/
|
29 |
+
export PATH=$MAVEN_HOME/bin/:$PATH
|
30 |
+
mvn clean package -U
|
31 |
+
/opt/vespa/bin/vespa deploy --wait 300
|
32 |
+
|
33 |
+
#Feed data
|
34 |
+
curl -L -o meta_sports_20k_sample.json.zst https://data.vespa.oath.cloud/sample-apps-data/meta_sports_20k_sample.json.zst
|
35 |
+
zstd -d meta_sports_20k_sample.json.zst
|
36 |
+
cat meta_sports_20k_sample.json | ./convert_meta.py > feed_items.json
|
37 |
+
|
38 |
+
curl -L -o reviews_sports_24k_sample.json.zst https://data.vespa.oath.cloud/sample-apps-data/reviews_sports_24k_sample.json.zst
|
39 |
+
zstd -d reviews_sports_24k_sample.json.zst
|
40 |
+
cat reviews_sports_24k_sample.json | ./convert_reviews.py > feed_reviews.json
|
41 |
+
|
42 |
+
FEED_CLI_REPO="https://repo1.maven.org/maven2/com/yahoo/vespa/vespa-feed-client-cli" \
|
43 |
+
&& FEED_CLI_VER=$(curl -Ss "${FEED_CLI_REPO}/maven-metadata.xml" | sed -n 's/.*<release>\(.*\)<.*>/\1/p') \
|
44 |
+
&& curl -SsLo vespa-feed-client-cli.zip ${FEED_CLI_REPO}/${FEED_CLI_VER}/vespa-feed-client-cli-${FEED_CLI_VER}-zip.zip \
|
45 |
+
&& unzip -o vespa-feed-client-cli.zip
|
46 |
+
|
47 |
+
./vespa-feed-client-cli/vespa-feed-client \
|
48 |
+
--verbose --file feed_items.json --endpoint http://localhost:8080
|
49 |
+
|
50 |
+
./vespa-feed-client-cli/vespa-feed-client \
|
51 |
+
--verbose --file feed_reviews.json --endpoint http://localhost:8080
|
52 |
+
|
53 |
+
FORMAT="${VESPA_LOG_FORMAT:-vespa}"
|
54 |
+
/opt/vespa/bin/vespa-logfmt --follow --format "$FORMAT" ${VESPA_LOGFMT_ARGUMENTS} &
|
55 |
+
wait
|