@@ -20,6 +20,9 @@ install_systemd=1
2020start_service=1
2121libseccomp_mode=" auto"
2222jacamar_pbs_tools=" "
23+ jacamar_make_jobs=" ${JACAMAR_BUILD_MAKE_JOBS:- 1} "
24+ jacamar_gomaxprocs=" ${JACAMAR_BUILD_GOMAXPROCS:- 1} "
25+ jacamar_goflags=" ${JACAMAR_BUILD_GOFLAGS:- -p=1 -gcflags=all=-dwarf=false} "
2326unrestricted_cmd_line=false
2427runner_proxy=" "
2528runner_no_proxy=" "
@@ -65,6 +68,12 @@ Options:
6568 --no-start Create and enable service, but do not start it.
6669 -h, --help Show this help.
6770
71+ Environment overrides:
72+ JACAMAR_BUILD_MAKE_JOBS Jacamar build make parallelism. Default: 1.
73+ JACAMAR_BUILD_GOMAXPROCS Jacamar build Go scheduler threads. Default: 1.
74+ JACAMAR_BUILD_GOFLAGS Jacamar build Go flags.
75+ Default: -p=1 -gcflags=all=-dwarf=false.
76+
6877Example:
6978 curl -fsSL https://raw.githubusercontent.com/RIKEN-RCCS/benchkit/main/scripts/setup_site_runner.sh \
7079 | bash -s -- --arch amd64 --site genkai \
@@ -297,7 +306,10 @@ if [[ ! -x "$jacamar_bin" ]]; then
297306 (
298307 cd " ${work_dir} /jacamar-ci"
299308 export CC=gcc CXX=g++ CGO_ENABLED=1
300- make build
309+ export GOMAXPROCS=" ${GOMAXPROCS:- $jacamar_gomaxprocs } "
310+ export GOFLAGS=" ${GOFLAGS:- $jacamar_goflags } "
311+ info " Using Jacamar build limits: make -j${jacamar_make_jobs} , GOMAXPROCS=${GOMAXPROCS} , GOFLAGS=${GOFLAGS} "
312+ make -j" $jacamar_make_jobs " build
301313 make install PREFIX=" $base_dir "
302314 )
303315else
@@ -349,11 +361,40 @@ set -euo pipefail
349361exit 0
350362EOF
351363
352- cat > " ${base_dir} /run .sh" << 'EOF '
364+ cat > " ${base_dir} /runner-env .sh" << 'EOF '
353365#!/usr/bin/env bash
354- source ~/.bashrc
366+
367+ source_if_readable() {
368+ local file="$1"
369+ if [[ -r "$file" ]]; then
370+ # shellcheck disable=SC1090
371+ source "$file" || true
372+ fi
373+ }
374+
375+ source_if_readable /etc/profile
376+ source_if_readable /etc/bashrc
377+
378+ if ! type module >/dev/null 2>&1; then
379+ source_if_readable /etc/profile.d/modules.sh
380+ source_if_readable /etc/profile.d/z00_lmod.sh
381+ fi
382+
383+ source_if_readable "${HOME}/.bashrc"
384+
385+ unset -f source_if_readable
386+ EOF
387+
388+ cat > " ${base_dir} /run.sh" << EOF
389+ #!/usr/bin/env bash
390+ RUNNER_ENV="\$ {CUSTOM_DIR:-${base_dir} }/runner-env.sh"
391+ if [[ -r "\$ {RUNNER_ENV}" ]]; then
392+ source "\$ {RUNNER_ENV}"
393+ elif [[ -r "\$ {HOME}/.bashrc" ]]; then
394+ source "\$ {HOME}/.bashrc"
395+ fi
355396set -eo pipefail
356- exec "$@"
397+ exec "\ $ @"
357398EOF
358399
359400cat > " ${base_dir} /cleanup.sh" << EOF
378419echo "CLEANUP DONE at \$ (date)" >> "\$ LOGFILE"
379420EOF
380421
381- chmod +x " ${base_dir} /config.sh" " ${base_dir} /prepare.sh" " ${base_dir} /run.sh" " ${base_dir} /cleanup.sh"
422+ chmod +x " ${base_dir} /config.sh" " ${base_dir} /prepare.sh" " ${base_dir} /runner-env.sh " " ${base_dir} / run.sh" " ${base_dir} /cleanup.sh"
382423
383424info " Writing Jacamar config"
384425cat > " ${base_dir} /custom-config.toml" << EOF
0 commit comments