zat.dev/zds
atproto pds · mirror of https://tangled.org/zat.dev/zds
zds 0.25.1 Latest 2 packages, all images
0
0
#!/usr/bin/env sh
# Run a command on one kind of core of a hybrid Intel CI host:
# tools/ci-cores.sh performance|efficiency command [args...]
# The deploy's release build goes on the performance cores and the workflows
# that do not gate a deploy (ARMv6, campaigns) on the efficiency cores, so they
# stop slowing it down. Without taskset or a hybrid CPU the command runs as is.
set -eu
case "${1:-}" in
performance) cpus=/sys/devices/cpu_core/cpus ;;
efficiency) cpus=/sys/devices/cpu_atom/cpus ;;
*) echo "usage: $0 performance|efficiency command [args...]" >&2; exit 2 ;;
esac
shift
set_=$(cat "$cpus" 2>/dev/null || true)
if [ -n "$set_" ] && command -v taskset >/dev/null 2>&1 && taskset -c "$set_" true 2>/dev/null; then
echo "running on cpus $set_: $1" >&2
exec taskset -c "$set_" "$@"
fi
exec "$@"