GithubHelp home page GithubHelp logo

aldrinmartoq / a0-fasten-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a0/a0-fasten-ruby

0.0 2.0 0.0 2.99 MB

Fasten your seatbelts! ๐Ÿ’บ๐Ÿ’บ๐Ÿ’บ๐Ÿ’บ Run jobs in parallel, intelligently.

License: MIT License

Ruby 99.78% Shell 0.22%

a0-fasten-ruby's Introduction

Fasten your seatbelts! ๐Ÿ’บ๐Ÿ’บ๐Ÿ’บ๐Ÿ’บ

Run ruby code, shell code, or customized tasks in parallel using worker processes/threads. You can dynamically pause/continue/increase/decrease the number of tasks using our UI.

WARNING this is a Work In Progress project:

  • features are still being implemented
  • API could and will change

It has been released so people can try it and make feature requests, comments and suggestions.

Feature Roadmap

Task definitions:

  • define tasks from an YAML file
  • tasks definition can include shell code or eval'ed ruby code
  • tasks can also be defined with blocks of code, like RSpec.describe
  • tasks can have dependencies that are needed to reach a goal, similar to rake, make, and others

Execution:

  • tasks are executed in parallel, using worker processes/threads
  • process are preferred on POSIX systems, otherwise threads are used
  • default number of jobs is the # of real cpu cores on the system
  • in case of task Error or Exception, the whole run will be stopped
  • runner saves a log file in $(pwd)/fasten/log/runner/*name_of_runner*.log
  • each task saves its STDERR/STDOUT to a log file in $(pwd)/fasten/log/task/*name_of_task*.log
  • once finished, statistics are saved in $HOME/.fasten/stats/*name_of_runner*.csv, which include: status (DONE, FAIL), duration, average, stdev, error and count
  • display a summary table of the execution

UI/Curses

  • only available if the 'curses' gem is installed
  • Display number of jobs running, idle, waiting, and number of jobs (max)
  • Display current running tasks, pending tasks, waiting tasks, etc; showing which task is pending because other tasks need to be run first
  • Display the number of tasks done/pending
  • Display a progressbar
  • Display current local time
  • Pause whole runner with P key (waits current running tasks end)
  • Resume paused runner with R key
  • Press โฌ…๏ธ or โžก๏ธ keys to dynamically increase/decrease number of jobs
  • Use โฌ†๏ธ and โฌ‡๏ธ to select tasks
  • Calculate ETA, assuming all tasks take same time
  • Calculate ETA, based on saved tasks statistics
  • Live tail -f of selected tasks

UI/Console

  • Console is the default if STDOUT/STDIN is not a tty
  • Display each task as is being finished
  • Calculate ETA, assuming all tasks take same time
  • Calculate ETA, based on saved tasks statistics

CLI

  • provides a CLI for running *_fasten.rb ruby code

Installation

Add this line to your application's Gemfile:

gem 'fasten'
gem 'curses' # optional

And then execute:

$ bundle

Or install it yourself as:

$ gem install fasten

Usage

TODO: Write usage instructions here. Right now, check spec directory for sample code.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/a0/a0-fasten-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Fasten projectโ€™s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

a0-fasten-ruby's People

Watchers

 avatar  avatar

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.