Enterprise Worker Start & Debug Containers

Stopping and Starting the Worker #

With Ubuntu 16.04 as host operating system #

The Travis CI Worker is installed as an systemd service. The following commands can be used to check the status and start/stop the service:

$ sudo systemctl status travis-worker
$ sudo systemctl start travis-worker
$ sudo systemctl stop travis-worker

With Ubuntu 14.04 as host operating system #

The Travis CI Worker is installed as an upstart service. The following commands can be used to check the status of the service, and to start or stop it.

$ sudo status travis-worker
travis-worker start/running, process 9622
$ sudo stop travis-worker
travis-worker stop/waiting
$ sudo start travis-worker
travis-worker start/running, process 16339

When the worker gets stopped with sudo stop travis-worker it gets shut down with a KILL signal. This stops all currently running build jobs and will enqueue them when the worker starts again. If you’d like to wait until some or all jobs are being worked off successfully, you can issue a SIGINT instead. This together with a sleep ensures that either at least some or all active jobs can finish (depending on how long your queue is). After sleep finished the worker has to be shutdown via sudo stop travis-worker.\

Example Worker Stop and Start #

travis-worker behaves differently based on the signals it receives. For instance a SIGINT drains the queue, it gives travis-worker enough time to work off all jobs which are still in progress but it doesn’t accept any new ones anymore.

SIGKILL on the other hand shuts down travis-worker immediately and cancels all currently running jobs. If you start the worker again afterwards, all previously enqueued and running jobs are re-queued again so they’ll get worked off as usual.

With Ubuntu 16.04 as host operating system #

With Ubuntu 16.04 as the host operating system, travis-works runs inside a Docker container, so starting and stopping the worker now works via systemctl:

$ sudo systemctl start travis-worker
$ sudo systemctl stop travis-worker
$ sudo systemctl status travis-worker

To send a SIGINT signal, please run the following:

sudo docker kill -s SIGINT travis-worker

With Ubuntu 14.04 as host operating system #

In this example, a sleep 60 is used to allow jobs to complete before the worker is stopped. The actual value depends on how long your current job queue is and how long it takes in average for a job to finish, so you may wish to adjust accordingly.

$ sudo status travis-worker
travis-worker start/running, process 5671
$ sudo kill -s INT 5671
$ sleep 60
$ sudo status travis-worker
travis-worker start/post-stop, process 9405
$ sudo stop travis-worker

Starting Worker Debug Containers #

In order to start a build container on a Travis CI Enterprise Worker host you can do the following:

# start a container and grab the port
id=$(docker -H tcp://0.0.0.0:4243 run -d -p 22 travis:php /sbin/init)
port=$(docker -H tcp://0.0.0.0:4243 port $id 22 | sed 's/.*://')

# ssh into the container (the default password is travis)
ssh travis@localhost -p $port

# stop and remove the container
docker -H tcp://0.0.0.0:4243 kill $id
docker -H tcp://0.0.0.0:4243 rm $id

(If travis-worker runs on Ubuntu 16.04, -H tcp://0.0.0.0:4243 is not necessary anymore)

Contact Enterprise Support #

To get in touch with us, please write a message to enterprise@travis-ci.com. If possible, please include as much of the following as you can:

  • Description of the problem - what are you observing?
  • Which steps did you try already?
  • A support bundle (You can get it from https://yourdomain:8800/support)
  • Log files from all workers (They can be found at /var/log/upstart/travis-worker.log - please include as many as you can retrieve).
  • If a build failed or errored, a text file of the build log

Have you made any customizations to your setup? While we may be able to see some information (such as hostname, IaaS provider, and license expiration), there are many other things we can’t see which could lead to something not working. Therefore , we’d like to ask you to also answer the questions below in your support request (if applicable):

  • How many machines are you using?
  • Do you use configuration management tools (Chef, Puppet)?
  • Which other services do interface with Travis CI Enterprise?
  • Do you use Travis CI Enterprise together with github.com or GitHub Enterprise?
  • If you’re using GitHub Enterprise, which version of it?

We’re looking forward to helping!