forked from canonical/ubuntu-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspread.yaml
More file actions
189 lines (174 loc) · 6.04 KB
/
Copy pathspread.yaml
File metadata and controls
189 lines (174 loc) · 6.04 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
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
SERIES: '$(HOST: echo "${SERIES:-noble}")'
backends:
openstack:
key: '$(HOST: echo "$OS_CREDENTIALS_AMD64_PS7")'
plan: shared.xsmall
halt-timeout: 2h
wait-timeout: 10m
groups: [default]
proxy: ingress-haproxy.ps7.canonical.com
cidr-port-rel: [10.151.96.0/21:5000]
volume-auto-delete: true
environment: &openstack-env
SNAPD_USE_PROXY: 'true'
HTTP_PROXY: 'http://egress.ps7.internal:3128'
HTTPS_PROXY: 'http://egress.ps7.internal:3128'
http_proxy: 'http://egress.ps7.internal:3128'
https_proxy: 'http://egress.ps7.internal:3128'
no_proxy: '127.0.0.1,127.0.0.53,localhost'
NO_PROXY: '127.0.0.1,127.0.0.53,localhost'
NTP_SERVER: 'ntp.ps7.internal'
systems:
- ubuntu-20.04-64:
image: snapd-spread/ubuntu-20.04-64
workers: 1
- ubuntu-22.04-64:
image: snapd-spread/ubuntu-22.04-64
workers: 1
- ubuntu-24.04-64:
image: snapd-spread/ubuntu-24.04-64
workers: 1
openstack-crossbuild:
type: openstack
key: '$(HOST: echo "$OS_CREDENTIALS_AMD64_PS7")'
plan: shared.medium
halt-timeout: 2h
wait-timeout: 10m
proxy: ingress-haproxy.ps7.canonical.com
cidr-port-rel: [10.151.96.0/21:5000]
volume-auto-delete: true
environment: *openstack-env
systems:
- ubuntu-24.04-64:
image: snapd-spread/ubuntu-24.04-64
workers: 1
openstack-arm:
type: openstack
key: '$(HOST: echo "$OS_CREDENTIALS_ARM64_PS7")'
plan: shared.xsmall.arm64
halt-timeout: 2h
wait-timeout: 10m
groups: [default]
proxy: ingress-haproxy.ps7.canonical.com
cidr-port-rel: [10.151.89.0/24:8000]
volume-auto-delete: true
environment: *openstack-env
systems:
- ubuntu-20.04-arm-64:
image: snapd-spread/ubuntu-20.04-arm-64
workers: 1
- ubuntu-22.04-arm-64:
image: snapd-spread/ubuntu-22.04-arm-64
workers: 1
- ubuntu-24.04-arm-64:
image: snapd-spread/ubuntu-24.04-arm-64
workers: 1
qemu:
memory: 4G
systems:
- ubuntu-20.04-64:
username: ubuntu
password: ubuntu
- ubuntu-22.04-64:
username: ubuntu
password: ubuntu
- ubuntu-24.04-64:
username: ubuntu
password: ubuntu
path: /home/ubuntu-image
prepare: |
#shellcheck source=tests/lib/spread/tools.sh
. $SPREAD_PATH/tests/lib/spread/tools.sh
if [ -n "$HTTP_PROXY" ]; then
tools.setup_system_proxy
tools.setup_git_protocol
# The snapd daemon doesn't see the environment variables, so we must modify its config
# to use a proxy with it. Came from:
# https://github.com/canonical/snapd/blob/619cc925793591348db21bb45fa4af65288d2c42/tests/lib/prepare.sh#L90
tools.setup_snapd_proxy
fi
# Make sure there is a hostname file because it could be missing
# We will need it to have debootstrap properly run
if [ ! -f /etc/hostname ]; then
echo "hostname" > /etc/hostname
fi
# 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
apt update
apt install -y snapd libc6-dev git ubuntu-dev-tools
if [[ ! "$SPREAD_BACKEND" == *-arm ]]; then
apt install -y gcc-multilib binfmt-support qemu-user-static
fi
snap install core24
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
# Install the snap
snap install --classic --dangerous ubuntu-image_*.snap
unset SHELL
git clone -b $SERIES https://git.launchpad.net/ubuntu-images
git clone https://github.com/canonical/risc-v-gadget
mv risc-v-gadget/image-definition.yaml ubuntu-images/ubuntu-server-riscv64.yaml
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: [openstack, qemu]
environment:
IMG/ubuntu_server_pc_amd64: ubuntu-server-pc-amd64
tests/amd64-crossbuild/:
summary: Integration tests for ubuntu-image on amd64
backends: [openstack-crossbuild, qemu]
environment:
IMG/ubuntu_server_riscv64: ubuntu-server-riscv64
IMG/ubuntu_server_pi_arm64: ubuntu-server-pi-arm64
tests/arm64/:
summary: Integration tests for ubuntu-image on arm64
backends: [openstack-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