Concourse CI – modern, scalable system for high performance and performance with composable declarative syntax. Compared to experiments for setting up a continuous experiment, the Concourse team has made every effort to simplify the management of the continuous experiment pipeline.
In our tutorial, we'll look through installing Concourse CI on Ubuntu/Debian/CentOS server, which will be pre-installed and configured. Let's set up a PostgreSQL database to use as a backend.
Preparation for installation
Before installing Concourse CI, it is necessery to deploy a Debian/Ubuntu/CentOS server and configure it. You can do this using our instruction.
Installing and configuring PostgreSQL
Pevious to downloading and installing Concourse CI, it is necessery to update indexes of packages and install PostgreSQL. To do that, follow that code:
apt install postgresql postgresq-contrib
Next to installing PostgreSQL, we have to create a user in the concourse database. User creation must be done as postgres.
sudo -u postgres createuser concourse
Concourse connects to a atc database. It is necessery to create an atc database and assign ownership rights to the concourse user.
sudo -u postgres createdb --owner=concourse atc
Next to installation and creation database process, we can download and install Concourse CI.
Download and install Concourse CI
You are aible to use file from official site of Concourse or from GitHub. In our case, we consider downloading from GitHub. It is neccesery to download server.
curl -LO "url_for_concourse_linux.tgz"
tar -xzf concourse*.tgz
After that, we need to download the fly client to your home directory and unzip it:
curl -LO "ufl_for_fly"
tar -xzf fly*.tgz
After that, we have to define the rights to run files on the unpacked files and move all files to the directory - /usr/local/bin
chmod +x concourse* fly*
mv concourse* /usr/local/bin/
mv fly* /usr/local/bin/
Let's make sure that our versions of concourse and fly are relevant using command:
As a result, we get versions 7.9.0.
Service configurationConcourse CI
After all, it is necessery to create concourse directory in /etc/:
mkdir -p /etc/concourse
Moving on we have to create encryption keys to access the service and set up the configuration for Concourse.
Go to the /etc/concourse directory and generate the keys:
sudo ssh-keygen -t rsa -q -N '' -f /etc/concourse/tsa_host_key
sudo ssh-keygen -t rsa -q -N '' -f /etc/concourse/worker_key
sudo ssh-keygen -t rsa -q -N '' -f /etc/concourse/session_signing_key
Check what is inside the folder via:
As a result, we are going to get a list of generated keys:
-rw------- 1 spcsteam spcsteam 1823 Jan 4 12:18 session_signing_key
-rw-r--r-- 1 spcsteam spcsteam 393 Jan 4 12:18 session_signing_key.pub
-rw------- 1 spcsteam spcsteam 1823 Jan 4 12:18 tsa_host_key
-rw-r--r-- 1 spcsteam spcsteam 393 Jan 4 12:18 tsa_host_key.pub
-rw------- 1 spcsteam spcsteam 1823 Jan 4 12:18 worker_key
-rw-r--r-- 1 spcsteam spcsteam 393 Jan 4 12:18 worker_key.pub
We are going to make a copy of the worker_key.pub key in order to distribute this key to employees for authorization.
cp /etc/concourse/worker_key.pub /etc/concourse/authorized_worker_keys
We are going to create a configuration file to launch the WEB UI of the Concourse service.
In the file, specify the paths for using the keys and the path to the file to start PostgreSQL. And also specify the login, password, server address and port.
Let's save the file and exit it.
We are going to create a configuration file for the Concourse backend. Specify the path to the key, local address and port:
Services are started from the /etc/systemd/system/ directory, for this reason two files must be created to start the web and worker services.
Description=Concourse CI worker process
This file specifies the user from whom the service is started, the path to the configuration file and the path to the worker file to be launched from the /etc/concourse directory.
Now let's create a file to start the WEB UI service in the /etc/systemd/system directory:
Description=Concourse CI web process (ATC and TSA)
Let's add port 8080 to the ufw rules to get access from another host and start the services:
ufw allow 8080
service start concourse-web.service
service start concourse-worker.service
We are going to add autoloading to the concourse-web and concourse-worker services so that they start automatically when the server starts:
systemctl enable concourse-web concourse-worker
Access to Web-interface
On the command line, run the following command:
fly -t tutorial login -c http://127.0.0.1:8080 -u serverspace -p p@ssw0rd
As a result, we are going to get:
logging in to team 'main'
Let's check the active component using the command:
fly -t tutorial workers
name containers platform tags team state version age
01fb36b82106 0 linux none none running 2.4 1d
The Web interface is checked through a web browser. Enter the server address and port in the address bar.
As a result, we can say that the following actions were considered:
- Downloading source files from GitHub;
- Setting up Concourse and Fly;
- Setting configuration files;
- Set up files to start the worker and web services;
- Create a worker;
- Login to the web interface.