forked from canonical/ubuntu-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spread.yaml
159 lines (142 loc) · 4.61 KB
/
spread.yaml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
project: ubuntu-image
environment:
# On some distros the default GOPROXY setting is 'direct' (eg. Fedora).
# Some of the external go packages may get removed or could be temporary
# offline (as happened with maze.io/x/crypt), and then the sources are
# only available through the proxy cache. Play it safe and enable the
# proxy to allow for least CI interruptions.
GOPROXY: https://proxy.golang.org,direct
LANG: "C.UTF-8"
LANGUAGE: "en"
# build the snap with lxd
SNAPCRAFT_BUILD_ENVIRONMENT: lxd
backends:
google:
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-east1-b
plan: n2-standard-2
halt-timeout: 2h
systems:
# - ubuntu-16.04-64:
# workers: 1
# storage: 45G
- ubuntu-18.04-64:
storage: 45G
workers: 1
- ubuntu-20.04-64:
storage: 45G
workers: 1
- ubuntu-22.04-64:
storage: 45G
workers: 1
- ubuntu-23.04-64:
storage: 45G
workers: 1
- ubuntu-23.10-64:
storage: 45G
workers: 1
google-arm:
type: google
key: '$(HOST: echo "$SPREAD_GOOGLE_KEY")'
location: snapd-spread/us-central1-a
plan: t2a-standard-1
halt-timeout: 2h
systems:
- ubuntu-20.04-arm-64:
image: ubuntu-os-cloud/ubuntu-2004-lts-arm64
workers: 1
storage: 45G
- ubuntu-22.04-arm-64:
image: ubuntu-os-cloud/ubuntu-2204-lts-arm64
workers: 1
storage: 45G
qemu:
memory: 4G
systems:
# - ubuntu-16.04-64:
# username: ubuntu
# password: ubuntu
- ubuntu-18.04-64:
username: ubuntu
password: ubuntu
- ubuntu-20.04-64:
username: ubuntu
password: ubuntu
- ubuntu-22.04-64:
username: ubuntu
password: ubuntu
- ubuntu-23.04-64:
username: ubuntu
password: ubuntu
- ubuntu-23.10-64:
username: ubuntu
password: ubuntu
path: /home/ubuntu-image
prepare: |
# NOTE: This part of the code needs to be in spread.yaml as it runs before
# the rest of the source code (including the tests/lib directory) is
# around. The purpose of this code is to fix some connectivity issues and
# then apply the delta of the git repository.
# apt update is hanging on security.ubuntu.com with IPv6, prefer IPv4 over IPv6
cat <<EOF > gai.conf
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 100
EOF
if ! mv gai.conf /etc/gai.conf; then
echo "/etc/gai.conf is not writable, ubuntu-core system? apt update won't be affected in that case"
rm -f gai.conf
fi
if command -v restorecon ; then
# restore proper context otherwise SELinux may complain
restorecon -v /etc/gai.conf
fi
if systemctl is-enabled unattended-upgrades.service; then
systemctl stop unattended-upgrades.service
systemctl mask unattended-upgrades.service
fi
# Make sure ssh service is restarted after it is killed by spread (pkill -o -HUP sshd)
# during the machine setup in google systems. For more details see lp:2011458
if [ "$SPREAD_BACKEND" = "google" ] && [[ "$SPREAD_SYSTEM" == ubuntu-2* ]] && ! systemctl is-active ssh; then
systemctl restart ssh
fi
apt update
apt install -y snapd libc6-dev git
if [[ ! "$SPREAD_BACKEND" == *-arm ]]; then
apt install -y gcc-multilib binfmt-support qemu-user-static
fi
snap install core22 --channel=latest/edge
snap install yq
snap install snapcraft --classic
# Setup lxd
# Make sure we use the snap version
apt remove -y lxd
snap install lxd
lxd init --auto
# Build and install the snap
snapcraft
snap install --classic --dangerous ubuntu-image_*.snap
unset SHELL
git clone -b noble https://git.launchpad.net/ubuntu-images
git clone https://github.com/snapcore/models
debug: |
cat /root/.local/state/snapcraft/log/snapcraft-*.log
suites:
tests/commons/:
summary: Common integration tests for ubuntu-image
tests/amd64/:
summary: Integration tests for ubuntu-image on amd64
backends: [google]
environment:
IMG/ubuntu_server_pc_amd64: ubuntu-server-pc-amd64
IMG/ubuntu_server_pi_arm64: ubuntu-server-pi-arm64
tests/arm64/:
summary: Integration tests for ubuntu-image on arm64
backends: [google-arm]
environment:
IMG/ubuntu_server_pi_arm64: ubuntu-server-pi-arm64
IMG/ubuntu_server_pc_arm64: ubuntu-server-pc-arm64
IMG/ubuntu_pi_arm64: ubuntu-pi-arm64
kill-timeout: 30m