Skip to content

Commit f0c4c8d

Browse files
committed
chore(stacks): add fluentd
1 parent 654311f commit f0c4c8d

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

stacks/fluentd/build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Load stack utils
4+
. /usr/bin/stack-utils
5+
6+
# Implement build function
7+
function build() {
8+
cat << EOF > ${PROFILE_DIR}/${STACK_NAME}.sh
9+
export GEM_HOME=/opt/drycc/fluentd
10+
export BUNDLE_SILENCE_ROOT_WARNING=1
11+
export BUNDLE_APP_CONFIG="$GEM_HOME"
12+
export PATH=$GEM_HOME/bin:$PATH
13+
EOF
14+
. ${PROFILE_DIR}/${STACK_NAME}.sh
15+
./make.sh
16+
echo "export LD_PRELOAD=/usr/lib/libjemalloc.so.2" >> ${PROFILE_DIR}/${STACK_NAME}.sh
17+
cp -rf /opt/drycc/fluentd/* "${DATA_DIR}"
18+
}
19+
20+
# call build stack
21+
build-stack "${1}"

stacks/fluentd/make.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
install-stack ruby 3.1.0
2+
. /opt/drycc/ruby/profile.d/*.sh
3+
4+
5+
apt-get update \
6+
&& apt-get install -y --no-install-recommends \
7+
ca-certificates \
8+
&& buildDeps=" \
9+
make gcc g++ libc-dev \
10+
wget bzip2 gnupg dirmngr \
11+
" \
12+
&& apt-get install -y --no-install-recommends $buildDeps \
13+
&& echo 'gem: --no-document' >> /etc/gemrc \
14+
&& gem install oj -v 3.10.18 \
15+
&& gem install json -v 2.4.1 \
16+
&& gem install async-http -v 0.54.0 \
17+
&& gem install fluentd -v 1.14.5 \
18+
&& wget -O /tmp/jemalloc-4.5.0.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/4.5.0/jemalloc-4.5.0.tar.bz2 \
19+
&& cd /tmp && tar -xjf jemalloc-4.5.0.tar.bz2 && cd jemalloc-4.5.0/ \
20+
&& ./configure && make \
21+
&& mkdir -p /opt/drycc/fluentd/lib \
22+
&& mv lib/libjemalloc.so.2 /opt/drycc/fluentd/lib \
23+
&& apt-get purge -y --auto-remove \
24+
-o APT::AutoRemove::RecommendsImportant=false \
25+
$buildDeps \
26+
&& rm -rf /var/lib/apt/lists/* \
27+
&& rm -rf /tmp/* /var/tmp/*

0 commit comments

Comments
 (0)