Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/install-test.sh
Expand All @@ -81,6 +82,7 @@ jobs:
--privileged \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/piuparts-test.sh
Expand All @@ -90,6 +92,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/serverspec-test.sh
Expand All @@ -99,6 +102,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/confluent-test.sh
Expand All @@ -108,6 +112,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/apt/binstubs-test.sh
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
--env CENTOS_STREAM=${{ matrix.centos-stream }} \
${{ matrix.test-docker-image }} \
Expand All @@ -71,6 +72,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
--env CENTOS_STREAM=${{ matrix.centos-stream }} \
${{ matrix.test-docker-image }} \
Expand All @@ -81,6 +83,7 @@ jobs:
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
--env CENTOS_STREAM=${{ matrix.centos-stream }} \
${{ matrix.test-docker-image }} \
Expand Down
16 changes: 16 additions & 0 deletions fluent-package/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class DownloadTask
def define_fluentd_archive
@file_fluentd_archive = File.join(DOWNLOADS_DIR, "fluentd-#{FLUENTD_REVISION}.tar.gz")
file @file_fluentd_archive do
puts "::group::Create #{@file_fluentd_archive}" if ENV["CI"]
ensure_directory(DOWNLOADS_DIR) do
dirname = "fluentd-#{FLUENTD_REVISION}"
rm_rf("fluentd") if File.exist?("fluentd")
Expand All @@ -320,6 +321,7 @@ class DownloadTask
mv("fluentd", dirname)
sh(*tar_command, "cvfz", "#{dirname}.tar.gz", dirname)
end
puts "::endgroup::" if ENV["CI"]
end
end

Expand Down Expand Up @@ -428,6 +430,7 @@ class BuildTask

desc "Install ruby gems"
task :ruby_gems => windows? ? [:"download:ruby_gems", :fluentd, :win32_service] : [:"download:ruby_gems", :fluentd] do
puts "::group::Install ruby gems" if ENV["CI"]
gem_install("bundler", BUNDLER_VERSION)

gem_home = ENV["GEM_HOME"]
Expand All @@ -441,10 +444,12 @@ class BuildTask
# for fat gems which depend on nonexistent libraries
# mainly for nokogiri 1.11 or later on CentOS 6
rebuild_gems
puts "::endgroup::" if ENV["CI"]
end

desc "Install fluentd"
task :fluentd => [:"download:fluentd", windows? ? :rubyinstaller : :ruby] do
puts "::group::Install fluentd" if ENV["CI"]
cd(DOWNLOADS_DIR) do
archive_path = @download_task.file_fluentd_archive
fluentd_dir = archive_path.sub(/\.tar\.gz$/, '')
Expand All @@ -457,6 +462,7 @@ class BuildTask
install_gemfiles
end
end
puts "::endgroup::" if ENV["CI"]
end

desc "Install win32-service"
Expand Down Expand Up @@ -662,6 +668,7 @@ class BuildTask
end

def build_jemalloc
puts "::group::Build jemalloc from source" if ENV["CI"]
tarball = @download_task.file_jemalloc_source
source_dir = tarball.sub(/\.tar\.bz2$/, '')

Expand Down Expand Up @@ -693,6 +700,7 @@ class BuildTask
sh("./configure", *configure_opts)
sh("make", "install", "-j#{Etc.nprocessors}", "DESTDIR=#{STAGING_DIR}")
end
puts "::endgroup::" if ENV["CI"]
end

def openssldir
Expand Down Expand Up @@ -731,6 +739,7 @@ class BuildTask
end

def build_openssl
puts "::group::Build openssl from source" if ENV["CI"]
tarball = @download_task.file_openssl_source
source_dir = tarball.sub(/\.tar\.gz$/, '')

Expand Down Expand Up @@ -768,9 +777,11 @@ class BuildTask
sh("make", "install")
sh("make", "install", "DESTDIR=#{STAGING_DIR}")
end
puts "::endgroup::" if ENV["CI"]
end

def build_ruby_from_source
puts "::group::Build ruby from source" if ENV["CI"]
tarball = @download_task.file_ruby_source
ruby_source_dir = tarball.sub(/\.tar\.gz$/, '')

Expand All @@ -797,6 +808,7 @@ class BuildTask
# For building gems. The built ruby & gem command cannot use without install.
sh("make", "install")
end
puts "::endgroup::" if ENV["CI"]
end

def extract_ruby_installer
Expand Down Expand Up @@ -1104,6 +1116,7 @@ class BuildTask
end

