scripts: drop quotes around $RPATH in ssh bash -lc to allow tilde expansion
Prior form `cd \"$RPATH\"` failed when REMOTE used `~/source/...` because bash saw the tilde as literal. Trade: paths can no longer contain spaces, which is fine for our remote.
This commit is contained in:
@@ -52,7 +52,11 @@ if [[ -n "$REMOTE" ]]; then
|
||||
HOST="${REMOTE%%:*}"
|
||||
RPATH="${REMOTE#*:}"
|
||||
echo "[orch] cargo build --release on remote ($HOST:$RPATH)…" >&2
|
||||
( ssh "$HOST" "bash -lc 'cd \"$RPATH\" && cargo build --release --bin paint_meta_opt_worker'" >&2 ) &
|
||||
# Don't quote $RPATH inside the bash -lc script — leaving it bare
|
||||
# lets tilde expansion work (cd ~/source/foo). With quotes, bash
|
||||
# sees "~/source/foo" as a literal pathname and `cd` fails. We
|
||||
# accept the no-spaces-in-path constraint that comes with this.
|
||||
( ssh "$HOST" "bash -lc 'cd $RPATH && cargo build --release --bin paint_meta_opt_worker'" >&2 ) &
|
||||
REMOTE_BUILD_PID=$!
|
||||
fi
|
||||
|
||||
@@ -87,7 +91,7 @@ if [[ -n "$REMOTE" && "$REMOTE_N" -gt 0 ]]; then
|
||||
echo "[orch] dispatching $REMOTE_N samples to $HOST (serial on remote)…" >&2
|
||||
(
|
||||
seq "$LOCAL_N" $((N - 1)) | \
|
||||
ssh "$HOST" "bash -lc 'cd \"$RPATH\" && while read -r i; do ./target/release/paint_meta_opt_worker \$i --inner $I --passes $P; done'"
|
||||
ssh "$HOST" "bash -lc 'cd $RPATH && while read -r i; do ./target/release/paint_meta_opt_worker \$i --inner $I --passes $P; done'"
|
||||
) >> "$REMOTE_OUT" &
|
||||
REMOTE_PID=$!
|
||||
fi
|
||||
|
||||
@@ -52,7 +52,7 @@ if [[ -n "$REMOTE" ]]; then
|
||||
HOST="${REMOTE%%:*}"
|
||||
RPATH="${REMOTE#*:}"
|
||||
echo "[orch] cargo build --release on remote ($HOST:$RPATH)…" >&2
|
||||
( ssh "$HOST" "bash -lc 'cd \"$RPATH\" && cargo build --release --bin paint_opt_worker'" >&2 ) &
|
||||
( ssh "$HOST" "bash -lc 'cd $RPATH && cargo build --release --bin paint_opt_worker'" >&2 ) &
|
||||
REMOTE_BUILD_PID=$!
|
||||
fi
|
||||
|
||||
@@ -86,7 +86,7 @@ if [[ -n "$REMOTE" && "$REMOTE_N" -gt 0 ]]; then
|
||||
echo "[orch] launching $REMOTE_N remote workers on $HOST…" >&2
|
||||
# Generate the index list local-side and stream to xargs over ssh.
|
||||
seq "$LOCAL_N" $((N - 1)) | \
|
||||
ssh "$HOST" "bash -lc 'cd \"$RPATH\" && xargs -n1 -P$REMOTE_N -I{} ./target/release/paint_opt_worker {}'" \
|
||||
ssh "$HOST" "bash -lc 'cd $RPATH && xargs -n1 -P$REMOTE_N -I{} ./target/release/paint_opt_worker {}'" \
|
||||
>> "$REMOTE_OUT" &
|
||||
REMOTE_PID=$!
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user