Skip to content

Commit

Permalink
proc_package.sh: add batch mode where output is logged into a file
Browse files Browse the repository at this point in the history
Use BATCH=1 env var to set the batch mode up. proca_package_parallel.sh
does that now.

Coincidentally: don't load Revise unconditionally (via startup.jl).
Should ease dependency footprint of Stability and speed up processing.
  • Loading branch information
ulysses4ever committed Mar 21, 2023
1 parent 996f072 commit befaec9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 11 additions & 4 deletions Stability/scripts/proc_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ pushd $pkg
# Call Julia with a timeout
#
STABILITY_HOME="$DIR/../"
out="$(DEV=YES JULIA_DEPOT_PATH="$PWD/depot" STABILITY_HOME="$STABILITY_HOME" timeout 2400 julia -L "$STABILITY_HOME/startup.jl" -e "$PACKAGE_STATS_CALL" 2>&1)"
retcode=$?
echo $retcode > test-result.txt
if [ $retcode -ne 0 ]; then

# NOTE: Below the main command is spelled twice on every branch of if -- this is unfortunate
# Make sure to edit both instances if you want to update the command
if [ -z "${BATCH}" ]; then
DEV=YES JULIA_DEPOT_PATH="$PWD/depot" STABILITY_HOME="$STABILITY_HOME" timeout 2400 julia -L "$STABILITY_HOME/startup.jl" -e "$PACKAGE_STATS_CALL" 2>&1
retcode=$?
echo "$retcode" > test-result.txt
else
out="$(DEV=YES JULIA_DEPOT_PATH="$PWD/depot" STABILITY_HOME="$STABILITY_HOME" timeout 2400 julia -L "$STABILITY_HOME/startup.jl" -e "$PACKAGE_STATS_CALL" 2>&1)"
retcode=$?
echo "$retcode" > test-result.txt
echo "$out" > test-out.txt
fi
popd
Expand Down
2 changes: 1 addition & 1 deletion Stability/scripts/proc_package_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

lines=$(wc -l $1 | awk '{print $1}')
head -n ${2:-$lines} $1 | parallel "$DIR/proc_package.sh"
head -n ${2:-$lines} $1 | BATCH=1 parallel "$DIR/proc_package.sh"
$DIR/pkgs-report.sh $1 ${2:-$lines}
2 changes: 0 additions & 2 deletions Stability/startup.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Pkg
Pkg.add("Revise")
using Revise
Pkg.activate(ENV["STABILITY_HOME"])
Pkg.instantiate()
using Stability

0 comments on commit befaec9

Please sign in to comment.