def remove_needless_files
puts "::group::Remove needless files" if ENV["CI"]
remove_files("#{fluent_package_staging_dir}/bin/jeprof", true) # jemalloc 4 or later
remove_files("#{fluent_package_staging_dir}/bin/pprof", true) # jemalloc 3
remove_files("#{fluent_package_staging_dir}/share/doc", true) # Contains only jemalloc.html
Expand Down Expand Up @@ -1131,6 +1144,7 @@ class BuildTask
Dir.glob("#{fluent_package_staging_dir}/**/.git").each do |git_dir|
remove_files(git_dir, true)
end
puts "::endgroup::" if ENV["CI"]
end

def render_fluent_package_config(package_type)
Expand Down Expand Up @@ -1292,6 +1306,7 @@ EOS

def build_archive
cd("..") do
puts "::group::Create #{@full_archive_name}" if ENV["CI"]
sh("git", "archive", "HEAD",
"--prefix", "#{@archive_base_name}/",
"--output", @full_archive_name)
Expand All @@ -1317,6 +1332,7 @@ EOS
tar_options << "--force-local" if windows?
sh(*tar_command, "cvfz", @full_archive_name, @archive_base_name, *tar_options)
rm_rf(@archive_base_name)
puts "::endgroup::" if ENV["CI"]
end
end

Expand Down
9 changes: 8 additions & 1 deletion fluent-package/apt/binstubs-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -exu

echo "BINSTUBS TEST"
if [ "$CI" = "true" ]; then
echo "::group::Setup binstubs test"
fi

apt update
apt install -V -y lsb-release

Expand All @@ -10,7 +15,9 @@ apt install -V -y lsb-release
apt install -V -y \
${repositories_dir}/${distribution}/pool/${code_name}/${channel}/*/*/*_${architecture}.deb

echo "BINSTUBS TEST"
if [ "$CI" = "true" ]; then
echo "::endgroup::"
fi
/opt/fluent/bin/ruby /fluentd/fluent-package/binstubs-test.rb
if [ $? -eq 0 ]; then
echo "Checking existence of binstubs: OK"
Expand Down
7 changes: 7 additions & 0 deletions fluent-package/apt/confluent-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -exu

if [ "$CI" = "true" ]; then
echo "::group::Setup confluent test"
fi

export DEBIAN_FRONTEND=noninteractive

apt update
Expand Down Expand Up @@ -60,6 +64,9 @@ while true ; do
exit 1
fi
done
if [ "$CI" = "true" ]; then
echo "::endgroup::"
fi
/usr/bin/kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
export PATH=/opt/fluent/bin:$PATH
export INSTALLATION_TEST=true
Expand Down
16 changes: 8 additions & 8 deletions fluent-package/apt/install-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -exu

apt update
apt install -V -y lsb-release
apt update --quiet
apt install -V -y --quiet lsb-release

. $(dirname $0)/commonvar.sh

apt install -V -y \
apt install -V -y --quiet \
${repositories_dir}/${distribution}/pool/${code_name}/${channel}/*/*/*_${architecture}.deb

fluentd --version
Expand Down Expand Up @@ -44,18 +44,18 @@ case $code_name in
;;
esac
# TODO: Remove it when v5 repository was deployed
apt install -y curl
apt install -y --quiet curl
curl -O https://packages.treasuredata.com/4/${distribution}/${code_name}/pool/contrib/f/fluentd-apt-source/fluentd-apt-source_2020.8.25-1_all.deb
apt install -y ./fluentd-apt-source_2020.8.25-1_all.deb
apt install -y --quiet ./fluentd-apt-source_2020.8.25-1_all.deb

apt clean all
# Uncomment when v5 repository was deployed
#apt_source_package=${apt_source_repositories_dir}/${distribution}/pool/${code_name}/${channel}/*/*/fluent-apt-source*_all.deb
#apt install -V -y ${apt_source_package} ca-certificates
apt update
apt install -V -y td-agent
apt update --quiet
apt install -V -y --quiet td-agent

apt install -V -y \
apt install -V -y --quiet \
${repositories_dir}/${distribution}/pool/${code_name}/${channel}/*/*/*_${architecture}.deb

getent passwd td-agent >/dev/null
Expand Down
13 changes: 10 additions & 3 deletions fluent-package/apt/piuparts-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

set -exu

apt update
apt install -V -y lsb-release
if [ "$CI" = "true" ]; then
echo "::group::Setup piuparts test"
fi

apt update --quiet
apt install -V -y --quiet lsb-release

. $(dirname $0)/commonvar.sh

