-
Notifications
You must be signed in to change notification settings - Fork 2
/
resctl-demo-ospack.yaml
249 lines (208 loc) · 5.88 KB
/
resctl-demo-ospack.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
{{ $variant := or .variant "resctl-demo" }}
{{ $ospack := or .ospack (printf "%s-ospack" $variant) }}
{{ $mirror := or .mirror "https://deb.debian.org/debian" }}
{{ $suite := or .suite "bookworm" }}
{{ $resctl_demo_src := or .resctl_demo_src "crates.io" }}
{{ $version := or .version "local" }}
architecture: amd64
actions:
- action: recipe
recipe: check-variant.yaml
variables:
variant: {{ $variant }}
- action: debootstrap
suite: {{ $suite }}
components:
- main
- contrib
- non-free
- non-free-firmware
mirror: {{ $mirror }}
variant: minbase
- action: apt
description: Core packages
packages:
- apt-transport-https
- dbus
- dialog
- gnupg
- initramfs-tools
- sudo
- systemd-sysv
- udev
- action: run
description: Add version metadata to /etc/os-release
command: |
echo "IMAGE_VERSION={{ $version }}" >> ${ROOTDIR}/etc/os-release
- action: apt
description: Install bootloader packages
packages:
- systemd-boot
- systemd-boot-efi
- action: apt
description: Networking packages
packages:
- iproute2
- iputils-ping
- network-manager
- wpasupplicant
- action: apt
description: openssh-server
packages:
- openssh-server
- action: apt
description: cloud-init (performs rootfs resize and ssh adds keys)
packages:
- cloud-init
- cloud-image-utils
- cloud-guest-utils
- btrfs-progs
- action: apt
description: Useful userspace packages
packages:
- htop
- bc
- bcc
- curl
- fish
- jq
- less
- lsscsi
- mosh
- nano
- nvme-cli
- screen
- stress
- sysstat
- tmux
- vim
- wget
- systemd-resolved
- action: apt
description: Runtime dependencies for resctl-demo
recommends: true
packages:
- oomd
- gnuplot-nox
- python3-bpfcc
- python3-drgn
- libssl-dev
- libelf-dev
- fio
- build-essential
- wget
- bison
- flex
- pkgconf
- git
- fontconfig
- ghostscript
- imagemagick
- librsvg2-bin
- action: run
description: Set python3 as default
chroot: true
command: update-alternatives --install /usr/bin/python python /usr/bin/python3 1
- action: run
description: Fix imagemagick policy configuration; see https://github.com/facebookexperimental/resctl-demo/issues/256
chroot: true
label: sed
command: sed -i 's/domain="coder" rights="none"/domain="coder" rights="read | write"/g' /etc/ImageMagick-*/policy.xml
- action: run
description: Disable oomd
chroot: true
command: systemctl mask oomd.service
- action: run
description: Set hostname to {{ $variant }}
command: echo "{{ $variant }}" > ${ROOTDIR}/etc/hostname
- action: run
description: Enable systemd-networkd
chroot: true
command: systemctl enable systemd-networkd
- action: run
description: Mask networking.service (dependency of cloud-init)
chroot: true
command: systemctl mask networking.service
- action: run
description: Enable systemd-resolved
chroot: true
command: systemctl enable systemd-resolved
- action: run
description: Disable systemd-sysusers
chroot: true
command: systemctl mask systemd-sysusers.service
- action: overlay
description: Configuration for locale
source: overlays/locale
- action: overlay
description: Configuration for motd
source: overlays/motd
- action: overlay
description: Configuration for pivot
source: overlays/pivot
- action: overlay
description: Configuration for sshd
source: overlays/sshd
- action: overlay
description: Configuration for swap
source: overlays/swap
- action: overlay
description: Configuration for cloud-init
source: overlays/cloud-init
- action: overlay
description: Configuration for systemd-networkd
source: overlays/systemd-networkd
- action: overlay
description: Configuration for systemd-resolved
source: overlays/systemd-resolved
- action: overlay
description: Configuration for systemd-repart
source: overlays/systemd-repart
- action: run
description: Setup root user
chroot: true
command: echo "root:root" | chpasswd
- action: run
description: Setup demo user
chroot: true
script: scripts/setup-demo-user.sh
- action: overlay
description: Configuration for resctl-demo
source: overlays/resctl-demo
- action: run
description: Change system PRETTY_NAME
command: sed -i "s/PRETTY_NAME=.*/PRETTY_NAME=\"{{ $variant }} test image\"/g" ${ROOTDIR}/etc/os-release
- action: run
description: Add variant to system metadata
command: echo "VARIANT={{ $variant }}" >> ${ROOTDIR}/etc/os-release
- action: download
description: Download linux payload tarball
url: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.16.11.tar.xz
name: linux-payload
filename: linux.tar
compression: xz
- action: overlay
description: Copy linux payload tarball into image
origin: linux-payload
destination: /usr/local/resctl-demo/linux.tar
- action: run
description: Run print-drive-model at boot
command: echo "\$HOME/.bin/print-drive-model" >> ${ROOTDIR}/home/demo/.bashrc
- action: run
description: Fix demo user home permissions
chroot: true
command: chown -R demo:demo /home/demo
- action: run
description: Install resctl-demo
chroot: true
label: install-resctl-demo
command: su demo -c "/home/demo/.bin/install-resctl-demo {{ $resctl_demo_src }}"
- action: run
description: Install Adobe fonts
chroot: true
script: scripts/install-adobe-fonts.sh
- action: run
description: Remove empty fstab
command: rm ${ROOTDIR}/etc/fstab
- action: pack
file: {{ $ospack }}.tar.gz