~vila/byoci/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Defaults for all vms 
vm.release = xenial
vm.architecture = amd64
vm.update = True

#
# The byoci definition
#
byoci.prefix = brz

# The byoci namespace is used to defined the whole byoci setup for code as
# well as the users (or launchpad teams where appropriate) responsible for
# the various parts: administration, code landings and running jobs.

# We define two name spaces 'production' and 'testing' and each vm will
# select the right one by setting 'byoci = production' or 'byoci =
# testing', scripts will use {byoci}.<name> to get the right values.

# See byov.conf.d/production.conf and byov.conf.d/testing.conf for default
# values.

# Some options need to be seen from several hosts
jenkins.home = /var/lib/jenkins
# We don't use 'greenballs' for testing as a visual way to differentiate
# from production. We use the same plugins otherwise but let jenkins find
# the latest revisions
jenkins.plugins = command-launcher build-timeout junit description-setter cloudbees-folder

# The monitor is reponsible for defining and running jobs as well as
# maintaining plugins on jenkins.
[brz-monitor]
vm.release = focal
vm.user.shell = /bin/bash
# FIXME: This should be ppa:brz/ci -- vila 2015-11-16
apt.sources = ppa:vila/ci
monitor.packages = breezy, jenkins-job-builder, python3-byoc
# Don't install as user to work around PATH being incomplete
pip.command = sudo, pip3
pip.install.command = install
pip.packages = {monitor.packages}
vm.setup.hook = @setup/hooks/monitor-setup.py
vm.setup_scripts = setup/monitor

# The jenkins dependencies have to be installed before jenkins itself
# because the jenkins packagers couldn't agree on which java version should
# be declared here. We settle for openjdk-11-jre-headless. So this vm produce
# a base image for the master where jenkins /can/ be installed.
[jenkins-deps]
vm.release = focal
vm.user = jenkins
vm.user.shell = /bin/bash
vm.user.home = /var/lib/jenkins
vm.packages = openjdk-11-jre-headless
vm.published_as = {vm.name}
vm.poweroff = True

# The jenkins master
[brz-master]
vm.ram_size = 1024
vm.user = jenkins
vm.user.shell = /bin/bash
vm.user.home = /var/lib/jenkins
apt.sources = deb http://pkg.jenkins.io/debian-stable binary/|62A9756BFD780C377CF24BA8FCEF32E745F2C3D5
vm.packages = bzr, jenkins # FIXME: brz ;-) -- vila 2017-05-23
vm.setup.hook = @setup/hooks/master-setup.py
vm.setup_scripts = setup/seed-jenkins-as-root
jenkins.tokens = {jenkins.home}/tokens
# Mounted from {{byoci}.host.jobs} and {{byoci}.host.users} which therefore
# need to exist
jenkins.jobs = {jenkins.home}/jobs
jenkins.users = {jenkins.home}/users
vm.start.hook =  mkdir -p {{byoci}.host.jobs} {{byoci}.host.users} 
lxd.image = jenkins-deps-{byoci}
lxd.user_mounts = {{byoci}.host.jobs}:{jenkins.jobs}, {{byoci}.host.users}:{jenkins.users}

# The slave model
[brz-slave]
vm.release = xenial
vm.user.shell = /bin/bash
vm.setup.hook = @setup/hooks/slave-setup.py
# We install nothing at all to start with. All setup should come from
# jenkins jobs triggered from master. To match production, we install only
# bzr. The rest should be setup by the
# setup/seed-slave script or preferably in the setup/seeded-slave script.
# FIXME: This should be ppa:brz/ci instead of ppa:vila/ci -- vila 2017-11-16
apt.sources = ppa:vila/ci
# FIXME: brz -- vila 2017-11-22
vm.packages = bzr
# Allow nesting so test containers can be created (second level allows a
# container to run byoci self tests)
lxd.nesting = 2
lxd.service = lxd
# setup/known_hosts is needed for bootstrap (to get
# {{byoci}.definition.branch})
vm.setup_scripts = setup/seed-slave, setup/known_hosts, setup/seeded-slave

# For gitlab tests. The related tests expect an existing server or are
# skipped.
# /!\ Needs to be setup with './testing/setup/gitlab' to get the proper
# options defined
[gitlab]
vm.class = lxd
#scaleway.flavor = C2S
vm.distribution = ubuntu
# FIXME: bump to focal asap but no sooner. 'bundle install' fails under
# focal so far -- vila 2020-02-17
vm.release = eoan
# lxd.image = ubuntu-daily:{vm.release}/{vm.architecture}
vm.update = True
# apt.sources = deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ bionic main|14219A96E15E78F4
# apt-cacher-ng version when testing on a local lxd:
apt.sources = deb http://HTTPS///packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ bionic main|14219A96E15E78F4
dev.packages = make, cmake, pkg-config, g++, zlib1g-dev, libssl-dev, libkrb5-dev, libre2-dev, libsqlite3-dev, ruby-dev, ruby-bundler, libpq-dev, libicu-dev
test.packages = chromium-chromedriver, chromium-browser, emacs
vm.packages = fail2ban, ca-certificates, wget, apt-transport-https, postfix, {dev.packages}, {test.packages}
vm.setup_scripts = testing/gitlab/seed-server
gitlab.api.url = http://{vm.ip}/
# FIXME: clone/pull/mount may be options ? -- vila 2020-02-16
lxd.user_mounts = ~/src/gitlab/gitlab-ce:/src