aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.21k stars 316 forks source link

[Batch] [Fargate] [request]: Add ARM64 architecture support for Batch jobs running on AWS Fargate #1652

Closed tlinhart closed 1 year ago

tlinhart commented 2 years ago

Community Note

Tell us about your request Add support for ARM64 architecture when running Batch jobs on AWS Fargate.

Which service(s) is this request for? Batch, Fargate, ECS.

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? There is already ARM64 support for ECS tasks running on AWS Fargate that we use extensively. The runtime platform can be specified in the task definition parameters. However, there is currently no option for specifying the runtime platform for Batch jobs running on AWS Fargate in the job definition parameters.

We use Batch jobs for a substantial portion of our workload and being able to use ARM64 architecture would lower the costs significantly.

Are you currently working around this issue? No, we use x86-64 architecture for the workload.

tlinhart commented 1 year ago

Any updates on this? Is this considered, worked on or ignored?

jamesev15 commented 1 year ago

Is this issue still opened?

sacundim commented 1 year ago

Just the other day (Jul 14, 2023) AWS announced that Batch on AWS Fargate now supports Linux ARM64... but posted no clear instructions at all on how to get it to work. The announcement has a link to ECS documentation on running ARM64 workloads, but I couldn't guess the config. I'm using Terraform, so there's the added complication that it might require a new version of its AWS provider.

jamesespichan commented 1 year ago

Thanks for posting that! I'm going to try it. I solved the problem using an EC2 and doing the compilation in that EC2 to generate the docker image for x86.

sacundim commented 1 year ago

The provider will likely need to be updated to support runtime_platform in the aws_batch_job_definition

UPDATE: Nah, doesn't look like, I found the relevant docs now and it's all under the containerProperties JSON object, not the top level aws_batch_job_definition. I'm in the process of trying it out...

aaronabf commented 1 year ago

Can confirm that adding this to the job definition worked:

"runtimePlatform": {
  "operatingSystemFamily": "LINUX",
  "cpuArchitecture": "ARM64"
}

In Terraform that would be:

resource "aws_batch_job_definition" "name" {
  ...
  container_properties = jsonencode({
    ...
    runtimePlatform = {
      operatingSystemFamily = "LINUX"
      cpuArchitecture       = "ARM64"
    }
    ...
  })
}
sacundim commented 1 year ago

Can confirm that adding this to the job definition worked:

Nice @aaronabf, I was just doing the same:

I couldn't find in the Batch UI any indication that my job ran on ARM64, so I went to the extra step to put a logging message on my app to confirm so. Log output confirms it:

2023-07-17 17:41:12,151 MainThread Platform: system=Linux, machine=aarch64, version=#1 SMP Tue Jun 27 21:48:49 UTC 2023
ollypom commented 1 year ago

AWS Batch Jobs on AWS Fargate now supports Linux arm64 and Windows x86.

Whats new post: https://aws.amazon.com/about-aws/whats-new/2023/07/aws-batch-fargate-linux-arm64-windows-x86-containers-cli-sdk/