Code Monkey home page Code Monkey logo

amazon-ecs-run-task's People

Contributors

allisaurus avatar clareliguori avatar dependabot-preview[bot] avatar dependabot[bot] avatar jamesiri avatar muya avatar piradeepk avatar smitp avatar yashdalfthegray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

amazon-ecs-run-task's Issues

Warning: The `set-output` command is deprecated and will be disabled soon

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
24
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

We are facing the warning while using the action Run muya/amazon-ecs-run-task@v1

Could you please help to fix the warning ?

Idea: Return the task log/output after task finishes if wait-for-finish set

First, thanks for all your updates to this action and your blog post, it was a big help to me! I'm not sure if this is the best place to talk about future ideas, but one idea I had was it would be really cool if the action could output the cloudwatch logs for the task when the task finishes. This is especially helpful if the task fails.

If anyone needs something like this today, I was able to implement this using another step like so. It will run even if the run-task step fails:

      - name: Fetch log output from run task
        if: always()
        run: |
          task_arn=${{ steps.run-task.outputs.task-arn }}
          if [ -n "$task_arn" ]; then
            #remove [] around task arn
            task_arn=`echo $task_arn | sed 's/[][]//g'`
            task_id=${task_arn##*/}
            aws logs get-log-events --log-group-name $LOG_GROUP_NAME --log-stream-name $LOG_PREFIX/$task_id --output text --start-from-head || exit 0
          else
            echo 'No logs available since run task did not run'
          fi

Perhaps another idea that would avoid cloudwatch logs altogether would be an action that can:

  1. Launch a task using run-task with --enable-execute-command and a container command like "sleep 3600"
  2. Wait until the task starts
  3. Run ECS's execute-command with the task id in step 1. I believe this should return the output from the command immediately to github actions. This does require the SSM Session Manager plugin though.
  4. Once execute-command completes, then stop the task.

I believe this way we could get the output of the command directly to github actions in real time as the command is running in the task. Unfortunately, there's no action I could find that can do ECS's execute-command yet, but hopefully some day. If I get some time, I may try this out with just aws cli commands. But for now, the step I posted above is working great to see logs from my task in Github actions.

Network configuration should not be set if networking mode of ECS task is not awsvpc

Even if we are setting capacity provider strategy, the action sends network configuration when running the task, while it shouldn't do this if the mode is e.g. bridged or host, because it can cause issues like

Error: Network Configuration is not valid for the given `networkMode` of this task definition. 

According to documentation, it's required only for awsvpc network mode (even if capacity provider strategy is set)

Step fails with no error message

I am using this action to run Django migration prior to deployment. It worked great the first time, but now the step is erroring out with an empty error message. I am not seeing the task show up in AWS console.

Here is the output I see:

Run muya/amazon-ecs-run-task@v1
  with:
    task-definition: /home/runner/work/_temp/task-definition--1908-YPaJWQ3ujiyu-.json
    cluster: redacted
    count: 1
    started-by: github-actions-DuncanTormey
    wait-for-finish: true
    subnets: redacted
    security-groups: redacted
    launch-type: FARGATE
  env:
    AWS_DEFAULT_REGION: redacted
    AWS_REGION: redacted
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
Warning: Ignoring property 'status' in the task definition file. This property is returned by the Amazon ECS DescribeTaskDefinition API and may be shown in the ECS console, but it is not a valid field when registering a new task definition. This field can be safely removed from your task definition file.
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
All tasks have stopped. Watch progress in the Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=redacted#/clusters/redacted/tasks
Error: 

Any ideas on what the empty Error might mean? At first I thought it might be a permissions issue, but the task worked great the first time.

Thanks for the great work on this GHA, really appreciate keeping this around when AWS should have implemented it 3 years ago.

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.