Coder Social home page Coder Social logo

elastic_whenever's People

Contributors

avinson avatar domcleal avatar hasimo avatar histoiredebabar avatar jotolo avatar kijimad avatar korbin avatar mfittko avatar nozayasu avatar pocke avatar stevenwilliamson avatar tobscher avatar wata727 avatar ybiquitous avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

elastic_whenever's Issues

Friendly README

Describe the following in README:

  • Differences with whenever, supported options
  • Mechanism of mapping with scheduled tasks

Current support policy

job_type

Not supported

set :job_templete

Not supported

env 'ENVIRONMENT_VARIABLE'

Not supported. Define environment variables in the task definition

every :reboot

Not supported

:roles options

Not supported

Elastic Whenever not working

Running this command used to work for me in other rails app that i've deployed to ECS, in a new rails app i'm deploying it stopped working. In another rails I deployed about 2 months ago, it worked perfectly well. Is there an update that we don't know about?

One significant difference I noticed is that events list has been moved to the EventBridge console, does that affect anything?

Even though the command executes successfully, no event is being created. Any idea why?

bundle exec elastic_whenever -i 'scheduled-events' --verbose --version --launch_type FARGATE --cluster $CLUSTER_NAME --task-definition $TASK_DEFINITION_NAME --container $CONTAINER_NAME --region $AWS_REGION --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --security-groups $SECURITY_GROUPS --subnets $SUBNETS

elastic_whenever can fail to schedule tasks due to hitting AWS API limits inside an ECS container

Problem:

We run elastic_whenever in an ECS Fargate container as part of a deploy process to schedule tasks. If you have a large number of scheduled tasks > 60, this can fail with the error message:

[fail] missing credential error occurred; please specify it with arguments, use shared credentials, or export `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variable.

This error is misleading the root cause of the problem is that API calls for fetching credentials for the role assigned to the ECS task is rate limited to a burst of 60 per second and a steady rate of 40 per second.

The problem occurs when tasks are deleted before adding the tasks again. The deletion phase creates a new aws sdk client for each task to be deleted. Each client requests credentials thus hitting the API limit when the scheduled tasks grow to 60+.

Expected:

elastic_whenever should complete even when the scheduled task count is greater than 60. It should request credentials as infrequently as possible to prevent hitting AWS API limits.

#51 fixes this issue

Handling `bundler exec`

Pre-Rails 3 apps and apps that don't use Bundler will redefine the rake and runner jobs respectively to function correctly.

Support `command` syntax

every :day do
  command "/usr/bin/awesome_cmd"
end
0 0 * * * /bin/bash -l -c '/usr/bin/awesome_cmd'

Support `sunday` syntax

Whenever supports any day of the week or symbol such as :weekend and :weekday.

every :sunday, :at => '12pm' do
  runner "Task.do_something_great"
end

Validate `ecsEventsRole` permission

Elastic whenever uses the IAM role named ecsEventsRole. It has proper permissions when created by the system. (e.g. elastic whenever, management console, etc)
However, if a user creates it oneself, it may not has the appropriate permissions.

Validate container name of input

Even if specify a container name that does not exist in the task definition, no error occurs. Therefore, need to validate the container name.

Support `environment` syntax and add `--environment` option

Hi, thanks for the very nice gem.

I'd like to use the environment syntax on a configuration file instead of the @environment instance variable.

Because:

  • Referring to instance variables feel weird to some people.
  • It seems hard to find a relationship between a CLI option (e.g. --set 'environment=staging') and @environment in a configuration file.

So, I suggest as follow:

  1. Can access to a new environment syntax:
-if @environment == 'production'
+if environment == 'production'
   every :day, at: '03:00am' do
     runner 'Hoge.run'
   end
 end
  1. Add a new --environment CLI option (default: production) instead of --set 'environment=...'.
-elastic_whenever --set 'environment=staging'
+elastic_whenever --environment=staging

What do you think about this suggestion?
It would be great if you could consider this. Thanks.

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.