-
Notifications
You must be signed in to change notification settings - Fork 315
/
Copy pathdruid.yaml
137 lines (126 loc) · 3.86 KB
/
druid.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
package:
name: druid
version: "32.0.1"
epoch: 1
description: Apache Druid is a high performance real-time analytics database.
copyright:
- license: Apache-2.0
resources:
cpu: 8
memory: 16Gi
dependencies:
runtime:
- bash
- busybox
- openjdk-17-default-jvm
environment:
contents:
packages:
- bash
- busybox
- maven
- openjdk-17-default-jdk
- py3-pyyaml
- python3
pipeline:
- uses: git-checkout
with:
repository: https://github.com/apache/druid.git
tag: druid-${{package.version}}
expected-commit: a0420265af08e285527893a3c26dbfdf85d87784
- uses: maven/pombump
- runs: |
mvn -B -ff -q \
install \
-Pdist,bundle-contrib-exts \
-Pskip-static-checks,skip-tests \
-Dmaven.javadoc.skip=true -T1C
- runs: |
mkdir -p ${{targets.destdir}}/usr/share/java/druid
tar -zxf distribution/target/apache-druid-${{package.version}}-bin.tar.gz --strip-components=1 -C ${{targets.destdir}}/usr/share/java/druid
- runs: |
# deduplicate jars
distribution/docker/deduplicate_jars.sh ${{targets.destdir}}/usr/share/java/druid
# deduplicate_jars makes symlinks, which would be fine, but they're absolute.
# it is meant to be run from /, so adjust things for it.
ddir=${{targets.destdir}}
cd "$ddir"
tmpf=$(mktemp)
trap "rm -f $tmpf" EXIT
find usr/share/java/druid -name "*.jar" -type l > "$tmpf"
while read src ; do
dest=$(readlink "$src") || {
echo "failed to readlink on '$src'"
exit 1
}
case "$dest" in
$ddir/*) ndest="/${dest#$ddir/}";;
*) continue;;
esac
[ -f "./${ndest}" -o -L "./${ndest}" ] || {
echo "$src was dangling symlink to $dest"
exit 1
}
echo "adjusting $src from $dest to $ndest"
ln -sf "${ndest}" "$src" || {
echo "failed [$?] ln -sf $ndest $src"
exit 1
}
done <"$tmpf"
subpackages:
- name: "${{package.name}}-compat"
description: "Compatibility package to copy the entrypoint scripts"
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}
cp distribution/docker/druid.sh ${{targets.subpkgdir}}/druid.sh
cp distribution/docker/peon.sh ${{targets.subpkgdir}}/peon.sh
mkdir -p ${{targets.subpkgdir}}/opt
ln -s /usr/share/java/druid ${{targets.subpkgdir}}/opt/druid
dependencies:
runtime:
- iproute2
test:
environment:
contents:
packages:
- python3
- perl
- curl
pipeline:
- uses: test/daemon-check-output
with:
start: env DRUID_LOG_DIR=/tmp/druid-logs /usr/share/java/druid/bin/start-nano-quickstart
expected_output: |
Starting Apache Druid
post: |
if grep -q -r java.lang.NoClassDefFoundError /tmp/druid-logs; then
echo "FATAL: found java.lang.NoClassDefFoundError in logs"
exit 1
fi
set -- curl -L --fail http://localhost:8888/
n=0
rc=1
max=60
while [ $n -lt $max ] && n=$((n+1)); do
sleep 1
"$@" > stdout.log 2>stderr.log && rc=0 && break
echo "[$n/$max] curl http://localhost:8888/ returned $?"
done
[ $n -eq $max ] && {
echo "FATAL: gave up on http://localhost:8888/ after $max tries"
exit 1
}
echo "$* returned success after $n/$max tries"
grep -q "Apache Druid" stdout.log &&
echo "PASS: found Apache Druid in curl output" || {
echo "FATAL: output of '$*' did not contain \"Apache Druid\"";
exit 1;
}
update:
enabled: true
github:
identifier: apache/druid
use-tag: true
tag-filter: druid-
strip-prefix: druid-