Skip to content

Commit 8d1531f

Browse files
Target fleet hosts by Auto Scaling group tag
Unquoted instance lists are not split by zsh, so pass the group tag to send-command and describe-instances and query the first instance directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a487f15 commit 8d1531f

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎benchmarks/README.md‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ uv run --env-file ../.env --locked aws cloudformation deploy \
118118
uv run --env-file ../.env --locked aws cloudformation describe-stacks --stack-name "$BENCHMARK_STACK"
119119
BENCHMARK_GROUP=$(uv run --env-file ../.env --locked aws cloudformation describe-stacks --stack-name "$BENCHMARK_STACK" \
120120
--query 'Stacks[0].Outputs[?OutputKey==`AutoScalingGroup`].OutputValue | [0]' --output text)
121-
BENCHMARK_INSTANCES=$(uv run --env-file ../.env --locked aws autoscaling describe-auto-scaling-groups \
122-
--auto-scaling-group-names "$BENCHMARK_GROUP" --query 'AutoScalingGroups[0].Instances[].InstanceId' --output text)
123-
BENCHMARK_INSTANCE=${BENCHMARK_INSTANCES%%[[:space:]]*}
121+
BENCHMARK_INSTANCE=$(uv run --env-file ../.env --locked aws autoscaling describe-auto-scaling-groups \
122+
--auto-scaling-group-names "$BENCHMARK_GROUP" --query 'AutoScalingGroups[0].Instances[0].InstanceId' --output text)
124123
uv run --env-file ../.env --locked aws ssm start-session --target "$BENCHMARK_INSTANCE"
125124
```
126125

@@ -287,7 +286,7 @@ With `--split-pages`, a job whose single trial needs at least that many pages be
287286
`run` accepts the matching `--arraysize`, `--warmups`, and `--repetitions` options.
288287

289288
Deploy a new stack with the fleet size under its own name; changing `FleetSize` on an existing stack does not wait for the added hosts to finish bootstrap.
290-
Then resolve its hosts and open a session on one of them:
289+
Then open a session on one of its hosts:
291290

292291
```bash
293292
BENCHMARK_STACK=pyathena-benchmark-fleet
@@ -299,9 +298,8 @@ uv run --env-file ../.env --locked aws cloudformation deploy \
299298
--parameter-overrides GitCommit="$BENCHMARK_COMMIT" FleetSize=20
300299
BENCHMARK_GROUP=$(uv run --env-file ../.env --locked aws cloudformation describe-stacks --stack-name "$BENCHMARK_STACK" \
301300
--query 'Stacks[0].Outputs[?OutputKey==`AutoScalingGroup`].OutputValue | [0]' --output text)
302-
BENCHMARK_INSTANCES=$(uv run --env-file ../.env --locked aws autoscaling describe-auto-scaling-groups \
303-
--auto-scaling-group-names "$BENCHMARK_GROUP" --query 'AutoScalingGroups[0].Instances[].InstanceId' --output text)
304-
BENCHMARK_INSTANCE=${BENCHMARK_INSTANCES%%[[:space:]]*}
301+
BENCHMARK_INSTANCE=$(uv run --env-file ../.env --locked aws autoscaling describe-auto-scaling-groups \
302+
--auto-scaling-group-names "$BENCHMARK_GROUP" --query 'AutoScalingGroups[0].Instances[0].InstanceId' --output text)
305303
uv run --env-file ../.env --locked aws ssm start-session --target "$BENCHMARK_INSTANCE"
306304
```
307305

@@ -329,7 +327,7 @@ Every worker runs its jobs with that stored configuration.
329327
Start a worker on every host from the local machine:
330328

331329
```bash
332-
uv run --env-file ../.env --locked aws ssm send-command --instance-ids $BENCHMARK_INSTANCES \
330+
uv run --env-file ../.env --locked aws ssm send-command --targets "Key=tag:aws:autoscaling:groupName,Values=$BENCHMARK_GROUP" \
333331
--document-name AWS-RunShellScript \
334332
--parameters 'commands=["sudo -iu ec2-user bash -lc \"cd /opt/pyathena/benchmarks && mkdir -p results && (nohup uv run --no-sync python -m pyathena_bench worker --stack $(cat /opt/pyathena/benchmarks/stack-id.txt) --name large-1 > results/worker-large-1.log 2>&1 &)\""]'
335333
uv run --env-file ../.env --locked python -m pyathena_bench status \
@@ -390,7 +388,8 @@ mkdir -p results/recovered
390388
uv run --env-file ../.env --locked aws s3 sync "s3://$BENCHMARK_BUCKET/reports/" results/recovered/
391389
uv run --env-file ../.env --locked aws cloudformation describe-stacks --stack-name "$BENCHMARK_STACK" > results/recovered/stack.json
392390
uv run --env-file ../.env --locked aws s3 sync "s3://$BENCHMARK_BUCKET/fleet/" results/recovered/fleet/
393-
uv run --env-file ../.env --locked aws ec2 describe-instances --instance-ids $BENCHMARK_INSTANCES > results/recovered/instances.json
391+
uv run --env-file ../.env --locked aws ec2 describe-instances \
392+
--filters "Name=tag:aws:autoscaling:groupName,Values=$BENCHMARK_GROUP" > results/recovered/instances.json
394393
```
395394

396395
Verify the downloaded files before proceeding.

0 commit comments

Comments
 (0)