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

Consume v4 container metadata handler from ecs-agent module #3727

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

amogh09
Copy link
Contributor

@amogh09 amogh09 commented May 31, 2023

Summary

Consume v4 container metadata handler from ecs-agent module. The handler was added to ecs-agent module in #3720.

Implementation details

  • Added a new type TMDSAgentState struct that implements AgentState interface introduced in Add v4 container metadata handler to ecs-agent module #3720. AgentState interface has methods that ecs-agent module uses to get metadata information from Agent.
  • Updated TMDS setup to register v4 container metadata handler using tmdsv4.ContainerMetadataHandler function imported from ecs-agent module. The handler from ecs-agent module supports publishing of metrics, however, since ECS Agent does not support metrics publishing, metrics.NewNopEntryFactory() was used to supply the handler a no-op implementation of metrics publishing.
  • Removed the now redundant ContainerMetadataHandler function from agent/handlers/v4/container_metadata_handler.go file.

Testing

Test driven development practice was followed and unit tests for container metadata endpoints were improved in #3722 as a part of that. The improved unit tests, existing integration tests, and existing functional tests are passing.

In addition to automated tests, manual regression, stress, and performance testing was performed. For manual testing, Agent was built and run on an EC2 instance from the source in this PR. Another EC2 instance was provisioned with Agent v1.71.1.

Manual regression testing was done by calling v4 container metadata endpoints on the two instances for the same task (two replicas under a service), and the responses were compared using diff. No regression was detected.

For stress testing, v4 container metadata endpoint was called on both instances at 3000 rps. 100% success rate was achieved on both instances and no significant differences were seen in the throughput (both instances achieved ~3000 rps throughput).

For performance testing, profiling data was collected for heap and cpu usage from the two Agents while stress testing v4 container metadata endpoints. No significant differences were seen in CPU and heap usage.

New tests cover the changes: no

Description for the changelog

Consume v4 container metadata handler from ecs-agent module.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amogh09 amogh09 changed the base branch from master to dev May 31, 2023 16:17
@amogh09 amogh09 marked this pull request as ready for review May 31, 2023 18:47
@amogh09 amogh09 requested a review from a team as a code owner May 31, 2023 18:47
@amogh09 amogh09 merged commit 780efae into aws:dev Jun 2, 2023
xxx0624 pushed a commit to xxx0624/amazon-ecs-agent that referenced this pull request Jun 3, 2023
@yinyic yinyic mentioned this pull request Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants