Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Use bazel cache also for acceptance tests #3582

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export ACCEPTANCE_ARTIFACTS="$TEST_ARTIFACTS"
echo "Create test artifacts: mkdir -p $TEST_ARTIFACTS"
mkdir -p "$TEST_ARTIFACTS"

if [ -z ${BAZEL_REMOTE_S3_ACCESS_KEY_ID+x} ]; then
echo "S3 env not set, not starting bazel remote proxy"
exit 0
fi

echo "Starting bazel remote cache proxy"

# Start bazel remote cache proxy for S3
Expand Down
3 changes: 2 additions & 1 deletion .buildkite/pipeline2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gen_acceptance() {
echo " key: ${name}_acceptance"
echo " env:"
echo " PYTHONPATH: \"python/:.\""
echo " BAZELRC: .bazelrc_ci"
echo " artifact_paths:"
echo " - \"artifacts.out/**/*\""
echo " retry:"
Expand All @@ -30,7 +31,7 @@ gen_bazel_acceptance() {
name=${name#'//acceptance/'}
echo " - label: \"Acceptance: $name\""
echo " command:"
echo " - bazel test $test"
echo " - bazel --bazelrc=.bazelrc_ci test $test"
echo " key: ${name}_acceptance"
echo " artifact_paths:"
echo " - \"artifacts.out/**/*\""
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ BRACCEPT = bin/braccept

GAZELLE_MODE?=fix

BAZELRC?=.bazelrc

all: bazel

clean:
Expand All @@ -30,7 +32,7 @@ go_deps.bzl: go.mod

bazel: godeps gogen
rm -f bin/*
bazel build //:scion //:scion-ci
bazel --bazelrc=${BAZELRC} build //:scion //:scion-ci
tar -kxf bazel-bin/scion.tar -C bin
tar -kxf bazel-bin/scion-ci.tar -C bin

Expand Down
2 changes: 1 addition & 1 deletion docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cmd_build() {

cmd_tester() {
set -eo pipefail
bazel run //docker/testimages:scion_testing_bundle
bazel --bazelrc=${BAZELRC:-.bazelrc} run //docker/testimages:scion_testing_bundle
docker build -f "docker/testimages/Dockerfile.sig_accept" -t "scion_sig_acceptance" docker/testimages
}

Expand Down
4 changes: 2 additions & 2 deletions docker/perapp/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ STAGE=${1:-prod}

# Build the binaries.
# This will fetch everything that haven't been fetched yet.
bazel build //:scion
bazel --bazelrc="$ROOTDIR/${BAZELRC:-.bazelrc}" build //:scion

# Collect the licenses from the bazel cache.
pushd $ROOTDIR/bazel-scion*/external
Expand All @@ -23,7 +23,7 @@ tar cf $ROOTDIR/docker/perapp/licenses.tar -C $TMPDIR --transform 's,^,licenses/
rm -rf $TMPDIR

# Build the images and push them to local docker repository.
bazel run //docker/perapp:$STAGE
bazel --bazelrc="$ROOTDIR/${BAZELRC:-.bazelrc}" run //docker/perapp:$STAGE

# Remove licenses
tar cvf $ROOTDIR/docker/perapp/licenses.tar --files-from /dev/null