-
Notifications
You must be signed in to change notification settings - Fork 2
/
rockcraft.yaml
78 lines (72 loc) · 2.65 KB
/
rockcraft.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
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
---
name: charmed-zookeeper # the name of your ROCK
base: [email protected] # the base environment for this ROCK
version: '3.9.2' # just for humans. Semantic versioning is recommended
summary: Charmed ZooKeeper ROCK OCI # 79 char long summary
description: |
This is an OCI image that bundles Apache ZooKeeper together with other tools
of its ecosystem in order to be used in Charmed Operators, providing
automated operations management from day 0 to day 2 on the Apache ZooKeeper
distributed coodrdinator, on top of a Virtual Machine cluster and K8s cluster.
It is an open source, end-to-end, production ready data platform on top of
cloud native technologies.
license: Apache-2.0 # your application's SPDX license
platforms: # The platforms this ROCK should be built on and run on
amd64:
environment:
JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
ZOO_LOG_DIR: /var/log/zookeeper
ZOOCFGDIR: /etc/zookeeper
services:
zookeeper:
override: replace
command: >
/opt/zookeeper/bin/zkServer.sh
--config /etc/zookeeper start-foreground
startup: enabled
user: zookeeper
group: zookeeper
parts:
zookeeper:
plugin: nil
stage-packages:
- openjdk-11-jre-headless
- libpsl5
- curl
build-environment:
- JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
stage-snaps:
- charmed-zookeeper/3/edge
override-build: |
ln -s /usr/lib/jvm/java-11-openjdk-amd64/bin/java \
$CRAFT_PART_INSTALL/usr/bin/java
ln -s /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool \
$CRAFT_PART_INSTALL/usr/bin/keytool
mkdir -p $CRAFT_PART_INSTALL/var/lib/pebble/default/
mkdir -p $CRAFT_PART_INSTALL/var/lib/zookeeper/
mkdir -p $CRAFT_PART_INSTALL/var/log/zookeeper/
mkdir -p $CRAFT_PART_INSTALL/opt/zookeeper/
mkdir -p $CRAFT_PART_INSTALL/etc/zookeeper/
cp $CRAFT_PART_INSTALL/opt/zookeeper/conf/zoo_sample.cfg \
$CRAFT_PART_INSTALL/etc/zookeeper/zoo.cfg
rm -rf $CRAFT_PART_INSTALL/opt/zookeeper/conf
override-prime: |
craftctl default
rm -vf usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts
non-root-user:
plugin: nil
after: [zookeeper]
overlay-script: |
# Create a user in the $CRAFT_OVERLAY chroot
groupadd -R $CRAFT_OVERLAY -g 1000 zookeeper
useradd -R $CRAFT_OVERLAY -M -r -g zookeeper -u 1000 zookeeper
override-prime: |
craftctl default
# Give permissions to the required folders
install -d -o 1000 -g 1000 -m 770 \
opt/zookeeper \
var/lib/zookeeper \
var/log/zookeeper \
etc/zookeeper