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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f790a3c
Add network builder and platform APIs
samjkon Sep 29, 2023
f369d80
Fix failing checks
Sep 29, 2023
05951d2
Merge branch 'aws:dev' into dev
samjkon Sep 29, 2023
693fbe5
Fix import issues
Sep 29, 2023
99ac0bf
Fix vendor files
Sep 29, 2023
bb1f92c
Fix windows code
Sep 29, 2023
197e290
Fix vendor update issue
Sep 29, 2023
0bbd262
Add primary attribute to network interface
Oct 2, 2023
2cf471a
Merge branch 'aws:dev' into dev
samjkon Oct 9, 2023
d40005d
Merge branch 'aws:dev' into dev
samjkon Oct 17, 2023
4da2af6
Address review comments
Oct 17, 2023
979e884
Merge branch 'aws:dev' into dev
samjkon Oct 19, 2023
2f58cc4
Merge branch 'aws:dev' into dev
samjkon Oct 28, 2023
3b322d4
Merge branch 'aws:dev' into dev
samjkon Oct 31, 2023
81029de
Add awsvpc network namespace setup workflows
Oct 9, 2023
e117ce1
Fix merge conflicts
Oct 17, 2023
13d1e99
Fix tests
Oct 19, 2023
4607a64
Fix static checks
Oct 19, 2023
e91c0e6
Fix test failures
Oct 19, 2023
4287e8a
Fix vendor files
Oct 19, 2023
e42f76c
Fix windows tests
Oct 19, 2023
d235580
Fix windows test
Oct 19, 2023
438e6e3
Fix Static Check
Oct 19, 2023
b3c40a9
Fix windows tests
Oct 20, 2023
50023bf
Fix test failures
Oct 20, 2023
f00b1b5
Fix test failures
Oct 20, 2023
1d98e40
Nit picks
Oct 25, 2023
287230f
Fix rebase errors
Oct 29, 2023
8cf80a1
Fix comments
samjkon Nov 1, 2023
ffdedf8
Address comments
samjkon Nov 2, 2023
1a14227
Fix static check failures
samjkon Nov 3, 2023
f9e6ca3
Merge branch 'dev' into unl
samjkon Nov 3, 2023
0741698
Merge branch 'dev' into unl
samjkon Nov 3, 2023
0f1cdaf
Merge branch 'dev' into unl
samjkon Nov 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 32 additions & 4 deletions ecs-agent/data/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@
package data

import (
"bytes"
"encoding/json"

"github.com/aws/amazon-ecs-agent/ecs-agent/modeltransformer"

"github.com/pkg/errors"
bolt "go.etcd.io/bbolt"
)

type NetworkDataClient interface {
}

type Client struct {
Accessor DBAccessor
DB *bolt.DB
Expand Down Expand Up @@ -74,3 +71,34 @@ func (DBAccessor) Walk(bucket *bolt.Bucket, callback func(id string, data []byte

return nil
}

func (DBAccessor) WalkPrefix(bucket *bolt.Bucket, prefix string, callback func(id string, data []byte) error) error {
var (
cursor = bucket.Cursor()
search = []byte(prefix)
)

for id, data := cursor.Seek(search); id != nil && bytes.HasPrefix(id, search); id, data = cursor.Next() {
if err := callback(string(id), data); err != nil {
return err
}
}

return nil
}

func (DBAccessor) GetBucket(tx *bolt.Tx, name string, nested ...string) (*bolt.Bucket, error) {
bucket := tx.Bucket([]byte(name))
if bucket == nil {
return nil, errors.New("bucket does not exist: " + name)
}

for _, n := range nested {
bucket = bucket.Bucket([]byte(n))
if bucket == nil {
return nil, errors.New("bucket does not exist: " + name)
}
}

return bucket, nil
}
2 changes: 2 additions & 0 deletions ecs-agent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.26.0
github.com/stretchr/testify v1.8.2
github.com/vishvananda/netlink v1.2.1-beta.2
go.etcd.io/bbolt v1.3.6
golang.org/x/net v0.13.0
golang.org/x/sys v0.10.0
Expand Down Expand Up @@ -49,6 +50,7 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions ecs-agent/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,13 @@ github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=
github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
Expand Down
8 changes: 8 additions & 0 deletions ecs-agent/metrics/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ const (
agentAvailabilityNamespace = "Availability"
ACSDisconnectTimeoutMetricName = agentAvailabilityNamespace + ".ACSDisconnectTimeout"
TCSDisconnectTimeoutMetricName = agentAvailabilityNamespace + ".TCSDisconnectTimeout"

dbClientMetricNamespace = "Data"
GetNetworkConfigurationByTaskMetricName = dbClientMetricNamespace + ".GetNetworkConfigurationByTask"
SaveNetworkNamespaceMetricName = dbClientMetricNamespace + ".SaveNetworkNamespace"
GetNetworkNamespaceMetricName = dbClientMetricNamespace + ".GetNetworkNamespace"

networkBuilderNamespace = "NetworkBuilder"
BuildNetworkNamespaceMetricName = networkBuilderNamespace + ".BuildNetworkNamespace"
)
Loading