Code Monkey home page Code Monkey logo

github-action-aws-ecs-run-task's People

Contributors

bl00d4ngel avatar dependabot[bot] avatar ic3w0lf avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

github-action-aws-ecs-run-task's Issues

Example task fails

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?

Github action hangs for longer ECS tasks

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,
      }),
    });

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.