Skip to content

Commit ab0a82d

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

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

stacks/fluentd/build.sh

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