Coder Social home page Coder Social logo

lukaselmer / simple-job-runner Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 1.93 MB

Job Scheduling and Result Storage

License: MIT License

Ruby 82.80% JavaScript 0.67% CSS 1.73% HTML 11.21% Shell 1.34% CoffeeScript 2.25%
job-scheduler job-runner heroku-toolbelt database jobs ec2 log-collector eth project message-queue

simple-job-runner's Introduction

Simple Job Runner

Build Status Code Climate Test Coverage

Job Scheduling and Result Storage

Deployment

git clone [email protected]:lukaselmer/simple-job-runner.git
cd simple-job-runner
git fetch --all
git checkout master
heroku create
# heroku create prints the app APP_HOST, e.g. rocky-lowlands-2159.herokuapp.com
git push heroku master
# choose an random SECRET_RANDOM_API_KEY, e.g. zyMvxTzylN1ZKLd5TSaWQD9UsESsU00CGH3P
heroku config:set API_KEY=<SECRET_RANDOM_API_KEY> APP_HOST=rocky-lowlands-2159.herokuapp.com APP_PORT=443
heroku run rake db:migrate
heroku open

More info: https://devcenter.heroku.com/articles/getting-started-with-ruby#introduction

Domains

Master

https://simple-job-runner-master.herokuapp.com

Develop

https://simple-job-runner-develop.herokuapp.com

Testing

https://simple-job-runner-testing.herokuapp.com

Installation

git clone [email protected]:lukaselmer/simple-job-runner.git
cd simple-job-runner
ln -s ../../bin/check .git/hooks/pre-commit
bundle install
bin/check

Configuration

cp config/database.example.yml config/database.yml
cp config/application.example.yml config/application.yml

Database

Setup the database for development:

rake db:drop db:setup

Tests

Initialization

rake db:create:all

Run Tests

rspec

Run

rails s webrick

Remarks

If something goes wrong with all the running tasks:

Run.started.each{|r| r.run_group.update(running: false); r.update(started_at: nil)}
rr=Run.includes(:run_group).where(created_at: 10.days.ago...Time.now).map(&:run_group).uniq.map{|x|x.update(host_name: '')}
Run.find(16179).run_group.update(host_name: 'Lukass-MacBook-Pro-2.local')
Run.find(16179).run_group.runs.map{|x| x.ended_at? ? x.score.nil? : false}
# restart failed runs from one run group
rr=Run.includes(:run_group).where(created_at: 10.days.ago...Time.now).to_a.select{|x| x.ended_at && x.score.nil?}.first.run_group.runs.to_a.reject(&:score).map{|x| x.update(started_at: nil, ended_at: nil)}
Run.includes(:run_group).where(created_at: 5.days.ago...Time.now).to_a.select{|x| x.ended_at && x.score.nil?}.first.run_group.runs.to_a.reject(&:score).map{|x| RunsService.new.restart(x)}
Run.includes(:run_group).where(created_at: 1.days.ago...Time.now).to_a.select{|x| x.ended_at && x.score.nil?}.map{|x| RunsService.new.restart(x)}

Copyright

Coypright 2015 Lukas Elmer.

simple-job-runner's People

Contributors

lukaselmer avatar

Watchers

 avatar  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.