Expand All @@ -24,11 +28,14 @@ mkdir -p $CHROOT
debootstrap --include=ca-certificates ${code_name} $CHROOT ${mirror}
cp $TD_AGENT_KEYRING $CHROOT/usr/share/keyrings/
chmod 644 $CHROOT/usr/share/keyrings/td-agent-archive-keyring.gpg
chroot $CHROOT apt install -V -y libyaml-0-2
chroot $CHROOT apt install -V -y --quiet libyaml-0-2
package=${repositories_dir}/${distribution}/pool/${code_name}/${channel}/*/*/*_${architecture}.deb
cp ${package} /tmp
echo "deb [signed-by=/usr/share/keyrings/td-agent-archive-keyring.gpg] https://packages.treasuredata.com/5/${distribution}/${code_name}/ ${code_name} contrib" | tee $CHROOT/etc/apt/sources.list.d/td.list
rm -rf $CHROOT/opt
if [ "$CI" = "true" ]; then
echo "::endgroup::"
fi
piuparts --distribution=${code_name} \
--existing-chroot=${CHROOT} \
--skip-logrotatefiles-test \
Expand Down
8 changes: 8 additions & 0 deletions fluent-package/apt/pkgsize-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -exu

echo "CHECK PACKAGE SIZE"

if [ "$CI" = "true" ]; then
echo "::group::Setup package size check"
fi

#
# Usage: $0 ubuntu:focal aarch64
#
Expand Down Expand Up @@ -58,6 +62,10 @@ case ${DISTRIBUTION} in
;;
esac

if [ "$CI" = "true" ]; then
echo "::endgroup::"
fi

set -e

DEB=$(find $REPOSITORIES_DIR/${DISTRIBUTION}/pool/${CODE_NAME}/${CHANNEL}/f/fluent-package/fluent-package_*${ARCH}.deb | sort -n | tail -1)
Expand Down
14 changes: 11 additions & 3 deletions fluent-package/apt/serverspec-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@ set -exu

export DEBIAN_FRONTEND=noninteractive

apt update
apt install -V -y lsb-release
if [ "$CI" = "true" ]; then
echo "::group::Setup serverspec test"
fi

apt update --quiet
apt install -V -y --quiet lsb-release

. $(dirname $0)/commonvar.sh

apt install -V -y \
apt install -V -y --quiet \
${repositories_dir}/${distribution}/pool/${code_name}/${channel}/*/*/*_${architecture}.deb

fluentd --version

if [ "$CI" = "true" ]; then
echo "::endgroup::"
fi

export PATH=/opt/fluent/bin:$PATH
export INSTALLATION_TEST=true
/usr/sbin/fluent-gem install --no-document serverspec
Expand Down
2 changes: 2 additions & 0 deletions fluent-package/binstubs-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
Dir.chdir(STUB_DIR) do
# Install all stub files which is described in Gemfile
gem_command = File.join(FLUENT_PACKAGE_DIR, "bin/gem")
puts "::group::Create stub files" if ENV["CI"]
system(gem_command, "pristine", "--all", "--only-executables", "--bindir", "#{STUB_DIR}/bin")
puts "::endgroup::" if ENV["CI"]

required_stub_paths = Dir.glob("#{STUB_DIR}/bin/*").each do |stub|
basename = File.basename(stub)
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ override_dh_builddeb:

override_dh_auto_install:
rake build:deb_config FLUENT_PACKAGE_STAGING_PATH="$(CURDIR)/debian/tmp" NO_VAR_RUN=1
rake build:all FLUENT_PACKAGE_STAGING_PATH="$(CURDIR)/debian/tmp" PATH="$(HOME)/.cargo/bin:$(PATH)"
CI=$CI rake build:all FLUENT_PACKAGE_STAGING_PATH="$(CURDIR)/debian/tmp" PATH="$(HOME)/.cargo/bin:$(PATH)"
dh_installman

override_dh_auto_clean:
Expand Down
10 changes: 9 additions & 1 deletion fluent-package/yum/binstubs-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ set -exu
# This means that column glitch exists.
# So, we should remove before "o" character.

echo "BINSTUBS TEST"
if [ "$CI" = "true" ]; then
echo "::group::Setup binstubs test"
fi

distribution=$(cat /etc/system-release-cpe | awk '{print substr($0, index($1, "o"))}' | cut -d: -f2)
version=$(cat /etc/system-release-cpe | awk '{print substr($0, index($1, "o"))}' | cut -d: -f4)

Expand Down Expand Up @@ -58,7 +63,10 @@ ARCH=$(rpm --eval "%{_arch}")
${DNF} install -y \
${repositories_dir}/${distribution}/${DISTRIBUTION_VERSION}/${ARCH}/Packages/*.rpm

echo "BINSTUBS TEST"
if [ "$CI" = "true" ]; then
echo "::endgroup::"
fi

/opt/fluent/bin/ruby /fluentd/fluent-package/binstubs-test.rb
if [ $? -eq 0 ]; then
echo "Checking existence of binstubs: OK"
Expand Down
Loading