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

V1.28.0 stage #2032

Merged
merged 69 commits into from
May 16, 2019
Merged

V1.28.0 stage #2032

merged 69 commits into from
May 16, 2019

Conversation

fenxiong
Copy link
Contributor

@fenxiong fenxiong commented May 9, 2019

Summary

Stage agent 1.28.0. Changelog:

  • Feature - Introduce high density awsvpc tasks support
  • Enhancement - Introduce ECS_CGROUP_CPU_PERIOD to make cgroup cpu period configurable @boynux #1941
  • Enhancement - Add Private Host IPv4 address to container metadata @bencord0 #2000
  • Enhancement - Set terminal reason for volume task resource #2004
  • Bug - Fixed a bug where container health status is not updated when container status isn't changed #1972
  • Bug - Fixed a bug where containers in 'dead' or 'created' status are not cleaned up by the agent #2015

Implementation details

Testing

New tests cover the changes:

Description for the changelog

Licensing

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

fenxiong and others added 30 commits February 26, 2019 19:51
A high level workflow to for this is as follow:

1. An ACS handler, AttachInstanceENIHandler receives an AttachNetworkInterfacesMessage from ACS which contains the information of the trunk ENI. upon receiving this message the handler adds the trunk eni attachment to the attachment table in Agent's state;
2. Udev Watcher is periodically scanning through attached network devices on the instances and also listens to network device's attached event. Once it found that the trunk ENI is attached (it knows a device is the trunk ENI from information in attachment table added in step 1), it sends an AttachmentStateChange event to the global state change event channel;
3. An event handler, AttachmentEventHandler handles the AttachmentStateChange event from the event channel by sending it to backend.
Merge branch 'dev' into eni-trunking
Changes involve:
  1. Add capability "task-eni-trunking" to indicate eni trunking support
  2. Add branch plugin capability verification
  3. Add branch plugin version attribute
  4. Add agent config ECS_ENABLE_HIGH_DENSITY_ENI for enabling eni trunking
  5. Integrate with plugin packaging changes
For an AWSVPC task using trunk ENI "vpc-branch-eni" CNI plugin will be used(for ADD and DEL) instead of "ecs-cni" plugin when setting up pause container namespace.

- "InterfaceVlanProperties" struct added. It will contain mac address and ID of the trunk ENI.
- "ENI" struct extended to add "ENIType" field and "InterfaceVlanProperties" field. ENI type indicates the type of ENI. It could be either "standard" or "vlan-tagged". "InterfaceVlanProperties" field points to  InterfaceVlanProperties struct which will contain trunk ENI information.
- "BranchENIConfig" struct added. This will be used to invoke the "vpc-branch-eni" plugin in the similar fashion as "ENIConfig" is used for invoking "ecs-cni" plugin.
- A "Config" object contains all the information required for invoking the CNI plugin which sets up the pause container's network namespace. The config object is extended to include trunk ENI information which will be needed to construct "BranchENIConfig" object.
* Build with Go 1.12
* Test with Go 1.12
* Build test images with Go 1.12
…eter.

This is needed becasue microsoft/windowsservercore only supports 2016, it does not run on WS2019 machines.
We need to pass in a different base image for functional tests to run on WS2019 machines.

The change includes:
1. Allow integ test functional test to pass base image as parameter
2. Tag amazon-ecs-ftest-windows-base:make from base image parameter
3. Change all existing microsoft/windowsservercore to use amazon-ecs-ftest-windows-base:make
add noiseDelta to telemetry test
In TestPullImageInactivityTimeout and TestStatsInactivityTimeout, sometimes the inactivity handling gorouting has some delay and isn't able to trigger inactivity timeout before the reader finishes reading. Reducing the timeout to 1ms helps reduce flakiness.
Revise telemetry tests to use average across normalized datapoints
Conflicts:
    agent/ecscni/plugin.go (only changed by eni-trunking branch, keeps the changes)
    agent/functional_tests/tests/generated/simpletests_windows/simpletests_generated_windows_test.go (regenerated simple tests)
    agent/statemanager/state_manager.go (only changed by eni-trunking branch, keeps the changes)
fenxiong and others added 12 commits May 3, 2019 10:28
The test verifies that when ENI trunking is enabled, the Trunk ENI is attached when container instance reaches ACTIVE status, and it's detached when the container instance is deregistered.
also cleanup of 'dangling' images that have no tags or names associated
with them (ie, they show as <none> in 'docker images')

closes aws#1684

unit tests

dont touch dangling images -- for now

skip containers that don't have a finished time
Related issue: aws#1575
Related PR: aws#1730

PR 1730 adds the Public IP Address of the host to the container metadata
file, however the EC2 host may be configured without a public address.

In this case, the EC2 metadata API returns a 404 response, and the host
IP is not available to containers.

Example ECS Agent Log
```
[ERROR] Unable to retrieve Host Instance PublicIPv4 Address: EC2MetadataError: failed to make EC2Metadata request
caused by: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>
```

This commit adds an extra field to the container metadata json,
`HostPrivateIPv4Address` which is available on EC2 hosts without
 a public address.
Merge branch 'eni-trunking' into dev
Adds an option (ENIPauseContainerCleanupDelaySeconds) to delay the
cleanup of the pause container that owns the network namespace for
AWSVPC network mode tasks. In practice, this won't be used unless
other applications on host are making use of the AWSVPC ENI.

The option can be used by setting ecs.config.json:

```
{
    "ENIPauseContainerCleanupDelaySeconds": 10
}
```
@fenxiong fenxiong requested a review from a team May 9, 2019 18:19
Copy link
Contributor

@yhlee-aws yhlee-aws left a comment

Choose a reason for hiding this comment

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

Pending all tests.

@fenxiong fenxiong added the staging Trigger staging workflow label May 9, 2019
@fenxiong fenxiong added this to the 1.28.0 milestone May 9, 2019
@fenxiong fenxiong added staging Trigger staging workflow and removed staging Trigger staging workflow labels May 9, 2019
@fenxiong fenxiong merged commit d2456be into aws:master May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging Trigger staging workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.