Job State Central Command
Ruby Shell Dockerfile
Switch branches/tags
v0.1.0 deploy.2015-01-26.13-01 deploy.2015-01-26.12-59 deploy.2014-10-15.04-55 deploy.2014-10-15.04-54 deploy.2014-10-15.04-52 deploy.2014-10-15.04-51 deploy.2014-10-15.04-50 deploy.2014-10-15.04-49 deploy.2014-10-14.16-32 deploy.2014-10-14.16-31 deploy.2014-10-12.15-19 deploy.2014-10-11.12-31 deploy.2014-10-02.12-20 deploy.2014-09-19.09-21 deploy.2014-08-06.12-06 deploy.2014-08-05.10-47 deploy.2014-07-29.12-55 deploy.2014-07-08.12-23 deploy.2014-07-03.10-03 deploy.2014-06-20.08-17 deploy.2014-05-21.10-33 deploy.2014-05-06.09-37 deploy.2014-05-06.09-36 deploy.2014-05-01.15-37 deploy.2014-05-01.00-15 deploy.2014-04-30.06-36 deploy.2014-04-18.12-34 deploy.2014-04-08.00-51 deploy.2014-03-12.08-26 deploy.2014-02-11.12-01 deploy.2014-01-29.16-46 deploy.2014-01-29.15-58 deploy.2014-01-14.16-46 deploy.2014-01-14.13-39 deploy.2013-12-16.12-52 deploy.2013-12-10.12-28 deploy.2013-12-05.14-10 deploy.2013-12-04.12-56 deploy.2013-12-03.09-57 deploy.2013-11-28.13-20 deploy.2013-11-22.20-21 deploy.2013-11-13.09-39 deploy.2013-11-08.18-57 deploy.2013-11-08.17-13 deploy.2013-11-08.16-23 deploy.2013-11-08.13-16 deploy.2013-11-08.10-20 deploy.2013-10-16.16-30 deploy.2013-10-15.12-36 deploy.2013-10-15.12-33 deploy.2013-09-26.15-03 deploy.2013-09-26.13-35 deploy.2013-09-10.11-07 deploy.2013-09-04.12-24 deploy.2013-09-04.11-30 deploy.2013-09-04.10-53 deploy.2013-09-04.10-38 deploy.2013-08-29.09-43 deploy.2013-08-21.00-02 deploy.2013-08-14.17-18 deploy.2013-08-14.17-10 deploy.2013-08-14.10-40 deploy.2013-08-14.10-32 deploy.2013-08-14.10-25 deploy.2013-08-14.09-48 deploy.2013-08-14.09-33 deploy.2013-07-23.15-32 deploy.2013-07-14.15-43 deploy.2013-07-12.21-13 deploy.2013-07-08.13-35 deploy.2013-07-05.17-31 deploy.2013-07-04.15-20 deploy.2013-07-04.13-49 deploy.2013-07-04.13-32 deploy.2013-06-22.18-32 deploy.2013-06-22.18-17 deploy.2013-06-22.17-58 deploy.2013-06-22.17-46 deploy.2013-06-10.11-41 deploy.2013-06-10.09-51 deploy.2013-05-23.12-55 deploy.2013-05-23.12-52 deploy.2013-05-22.13-27 deploy.2013-05-20.14-02 deploy.2013-05-10.12-03 deploy.2013-05-06.17-40 deploy.2013-05-05.02-29 deploy.2013-05-05.01-57 deploy.2013-05-04.23-51 deploy.2013-05-01.21-50 deploy.2013-04-24.18-02 deploy.2013-04-22.14-02 deploy.2013-04-19.06-44 deploy.2013-04-17.19-23 deploy.2013-04-16.15-46 deploy.2013-04-12.13-29 deploy.2013-04-12.10-24 deploy.2013-03-30.11-34 deploy.2013-03-25.12-20
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin add an endpoint for job state updates May 24, 2017
config extract app context Oct 26, 2015
lib/travis Send category with broadcast data (#164) Aug 20, 2018
script Conditionally build on quay.io; add script/send-docker-hub-trigger an… Oct 13, 2017
spec Send category with broadcast data (#164) Aug 20, 2018
var/librato update librato space Dec 2, 2015
.gitignore Add docker-compose.yml Oct 11, 2017
.librato.yml update librato space Dec 2, 2015
.rspec Remove travis-core Oct 9, 2015
.ruby-version update ruby version Sep 15, 2017
.simplecov Improving visibility around spec coverage Mar 14, 2017
.travis.yml Skip docker stage in PRs and non-master builds Apr 16, 2018
CONTRIBUTING.md contributing updates Apr 29, 2013
Dockerfile Update Dockerfile from ruby:2.2.2 to ruby:2.4.2 to match Gemfile Oct 12, 2017
Gemfile add rollout to everygreen, dial down error logging May 5, 2018
Gemfile.lock Merge branch 'master' into bf-update-bunny-for-sni May 8, 2018
MIT-LICENSE.md explain hub in the readme Oct 9, 2015
NOTES.md Re-add Coder to see if that removes Encoding::UndefinedConversionError Nov 9, 2015
Procfile add an endpoint for job state updates May 24, 2017
README.md improve instrument log line Oct 10, 2015
Rakefile Remove logs structure creation/migration May 9, 2017
config.ru do not load hub/api unless in the web process May 24, 2017
docker-compose.yml Add docker-compose.yml Oct 11, 2017
docker-entrypoint.sh Add docker-compose.yml Oct 11, 2017

README.md

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 updates, email, IRC, webhook notifications etc).

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

See the CONTRIBUTING.md file for information on how to contribute to travis-hub. Note that we're using a [central issue tracker] (https://github.com/travis-ci/travis-ci/issues) for all the Travis projects.

License & copyright

See MIT-LICENSE.