The Jenkins Idler is a service which idles perspectively unidles a tenant's Jenkins instance. In order to determine whether a Jenkins instance can be idled, the Idler monitors OpenShift Build and DeploymentConfig changes. It also keeps track of direct access to the UI as well as GitHub webhook deliveries.
- Idler watches Build and DeploymentConfig changes in OpenShift
- Idler controls the state of Jenkins DeploymentConfig in OpenShift
- Idler is checking Jenkins Proxy for number of buffered webhook requests and last access to Jenkins UI
- Proxy caches webhook requests while Jenkins is un-idling
Jenkins Idler is the sister project to fabric8-jenkins-proxy(Jenkins Proxy).
The following paragraphs describe how to build and work with the source.
The project is written in Go, so you will need a working Go installation (Go version >= 1.8.3).
The build itself is driven by GNU Make which also needs to be installed on your systems.
Last but not least, you need a running Docker daemon, since the final build artifact is a Docker container. Also of the unit tests make use of Docker.
$ make build
$ make image
$ make test
$ make fmt
$ make validate_commits
$ make clean
More help is provided by make help
.
The dependencies of the project are managed by Dep. To add or change the current dependencies you need to delete the Dep lock file (Gopkg.lock), update the dependency list (Gopkg.toml) and then regenerate the lock file. The process looks like this:
$ make clean
$ rm Gopkg.lock
# Update Gopkg.toml with the changes to the dependencies
$ make build
$ git add Gopkg.toml Gopkg.lock
$ git commit
At the moment Travis CI and CentOS CI are configured. Both CI systems build all merges to master as well as pull requests.
CI System | |
---|---|
CentOS CI | master, pr |
Travis CI | master, pr |
The repository contains a script setupLocalIdler.sh
which can be used to run the Idler locally.
A prerequisite for this is access to https://console.rh-idev.openshift.com/.
To run the script you need to export your OpenShift access token for console.rh-idev.openshift.com as DSAAS_PREVIEW_TOKEN.
Note, you need edit permissions on the dsaas-preview namespace in order to port forward.
You also need to make sure to limit the Idler feature to a specific set of users by setting JC_FIXED_UUIDS to a comma separated list of dedicated user UUIDs.
For more information refer to help of setupLocalIdler.sh
itself.
- The original problem statement.
- Service operations within OpenShift.io.
If you want to contribute, make sure to follow the contribution guidelines when you open issues or submit pull requests.