muya / amazon-ecs-run-task Goto Github PK
View Code? Open in Web Editor NEWThis project forked from yashdalfthegray/amazon-ecs-run-task
Runs an Amazon ECS task on an ECS cluster, with options to set Capacity Provider Strategy
License: MIT License
This project forked from yashdalfthegray/amazon-ecs-run-task
Runs an Amazon ECS task on an ECS cluster, with options to set Capacity Provider Strategy
License: MIT License
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 ?
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:
--enable-execute-command
and a container command like "sleep 3600"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.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.
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)
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.
The save-state
and set-output
commands have been marked as deprecated by GitHub: GitHub Actions: Deprecating save-state and set-output commands
Update the libraries & actions in this action to utilize updated commands.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.