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

ecs_* - add waiters #1209

Merged
merged 6 commits into from
Jun 29, 2022
Merged

Conversation

jatorcasso
Copy link
Contributor

@jatorcasso jatorcasso commented Jun 3, 2022

Originally-Depends-On: #1212

SUMMARY
  • Add wait parameter to utilize boto3 waiters in ecs_service and ecs_task (ServicesInactive, TasksStopped, TasksRunning).
  • There's an additional waiter for ServicesStable but idempotence checked never failed locally so it seems redundant when creating a service.

Ref #1142

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • ecs_service
  • ecs_task
ADDITIONAL INFORMATION

When testing the waiter for TasksRunning, tests failed on waiter error due to the container instance not being able to be created, not because of the waiter, so I commented out those tests for now.

In the ECS console:

Stopped reason CannotPullContainerError: inspect image has been retried 5 time(s): failed to resolve ref "docker.io/library/nginx:latest": failed to do request: Head https://registry-1.docker.io/v2/library/nginx/manifests/latest: dial tcp 34.237.244.67:443: i/o timeout

@jatorcasso jatorcasso requested a review from markuman June 3, 2022 15:52
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration module module needs_triage plugins plugin (any type) tests tests labels Jun 3, 2022
@markuman
Copy link
Member

markuman commented Jun 3, 2022

Stopped reason CannotPullContainerError: inspect image has been retried 5 time(s): failed to resolve ref "docker.io/library/nginx:latest": failed to do request: Head https://registry-1.docker.io/v2/library/nginx/manifests/latest: dial tcp 34.237.244.67:443: i/o timeout

Maybe we must also create an ECR, pull the nginx image and push to the ECR.
Afterwards, delete the ECR.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 4m 28s (non-voting)
✔️ build-ansible-collection SUCCESS in 5m 13s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 07s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 30s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 14m 04s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 10m 56s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 16s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 45s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 35s
✔️ ansible-test-splitter SUCCESS in 2m 25s
✔️ integration-community.aws-1 SUCCESS in 5m 20s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@jatorcasso jatorcasso changed the title ecs_* - add waiters and some bugfixes ecs_* - add waiters Jun 3, 2022
@jatorcasso jatorcasso requested a review from markuman June 3, 2022 23:05
@ansibullbot ansibullbot added the feature This issue/PR relates to a feature request label Jun 3, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 4m 03s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 52s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 12s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 24s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 12m 57s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 10m 52s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 12m 29s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 5m 40s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 22s
✔️ ansible-test-splitter SUCCESS in 2m 46s
✔️ integration-community.aws-1 SUCCESS in 5m 24s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@markuman markuman added the backport-3 PR should be backported to the stable-3 branch label Jun 4, 2022
plugins/modules/ecs_service.py Outdated Show resolved Hide resolved
@markuman markuman mentioned this pull request Jun 5, 2022
10 tasks
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 4m 47s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 46s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 56s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 11m 24s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 12m 58s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 10m 05s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 34s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 5m 43s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 47s
✔️ ansible-test-splitter SUCCESS in 2m 58s
✔️ integration-community.aws-1 SUCCESS in 5m 15s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

