Skip to content

Commit

Permalink
Merge branch 'master' into interns/magnus/servicesxml
Browse files Browse the repository at this point in the history
  • Loading branch information
Mangern committed Oct 25, 2024
2 parents 882d580 + 9b94159 commit 2048512
Show file tree
Hide file tree
Showing 405 changed files with 5,184 additions and 3,143 deletions.
1 change: 1 addition & 0 deletions .buildkite/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
export TOP := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

export ARCH ?= $(shell if [[ $$(arch) == x86_64 ]]; then echo amd64; else echo arm64; fi)
Expand Down
1 change: 1 addition & 0 deletions .buildkite/basic-search-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
2 changes: 2 additions & 0 deletions .buildkite/bootstrap-cmake.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

# shellcheck disable=1091
source /etc/profile.d/enable-gcc-toolset.sh

VESPA_CMAKE_SANITIZERS_OPTION=""
Expand Down
1 change: 1 addition & 0 deletions .buildkite/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/build-container.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/build-rpms.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/cpp-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
2 changes: 2 additions & 0 deletions .buildkite/cpp.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

# shellcheck disable=1091
source /etc/profile.d/enable-gcc-toolset.sh

cd "$SOURCE_DIR"
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion .buildkite/execute.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand All @@ -7,7 +8,7 @@ if [[ $# != 1 ]]; then
exit 1
fi

readonly MYDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )"
MYDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )"
readonly STEP=$1
readonly VERBOSE=${VERBOSE:-}

Expand Down
1 change: 1 addition & 0 deletions .buildkite/go.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
2 changes: 2 additions & 0 deletions .buildkite/java.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

# shellcheck disable=1091
source /etc/profile.d/enable-gcc-toolset.sh

cd "$SOURCE_DIR"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/plugins/factory-reporter/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Factory Reporter Buildkite Plugin
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

Reports a build to Vespa Factory

Expand Down
1 change: 1 addition & 0 deletions .buildkite/plugins/factory-reporter/hooks/pre-command
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/plugins/factory-reporter/hooks/pre-exit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -eo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/plugins/factory-reporter/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
name: Factory Reporter
description: Reports build pipeline status to Vespa Factory
author: https://github.com/vespa-engine
Expand Down
3 changes: 2 additions & 1 deletion .buildkite/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

"$SOURCE_DIR/screwdriver/replace-vespa-version-in-poms.sh" "$VESPA_VERSION" "$SOURCE_DIR"
"$SOURCE_DIR/.buildkite/replace-vespa-version-in-poms.sh" "$VESPA_VERSION" "$SOURCE_DIR"

