Giter Site home page Giter Site logo

travis-hub's Introduction

Travis Hub Build Status

Keeper of the statuses

Travis Hub is the application that, in the life-cycle of accepting, evaluating, and executing a build request, sits in the fifth position, next to Travis Logs.

In short Hub deals with updates to the job and build status coming in from the workers, while Logs deals with collecting build log output from them.

Once a build request has been:

they will be picked by a Worker which will execute the build Bash script as generated by the build script compiler).

The worker goes through a series of stages while acquiring and preparing a VM, and running the build script. Each time the state of the job changes the worker will send a message that will be processed by Hub. These messages are:

  • job:receive signals that the worker has picked up a job and is going to boot a VM for it. (This state is displayed as "booting" in the UI.)
  • job:start signals that the worker has started executing the build script.
  • job:finish signals that the worker has finished executing the build script.
  • job:restart occurs when the worker has troubles booting a VM, or looses connection to it while running the build script. (In this case the job's state will be reset to :created so that Scheduler will queue it again, and Worker will try again.

Processing these messages Hub will change the job's state in the database, set attributes such as received_at, potentially change the respective build's state as well. It will then emit events such as job:started or build:finished which will send out notifications to other parties (such as the web UI via Pusher, GitHub commit status or check run updates, email, IRC, webhook notifications etc).

Setup

First, run bundle install to retrieve dependencies from rubygems. Once key dependency, Sidekiq Pro required additional username/password config:

BUNDLE_GEMS__CONTRIBSYS__COM=username:password
bundle config https://gems.contribsys.com/ $BUNDLE_GEMS__CONTRIBSYS__COM 

Then, you'll need to install:

  • postgresql
  • rabbitmq
  • redis

Database Config

Once postgresql is installed, you'll need to setup a local test database:

createdb travis_test
curl -fs https://raw.githubusercontent.com/travis-ci/travis-migrations/master/db/main/structure.sql | psql travis_test

Make sure you can use postgresql as the database adapter, i.e. if you're using homebrew, your [email protected] should be brew linked to postgresql.

Testing

Once everything is setup, start the following services:

  • postgresql
  • rabbitmq
  • redis

run tests with:

bundle exec rspec

History

Travis Hub was the first service that we extracted from our Rails application apart from Travis Listener. It was huge, and did all the things that now are being split up into 6 applications (Gatekeeper, Scheduler, Hub, Logs, Sync, Tasks). Nowadays it is one of the smallest service that deals with our core models directly.

Contributing

We appreciate suggestions and contributions! See the CONTRIBUTING.md file for information on how to contribute to travis-hub. To chat about improvements, check out our community forum travis-ci.community and central issue tracker, travis-ci/travis-ci.

License & copyright

See MIT-LICENSE.

travis-hub's People

Contributors

acnagy avatar anarosas avatar artur-assembla avatar artursmirnov avatar banzaiman avatar bnferguson avatar bogdanap avatar carlad avatar clekstro avatar damianszymanski avatar drogus avatar eugene-travis avatar igorwwwwwwwwwwwwwwwwwwww avatar jaroslawsokol avatar joecorcoran avatar joshk avatar kl-7 avatar lucaspinto avatar meatballhat avatar michaelklishin avatar pavel-d avatar piotr-travisci avatar piotrmilcarz avatar porras avatar rkh avatar roidrage avatar sarahhodne avatar soulshake avatar svenfuchs avatar vijaycel 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

Watchers

 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

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.