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

Expose FaultInjection status in TaskResponse #4285

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

xxx0624
Copy link
Contributor

@xxx0624 xxx0624 commented Aug 14, 2024

Summary

This change is to expose the FaultInjection status to the TaskResponse so that GetTaskMetadata in AgentState can facilitate shared Faults handlers to determine if the new endpoints should be exposed to tasks.

Implementation details

Testing

Launch a task where the TMDS has this change and the new field is not visible in task metadata response

sh-5.2# curl ${ECS_CONTAINER_METADATA_URI_V4}/task | jq .

{
  "Cluster": "arn:aws:ecs:us-west-2:371230630865:cluster/tobedeletedsoon",
  "TaskARN": "arn:aws:ecs:us-west-2:371230630865:task/tobedeletedsoon/f35dd4dc38a84a9ab03ba517dae449e9",
  "Family": "shim-logger-test",
  "Revision": "6",
  "DesiredStatus": "RUNNING",
  "KnownStatus": "RUNNING",
  "Limits": {
    "CPU": 0.5,
    "Memory": 1024
  },
  "PullStartedAt": "2024-08-15T00:33:23.286905232Z",
  "PullStoppedAt": "2024-08-15T00:33:28.141762495Z",
  "AvailabilityZone": "us-west-2a",
  "LaunchType": "FARGATE",
  "Containers": [
    {
      "DockerId": "f35dd4dc38a84a9ab03ba517dae449e9-3147973833",
      "Name": "testing-1",
      "DockerName": "testing-1",
      "Image": "public.ecr.aws/amazonlinux/amazonlinux:2023",
      "ImageID": "sha256:03c807fdc5d40ab06b21c2e6d158c63c37d5149a127b7fdfa9e3c1150352ff20",
      "Labels": {
        "com.amazonaws.ecs.cluster": "arn:aws:ecs:us-west-2:371230630865:cluster/tobedeletedsoon",
        "com.amazonaws.ecs.container-name": "testing-1",
        "com.amazonaws.ecs.task-arn": "arn:aws:ecs:us-west-2:371230630865:task/tobedeletedsoon/f35dd4dc38a84a9ab03ba517dae449e9",
        "com.amazonaws.ecs.task-definition-family": "shim-logger-test",
        "com.amazonaws.ecs.task-definition-version": "6"
      },
      "DesiredStatus": "RUNNING",
      "KnownStatus": "RUNNING",
      "Limits": {
        "CPU": 2
      },
      "CreatedAt": "2024-08-15T00:33:44.293009889Z",
      "StartedAt": "2024-08-15T00:33:44.293009889Z",
      "Type": "NORMAL",
      "LogDriver": "awslogs",
      "LogOptions": {
        "awslogs-create-group": "true",
        "awslogs-group": "xing-testing-group",
        "awslogs-region": "us-west-2",
        "awslogs-stream": "xing-testing-prefix/testing-1/f35dd4dc38a84a9ab03ba517dae449e9",
        "mode": "non-blocking"
      },
      "ContainerARN": "arn:aws:ecs:us-west-2:371230630865:container/tobedeletedsoon/f35dd4dc38a84a9ab03ba517dae449e9/a7c6f438-8621-4ebe-b075-6a904cba03fd",
      "Networks": [
        {
          "NetworkMode": "awsvpc",
          "IPv4Addresses": [
            "10.194.20.158"
          ],
          "AttachmentIndex": 0,
          "MACAddress": "06:f3:f9:0a:00:af",
          "IPv4SubnetCIDRBlock": "10.194.20.0/24",
          "PrivateDNSName": "ip-10-194-20-158.us-west-2.compute.internal",
          "SubnetGatewayIpv4Address": "10.194.20.1/24"
        }
      ],
      "Snapshotter": "overlayfs"
    }
  ],
  "ClockDrift": {
    "ClockErrorBound": 0.253453,
    "ReferenceTimestamp": "2024-08-15T00:37:08Z",
    "ClockSynchronizationStatus": "SYNCHRONIZED"
  },
  "EphemeralStorageMetrics": {
    "Utilized": 238,
    "Reserved": 20496
  }
}

New tests cover the changes:
Yes

Description for the changelog

Feature - add an internal field in TaskResponse object.

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.

@xxx0624 xxx0624 force-pushed the fis-agentstate-cr branch from f9a0332 to acc5e02 Compare August 14, 2024 23:53
@xxx0624 xxx0624 marked this pull request as ready for review August 15, 2024 00:39
@xxx0624 xxx0624 requested a review from a team as a code owner August 15, 2024 00:39
@xxx0624 xxx0624 requested review from amogh09 and mye956 August 15, 2024 00:39
amogh09
amogh09 previously approved these changes Aug 15, 2024
@xxx0624 xxx0624 force-pushed the fis-agentstate-cr branch from 0d05fe1 to 5e8ed27 Compare August 15, 2024 23:07
@xxx0624 xxx0624 changed the title Expose FIS status in TaskResponse Expose FaultInjection status in TaskResponse Aug 15, 2024
@xxx0624 xxx0624 merged commit fd3693c into aws:dev Aug 16, 2024
40 checks passed
danehlim added a commit to danehlim/amazon-ecs-agent that referenced this pull request Aug 17, 2024
harishxr pushed a commit that referenced this pull request Aug 18, 2024
* Revert "Expose FaultInjection status in TaskResponse (#4285)"

This reverts commit fd3693c.

* Revert "Implementing network blackhole port handler"

This reverts commit 177dbd2.

* Revert "TaskStopVerificationACKResponder integration tests (#4282)"

This reverts commit d6fbc04.

* Revert "Container transition to MANIFEST_PULLED state should happen after network pause container reaches RESOURCES_PROVISIONED state (#4286)"

This reverts commit 6c7758d.
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