Giter VIP home page Giter VIP logo

Comments (14)

bmbferreira avatar bmbferreira commented on August 20, 2024 15

Like @erikahansen pointed out, we also ended up adding an extra step doing a post deployment check to verify this. Here's how we did it:

...
- name: Deploy to ECS
  uses: aws-actions/amazon-ecs-deploy-task-definition@v1
  id: ecs-deploy
  with:
    task-definition: ${{ steps.task-def.outputs.task-definition }}
    service: ${{ matrix.service }}
    cluster: ${{ env.CLUSTER_NAME }}
- name: Check if deployment was successful
  id: check-deployment
  run: |
     CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ env.CLUSTER_NAME }} --services ${{ matrix.service }} --query services[0].deployments[0].taskDefinition | jq -r ".")
     NEW_TASK_DEF_ARN=${{ steps.ecs-deploy.outputs.task-definition-arn }}
     echo "Current task arn: $CURRENT_TASK_DEF_ARN"
     echo "New task arn: $NEW_TASK_DEF_ARN"
     if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
       echo "Deployment failed."
       exit 1
     fi
...

However, it would be good to have this action checking that already... I will try to find the time to work on it.

from amazon-ecs-deploy-task-definition.

erikahansen avatar erikahansen commented on August 20, 2024 1

We built into our pipeline a post-deployment check that verifies that the new registered revision is the current task definition in ECS.

from amazon-ecs-deploy-task-definition.

jdjkelly avatar jdjkelly commented on August 20, 2024 1

+1 critically important feature

from amazon-ecs-deploy-task-definition.

CalebC-RW avatar CalebC-RW commented on August 20, 2024

How is the deployment circuit breaker enabled? I do not see the option being submitted to ecs.updateService. https://github.com/aws-actions/amazon-ecs-deploy-task-definition/blob/master/index.js#L26

from amazon-ecs-deploy-task-definition.

spyoungtech avatar spyoungtech commented on August 20, 2024

@CalebC-RW the circuit breaker is an ECS service feature. You can see it referenced in the link above or in the AWS CLI ECS update-service documentation for example.

from amazon-ecs-deploy-task-definition.

CalebC-RW avatar CalebC-RW commented on August 20, 2024

@spyoungtech, thanks for replying! I see that the circuit breaker feature can be enabled on the service (using the old ECS experience on the console or when creating the service). We have tried to enable it on the service and then run this action, but it seems to not be taking effect (failing deployments are being retried repeatedly and not being rolled back). Does it need to be enabled with the "updateService" call (during deployment) as well as be enabled for the service? If it does, this action does not seem to enable the flag when it calls updateService.

Or, am I completely misunderstanding this feature.

from amazon-ecs-deploy-task-definition.

CalebC-RW avatar CalebC-RW commented on August 20, 2024

I believe I have addressed my questions. The rollback process does seem to work (without specifying it on the update-service instruction), though it does take time. I have not determined how many attempts that the deployment makes before the circuit breaker kicks in and performs the rollback. My services are such that if the deployment fails, they will almost certainly fail after the first deployment attempt and consistently thereafter. After many tests, we have determined that setting the wait-time to a little longer than a successful deployment but shorter than a few failures lets the action fail when the deployment fails and succeed when it succeeds.

I wish that this action/deployment process let us more explicitly specify the number of deployment attempts before rollback and to let the action fail when a rollback occurs (as @spyoungtech originally requested).

from amazon-ecs-deploy-task-definition.

chrispetsos avatar chrispetsos commented on August 20, 2024

+1 for this, please make this workaround part of the core functionality of this Action.

from amazon-ecs-deploy-task-definition.

eagleeyec avatar eagleeyec commented on August 20, 2024

+1 we need this feature too, currently failures in prod are hidden without this workaround

from amazon-ecs-deploy-task-definition.

lexabug avatar lexabug commented on August 20, 2024

+1 for this. I need this workaround to be a part of the core functionality.

from amazon-ecs-deploy-task-definition.

healthbjk avatar healthbjk commented on August 20, 2024

Very important to fix

from amazon-ecs-deploy-task-definition.

larry-flexpa avatar larry-flexpa commented on August 20, 2024

+1 really should be part of core functionality now

from amazon-ecs-deploy-task-definition.

raf-stx avatar raf-stx commented on August 20, 2024

+1 for this feature

from amazon-ecs-deploy-task-definition.

vitalykarasik avatar vitalykarasik commented on August 20, 2024

Hi,
Is there any update on this?

from amazon-ecs-deploy-task-definition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.