Skip to content

CDash Server

Introduction

This describes on how to install a CDash server within an LXC-container.

Installation

Create an LXC-container

Presuming LXC is already installed.

Create container type from selection out of list which is downloaded.

lxc-create -n cdash -t download
For this example ubuntu, jammy, amd64 is selected.

Start the container.

lxc-start -n cdash

Make the LXC-container run at start by changing or adding the following to the file /var/lib/lxc/cdash/config.

# Enable auto start of this container.
lxc.start.auto = 1
# Delay start this container 45 seconds from when the host starts.
lxc.start.delay = 45

Container Configuration

To get hold of the containers console (root) execute the following.

lxc-attach -n cdash

Install the needed packages for easy use of commend line (bash-completion) and an editor (joe) or any other.

apt install bash-completion mc joe

Make the shell use colors by modifying the .bashrc and uncomment the line #force_color_prompt=yes and also at the end of the same file uncomment the lines.

if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

Install a CDash required packages.

apt install mysql-server mysql-client git unzip wget\
php php-bcmath php-bz2 php-curl php-gd php-json php-mbstring php-pdo-mysql \
php-xsl php-posix php-simplexml php-tokenizer php-fileinfo
After this the Apache web-server is automatically installed.

Configure / Install Application

Composer V2

See: CDash Installation

Download the latest composer version from GetComposer website.

wget https://getcomposer.org/installer -O installer.php
php installer.php
mv composer.phar /usr/local/bin/composer2

CDash Application

Since the user is wwww-data the application is running under.

Create the directory for the application.

mkdir /var/www/cdash
chown www-data:www-data /var/www/cdash

Run shell as user www-data.

su - www-data -s /bin/bash

Shallow clone the PHP application as user www-data in subdirectory cdash.

git clone --depth 1 https://github.com/Kitware/CDash /var/www/cdash

Use composer version 2 to install the dependencies ignore platform requirements.

cd cdash
composer2 install --no-dev --prefer-dist --ignore-platform-reqs 

Install nodejs dependencies using npm.

npm install

Copy the example environment file .env.example to .env.

cp .env.example .env
php artisan key:generate

Edit the .env file and: * APP_URL should be set to the root URL of CDash (ie https://localhost/cdash) * The DB_ variables instruct CDash how to connect to its database. * The MAIL_ variables dictate how email should be sent by CDash.

For MySQL this is:

# database.php
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=cdash
DB_USERNAME=cdash
DB_PASSWORD="<your-cdash-password>"

The APP_URL needs to be set to the container ip-address for now for testing. When accessed through an HTTPS proxy a full qualified name is set here.

APP_URL=http://<your-container-ip>

Generate build files after configuring the .env file.

npm run dev

Mysql Database

Configure mysql for database cdash and user cdash.

CREATE DATABASE IF NOT EXISTS `cdash`;
CREATE USER 'cdash'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL ON `cdash`.* TO 'cdash'@'localhost';

Apache Webserver

Add configuration file /etc/apache2/sites-available/001-cdash.conf with the following content.

Define APP_DIR "/var/www/cdash/public"

<VirtualHost *:80>
  <Directory "${APP_DIR}">
    AllowOverride All
    Require all granted
  </Directory>
  ServerName localhost
  ServerAdmin webmaster@scanframe.nl
  DocumentRoot "${APP_DIR}"
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Create symbolic link to /etc/apache2/sites-available/001-cdash.conf in directory /etc/apache2/sites-enabled/.

ln -sr /etc/apache2/sites-available/001-cdash.conf /etc/apache2/sites-enabled/001-cdash.conf

Remove the default apache website symbolic link.

rm /etc/apache2/sites-enabled/000-default.conf

Browser Installer

Find the containers ip-address using ip addr on the containers command-line and open it in your browser (open "http://<ip-address>")

Error Backup Directory

For some reason the /var/www/cdash/storage/app/inbox is missing and generates an error in the install.php (browser). This can be solved creating it.

/var/www/cdash/storage/app/inbox