README.md 3.12 KB
Newer Older
Laurent Modolo's avatar
Laurent Modolo committed
1
2
3
# GitLab Runners

This repository contains scripts to launch GitLab Runners for your group.
Laurent Modolo's avatar
Laurent Modolo committed
4
Once configured, GitLab runners are called by the GitLab server to perform computations (package, building, test, etc) on your code, after each commit. Runners are not executed on the server but on remote computer accessible by the network.
Laurent Modolo's avatar
Laurent Modolo committed
5
6
7
8
9
10
11
12
13
This repository contains various scripts to initialise a GitLab Runner, to register it for your group with the GitLab server, and to launch it.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine

### Prerequisites

You need the registration token for your group from the GitLab server.
Laurent Modolo's avatar
Laurent Modolo committed
14
For this go to your group page, **settings**, **CI/CD** and **Runners settings**. For the LBMC group, this corresponds to the following url :
Laurent Modolo's avatar
Laurent Modolo committed
15
16
17
18
19
20

[https://gitlab.biologie.ens-lyon.fr/groups/LBMC/-/settings/ci_cd](https://gitlab.biologie.ens-lyon.fr/groups/LBMC/-/settings/ci_cd)

Cloning this repository:

```sh
Laurent Modolo's avatar
Laurent Modolo committed
21
git clone gitlab_lbmc:LBMC/gitlab_runner.git
Laurent Modolo's avatar
Laurent Modolo committed
22
23
24
25
26
27
28
29
30
31
32
33
34
```

### Installing

First, we need to build a custom container of the gitlab-runner with the following command.

```sh
sudo mkdir -p /srv/gitlab-runner/config
gitlab_runner/docker_init.sh
```

This will build the `gitlab_runner` container with the certificate of the [gitlab.biologie.ens-lyon.fr](https://gitlab.biologie.ens-lyon.fr/) website installed.

Laurent Modolo's avatar
Laurent Modolo committed
35
This container will be the process that register and manage the GitLab runners on your computer.
Laurent Modolo's avatar
Laurent Modolo committed
36

Laurent Modolo's avatar
Laurent Modolo committed
37
38
To run the runners safely themselves, we are going to instantiate new containers, for each runner.
For example, to have a runner for `R` development `r_dev/Dockerfile`. Those containers must be available from the [Docker store](https://store.docker.com/community/images/lmodolo/r_dev/tags).
Laurent Modolo's avatar
Laurent Modolo committed
39

Laurent Modolo's avatar
Laurent Modolo committed
40
The `gitlab_runner` container will be able to pull them and launch them (within the `r_dev:3.5.1` container for the `r_dev` example)
Laurent Modolo's avatar
Laurent Modolo committed
41
42
43
44
45
46


## Registering a Runner

To register a runner you need to use the `*_runner_register.sh` scripts.

47
For example, for a `r_dev:3.5.1` runner register it with the following command, where `<group_token>` is the token of your group :
Laurent Modolo's avatar
Laurent Modolo committed
48
49

```sh
50
./r_dev_runner_register.sh <group_token>
Laurent Modolo's avatar
Laurent Modolo committed
51
52
53
54
55
56
57
58
59
```

You can check the runners registered in the **CI/CD** settings of your group.

## Launching your Runners

To launch your runners execute the following command:

```sh
60
./runner_start.sh
Laurent Modolo's avatar
Laurent Modolo committed
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
```

To check the GitLab runner status:

```sh
docker ps
```

## Sopping your Runners

To stop your runners, execute the following command:

```sh
./runner_stop.sh
```


## Contributing

Laurent Modolo's avatar
Laurent Modolo committed
80
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process of submitting pull requests to us.
Laurent Modolo's avatar
Laurent Modolo committed
81
82
83
84
85
86
87
88
89
90
91
92
93

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://gitlab.biologie.ens-lyon.fr/pipelines/nextflow/tags). 

## Authors

* **Laurent Modolo** - *Initial work*

See also the list of [contributors](https://gitlab.biologie.ens-lyon.fr/pipelines/nextflow/graphs/master) who participated in this project.

## License

Laurent Modolo's avatar
Laurent Modolo committed
94
This project is licensed under the CeCiLL License- see the [LICENSE](LICENSE) file for details.
Laurent Modolo's avatar
Laurent Modolo committed
95