Spaces:
Paused
Paused
# 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 | |