Skip to content

Commit

Permalink
fix: Download ARM64 binary (#5577)
Browse files Browse the repository at this point in the history
The lambda runner-binaries-syncer is missing code to actually perform
the
download for the ARM64 binary despite having the variables in place.
This change resolves that issue so that the syncer actually fetches
the appropriate binary for ARM64.

Closes: pytorch/ci-infra#263
Depends-On: #5569

---------

Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
  • Loading branch information
zxiiro authored Aug 21, 2024
1 parent 3ebf5bb commit 0f0abc8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ export const handle = async (): Promise<void> => {
runnerArch: 'x64',
s3Key: process.env.S3_OBJECT_KEY_LINUX,
},
{
runnerOS: 'linux',
runnerArch: 'arm64',
s3Key: process.env.S3_OBJECT_KEY_LINUX_ARM64,
},
{
runnerOS: 'win',
runnerArch: 'x64',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"s3:PutObject*",
"s3:RequestObjectTag*"
],
"Resource": ["${s3_resource_arn_linux}", "${s3_resource_arn_windows}"]
"Resource": [
"${s3_resource_arn_linux}",
"${s3_resource_arn_linux_arm64}",
"${s3_resource_arn_windows}"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ resource "aws_lambda_function" "syncer" {
variables = {
S3_BUCKET_NAME = aws_s3_bucket.action_dist.id
S3_OBJECT_KEY_LINUX = local.action_runner_distribution_object_key_linux
S3_OBJECT_KEY_LINUX_ARM64 = local.action_runner_distribution_object_key_linux_arm64
S3_OBJECT_KEY_WINDOWS = local.action_runner_distribution_object_key_windows
GITHUB_RUNNER_ALLOW_PRERELEASE_BINARIES = var.runner_allow_prerelease_binaries
}
Expand Down Expand Up @@ -65,8 +66,9 @@ resource "aws_iam_role_policy" "syncer" {
role = aws_iam_role.syncer_lambda.id

policy = templatefile("${path.module}/policies/lambda-syncer.json", {
s3_resource_arn_linux = "${aws_s3_bucket.action_dist.arn}/${local.action_runner_distribution_object_key_linux}"
s3_resource_arn_windows = "${aws_s3_bucket.action_dist.arn}/${local.action_runner_distribution_object_key_windows}"
s3_resource_arn_linux = "${aws_s3_bucket.action_dist.arn}/${local.action_runner_distribution_object_key_linux}"
s3_resource_arn_linux_arm64 = "${aws_s3_bucket.action_dist.arn}/${local.action_runner_distribution_object_key_linux_arm64}"
s3_resource_arn_windows = "${aws_s3_bucket.action_dist.arn}/${local.action_runner_distribution_object_key_windows}"
})
}

Expand Down

0 comments on commit 0f0abc8

Please sign in to comment.