-
Notifications
You must be signed in to change notification settings - Fork 25
/
snapcraft.yaml
291 lines (275 loc) · 6.68 KB
/
snapcraft.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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
name: microceph
base: core22
version: git
grade: stable
source-code: https://github.com/canonical/microceph.git
summary: Simple clustered Ceph deployment
description: |-
Self-contained self-deployment with clustering.
confinement: strict
slots:
ceph-conf:
interface: content
source:
read:
- "$SNAP_DATA/conf"
environment:
LD_LIBRARY_PATH: $SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET:$SNAP/lib/$CRAFT_ARCH_TRIPLET/ceph:$SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET:$SNAP/lib/$CRAFT_ARCH_TRIPLET/ceph:$SNAP/lib/$CRAFT_ARCH_TRIPLET/ceph/compressor:$SNAP/lib/$CRAFT_ARCH_TRIPLET/ceph/crypto:$SNAP/lib/$CRAFT_ARCH_TRIPLET/ceph/erasure-code
PYTHONPATH: $SNAP/lib/python3/dist-packages
layout:
/usr/lib/$CRAFT_ARCH_TRIPLET/ceph:
symlink: $SNAP/lib/$CRAFT_ARCH_TRIPLET/ceph
/usr/lib/$CRAFT_ARCH_TRIPLET/rados-classes:
symlink: $SNAP/lib/$CRAFT_ARCH_TRIPLET/rados-classes
/etc/ceph:
bind: $SNAP_DATA/conf
/usr/share/ceph:
bind: $SNAP/share/ceph
/var/lib/ceph:
bind: $SNAP_COMMON/data
/var/log/ceph:
bind: $SNAP_COMMON/logs
apps:
# Service
daemon:
command: commands/daemon.start
daemon: simple
plugs:
- block-devices
- dm-crypt
- hardware-observe
- network
- network-bind
slots:
- microceph
mds:
command: commands/mds.start
daemon: simple
install-mode: disable
plugs:
- network
- network-bind
mon:
command: commands/mon.start
daemon: simple
install-mode: disable
plugs:
- hardware-observe
- network
- network-bind
mgr:
command: commands/mgr.start
daemon: simple
install-mode: disable
plugs:
- network
- network-bind
osd:
command: commands/osd.start
reload-command: commands/osd.reload
daemon: simple
install-mode: disable
stop-mode: sigterm-all
stop-timeout: 5m
plugs:
- block-devices
- dm-crypt
- hardware-observe
- network
- network-bind
rgw:
command: commands/rgw.start
daemon: simple
install-mode: disable
plugs:
- hardware-observe
- network
- network-bind
# Commands
ceph:
command: commands/ceph
plugs:
- network
- home
"radosgw-admin":
command: commands/radosgw-admin
plugs:
- network
microceph:
command: commands/microceph
plugs:
- network
- block-devices
- dm-crypt
rbd:
command: commands/rbd
plugs:
- network
rados:
command: commands/rados
plugs:
- network
parts:
ceph:
plugin: nil
override-prime: |
snapcraftctl prime
pkg_version=$(
dpkg-deb -f \
$CRAFT_PART_SRC/../stage_packages/ceph-common*.deb Version)
git_version=$(
git -C $CRAFT_PROJECT_DIR describe \
--always \
--dirty \
--tags \
--abbrev=10 | sed -s 's/^v//')
printf "ceph-version: ${pkg_version}\nmicroceph-git: ${git_version}\n" > share/metadata.yaml
stage-packages:
- ceph-common
- ceph-mds
- ceph-mgr
- ceph-mgr-dashboard
- ceph-mon
- ceph-osd
- radosgw
organize:
usr/bin/: bin/
usr/sbin/: bin/
usr/lib/: lib/
usr/share/: share/
prime:
- bin/ceph
- bin/ceph-authtool
- bin/ceph-bluestore-tool
- bin/ceph-mds
- bin/ceph-mgr
- bin/ceph-mon
- bin/ceph-osd
- bin/ceph-conf
- bin/monmaptool
- bin/rbd
- bin/rados
- bin/radosgw
- bin/radosgw-admin
- lib/*/ceph
- lib/*/libaio.so*
- lib/*/libasn1.so*
- lib/*/libboost_context.so*
- lib/*/libboost_filesystem.so*
- lib/*/libboost_iostreams.so*
- lib/*/libboost_program_options.so*
- lib/*/libboost_python310.so*
- lib/*/libboost_thread.so*
- lib/*/libcephfs.so*
- lib/*/libcephsqlite.so*
- lib/*/libcurl-gnutls.so*
- lib/*/libdaxctl.so*
- lib/*/libfuse3.so*
- lib/*/libibverbs.so*
- lib/*/libicudata.so*
- lib/*/libicuuc.so*
- lib/*/liblber-2.5.so*
- lib/*/libldap-2.5.so*
- lib/*/liblua5.3.so*
- lib/*/libndctl.so*
- lib/*/libnghttp2.so*
- lib/*/libnuma.so*
- lib/*/liboath.so*
- lib/*/libpmem.so*
- lib/*/libpmemobj.so*
- lib/*/libpsl.so*
- lib/*/libpython3.10.so*
- lib/*/librabbitmq.so*
- lib/*/librados.so*
- lib/*/libradosgw.so*
- lib/*/libradosstriper.so.*
- lib/*/librbd.so*
- lib/*/librdmacm.so*
- lib/*/libroken.so*
- lib/*/librtmp.so*
- lib/*/libsasl2.so*
- lib/*/libsnappy.so*
- lib/*/libwind.so*
- lib/python3
- lib/*/rados-classes
- lib/*/libtcmalloc.so*
- lib/*/libunwind.so*
- share/ceph
deps:
plugin: nil
stage-packages:
- uuid-runtime
organize:
usr/bin/: bin/
prime:
- bin/uuidgen
dqlite:
build-attributes: [core22-step-dependencies]
after:
- raft
source: https://github.com/canonical/dqlite
source-type: git
source-depth: 1
plugin: autotools
autotools-configure-parameters:
- --prefix=
stage-packages:
- libuv1
- libsqlite3-0
build-packages:
- libuv1-dev
- libsqlite3-dev
- pkg-config
organize:
usr/lib/: lib/
prime:
- lib/libdqlite*so*
- lib/*/libuv*
raft:
build-attributes: [core22-step-dependencies]
source: https://github.com/canonical/raft
source-type: git
source-depth: 1
plugin: autotools
autotools-configure-parameters:
- --prefix=
stage-packages:
- libuv1
- liblz4-1
build-packages:
- libuv1-dev
- liblz4-dev
- pkg-config
organize:
usr/lib/: lib/
prime:
- lib/libraft*so*
- lib/*/libuv.so*
microceph:
build-attributes: [core22-step-dependencies]
source: microceph/
after:
- dqlite
build-snaps:
- go
plugin: nil
override-pull: |
snapcraftctl pull
set -ex
# Download the dependencies
go get -d -v ./...
override-build: |
set -ex
# Setup build environment
export CGO_CFLAGS="-I${SNAPCRAFT_STAGE}/include/ -I${SNAPCRAFT_STAGE}/usr/local/include/"
export CGO_LDFLAGS="-L${SNAPCRAFT_STAGE}/lib/ -L${SNAPCRAFT_STAGE}/usr/local/lib/"
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
# Build the binaries
go build -o "${SNAPCRAFT_PART_INSTALL}/bin/microceph" ./cmd/microceph
go build -o "${SNAPCRAFT_PART_INSTALL}/bin/microcephd" -tags=libsqlite3 ./cmd/microcephd
prime:
- bin/microceph
- bin/microcephd
wrappers:
plugin: dump
source: snapcraft/