-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathspread.yaml
More file actions
100 lines (84 loc) · 2.63 KB
/
Copy pathspread.yaml
File metadata and controls
100 lines (84 loc) · 2.63 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
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
project: synapse-operator
path: /synapse-operator
environment:
PROJECT_PATH: /synapse-operator
# important to ensure adhoc and linode/qemu behave the same
SUDO_USER: ""
SUDO_UID: ""
LANG: "C.UTF-8"
LANGUAGE: "en"
exclude:
- .git
- .github
- .tox
- .venv
- .*_cache
- charmcraft
- libexec
- schema
- snap
backends:
multipass:
type: adhoc
allocate: |
# Mitigate issues found when launching multiple mutipass instances
# concurrently. See https://github.com/canonical/multipass/issues/3336
sleep 0.$RANDOM
sleep 0.$RANDOM
sleep 0.$RANDOM
mkdir -p "$HOME/.spread"
export counter_file="$HOME/.spread/multipass-count"
# Sequential variable for unique instance names
instance_num=$(flock -x $counter_file bash -c '
[ -s $counter_file ] || echo 0 > $counter_file
num=$(< $counter_file)
echo $num
echo $(( $num + 1 )) > $counter_file')
multipass_image=$(echo "${SPREAD_SYSTEM}" | sed -e s/ubuntu-// -e s/-64//)
system=$(echo "${SPREAD_SYSTEM}" | tr . -)
instance_name="spread-${SPREAD_BACKEND}-${instance_num}-${system}"
multipass launch -vv --cpus 4 --disk 50G --memory 8G --name "${instance_name}" \
--cloud-init charm/tests/spread/lib/cloud-config.yaml "${multipass_image}"
# Get the IP from the instance
ip=$(multipass info --format csv "$instance_name" | tail -1 | cut -d\, -f3)
ADDRESS "$ip"
discard: |
instance_name=$(multipass list --format csv | grep $SPREAD_SYSTEM_ADDRESS | cut -f1 -d\,)
multipass delete --purge "${instance_name}"
systems:
- ubuntu-24.04-64:
username: spread
password: spread
workers: 1
github-ci:
type: adhoc
allocate: |
echo "Allocating ad-hoc $SPREAD_SYSTEM"
if [ -z "${GITHUB_RUN_ID:-}" ]; then
FATAL "this back-end only works inside GitHub CI"
exit 1
fi
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/99-spread-users
ADDRESS localhost:22
discard: |
echo "Discarding ad-hoc $SPREAD_SYSTEM"
systems:
- ubuntu-24.04-64:
username: ubuntu
password: ubuntu
workers: 1
prepare: |
snap refresh --hold
if systemctl is-enabled unattended-upgrades.service; then
systemctl stop unattended-upgrades.service
systemctl mask unattended-upgrades.service
fi
sudo snap install --classic concierge
sudo concierge prepare -p microk8s
suites:
tests/spread/:
summary: tutorial test
systems:
- ubuntu-24.04-64