Spaces:
Paused
Paused
File size: 2,758 Bytes
8bd7be8 24d6cbb 8bd7be8 24d6cbb 8bd7be8 522862b 182f186 e72c3bc 8bd7be8 b74040e 8bd7be8 0d71d26 8bd7be8 0d71d26 8bd7be8 182f186 0d71d26 8bd7be8 182f186 0d71d26 8bd7be8 139660c cdd9ba7 139660c 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 55 56 57 58 59 60 61 62 63 64 65 66 67 |
#!/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
cat src/main/application/services.xml|sed 's/<redundancy>2<\/redundancy>/<redundancy>2<\/redundancy><tuning><resource-limits><disk>0.95<\/disk><\/resource-limits><\/tuning>/' > src/main/application/services.xml.new
mv src/main/application/services.xml.new src/main/application/services.xml
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 |zstd > feed_items.json.zstd
rm meta_sports_20k_sample.json meta_sports_20k_sample.json.zst
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 |zstd > feed_reviews.json.zstd
rm reviews_sports_24k_sample.json reviews_sports_24k_sample.json.zst
df -h /opt/vespa/var
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
chmod +x ./vespa-feed-client-cli/vespa-feed-client
ls -lart ./vespa-feed-client-cli/vespa-feed-client
zstdcat feed_items.json.zstd|./vespa-feed-client-cli/vespa-feed-client \
--verbose --stdin --show-errors --endpoint http://localhost:8080
zstdcat feed_reviews.json.zstd|./vespa-feed-client-cli/vespa-feed-client \
--verbose --stdin --show-errors --endpoint http://localhost:8080
echo "Starting proxy server"
/opt/vespa/vespa/bin/proxy.py
echo "Proxy server died"
FORMAT="${VESPA_LOG_FORMAT:-vespa}"
/opt/vespa/bin/vespa-logfmt --follow --format "$FORMAT" ${VESPA_LOGFMT_ARGUMENTS} &
wait
|