mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-05-08 15:52:10 +02:00
wip
This commit is contained in:
@@ -24,46 +24,15 @@ conda create -q -n test-environment "python=${python_version}"
|
||||
conda activate test-environment
|
||||
|
||||
cd bec
|
||||
source ./bin/install_bec_dev.sh -t
|
||||
source ./bin/install_bec_dev.sh
|
||||
cd ..
|
||||
|
||||
python -m pip install -e ./ophyd_devices -e .[dev,pyside6] -e ./bec_testing_plugin
|
||||
|
||||
benchmark_tmp_dir="$(mktemp -d)"
|
||||
export BEC_SERVICE_CONFIG="$benchmark_tmp_dir/services_config.yaml"
|
||||
ready_file="$benchmark_tmp_dir/ready"
|
||||
supervisor_log="$benchmark_tmp_dir/bec-benchmark-services.log"
|
||||
|
||||
python .github/scripts/start_bec_benchmark_services.py \
|
||||
--files-path "$benchmark_tmp_dir" \
|
||||
--services-config "$BEC_SERVICE_CONFIG" \
|
||||
--ready-file "$ready_file" \
|
||||
> "$supervisor_log" 2>&1 &
|
||||
supervisor_pid=$!
|
||||
redis-server --daemonize yes --port 6379
|
||||
|
||||
cleanup_benchmark_services() {
|
||||
if kill -0 "$supervisor_pid" >/dev/null 2>&1; then
|
||||
kill "$supervisor_pid"
|
||||
wait "$supervisor_pid" || true
|
||||
fi
|
||||
rm -rf "$benchmark_tmp_dir"
|
||||
}
|
||||
trap cleanup_benchmark_services EXIT
|
||||
bec-server start --config "$BEC_SERVICE_CONFIG"
|
||||
|
||||
deadline=$((SECONDS + 30))
|
||||
while [ ! -f "$ready_file" ]; do
|
||||
if ! kill -0 "$supervisor_pid" >/dev/null 2>&1; then
|
||||
cat "$supervisor_log" >&2 || true
|
||||
echo "BEC benchmark service supervisor exited before becoming ready" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ "$SECONDS" -ge "$deadline" ]; then
|
||||
cat "$supervisor_log" >&2 || true
|
||||
echo "Timed out waiting for BEC benchmark services" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
cat "$supervisor_log"
|
||||
echo "BEC_SERVICE_CONFIG=$BEC_SERVICE_CONFIG" >> "$GITHUB_ENV"
|
||||
|
||||
Reference in New Issue
Block a user