vm flag and wip vsh rework

Signed-off-by: Ava Hahn <a.hahn@f5.com>
This commit is contained in:
Ava Hahn 2025-01-21 14:25:05 -08:00
parent 8c91778fe1
commit b47476bd69
5 changed files with 266 additions and 195 deletions

View file

@ -1,23 +1,38 @@
#!/bin/bash
# gets executed ON REMOTE HOST
#function current_dir_is_nginx_repo() {
# local tok
# tok=$(basename -s .git `git config --get remote.origin.url` 2> /dev/null)
# if [[ "$tok" == "nginx" ]]; then
# ret="true"
# return 0
# else
# ret="false"
# return 0
# fi
#}
dirn=$(dirname "$0")
source $dirn/common.sh
if [[ ! -f $dirn/SECRET.sh ]]; then
error "need to create SECRET.sh... see Readme"
exit 1
fi
source $dirn/SECRET.sh
# function that helps set parallelism in builds
# needs to strictly return 3 on VMs and strictly
# return a lot more on the hypervisor host.
function num_jobs() {
if [ ! $VM_PARALLEL ]; then
log "VM_PARALLEL not defined, defaulting to 3"
VM_PARALLEL=3
fi
if [ ! $HOST_PARALLEL ]; then
log "HOST_PARALLEL not defined, defaulting to 22"
HOST_PARALLEL=22
fi
which virsh >/dev/null && echo $HOST_PARALLEL || echo $VM_PARALLEL
}
# The following functions are all run on a VM
# Through an SSH connection. Make sure not to
# use any external functions in them.
function build_nginx_remote() {
function build_nginx() {
auto/configure \
--with-threads \
--with-http_ssl_module \
@ -38,31 +53,30 @@ function build_nginx_remote() {
--with-stream_realip_module \
--with-stream_ssl_preread_module \
--with-debug && \
make -j3
return $?
make -j$(num_jobs)
}
function test_nginx_remote() {
TEST_NGINX_VERBOSE=1 TEST_NGINX_CATLOG=1 prove -vw -j 3 .
return $?
function test_nginx() {
TEST_NGINX_VERBOSE=1 \
TEST_NGINX_CATLOG=1 \
prove -vw -j$(num_jobs) .
}
function clean_nginx_remote() {
function clean_nginx() {
make clean
return $?
}
function build_otel_remote() {
mkdir -p build && cd build && \
cmake -DNGX_OTEL_NGINX_BUILD_DIR=../../nginx/objs .. && \
make -j3
return $?
function build_otel() {
mkdir -p build && \
cd build && \
cmake -DNGX_OTEL_NGINX_BUILD_DIR=../../nginx/objs .. && \
make -j$(num_jobs)
}
function test_otel_remote() {
function test_otel() {
echo "UNIMPLEMENTED!"
}
function clean_otel_remote() {
function clean_otel() {
rm -rf build
}