# We disable javadoc for all modules not marked as public API
for MODULE in $(comm -2 -3 \
Expand Down
1 change: 1 addition & 0 deletions .buildkite/publish-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
1 change: 1 addition & 0 deletions .buildkite/publish-container.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand Down
3 changes: 2 additions & 1 deletion .buildkite/quick-start-guide.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail

Expand All @@ -7,4 +8,4 @@ if [[ $VESPA_USE_SANITIZER != null ]]; then
exit 0
fi

"$SOURCE_DIR/screwdriver/test-quick-start-guide.sh"
"$SOURCE_DIR/.buildkite/test-quick-start-guide.sh"
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/ssh-agent /bin/bash
# shellcheck shell=bash disable=SC1008
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

set -euo pipefail
Expand All @@ -16,16 +17,17 @@ if [[ -z "$ANN_BENCHMARK_DEPLOY_TOKEN" ]]; then
fi

BUILD_DIR=$(mktemp -d)
# shellcheck disable=2064
trap "rm -rf $BUILD_DIR" EXIT
cd $BUILD_DIR
cd "$BUILD_DIR"

ssh-add -D
ssh-add <(echo $ANN_BENCHMARK_DEPLOY_TOKEN | base64 -d)
ssh-add <(echo "$ANN_BENCHMARK_DEPLOY_TOKEN" | base64 -d)
git clone [email protected]:vespa-engine/vespa-ann-benchmark
cd vespa-ann-benchmark

RELEASE_TAG="v$VESPA_VERSION"
if ! git rev-parse $RELEASE_TAG &> /dev/null; then
if ! git rev-parse "$RELEASE_TAG" &> /dev/null; then
git tag -a "$RELEASE_TAG" -m "Release version $VESPA_VERSION"
git push origin "$RELEASE_TAG"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ $# -ne 1 ]]; then
fi

readonly VESPA_VERSION=$1
readonly VESPA_MAJOR=$(echo $VESPA_VERSION | cut -d. -f1)
VESPA_MAJOR=$(echo "$VESPA_VERSION" | cut -d. -f1)

if [[ -z "$DOCKER_HUB_DEPLOY_TOKEN" ]]; then
echo "Environment variable DOCKER_HUB_DEPLOY_TOKEN must be set, but is empty."
Expand All @@ -20,33 +20,33 @@ if [[ -z "$GHCR_DEPLOY_TOKEN" ]]; then
exit 1
fi

crane auth login -u aressem -p $GHCR_DEPLOY_TOKEN ghcr.io
SRC_IMAGE=ghcr.io/vespa-engine/vespa-preview:$VESPA_VERSION
SRC_IMAGE_DIGEST=$(crane digest $SRC_IMAGE)
crane auth login -u aressem -p "$GHCR_DEPLOY_TOKEN" ghcr.io
SRC_IMAGE="ghcr.io/vespa-engine/vespa-preview:$VESPA_VERSION"
SRC_IMAGE_DIGEST=$(crane digest "$SRC_IMAGE")
cosign verify \
--certificate-identity https://buildkite.com/vespaai/vespa-engine-vespa \
--certificate-oidc-issuer https://agent.buildkite.com \
$SRC_IMAGE@$SRC_IMAGE_DIGEST
"$SRC_IMAGE@$SRC_IMAGE_DIGEST"

# Copy to Docker Hub
if curl -fsSL https://hub.docker.com/v2/repositories/vespaengine/vespa/tags/$VESPA_VERSION &> /dev/null; then
if curl -fsSL "https://hub.docker.com/v2/repositories/vespaengine/vespa/tags/$VESPA_VERSION" &> /dev/null; then
echo "Container image docker.io/vespaengine/vespa:$VESPA_VERSION already exists."
else
DST_IMAGE=docker.io/vespaengine/vespa:$VESPA_VERSION
crane auth login -u aressem -p $DOCKER_HUB_DEPLOY_TOKEN docker.io
crane cp $SRC_IMAGE@$SRC_IMAGE_DIGEST $DST_IMAGE
crane tag $DST_IMAGE $VESPA_MAJOR
crane tag $DST_IMAGE latest
DST_IMAGE="docker.io/vespaengine/vespa:$VESPA_VERSION"
crane auth login -u aressem -p "$DOCKER_HUB_DEPLOY_TOKEN" docker.io
crane cp "$SRC_IMAGE@$SRC_IMAGE_DIGEST" "$DST_IMAGE"
crane tag "$DST_IMAGE" "$VESPA_MAJOR"
crane tag "$DST_IMAGE" latest
fi

# Copy to GitHub Container Registry
JWT=$(curl -sSL -u aressem:$GHCR_DEPLOY_TOKEN "https://ghcr.io/token?service=ghcr.io&scope=repository:vespa-engine/vespa:pull" | jq -re '.token')
JWT=$(curl -sSL -u "aressem:$GHCR_DEPLOY_TOKEN" "https://ghcr.io/token?service=ghcr.io&scope=repository:vespa-engine/vespa:pull" | jq -re '.token')
IMAGE_TAGS=$(curl -sSL -H "Authorization: Bearer $JWT" https://ghcr.io/v2/vespa-engine/vespa/tags/list | jq -re '.tags[]')
if grep $VESPA_VERSION <<< "$IMAGE_TAGS" &> /dev/null; then
if grep "$VESPA_VERSION" <<< "$IMAGE_TAGS" &> /dev/null; then
echo "Container image ghcr.io/vespa-engine/vespa:$VESPA_VERSION already exists."
else
DST_IMAGE=ghcr.io/vespa-engine/vespa:$VESPA_VERSION
crane cp $SRC_IMAGE@$SRC_IMAGE_DIGEST $DST_IMAGE
crane tag $DST_IMAGE $VESPA_MAJOR
crane tag $DST_IMAGE latest
DST_IMAGE="ghcr.io/vespa-engine/vespa:$VESPA_VERSION"
crane cp "$SRC_IMAGE@$SRC_IMAGE_DIGEST" "$DST_IMAGE"
crane tag "$DST_IMAGE" "$VESPA_MAJOR"
crane tag "$DST_IMAGE" latest
fi
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ fi
readonly VESPA_VERSION=$1
readonly IMAGE_NAME="vespaengine/vespa-generic-intel-x86_64"

if curl -fsSL https://hub.docker.com/v2/repositories/$IMAGE_NAME/tags/$VESPA_VERSION/ &> /dev/null; then
if curl -fsSL "https://hub.docker.com/v2/repositories/$IMAGE_NAME/tags/$VESPA_VERSION/" &> /dev/null; then
echo "Container image docker.io/$IMAGE_NAME:$VESPA_VERSION aldready exists."
exit 0
fi

TMPDIR=$(mktemp -d)
# shellcheck disable=2064
trap "rm -rf $TMPDIR" EXIT

pushd $TMPDIR
pushd "$TMPDIR"
git clone -q --filter tree:0 https://github.com/vespa-engine/vespa
(cd vespa && git checkout v$VESPA_VERSION)
(cd vespa && screwdriver/replace-vespa-version-in-poms.sh $VESPA_VERSION $(pwd) )
(cd vespa && git checkout "v$VESPA_VERSION")
(cd vespa && .buildkite/replace-vespa-version-in-poms.sh "$VESPA_VERSION" "$(pwd)" )

make -C vespa -f .copr/Makefile srpm outdir=$(pwd)
make -C vespa -f .copr/Makefile srpm outdir="$(pwd)"

rpmbuild --rebuild \
--define="_topdir $TMPDIR/vespa-rpmbuild" \
--define "debug_package %{nil}" \
--define "_debugsource_template %{nil}" \
--define '_cmake_extra_opts "-DDEFAULT_VESPA_CPU_ARCH_FLAGS=-msse3 -mcx16 -mtune=intel"' \
*.src.rpm
./*.src.rpm

rm -f *.src.rpm
mv $TMPDIR/vespa-rpmbuild/RPMS/*/*.rpm .
rm -f ./*.src.rpm
mv "$TMPDIR"/vespa-rpmbuild/RPMS/*/*.rpm .

cat <<EOF > Dockerfile
ARG VESPA_VERSION
Expand All @@ -46,18 +47,18 @@ EOF


docker build --progress plain \
--build-arg VESPA_VERSION=$VESPA_VERSION \
--tag docker.io/$IMAGE_NAME:$VESPA_VERSION \
--tag docker.io/$IMAGE_NAME:latest \
--build-arg VESPA_VERSION="$VESPA_VERSION" \
--tag "docker.io/$IMAGE_NAME:$VESPA_VERSION" \
--tag "docker.io/$IMAGE_NAME:latest" \
--tag vespaengine/vespa:latest \
--file Dockerfile .

vespa/screwdriver/test-quick-start-guide.sh
vespa/.buildkite/test-quick-start-guide.sh

OPT_STATE="$(set +o)"
set +x
docker login --username aressem --password "$DOCKER_HUB_DEPLOY_TOKEN"
eval "$OPT_STATE"
docker push docker.io/$IMAGE_NAME:$VESPA_VERSION
docker push docker.io/$IMAGE_NAME:latest
docker push "docker.io/$IMAGE_NAME:$VESPA_VERSION"
docker push "docker.io/$IMAGE_NAME:latest"

Loading

0 comments on commit 2048512

Please sign in to comment.