Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Image support for ARM64 #536

Closed
ulili5 opened this issue Jun 7, 2021 · 18 comments
Closed

Docker Image support for ARM64 #536

ulili5 opened this issue Jun 7, 2021 · 18 comments
Labels
enhancement Request for enhancement other than new feature

Comments

@ulili5
Copy link

ulili5 commented Jun 7, 2021

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

  • The current Docker Image is available only on ARCH=x86_64 this is a huge limitation and frustrating when working with ARM64 for workload like Graviton 2 or Raspberry

Describe the solution you'd like
A clear and concise description of what you want to happen.

  • Since the project is built in GoLang it's straightforward to generate a multi-architect docker image by adding ARCH=arm64

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

  • My alternative was to clone this Repo and did a minor change on the Make file to generate docker image for ARM64 so we can build our Graviton 2 IKS workload. But, it would be great with the public Docker Hub or ECR Galery to add the ARM64 Docker image support

Additional context
Add any other context or screenshots about the feature request here.

@sethAmazon
Copy link
Member

sethAmazon commented Jun 11, 2021

What change did you make to the make file? I'm looking at the dockerfile and it seems to me only the amd64 (this maps to x86-64) binary is built. Does the amd64 binary work on arm64? To my knowledge this should not work since the instruction set is different.
Screen Shot 2021-06-11 at 10 28 28 AM

@sethAmazon
Copy link
Member

Using "docker buildx build -t $(DOCKER_NAMESPACE)/$(COMPONENT):$(VERSION) -f ./cmd/$(COMPONENT)/Dockerfile --platform=linux/arm64 --load ." for platform arm64 fails on the build step in the dockerfile both for the current amd64 and if I substitute with a arm64 build. Can you please add how you got this to build for arm64 platform.

@pingleig
Copy link
Member

The Dockerfile under cmd is for building from source. You can build the binary for amd64 and arm64 directly using go's cross compile and build the docker image (using a different Dockerfile). #494 (comment) also mentioned it a bit.

@sethAmazon
Copy link
Member

sethAmazon commented Jun 22, 2021

@pingleig it seems in your docker for amazon cloud watch agent you curl the deb. You do not build locally. https://github.com/aws/amazon-cloudwatch-agent/blob/master/amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/Dockerfile please confirm or deny.

sethAmazon added a commit to sethAmazon/aws-otel-collector that referenced this issue Jun 22, 2021
@pingleig
Copy link
Member

sethAmazon added a commit to sethAmazon/aws-otel-collector that referenced this issue Jun 22, 2021
@anuraaga
Copy link
Contributor

@pingleig Can we go ahead and add building and release the arm64 image with next collector release?

@pingleig
Copy link
Member

@anuraaga To be honest I don't think we can make it for next release (if it's around end of this month). I think @sethAmazon has other tasks and we don't have integration test in our test framework yet. We only test arm binary and didn't test arm container image.

The tricky part is in releasing, we are not using docker build actions. We dump docker image as tar to private s3, then in a different release action, load the tar to push to ECR and Dockerhub.

@alolita
Copy link
Contributor

alolita commented Jun 23, 2021

@pingleig @anuraaga please sync up with me before adding this support. I'd like to see a design and maintenance proposal. Thanks!

cc: @ntyrewalla

@anuraaga
Copy link
Contributor

I see - I have a feeling the release will be pushed back a bit so if that can help, it would be good to prioritize. Arm64 support is very important for AWS as a whole.

XRay daemon workflow / Dockerfile is here maybe can copy paste something.

https://github.com/aws/aws-xray-daemon/blob/master/.github/workflows/release-publish-Dockerhub.yml

Ideally you can build the image in an action but if not, the actions workflow logs show what buildx commands are run so maybe they can help for copy pasting.

sethAmazon added a commit to sethAmazon/aws-otel-collector that referenced this issue Jun 23, 2021
sethAmazon added a commit to sethAmazon/aws-otel-collector that referenced this issue Jun 23, 2021
@sethAmazon
Copy link
Member

I have successfully created a sample commit of how this could work. I will be manually testing this on ecs today. After I will see about integration tests for this issue as well as talk to @alolita about maintenance of this feature.

sethAmazon added a commit to sethAmazon/aws-otel-collector that referenced this issue Jun 23, 2021
sethAmazon added a commit to sethAmazon/aws-otel-collector that referenced this issue Jun 23, 2021
@sethAmazon
Copy link
Member

