README.md 2.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Run a CTA test instance from build tree in an independent virtual machine.

For the test instance details, see the orchestration directory.

The scripts in this directory allow to run the continuous integration system tests from a locally built CTA, without RPMs.

The target is to run in a virtual machine, possibly in a disconnected laptop.

## Setting up a fresh virtual machine

### User environment

The vmBootstrap directory contains all the necessary script to go from minimal CC7 instalation to running kubernetes with CTA checked out and compiled.

15
A full CTA source tree should be cloned or copied in the target system, and scripts should be run from .../CTA/continuousintegration/buildtree_runner/vmBootstrap:
16
17

```
18
cd .../CTA/continuousintegration/buildtree_runner/vmBootstrap
19
20
21
22
23
24
25
26
27
28
./bootstrapSystem.sh
```

This will create a new user (currently hardcoded to "eric") and prompt for the password. The use will be a sudoer (no password).

### CTA build tree

The user should then login as the user, kinit with a valid CERN.CH token, and then run the next step: bootstrapCTA.sh:
```
kinit user@CERN.CH
29
cd .../CTA/continuousintegration/buildtree_runner/vmBootstrap
30
31
32
33
34
35
36
37
38
./bootstrapCTA.sh
```

This will check out CTA from git, in install the necessary build RPMs and compile.

### Kubernetes setup

The user should then run the script to setup kubernetes:
```
39
cd .../CTA/continuousintegration/buildtree_runner/vmBootstrap
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
./bootstrapKubernetes.sh
```

A reboot is currently required at that point.

## Running the system tests.

### Docker image

The system tests run with a single image with all the non CTA rpms pre-loaded. The image should be generated once for all:

```
cd ~/CTA/continuousintegration/buildtree_runner
./prepareImage.sh
```

This image also contains embedded scripts from the CTA tree. As the build is 2 stage, the embedding of scripts can be run separately, saving the time to install the RPMs.

58
59
When updating image content, be careful that some layers can be cached event if the content changed (for example an `ADD` layer may not be updated in the new image...). To make sure everything is clean, you need to remove all cached layers from `docker`:
```
60
docker rmi $(docker images -a | tail -n+2 | awk '{print $3}')
61
62
```

63
64
65
66
67
68
### Preparing the environment (MHVTL, kubernetes volumes...)

MHVTL should then be setup by running:

```
cd ~/CTA/continuousintegration/buildtree_runner
69
sudo ./recreate_buildtree_running_environment.sh
70
71
72
73
74
75
76
77
```

### Preparing the test instance

The test instance can then be created by running (typically):

```
cd ~/CTA/continuousintegration/orchestration
78
./create_instance.sh -n ctatest -b /home/eric -B CTA-build -D -O
79
80
81
82
```

and the tests will run like in the continuous integration environment.