Skip to content

Commit

Permalink
Merge branch 'main' of github.com:cloudfoundry/bosh into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
git committed Dec 6, 2024
2 parents 239f39c + 3ab11e0 commit 374b7ef
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
38 changes: 23 additions & 15 deletions ci/tasks/test-brats-performance.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
#!/usr/bin/env bash
set -eu -o pipefail

set -eu

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
src_dir="${script_dir}/../../.."
bosh_repo_dir="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../" && pwd)")"
bosh_repo_parent_dir="$(realpath "${bosh_repo_dir}/..")"

export BOSH_DEPLOYMENT_PATH="/usr/local/bosh-deployment"

source "${src_dir}/bosh/ci/dockerfiles/docker-cpi/start-bosh.sh"
source "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/start-bosh.sh"
source /tmp/local-bosh/director/env

bosh int /tmp/local-bosh/director/creds.yml --path /jumpbox_ssh/private_key > /tmp/jumpbox_ssh_key.pem
chmod 400 /tmp/jumpbox_ssh_key.pem

export BOSH_DIRECTOR_IP="10.245.0.3"

export BOSH_BINARY_PATH=$(which bosh)
bosh_release_tgz=(${PWD}/bosh-release/*.tgz)
export BOSH_DIRECTOR_TARBALL_PATH=${bosh_release_tgz[0]}
BOSH_BINARY_PATH=$(which bosh)
export BOSH_BINARY_PATH
BOSH_DIRECTOR_TARBALL_PATH="$(find "${bosh_repo_parent_dir}/bosh-release" -maxdepth 1 -path '*.tgz')"
export BOSH_DIRECTOR_TARBALL_PATH
export BOSH_DIRECTOR_RELEASE_PATH="$PWD/bosh"
export CF_DEPLOYMENT_RELEASE_PATH="$PWD/cf-deployment"
export CANDIDATE_STEMCELL_TARBALL_PATH="$(realpath "${src_dir}"/stemcell/*.tgz)"
CANDIDATE_STEMCELL_TARBALL_PATH="$(find "${bosh_repo_parent_dir}/stemcell" -maxdepth 1 -path '*.tgz')"
export CANDIDATE_STEMCELL_TARBALL_PATH
export STEMCELL_OS=ubuntu-jammy

export DOCKER_CERTS="$(bosh int /tmp/local-bosh/director/bosh-director.yml --path /instance_groups/0/properties/docker_cpi/docker/tls)"
export DOCKER_HOST="$(bosh int /tmp/local-bosh/director/bosh-director.yml --path /instance_groups/name=bosh/properties/docker_cpi/docker/host)"
DOCKER_CERTS="$(bosh int /tmp/local-bosh/director/bosh-director.yml --path /instance_groups/0/properties/docker_cpi/docker/tls)"
export DOCKER_CERTS
DOCKER_HOST="$(bosh int /tmp/local-bosh/director/bosh-director.yml --path /instance_groups/name=bosh/properties/docker_cpi/docker/host)"
export DOCKER_HOST

bosh -n update-cloud-config \
"${BOSH_DEPLOYMENT_PATH}/docker/cloud-config.yml" \
-o "${src_dir}/bosh-ci/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-o "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-v network=director_network

bosh -n upload-stemcell "${CANDIDATE_STEMCELL_TARBALL_PATH}"
Expand All @@ -38,6 +41,11 @@ bosh upload-release "$(bosh int ${BOSH_DEPLOYMENT_PATH}/docker/cpi.yml --path /n
bosh upload-release "$(bosh int ${BOSH_DEPLOYMENT_PATH}/jumpbox-user.yml --path /release=os-conf/value/url)" \
--sha1 "$(bosh int ${BOSH_DEPLOYMENT_PATH}/jumpbox-user.yml --path /release=os-conf/value/sha1)"

pushd "${src_dir}/bosh/src/brats" > /dev/null
go run github.com/onsi/ginkgo/v2/ginkgo --timeout=24h -r --race --nodes 1 performance
popd > /dev/null
pushd "${bosh_repo_dir}/src/brats/performance"
go run github.com/onsi/ginkgo/v2/ginkgo \
-r -v --race \
--focus="${FOCUS_SPEC:-}" \
--nodes 1 \
--timeout=24h \
.
popd
30 changes: 19 additions & 11 deletions ci/tasks/test-brats.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -eu -o pipefail

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
src_dir="${script_dir}/../../.."
bosh_repo_dir="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")/../../" && pwd)")"
bosh_repo_parent_dir="$(realpath "${bosh_repo_dir}/..")"

OVERRIDDEN_BOSH_DEPLOYMENT=$(realpath "$(dirname $0)/../../../bosh-deployment")
OVERRIDDEN_BOSH_DEPLOYMENT="${bosh_repo_parent_dir}/bosh-deployment"

if [[ -e "${OVERRIDDEN_BOSH_DEPLOYMENT}/bosh.yml" ]];then
BOSH_DEPLOYMENT_PATH=${OVERRIDDEN_BOSH_DEPLOYMENT}
Expand All @@ -14,7 +14,7 @@ fi
export BOSH_DEPLOYMENT_PATH

if [ ! -f /tmp/local-bosh/director/env ]; then
source "${src_dir}/bosh/ci/dockerfiles/docker-cpi/start-bosh.sh"
source "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/start-bosh.sh"
fi
source /tmp/local-bosh/director/env

Expand All @@ -25,11 +25,11 @@ export BOSH_DIRECTOR_IP="10.245.0.3"

BOSH_BINARY_PATH=$(which bosh)
export BOSH_BINARY_PATH
export BOSH_RELEASE="${PWD}/bosh/src/spec/assets/dummy-release.tgz"
export BOSH_DIRECTOR_RELEASE_PATH="${PWD}/bosh-release"
DNS_RELEASE_PATH="$(realpath "$(find "${PWD}"/bosh-dns-release -maxdepth 1 -path '*.tgz')")"
export BOSH_RELEASE="${bosh_repo_dir}/src/spec/assets/dummy-release.tgz"
export BOSH_DIRECTOR_RELEASE_PATH="${bosh_repo_parent_dir}/bosh-release"
DNS_RELEASE_PATH="$(find "${bosh_repo_parent_dir}/bosh-dns-release" -maxdepth 1 -path '*.tgz')"
export DNS_RELEASE_PATH
CANDIDATE_STEMCELL_TARBALL_PATH="$(realpath "${src_dir}"/stemcell/*.tgz)"
CANDIDATE_STEMCELL_TARBALL_PATH="$(find "${bosh_repo_parent_dir}/stemcell" -maxdepth 1 -path '*.tgz')"
export CANDIDATE_STEMCELL_TARBALL_PATH
export BOSH_DNS_ADDON_OPS_FILE_PATH="${BOSH_DEPLOYMENT_PATH}/misc/dns-addon.yml"

Expand All @@ -42,7 +42,7 @@ export DOCKER_HOST

bosh -n update-cloud-config \
"${BOSH_DEPLOYMENT_PATH}/docker/cloud-config.yml" \
-o "${src_dir}/bosh-ci/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-o "${bosh_repo_dir}/ci/dockerfiles/docker-cpi/outer-cloud-config-ops.yml" \
-v network=director_network

bosh -n upload-stemcell "${CANDIDATE_STEMCELL_TARBALL_PATH}"
Expand Down Expand Up @@ -73,7 +73,7 @@ if [ -d database-metadata ]; then
export GCP_POSTGRES_EXTERNAL_DB_CLIENT_PRIVATE_KEY
fi

brats_env_file="${PWD}/brats-env.sh"
brats_env_file="${bosh_repo_parent_dir}/brats-env.sh"
{
echo "export OUTER_BOSH_ENV_PATH=\"${OUTER_BOSH_ENV_PATH}\""
echo "export DOCKER_CERTS=\"${DOCKER_CERTS}\""
Expand Down Expand Up @@ -112,4 +112,12 @@ brats_env_file="${PWD}/brats-env.sh"
echo "# The required BRATS environment can be loaded by running the following:"
echo "# 'source ${brats_env_file}'"

bosh/scripts/test-brats
pushd "${bosh_repo_dir}/src/brats"
go run github.com/onsi/ginkgo/v2/ginkgo \
-r -v --race \
--randomize-suites --randomize-all \
--focus="${FOCUS_SPEC:-}" \
-nodes 5 \
--skip-package=performance \
.
popd

0 comments on commit 374b7ef

Please sign in to comment.