How I tested
https://aws-otel.github.io/docs/setup/ecs 1 and 2.2

  1. Upload image to my ecr
  2. Create arm64 ec2
  3. Create ecs cluster and attach ec2
  4. Create iam roles also add ecr read to execution role since to test you need to read from ecr
  5. Create task using you will need to use jmb12686/socat instead of alpine/socat:latest since this needs to support arm64
    {
    "ipcMode": null,
    "executionRoleArn": "{your execution role arn}",
    "containerDefinitions": [
    {
    "dnsSearchDomains": null,
    "environmentFiles": null,
    "logConfiguration": {
    "logDriver": "awslogs",
    "secretOptions": null,
    "options": {
    "awslogs-group": "/ecs/aws-otel-EC2",
    "awslogs-region": "{your region}",
    "awslogs-create-group": "True",
    "awslogs-stream-prefix": "ecs"
    }
    },
    "entryPoint": null,
    "portMappings": [
    {
    "hostPort": 2000,
    "protocol": "udp",
    "containerPort": 2000
    },
    {
    "hostPort": 4317,
    "protocol": "tcp",
    "containerPort": 4317
    },
    {
    "hostPort": 8125,
    "protocol": "udp",
    "containerPort": 8125
    }
    ],
    "command": [
    "{your command}"
    ],
    "linuxParameters": null,
    "cpu": 0,
    "environment": [],
    "resourceRequirements": null,
    "ulimits": null,
    "dnsServers": null,
    "mountPoints": [],
    "workingDirectory": null,
    "secrets": null,
    "dockerSecurityOptions": null,
    "memory": null,
    "memoryReservation": 512,
    "volumesFrom": [],
    "stopTimeout": null,
    "image": "{your image}",
    "startTimeout": null,
    "firelensConfiguration": null,
    "dependsOn": null,
    "disableNetworking": null,
    "interactive": null,
    "healthCheck": null,
    "essential": true,
    "links": null,
    "hostname": null,
    "extraHosts": null,
    "pseudoTerminal": null,
    "user": null,
    "readonlyRootFilesystem": null,
    "dockerLabels": null,
    "systemControls": null,
    "privileged": null,
    "name": "aws-otel-collector"
    },
    {
    "dnsSearchDomains": null,
    "environmentFiles": null,
    "logConfiguration": {
    "logDriver": "awslogs",
    "secretOptions": null,
    "options": {
    "awslogs-group": "/ecs/aws-otel-EC2",
    "awslogs-region": "{your region}",
    "awslogs-create-group": "True",
    "awslogs-stream-prefix": "ecs"
    }
    },
    "entryPoint": null,
    "portMappings": [
    {
    "hostPort": 8000,
    "protocol": "tcp",
    "containerPort": 8000
    }
    ],
    "command": null,
    "linuxParameters": null,
    "cpu": 0,
    "environment": [
    {
    "name": "AWS_XRAY_DAEMON_ADDRESS",
    "value": "aws-otel-collector:2000"
    }
    ],
    "resourceRequirements": null,
    "ulimits": null,
    "dnsServers": null,
    "mountPoints": [],
    "workingDirectory": null,
    "secrets": null,
    "dockerSecurityOptions": null,
    "memory": null,
    "memoryReservation": null,
    "volumesFrom": [],
    "stopTimeout": null,
    "image": "611364707713.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-otel-goxray-sample-app:v0.0.1",
    "startTimeout": null,
    "firelensConfiguration": null,
    "dependsOn": [
    {
    "containerName": "aws-otel-collector",
    "condition": "START"
    }
    ],
    "disableNetworking": null,
    "interactive": null,
    "healthCheck": null,
    "essential": false,
    "links": [
    "aws-otel-collector"
    ],
    "hostname": null,
    "extraHosts": null,
    "pseudoTerminal": null,
    "user": null,
    "readonlyRootFilesystem": null,
    "dockerLabels": null,
    "systemControls": null,
    "privileged": null,
    "name": "aws-otel-emitter"
    },
    {
    "dnsSearchDomains": null,
    "environmentFiles": null,
    "logConfiguration": null,
    "entryPoint": null,
    "portMappings": [],
    "command": null,
    "linuxParameters": null,
    "cpu": 0,
    "environment": [],
    "resourceRequirements": null,
    "ulimits": null,
    "dnsServers": null,
    "mountPoints": [],
    "workingDirectory": null,
    "secrets": null,
    "dockerSecurityOptions": null,
    "memory": null,
    "memoryReservation": null,
    "volumesFrom": [],
    "stopTimeout": null,
    "image": "nginx:latest",
    "startTimeout": null,
    "firelensConfiguration": null,
    "dependsOn": [
    {
    "containerName": "aws-otel-collector",
    "condition": "START"
    }
    ],
    "disableNetworking": null,
    "interactive": null,
    "healthCheck": null,
    "essential": false,
    "links": null,
    "hostname": null,
    "extraHosts": null,
    "pseudoTerminal": null,
    "user": null,
    "readonlyRootFilesystem": null,
    "dockerLabels": null,
    "systemControls": null,
    "privileged": null,
    "name": "nginx"
    },
    {
    "dnsSearchDomains": null,
    "environmentFiles": null,
    "logConfiguration": {
    "logDriver": "awslogs",
    "secretOptions": null,
    "options": {
    "awslogs-group": "/ecs/statsd-emitter",
    "awslogs-region": "{your region}",
    "awslogs-create-group": "True",
    "awslogs-stream-prefix": "ecs"
    }
    },
    "entryPoint": [
    "/bin/sh",
    "-c",
    "while true; do echo 'statsdTestMetric:1|c' | socat -v -t 0 - UDP:127.0.0.1:8125; sleep 1; done"
    ],
    "portMappings": [],
    "command": null,
    "linuxParameters": null,
    "cpu": 0,
    "environment": [],
    "resourceRequirements": null,
    "ulimits": null,
    "dnsServers": null,
    "mountPoints": [],
    "workingDirectory": null,
    "secrets": null,
    "dockerSecurityOptions": null,
    "memory": null,
    "memoryReservation": null,
    "volumesFrom": [],
    "stopTimeout": null,
    "image": "jmb12686/socat",
    "startTimeout": null,
    "firelensConfiguration": null,
    "dependsOn": [
    {
    "containerName": "aws-otel-collector",
    "condition": "START"
    }
    ],
    "disableNetworking": null,
    "interactive": null,
    "healthCheck": null,
    "essential": false,
    "links": null,
    "hostname": null,
    "extraHosts": null,
    "pseudoTerminal": null,
    "user": null,
    "readonlyRootFilesystem": null,
    "dockerLabels": null,
    "systemControls": null,
    "privileged": null,
    "name": "aoc-statsd-emitter"
    }
    ],
    "placementConstraints": [],
    "memory": "2048",
    "taskRoleArn": "{your task role arn}",
    "compatibilities": [
    "EXTERNAL",
    "EC2"
    ],
    "taskDefinitionArn": "{your task def arn}",
    "family": "aws-otel-EC2",
    "requiresAttributes": [
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "ecs.capability.execution-role-awslogs"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.task-iam-role-network-host"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.ecr-auth"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.21"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.task-iam-role"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "ecs.capability.container-ordering"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "ecs.capability.execution-role-ecr-pull"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
    },
    {
    "targetId": null,
    "targetType": null,
    "value": null,
    "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
    }
    ],
    "pidMode": null,
    "requiresCompatibilities": [],
    "networkMode": "host",
    "cpu": "1024",
    "revision": 4,
    "status": "ACTIVE",
    "inferenceAccelerators": null,
    "proxyConfiguration": null,
    "volumes": []
    }

@sethAmazon
Copy link
Member

Screen Shot 2021-06-23 at 5 14 23 PM

@alolita alolita added the enhancement Request for enhancement other than new feature label Aug 4, 2021
@ulili5
Copy link
Author

ulili5 commented Oct 20, 2021

@sethAmazon ping me on our internal Slack or Chime. I can share with you my implementation and we can evaluate it...

@rakyll
Copy link
Contributor

rakyll commented Nov 23, 2021

With Fargate now supporting ARM64, I expect the demand to have ARM64 support will be critical for this image. We should help landing this if any help is needed.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Jan 23, 2022
@anuraaga anuraaga removed the stale label Jan 24, 2022
@anuraaga
Copy link
Contributor

As an update, we've been working on adding ARM64 support lately and should have it ready soon. Thanks for the patience.

@jefchien
Copy link
Member

jefchien commented Feb 1, 2022

We've just released v0.16.0. The new Docker images released to DockerHub and ECR include an ARM64 image.

@jefchien jefchien closed this as completed Feb 1, 2022
@ulili5
Copy link
Author

ulili5 commented Feb 17, 2022

Thanks great work. @jefchien, @anuraaga and the team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for enhancement other than new feature
Projects
None yet
Development

No branches or pull requests

7 participants