Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 439fb1b

Browse files
authored
fix: explicit set region for downloading runner distribution from S3 (#1204)
Agents stall when running in af-south-1 unless the region is set explicitly: ``` aws s3 cp s3://default-dist-xxxxx1245/actions-runner-linux.tar.gz . download failed: s3://default-dist-xxxxx1245/actions-runner-linux.tar.gz to ./actions-runner-linux.tar.gz An error occurred (IllegalLocationConstraintException) when calling the GetObject operation: The af-south-1 location constraint is incompatible for the region specific endpoint this request was sent to. [root@ip-10-165-0-77 bin]# aws s3 cp s3://default-dist-xxxxx1245/actions-runner-linux.tar.gz . --region af-south-1 download: s3://default-dist-xxxxx1245/actions-runner-linux.tar.gz to ./actions-runner-linux.tar.gz ```
1 parent e72227b commit 439fb1b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: modules/runners/templates/install-config-runner.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
cd /home/$USER_NAME
22
mkdir actions-runner && cd actions-runner
33

4-
aws s3 cp ${s3_location_runner_distribution} actions-runner.tar.gz
4+
REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region)
5+
6+
aws s3 cp ${s3_location_runner_distribution} actions-runner.tar.gz --region $REGION
57
tar xzf ./actions-runner.tar.gz
68
rm -rf actions-runner.tar.gz
79

810
${arm_patch}
911

1012
INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
11-
REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region)
13+
1214

1315
echo wait for configuration
1416
while [[ $(aws ssm get-parameters --names ${environment}-$INSTANCE_ID --with-decryption --region $REGION | jq -r ".Parameters | .[0] | .Value") == null ]]; do

0 commit comments

Comments
 (0)