Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/Reload without downtime #713

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
520d3c3
deb rpm: install missing local plugins during upgrade process
kenhys Oct 9, 2024
aebf70e
deb rpm: add auto/manual service restart during upgrading
kenhys Oct 15, 2024
9532daf
deb: remove debug print
kenhys Oct 18, 2024
2c53974
deb: fix wrong hook order to install plugins
kenhys Oct 18, 2024
2481cb0
deb: fix inconsistent phase comparison
kenhys Oct 18, 2024
b751f39
deb rpm: add helper script to repack debug packages (#692)
kenhys Oct 23, 2024
1bd6f5a
deb: simplify helper script (#693)
kenhys Oct 23, 2024
a93adc2
ci: fix tests for no-downtime
Watson1978 Oct 23, 2024
36a7469
rules: add --no-restart-after-upgrade option in dh_installsystemd for…
Watson1978 Oct 16, 2024
4a35aa6
system-test: remove unnecessary condition
Watson1978 Oct 24, 2024
2b4fed5
system-test: add comments
Watson1978 Oct 24, 2024
b4bc8d9
system-test: add TODO comments
Watson1978 Oct 24, 2024
2ae2ed9
rpm ci: collect diagnostic message for cgroup v1 (#696)
kenhys Oct 29, 2024
29fc031
ci: add cancel-in-progress setting
kenhys Oct 29, 2024
9f61d42
ci: extend timeout for v6 workflow (#701)
kenhys Oct 30, 2024
4ba7f76
ci: show debug message to investigate
kenhys Oct 30, 2024
953caa3
use Fluentd for the feature (#700)
daipom Oct 31, 2024
cf9f02a
ci: add test to update without data lost (#699)
Watson1978 Oct 31, 2024
f9fe3ff
fluent-package: improve repack helper script
kenhys Oct 31, 2024
5374b3f
deb rpm: fix local dependency gem (#688)
kenhys Nov 1, 2024
d3441e0
ci: add test to update with auto / manual feature (#712)
Watson1978 Nov 5, 2024
bbdbb8b
Remove unnecessary GEM_HOME/GEM_PATH settings (#714)
Watson1978 Nov 6, 2024
45f148a
deb: suppress service restart by needrestart
kenhys Oct 28, 2024
fedfe9f
ci deb: check whether needrestart was suppressed
kenhys Nov 7, 2024
14ffd6a
deb yum: use /usr/sbin/fluent-gem to migrate gems when upgrade
Watson1978 Nov 7, 2024
a7d9330
Rakefile: fix build error of windows package
Watson1978 Nov 8, 2024
d41dbc4
Gemfile.lock: fix dependency due to fix build error on windows (#730)
Watson1978 Nov 11, 2024
310e254
ci: update the tests for no data lost (#715)
Watson1978 Nov 11, 2024
8e00ff7
ci: rename test file
Watson1978 Nov 12, 2024
517049c
ci: add downgrade test for no data lost
Watson1978 Nov 12, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/apt-arm.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Apt based Linux (AArch64)
on:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
Expand Down
49 changes: 48 additions & 1 deletion .github/workflows/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ on:
- master
- fluent-package-lts-v5
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
timeout-minutes: 60
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -51,16 +54,34 @@ jobs:
fluent-package/apt/repositories
fluent-apt-source/apt/repositories
fluent-lts-apt-source/apt/repositories
v6-test/fluent-package/apt/repositories
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', 'fluent-package/templates/**', 'fluent-package/debian/**', 'fluent-package/apt/**/Dockerfile') }}
- name: Build deb with Docker
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
run: |
rake apt:build APT_TARGETS=${{ matrix.rake-job }}
- uses: actions/checkout@master
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
with:
path: v6-test
- name: Build v6 deb with Docker
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
run: |
cd v6-test
git config user.email "[email protected]"
git config user.name "Fluentd developers"
git am fluent-package/bump-version-v6.patch
rake apt:build APT_TARGETS=${{ matrix.rake-job }}
- name: Upload fluent-package deb
uses: actions/upload-artifact@master
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Upload v6 fluent-package deb
uses: actions/upload-artifact@master
with:
name: v6-packages-${{ matrix.rake-job }}
path: v6-test/fluent-package/apt/repositories
- name: Upload fluent-apt-source deb
uses: actions/upload-artifact@master
with:
Expand Down Expand Up @@ -154,6 +175,10 @@ jobs:
- "update-to-next-version-service-status.sh enabled inactive"
- "update-to-next-version-service-status.sh disabled active"
- "update-to-next-version-service-status.sh disabled inactive"
- "update-to-next-version-with-auto-and-manual.sh"
- "update-to-next-major-version.sh"
- "update-without-data-lost.sh v5 v6"
- "update-without-data-lost.sh v6 v5"
include:
- label: Debian bullseye amd64
rake-job: debian-bullseye
Expand Down Expand Up @@ -196,9 +221,31 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: v6-packages-${{ matrix.rake-job }}
path: v6-test
- uses: actions/download-artifact@v4
with:
name: packages-apt-source-${{ matrix.rake-job }}
- uses: canonical/[email protected]
- name: Run diagnostic
run: |
uname -a
echo "::group::snap info lxd"
snap info lxd
echo "::endgroup::"
echo "::group::snap services lxd"
snap services lxd
echo "::endgroup::"
echo "::group::snap logs lxd"
sudo snap logs lxd
echo "::endgroup::"
echo "::group::lxc remote list"
lxc remote list
echo "::endgroup::"
echo "::group::lxc list images:"
lxc image list images:
echo "::endgroup::"
- name: Run Test ${{ matrix.test }} on ${{ matrix.lxc-image }}
run: fluent-package/apt/systemd-test/test.sh ${{ matrix.lxc-image }} ${{ matrix.test }}
3 changes: 3 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- master
- fluent-package-lts-v5
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- master
- fluent-package-lts-v5
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/yum-arm.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Yum based Linux (AArch64)
on:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
Expand Down
60 changes: 58 additions & 2 deletions .github/workflows/yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ on:
- master
- fluent-package-lts-v5
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Build
timeout-minutes: 60
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -47,17 +50,36 @@ jobs:
uses: actions/cache@v4
id: cache-rpm
with:
path: fluent-package/yum/repositories
path: |
fluent-package/yum/repositories
v6-test/fluent-package/yum/repositories
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }}
- name: Build rpm with Docker
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
run: |
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- uses: actions/checkout@master
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
with:
path: v6-test
- name: Build v6 rpm with Docker
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
run: |
cd v6-test
git config user.email "[email protected]"
git config user.name "Fluentd developers"
git am fluent-package/bump-version-v6.patch
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- name: Upload fluent-package rpm
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Upload v6 fluent-package rpm
uses: actions/upload-artifact@v4
with:
name: v6-packages-${{ matrix.rake-job }}
path: v6-test/fluent-package/yum/repositories
# TODO move the following steps to "Test" job
- name: Check Package Size
run: |
Expand Down Expand Up @@ -128,6 +150,10 @@ jobs:
- "update-to-next-version-service-status.sh enabled inactive"
- "update-to-next-version-service-status.sh disabled active"
- "update-to-next-version-service-status.sh disabled inactive"
- "update-to-next-version-with-auto-and-manual.sh"
- "update-to-next-major-version.sh"
- "update-without-data-lost.sh v5 v6"
- "update-without-data-lost.sh v6 v5"
include:
- label: AmazonLinux 2 x86_64
rake-job: amazonlinux-2
Expand All @@ -147,7 +173,29 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: v6-packages-${{ matrix.rake-job }}
path: v6-test
- uses: canonical/[email protected]
- name: Run diagnostic
run: |
uname -a
echo "::group::snap info lxd"
snap info lxd
echo "::endgroup::"
echo "::group::snap services lxd"
snap services lxd
echo "::endgroup::"
echo "::group::snap logs lxd"
sudo snap logs lxd
echo "::endgroup::"
echo "::group::lxc remote list"
lxc remote list
echo "::endgroup::"
echo "::group::lxc list images:"
lxc image list images:
echo "::endgroup::"
- name: Run Test ${{ matrix.test }} on ${{ matrix.lxc-image }}
run: fluent-package/yum/systemd-test/test.sh ${{ matrix.lxc-image }} ${{ matrix.test }}

Expand All @@ -174,6 +222,10 @@ jobs:
- "update-to-next-version-service-status.sh enabled inactive"
- "update-to-next-version-service-status.sh disabled active"
- "update-to-next-version-service-status.sh disabled inactive"
- "update-to-next-version-with-auto-and-manual.sh"
- "update-to-next-major-version.sh"
- "update-without-data-lost.sh v5 v6"
- "update-without-data-lost.sh v6 v5"
include:
- label: RockyLinux 8 x86_64
rake-job: rockylinux-8
Expand All @@ -186,6 +238,10 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: v6-packages-${{ matrix.rake-job }}
path: v6-test
- uses: canonical/[email protected]
- name: Run Test ${{ matrix.test }} on ${{ matrix.lxc-image }}
run: fluent-package/yum/systemd-test/test.sh ${{ matrix.lxc-image }} ${{ matrix.test }}
2 changes: 1 addition & 1 deletion fluent-package/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem "cool.io", "1.8.1", platforms: no_fat_gem
gem "sigdump", "0.2.5"
gem "http_parser.rb", "0.8.0"
gem "yajl-ruby", "1.4.3"
gem "serverengine", '2.3.2'
gem "serverengine", '2.4.0'
gem "msgpack", "1.7.2"
gem "oj", "3.16.4"
gem "tzinfo", "2.0.6"
Expand Down
13 changes: 8 additions & 5 deletions fluent-package/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ GIT

GIT
remote: https://github.com/fluent/fluentd
revision: e763c0761c44d9734b6aa374371387a2e8406522
ref: e763c0761c44d9734b6aa374371387a2e8406522
revision: f8755d09b747d054302c0e12a3b0962a11f1045e
ref: f8755d09b747d054302c0e12a3b0962a11f1045e
specs:
fluentd (1.17.0)
fluentd (1.17.1)
base64 (~> 0.2)
bundler
certstore_c (~> 0.1.7)
cool.io (>= 1.4.5, < 2.0.0)
csv (~> 3.2)
drb (~> 2.2)
http_parser.rb (>= 0.5.1, < 0.9.0)
logger (~> 1.6)
msgpack (>= 1.3.1, < 2.0.0)
serverengine (>= 2.3.2, < 3.0.0)
sigdump (~> 0.2.5)
Expand Down Expand Up @@ -236,7 +237,9 @@ GEM
digest-crc
ruby-progressbar (1.13.0)
rubyzip (1.3.0)
serverengine (2.3.2)
serverengine (2.4.0)
base64 (~> 0.1)
logger (~> 1.4)
sigdump (~> 0.2.2)
sigdump (0.2.5)
strptime (0.2.5)
Expand Down Expand Up @@ -337,7 +340,7 @@ DEPENDENCIES
rake
rdkafka (= 0.16.1)
ruby-kafka (= 1.5.0)
serverengine (= 2.3.2)
serverengine (= 2.4.0)
sigdump (= 0.2.5)
systemd-journal (= 1.4.2)
td (= 0.17.1)
Expand Down
21 changes: 16 additions & 5 deletions fluent-package/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def extract_fluentd_version(archive_path)
File.basename(archive_path, ".tar.gz"))
Dir.chdir(archive_dir) do
IO.popen("git tag --contains #{FLUENTD_REVISION}") do |tags|
fluentd_version = tags.readlines.last.chomp.delete_prefix("v")
fluentd_version = tags.readlines.last&.chomp&.delete_prefix("v") || ""
end
end
puts "::endgroup::" if ENV["CI"]
Expand Down Expand Up @@ -1183,10 +1183,21 @@ class BuildTask
fluentd_conf = "etc/#{PACKAGE_DIR}/#{SERVICE_NAME}.conf"
fluentd_conf_default = "opt/#{PACKAGE_DIR}/share/#{SERVICE_NAME}.conf"
configs = [fluentd_conf]
configs.concat([
"etc/logrotate.d/#{SERVICE_NAME}",
fluentd_conf_default,
]) unless windows? || macos?
unless windows? || macos?
configs.concat([
"etc/logrotate.d/#{SERVICE_NAME}",
fluentd_conf_default,
])
File.readlines("/etc/os-release").each do |line|
if line.include?("ID=")
distribution = line.split(/=/).last.chomp
if ["debian", "ubuntu"].include?(distribution)
puts "Suppress needrestart on #{distribution}"
configs.concat(["etc/needrestart/conf.d/50-fluent-package.conf"])
end
end
end
end
configs.each do |config|
src =
if config == fluentd_conf_default
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/apt/systemd-test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dir="/host/fluent-package/apt/systemd-test"
set -eux

echo "::group::Run test: launch $image"
lxc launch $image target
lxc launch $image target --debug
sleep 5
echo "::endgroup::"
echo "::group::Run test: configure $image"
Expand Down
14 changes: 13 additions & 1 deletion fluent-package/apt/systemd-test/update-from-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ case $1 in
local)
sudo apt install -V -y \
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb 2>&1 | tee upgrade.log
# Test: needrestart was suppressed
if dpkg-query --show --showformat='${Version}' needrestart ; then
case $code_name in
focal)
# dpkg-query succeeds even though needrestart is not installed.
(! grep "No services need to be restarted." upgrade.log)
;;
*)
grep "No services need to be restarted." upgrade.log
;;
esac
fi
;;
v5)
curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5.sh | sh
Expand Down
Loading
Loading