mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Use Cirrus's new greedy mode for parallelizing builds and tests
This oversubscribes our cores 2x, which testing shows we actually run with at times: speedup is around a third on average for builds, and a bit more than that for testing. Also some light Bashification in ci/build.sh, for consistency.
This commit is contained in:
parent
d8b0ee0853
commit
959de22349
4 changed files with 22 additions and 2 deletions
|
@ -18,6 +18,8 @@ mobile_ipv6_config: &MOBILE_IPV6_CONFIG --build-type=release --enable-cpp-tests
|
||||||
resources_template: &RESOURCES_TEMPLATE
|
resources_template: &RESOURCES_TEMPLATE
|
||||||
cpu: *CPUS
|
cpu: *CPUS
|
||||||
memory: *MEMORY
|
memory: *MEMORY
|
||||||
|
# For greediness, see https://medium.com/cirruslabs/introducing-greedy-container-instances-29aad06dc2b4
|
||||||
|
greedy: true
|
||||||
|
|
||||||
macos_resources_template: &MACOS_RESOURCES_TEMPLATE
|
macos_resources_template: &MACOS_RESOURCES_TEMPLATE
|
||||||
# https://medium.com/cirruslabs/new-macos-task-execution-architecture-for-cirrus-ci-604250627c94
|
# https://medium.com/cirruslabs/new-macos-task-execution-architecture-for-cirrus-ci-604250627c94
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
|
||||||
|
. ${SCRIPT_DIR}/common.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# If we're on macOS, use --osx-sysroot to ensure we can find the SDKs from Xcode. This avoids
|
# If we're on macOS, use --osx-sysroot to ensure we can find the SDKs from Xcode. This avoids
|
||||||
# some problems with Catalina specifically, but it doesn't break anything on Big Sur either.
|
# some problems with Catalina specifically, but it doesn't break anything on Big Sur either.
|
||||||
if [ "${CIRRUS_OS}" == "darwin" ]; then
|
if [[ "${CIRRUS_OS}" == "darwin" ]]; then
|
||||||
export ZEEK_CI_CONFIGURE_FLAGS="${ZEEK_CI_CONFIGURE_FLAGS} --osx-sysroot=$(xcrun --show-sdk-path)"
|
export ZEEK_CI_CONFIGURE_FLAGS="${ZEEK_CI_CONFIGURE_FLAGS} --osx-sysroot=$(xcrun --show-sdk-path)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${ZEEK_CI_CREATE_ARTIFACT}" != "1" ]; then
|
if [[ "${ZEEK_CI_CREATE_ARTIFACT}" != "1" ]]; then
|
||||||
./configure ${ZEEK_CI_CONFIGURE_FLAGS}
|
./configure ${ZEEK_CI_CONFIGURE_FLAGS}
|
||||||
cd build
|
cd build
|
||||||
make -j ${ZEEK_CI_CPUS}
|
make -j ${ZEEK_CI_CPUS}
|
||||||
|
|
12
ci/common.sh
Normal file
12
ci/common.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Common material sourced by Bash CI scripts in this directory
|
||||||
|
|
||||||
|
# On Cirrus, oversubscribe the CPUs when on Linux. This uses Cirrus' "greedy" feature.
|
||||||
|
if [[ "${CIRRUS_OS}" == linux ]]; then
|
||||||
|
if [[ -n "${ZEEK_CI_CPUS}" ]]; then
|
||||||
|
ZEEK_CI_CPUS=$(( 2 * ${ZEEK_CI_CPUS} ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${ZEEK_CI_BTEST_JOBS}" ]]; then
|
||||||
|
ZEEK_CI_BTEST_JOBS=$(( 2 * ${ZEEK_CI_BTEST_JOBS} ))
|
||||||
|
fi
|
||||||
|
fi
|
|
@ -16,6 +16,9 @@ if [[ -z "${CIRRUS_CI}" ]]; then
|
||||||
ZEEK_CI_BTEST_RETRIES=2
|
ZEEK_CI_BTEST_RETRIES=2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
|
||||||
|
. ${SCRIPT_DIR}/common.sh
|
||||||
|
|
||||||
function pushd
|
function pushd
|
||||||
{
|
{
|
||||||
command pushd "$@" > /dev/null || exit 1
|
command pushd "$@" > /dev/null || exit 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue