geekcell / github-action-aws-ecs-run-task Goto Github PK
View Code? Open in Web Editor NEWRun an AWS ECS Fargate task.
Home Page: https://www.geekcell.io
License: Apache License 2.0
Run an AWS ECS Fargate task.
Home Page: https://www.geekcell.io
License: Apache License 2.0
The current full example task fails as /bin/sh -c
only accepts a single argument.
The current example
override-container-command: |
/bin/sh
-c
php artisan migrate --force --ansi && \
php artisan db:seed --force --ansi && \
php artisan config:clear --ansi
will produce an ecs run-task
equivalent of:
aws ecs run-task ... \
--overrides '{ "containerOverrides": [ { "name": "foo", "command": ["/bin/sh", "-c", "php artisan migrate --force --ansi && \\", "php artisan db:seed --force --ansi && \\", "php artisan config:clear --ansi"] } ] }'
which executes the first argument (artisan migrate), but produces line 0 errors on the other commands.
It would be great to support a shell command helper that merges the [multiline] commands into a single argument (when they trail with a \
?). For now, I think we must do everything on a single line, e.g.
override-container-command: |
/bin/sh
-c
php artisan migrate --force --ansi && php artisan db:seed --force --ansi && php artisan config:clear --ansi
and should update the example?
I'm trying to use your Github action in a project, as it makes executing ECS tasks very very simple. It works like a charm for short (a couple minutes) ECS tasks, but I'm running into issues when I use it to run ECS task that takes longer to execute (10+ minutes).
ECS task gets started correctly by the Github action, runs till completion (I can see ECS logs output from github action) and then changes its status to Stopped in AWS Console. The Github action execution however just hangs there in running state forever (well, I've waited 20 minutes for it to complete and then cancelled the workflow). For shorter tasks the action execution completes as soon as ECS task goes into Stopped status.
Any advice how to get the action to work with longer ECS tasks?
Task configuration
- name: Run command
uses: geekcell/[email protected]
with:
cluster: clusterXYZ
task-definition: taskXYZ
assign-public-ip: 'DISABLED'
subnet-ids: subnet-123
security-group-ids: sg-123
tail-logs: true
override-container: Container
override-container-command: ${{ inputs.command }}
override-container-environment: |
NODE_ENV=dev
Cluster/task definitions:
const image = ecs.EcrImage.fromEcrRepository(repository, 'latest');
const vpc = ec2.Vpc.fromLookup(this, 'VPC', {
vpcId: 'vpc-123',
});
new ecs.Cluster(this, 'Cluster', {
clusterName: 'clusterXYZ',
vpc,
});
const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDefinition', {
family: 'taskXYZ',
memoryLimitMiB: 16384,
cpu: 4096,
taskRole: new Role(this, 'TaskRole', {
...
}
);
taskDefinition.addContainer('Container', {
image: image,
environment: { NODE_ENV: 'dev' },
logging: new ecs.AwsLogDriver({
streamPrefix: 'prefixXYZ',
mode: ecs.AwsLogDriverMode.NON_BLOCKING,
}),
});
I have some really long running ones. Yours is the only plugin that works. I turned logs off -- will that just exec the task and go?
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.