Spaces:
Paused
Paused
File size: 2,075 Bytes
8bd7be8 24d6cbb 8bd7be8 24d6cbb 8bd7be8 e72c3bc 8bd7be8 b74040e 8bd7be8 24d6cbb 8bd7be8 24d6cbb 8bd7be8 |
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 |
#!/bin/bash
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e
export VESPA_CONFIGSERVERS=$(hostname)
export VESPA_CLI_HOME=/tmp/.vespa
export VESPA_CLI_CACHE_DIR=/tmp/.cache/vespa
trap cleanup TERM INT
cleanup() {
/opt/vespa/bin/vespa-stop-services
exit $?
}
VESPA_CONFIGSERVER_JVMARGS="-Xms32M -Xmx128M" /opt/vespa/bin/vespa-start-configserver
VESPA_CONFIGPROXY_JVMARGS="-Xms32M -Xmx32M" /opt/vespa/bin/vespa-start-services
export HOME=/tmp/
cd $HOME
/opt/vespa/bin/vespa clone use-case-shopping myapp && cd myapp
wget https://dlcdn.apache.org/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-bin.tar.gz && tar zxvpf apache-maven-3.9.0-bin.tar.gz
export JAVA_HOME=/usr/
./apache-maven-3.9.0/bin/mvn clean package -U
/opt/vespa/bin/vespa deploy --wait 300
#Feed data
curl -L -o meta_sports_20k_sample.json.zst https://data.vespa.oath.cloud/sample-apps-data/meta_sports_20k_sample.json.zst
zstd -d meta_sports_20k_sample.json.zst
cat meta_sports_20k_sample.json | ./convert_meta.py > feed_items.json
curl -L -o reviews_sports_24k_sample.json.zst https://data.vespa.oath.cloud/sample-apps-data/reviews_sports_24k_sample.json.zst
zstd -d reviews_sports_24k_sample.json.zst
cat reviews_sports_24k_sample.json | ./convert_reviews.py > feed_reviews.json
FEED_CLI_REPO="https://repo1.maven.org/maven2/com/yahoo/vespa/vespa-feed-client-cli" \
&& FEED_CLI_VER=$(curl -Ss "${FEED_CLI_REPO}/maven-metadata.xml" | sed -n 's/.*<release>\(.*\)<.*>/\1/p') \
&& curl -SsLo vespa-feed-client-cli.zip ${FEED_CLI_REPO}/${FEED_CLI_VER}/vespa-feed-client-cli-${FEED_CLI_VER}-zip.zip \
&& unzip -o vespa-feed-client-cli.zip
./vespa-feed-client-cli/vespa-feed-client \
--verbose --file feed_items.json --show-errors --endpoint http://localhost:8080
./vespa-feed-client-cli/vespa-feed-client \
--verbose --file feed_reviews.json --show-errors --endpoint http://localhost:8080
FORMAT="${VESPA_LOG_FORMAT:-vespa}"
/opt/vespa/bin/vespa-logfmt --follow --format "$FORMAT" ${VESPA_LOGFMT_ARGUMENTS} &
wait
|