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

Implement regular ENI and branch ENI configuration #3972

Merged
merged 34 commits into from
Nov 5, 2023
Merged

Conversation

samjkon
Copy link
Contributor

@samjkon samjkon commented Oct 19, 2023

Summary

This PR implements regular ENI and branch ENI configuration for the containerd platform including network namespace setup, DNS config file creation and CNI plugin execution. Additionally it includes many additional wrapper utilities and their corresponding mock files.

Implementation details

Changes in NetworkBuilder:

  • Implemented the Start method for AWSVPC network mode.

Changes in ecs-agent/netlib/platform package:

  • Implemented methods to create netns, write DNS config files and invoke CNI plugins.
  • Implemented methods to convert interface/netns level data into inputs to the libCNI APIs in order to facilitate CNI plugin executions.
  • Added tests to verify right method invocations during network namespace creation.

Changes in ecs-agent/volume package:

  • A new interface named VolumeAccessor is introduced. This is mainly to allow copying files in to task volumes from the root volume. The VolumeAccessor is agent specific, the concrete implementation is not included here. It will be done in the agent specific code during the integration phase.

Changes in ecs-agent/data package:

  • Removed the NetworkDataClient from here and moved it to a new package ecs-agent/netlib/data.
  • Added methods to get a bucket from boltDB and to get all entries from a bucket that has a key with a given prefix. This is used to fetch all network namespace objects from the DB that is associated to a given task ID.

Changes in ecs-agent/netlib/data package:

  • Added functions to access network namespace object from the boltDB.

Dependencies are updated in go.mod and the vendor directory to include https://github.com/vishvananda/netlink to the list.

Added copyright comment in several new and old files.

Testing

New tests cover the changes: Yes. Further integration tests will be added in subsequent PRs with dependent code.

Description for the changelog

Implement regular ENI and branch ENI configuration

Does this PR include breaking model changes? If so, Have you added transformation functions?
No

Licensing

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

@samjkon samjkon marked this pull request as ready for review October 20, 2023 20:11
@samjkon samjkon requested a review from a team as a code owner October 20, 2023 20:11
@samjkon samjkon changed the title [DRAFT] UNL: Implement regular ENI and branch ENI configuration UNL: Implement regular ENI and branch ENI configuration Oct 20, 2023
Copy link
Contributor

@Realmonia Realmonia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the PR name - remove UNL from it?

ecs-agent/netlib/network_builder.go Show resolved Hide resolved
ecs-agent/netlib/platform/common_linux.go Outdated Show resolved Hide resolved
ecs-agent/netlib/network_builder.go Show resolved Hide resolved
ecs-agent/netlib/network_builder.go Show resolved Hide resolved
ecs-agent/netlib/platform/cniconf_linux.go Show resolved Hide resolved
ecs-agent/netlib/platform/api.go Outdated Show resolved Hide resolved
ecs-agent/volume/tmp_accessor.go Outdated Show resolved Hide resolved
ecs-agent/netlib/platform/common_linux.go Show resolved Hide resolved
ecs-agent/netlib/platform/common_linux.go Show resolved Hide resolved
@samjkon samjkon changed the title UNL: Implement regular ENI and branch ENI configuration Implement regular ENI and branch ENI configuration Oct 25, 2023
Realmonia
Realmonia previously approved these changes Oct 25, 2023
ecs-agent/netlib/data/network_client.go Show resolved Hide resolved
ecs-agent/netlib/network_builder.go Outdated Show resolved Hide resolved
ecs-agent/netlib/network_builder.go Show resolved Hide resolved
ecs-agent/netlib/platform/cniconf_linux.go Show resolved Hide resolved
ecs-agent/netlib/platform/common.go Show resolved Hide resolved
@samjkon samjkon merged commit f374bfb into aws:dev Nov 5, 2023
36 checks passed
as14692 pushed a commit to as14692/amazon-ecs-agent that referenced this pull request Nov 6, 2023
This PR implements regular ENI and branch ENI configuration for the containerd platform including network namespace setup, DNS config file creation and CNI plugin execution. Additionally it includes many additional wrapper utilities and their corresponding mock files.

---------

Co-authored-by: Samuel Konat <[email protected]>
@chienhanlin chienhanlin mentioned this pull request Nov 13, 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