plugins/modules/ecs_service.py Outdated Show resolved Hide resolved
plugins/modules/ecs_task.py Outdated Show resolved Hide resolved
plugins/modules/ecs_task.py Outdated Show resolved Hide resolved
patchback bot pushed a commit that referenced this pull request Jun 8, 2022
…`` (#1212)

ecs_* - fix idempotence bug in ecs_service and dont require ``cluster``

SUMMARY

Don't require cluster param and use cluster name 'default' when not specified (see docs).
Fix bug when comparing health_check_grace_period_seconds when not input by user.

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ecs_service
ecs_task

ADDITIONAL INFORMATION
Split up from #1209 to backport to stable-2

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit bac2473)
patchback bot pushed a commit that referenced this pull request Jun 8, 2022
…`` (#1212)

ecs_* - fix idempotence bug in ecs_service and dont require ``cluster``

SUMMARY

Don't require cluster param and use cluster name 'default' when not specified (see docs).
Fix bug when comparing health_check_grace_period_seconds when not input by user.

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ecs_service
ecs_task

ADDITIONAL INFORMATION
Split up from #1209 to backport to stable-2

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis <None>
(cherry picked from commit bac2473)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 15, 2022
…`` (#1212) (#1231)

[PR #1212/bac24736 backport][stable-3] ecs_* - fix idempotence bug in ecs_service and dont require ``cluster``

This is a backport of PR #1212 as merged into main (bac2473).
SUMMARY

Don't require cluster param and use cluster name 'default' when not specified (see docs).
Fix bug when comparing health_check_grace_period_seconds when not input by user.


ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ecs_service
ecs_task

ADDITIONAL INFORMATION
Split up from #1209 to backport to stable-2

Reviewed-by: Mark Chappell <None>
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 15, 2022
…`` (#1212) (#1230)

[PR #1212/bac24736 backport][stable-2] ecs_* - fix idempotence bug in ecs_service and dont require ``cluster``

This is a backport of PR #1212 as merged into main (bac2473).
SUMMARY

Don't require cluster param and use cluster name 'default' when not specified (see docs).
Fix bug when comparing health_check_grace_period_seconds when not input by user.


ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ecs_service
ecs_task

ADDITIONAL INFORMATION
Split up from #1209 to backport to stable-2

Reviewed-by: Mark Chappell <None>
@jatorcasso jatorcasso marked this pull request as ready for review June 28, 2022 19:57
Co-authored-by: Markus Bergholz <[email protected]>
@tremble tremble added backport-4 PR should be backported to the stable-4 branch and removed backport-3 PR should be backported to the stable-3 branch labels Jun 29, 2022
@markuman markuman added the mergeit Merge the PR (SoftwareFactory) label Jun 29, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 4m 00s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 57s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 11s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 14s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 23s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 27s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 5m 40s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 11s
✔️ ansible-test-splitter SUCCESS in 2m 25s
✔️ integration-community.aws-1 SUCCESS in 5m 15s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul
Copy link
Contributor

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

@tremble tremble added mergeit Merge the PR (SoftwareFactory) and removed mergeit Merge the PR (SoftwareFactory) labels Jun 29, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 3m 57s (non-voting)
✔️ build-ansible-collection SUCCESS in 5m 01s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 03s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 02s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 32s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 01s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 04s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 46s
✔️ ansible-test-splitter SUCCESS in 2m 28s
✔️ integration-community.aws-1 SUCCESS in 6m 22s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul
Copy link
Contributor

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

@tremble tremble merged commit cff148f into ansible-collections:main Jun 29, 2022
@patchback
Copy link

patchback bot commented Jun 29, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/cff148f0da99600f707387fe6e9943c442b1132a/pr-1209

Backported as #1274

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 29, 2022
SUMMARY

    Add wait parameter to utilize boto3 waiters in ecs_service and ecs_task (ServicesInactive, TasksStopped, TasksRunning).
    There's an additional waiter for ServicesStable but idempotence checked never failed locally so it seems redundant when creating a service.

ISSUE TYPE

    Feature Pull Request

COMPONENT NAME

    ecs_service
    ecs_task

ADDITIONAL INFORMATION

When testing the waiter for TasksRunning, tests failed on waiter error due to the container instance not being able to be created, not because of the waiter, so I commented out those tests for now.

In the ECS console:

Stopped reason CannotPullContainerError: inspect image has been retried 5 time(s): failed to resolve ref "docker.io/library/nginx:latest": failed to do request: Head https://registry-1.docker.io/v2/library/nginx/manifests/latest: dial tcp 34.237.244.67:443: i/o timeout

* add waiters and fix some bugs
* add changelog
* move bugfixes to different PR for backporting purposes
* update wait description
* catch WaiterError
* Bump version_added

(cherry picked from commit cff148f)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 29, 2022
[PR #1209/cff148f0 backport][stable-4] ecs_* - add waiters

This is a backport of PR #1209 as merged into main (cff148f).
Originally-Depends-On: #1212
SUMMARY

Add wait parameter to utilize boto3 waiters in ecs_service and ecs_task (ServicesInactive, TasksStopped, TasksRunning).
There's an additional waiter for ServicesStable but idempotence checked never failed locally so it seems redundant when creating a service.

Ref #1142
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ecs_service
ecs_task

ADDITIONAL INFORMATION
When testing the waiter for TasksRunning, tests failed on waiter error due to the container instance not being able to be created, not because of the waiter, so I commented out those tests for now.
In the ECS console:
Stopped reason CannotPullContainerError: inspect image has been retried 5 time(s): failed to resolve ref "docker.io/library/nginx:latest": failed to do request: Head https://registry-1.docker.io/v2/library/nginx/manifests/latest: dial tcp 34.237.244.67:443: i/o timeout

Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…ons#1209)

lambda_event: Add support for FunctionResponseTypes

SUMMARY

Resolves ansible-collections#1081
Added support to set FunctionResponseTypes when creating lambda event source mappings

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

lambda_event
ADDITIONAL INFORMATION


Can be tested using below playbook (needs a dynamo db table and lambda function with appropriate access/policy/role)

---
- name: lambda_event
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Create DynamoDB stream event mapping (trigger)
      amazon.aws.lambda_event:
        state: present
        event_source: stream
        function_name: my-test-function
        source_params:
          source_arn: arn:aws:dynamodb:us-east-2:721234567890:table/my-test-table/stream/2022-10-26T17:55:25.232
          enabled: True
          batch_size: 500
          starting_position: LATEST
          function_response_types:
            - ReportBatchItemFailures
      register: event

    - name: Get info on above trigger
      command: 'aws lambda get-event-source-mapping --uuid {{ event.events.uuid }}'
      environment:
        AWS_ACCESS_KEY_ID: "{{ aws_access_key }}"
        AWS_SECRET_ACCESS_KEY: "{{ aws_secret_key }}"
        AWS_SESSION_TOKEN: "{{ security_token | default('') }}"
        AWS_DEFAULT_REGION: "{{ aws_region }}"
      register: my_function_details

    - name: convert it to an object
      set_fact:
        my_function_details_obj: "{{ my_function_details.stdout | from_json }}"

    - assert:
        that:
          - my_function_details_obj.FunctionResponseTypes is defined
          - my_function_details_obj.FunctionResponseTypes | length > 0
          - my_function_details_obj.FunctionResponseTypes[0] == "ReportBatchItemFailures"

Reviewed-by: Bikouo Aubin <None>
Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: GomathiselviS <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4 PR should be backported to the stable-4 branch bug This issue/PR relates to a bug community_review feature This issue/PR relates to a feature request has_issue integration tests/integration mergeit Merge the PR (SoftwareFactory) module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants