diff --git a/.github/workflows/apt-arm.yml b/.github/workflows/apt-arm.yml index e32edee8a..81ca0bb8d 100644 --- a/.github/workflows/apt-arm.yml +++ b/.github/workflows/apt-arm.yml @@ -47,7 +47,7 @@ jobs: run: | rake apt:build APT_TARGETS=${{ matrix.rake-job }}-arm64 ${{ matrix.rake-options }} - name: Upload fluent-package deb - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-${{ matrix.rake-job }}-arm64 path: fluent-package/apt/repositories diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index 2e982333c..494d05f19 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -50,17 +50,17 @@ jobs: run: | rake apt:build APT_TARGETS=${{ matrix.rake-job }} - name: Upload fluent-package deb - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-${{ matrix.rake-job }} path: fluent-package/apt/repositories - name: Upload fluent-apt-source deb - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-apt-source-${{ matrix.rake-job }} path: fluent-apt-source/apt/repositories - name: Upload fluent-lts-apt-source deb - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-lts-apt-source-${{ matrix.rake-job }} path: fluent-lts-apt-source/apt/repositories diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 04debe32c..6c0f74d4c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -33,7 +33,7 @@ jobs: rm -rf fluent/staging rake dmg:selfbuild PATH="$HOME/.cargo/bin:$PATH" - name: Upload fluent-package dmg - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-macos path: fluent-package/dmg/*.dmg diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a610d7bb3..f0068f475 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -34,7 +34,7 @@ jobs: gem install bundler:2.2.9 --no-document rake msi:build - name: Upload td-agent msi - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-windows-x86_64 path: fluent-package/msi/repositories diff --git a/.github/workflows/yum-arm.yml b/.github/workflows/yum-arm.yml index 10879c446..134a7178a 100644 --- a/.github/workflows/yum-arm.yml +++ b/.github/workflows/yum-arm.yml @@ -34,6 +34,7 @@ jobs: with: path: | fluent-package/yum/repositories + fluent-release/yum/repositories key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-aarch64-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }} - name: Install dependencies if: ${{ ! steps.cache-rpm.outputs.cache-hit }} @@ -47,10 +48,15 @@ jobs: run: | rake yum:build YUM_TARGETS=${{ matrix.rake-job }}-aarch64 - name: Upload fluent-package rpm - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: packages-${{ matrix.rake-job }}-aarch64 path: fluent-package/yum/repositories + - name: Upload fluent-release rpm + uses: actions/upload-artifact@v4 + with: + name: packages-release-lts-${{ matrix.rake-job }}-aarch64 + path: fluent-release/yum/repositories check_package_size: name: Check Package Size runs-on: ubuntu-24.04-arm diff --git a/.github/workflows/yum.yml b/.github/workflows/yum.yml index b3a730b43..fb4a9061b 100644 --- a/.github/workflows/yum.yml +++ b/.github/workflows/yum.yml @@ -35,6 +35,7 @@ jobs: with: path: | fluent-package/yum/repositories + fluent-release/yum/repositories key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }} - name: Install dependencies if: ${{ ! steps.cache-rpm.outputs.cache-hit }} @@ -52,6 +53,11 @@ jobs: with: name: packages-${{ matrix.rake-job }} path: fluent-package/yum/repositories + - name: Upload fluent-release rpm + uses: actions/upload-artifact@v4 + with: + name: packages-release-lts-${{ matrix.rake-job }} + path: fluent-release/yum/repositories check_package_size: name: Check Package Size runs-on: ubuntu-latest @@ -235,6 +241,9 @@ jobs: - uses: actions/download-artifact@v4 with: name: packages-${{ matrix.rake-job }} + - uses: actions/download-artifact@v4 + with: + name: packages-release-lts-${{ matrix.rake-job }} - name: Install Incus run: | sudo apt-get update @@ -249,3 +258,53 @@ jobs: sudo incus admin init --auto - name: Run Test ${{ matrix.test-file }} on ${{ matrix.container-image }} run: fluent-package/yum/systemd-test/test.sh ${{ matrix.container-image }} ${{ matrix.test-file }} + - name: Run Test ${{ matrix.test }} on ${{ matrix.container-image }} + run: fluent-package/yum/systemd-test/test.sh ${{ matrix.container-image }} ${{ matrix.test-file }} + + fluent-release-test: + name: Test ${{ matrix.label }} ${{ matrix.test }} (CGroup V2) + needs: [v2test] + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + label: + - RockyLinux 8 x86_64 + - AlmaLinux 9 x86_64 + #- AmazonLinux 2 x86_64 + - AmazonLinux 2023 x86_64 + test: + - install-from-r2.sh + include: + - label: RockyLinux 8 x86_64 + rake-job: rockylinux-8 + container-image: images:rockylinux/8 + - label: AlmaLinux 9 x86_64 + rake-job: almalinux-9 + container-image: images:almalinux/9 + # - label: AmazonLinux 2 x86_64 + # rake-job: amazonlinux-2 + # container-image: images:amazonlinux/2 + - label: AmazonLinux 2023 x86_64 + rake-job: amazonlinux-2023 + container-image: images:amazonlinux/2023 + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: packages-release-lts-${{ matrix.rake-job }} + - name: Install Incus + run: | + sudo apt-get update + sudo apt-get install -y -V incus + - name: Allow egress network traffic flows for Incus + # https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker + run: | + sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT + sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT + - name: Setup Incus + run: | + sudo incus admin init --auto + - name: Run Test ${{matrix.test}} on ${{ matrix.container-image }} + run: fluent-release/yum/systemd-test/test.sh ${{ matrix.container-image }} ${{ matrix.test }} diff --git a/Rakefile b/Rakefile index 2d6d0089c..962dbd299 100755 --- a/Rakefile +++ b/Rakefile @@ -24,10 +24,15 @@ APT_SOURCE_PACKAGES = [ "fluent-lts-apt-source", ] +YUM_RELEASE_PACKAGES = [ + "fluent-release" +] + ALL_PACKAGE = [ "fluent-package", "fluent-apt-source", "fluent-lts-apt-source", + "fluent-release", ] def define_bulked_task(name, description, packages = PACKAGES) @@ -59,6 +64,7 @@ end [ ["apt:build", "Build fluent-apt-source deb packages", APT_SOURCE_PACKAGES], + ["yum:build", "Build fluent-release rpm packages", YUM_RELEASE_PACKAGES], ].each do |params| define_bulked_task(*params) end diff --git a/fluent-release/RPM-GPG-KEY-fluent-package b/fluent-release/RPM-GPG-KEY-fluent-package new file mode 100644 index 000000000..c0e0cd0e6 --- /dev/null +++ b/fluent-release/RPM-GPG-KEY-fluent-package @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGSbzFkBEADhPkZICm+ilfPuvGUM5eJZRII/ZHO8vWFbesS22to52JELB2mO +HqzwK4A9PQwuZY1LyUS9KnP6gyUGYfcLxvG3Rnr+QFup7zjMvj8qSfv4L3mSVlKg +6tG+jbS/lwnCS+WbbB+5giMQud4NFSYhZP57+jQK+vmxy0HZxReB7XP90xWdpF0y +B1MUHSnOviBtEX0OEDSEWPIsIDu6LX83Wu4NeRMOXBsDALYo32jEem/QpTjUL6jP +k3xMDIcLa/HwZkY8EzdruBL1lZh5CbV2dyrLFnNy2FrHzjzDHWd9PzvAzjtACXXP +XUBm2eu4S9Vr9r7KfrRHpPzl56kYevv270dOfxxKKajPJQjSdp9gLEOCh5PJCuX8 +q8V1k/dRf5o+oh+6PlDl9UFYtoodT1KoioCVBriVHc9pmFXzDOwwzKD3Odp0nkh4 +0MH1B6OFX0Vfm7y8b934RuBjiNLjZ9iBi8/tuxgV/KSNsri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47hWFh5un+Wa +CiJLouURD1FnbEiNQ+fzGcJTaetTNOYFRw6yJgAUh7JNYvyAqToDilP5zUgop+/T +x0sLSr4HbeVZg/R1JDmYhVlcJw3+D6gA8vN7baqbUxomTzpVAuMYBOE21EakTQPd +T+Qpfz68zSxGGr7HolMy5D4R4EXI53ijKOgy7utMLvEHOmOubZG75pUMDkbMAltb ++bCednbSXr31IhcdmIfqklQw55ak3PX222i4hkajTSPosoiO9Yfd9ZEtt8TT83aF +a4VZT9vDzqyEG1Z52zLA+nx69VLolNeLv/9ViOM0WNbmaN9F1ruDQ7Mku7ZWCExW +b1iKF7/N1qceF3k4K87LI/SxIvNAxhyLi13i6cATQuPiUZoAvCaWmn70qImR5H+L +wBZ3uruCU1F15VXY5LL+v7JwzwhT9PQvsYnRBClOtd35gq5oBBqt8QIGeg3kY+8= +=nE26 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/fluent-release/RPM-GPG-KEY-td-agent b/fluent-release/RPM-GPG-KEY-td-agent new file mode 100644 index 000000000..8d0b22ff9 --- /dev/null +++ b/fluent-release/RPM-GPG-KEY-td-agent @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFhiI8wBEADThWLNd8IKPRw7Ygu3DHS4Sb/Yc6vSZSaMGJ6Wkj245jScvI+C +nG4C4rtO/8ObUj5cUpb4CyfYZX8W4tp9x+W68c4paXevG4s+X4EE3uUsgdwTnFXi +GMa57QDzR4p/JvjUjfGJ2UAr4Bfj8Q2S54LmIu6UAe82ce2B4tEHCeYSxkmVUDAZ +utfmgKoVTbnceTemU0m5ANS6IC1/53KEhgB1sKm5G/FjRJGslHWb3mf+bLrhmlkP +pA4BOKF2w3eFYH3LhWskxMS0SPM7J6aq+6LyNNqtlKL6lUS7qVjRQ6PlgFcmtG4J +tijsZI62bDn1f44DmeLY+LMS/nM0xyIx94lYumGH5EYmjUECagqMool98/+Wx79A +Thtg/1pYNzo8Z76qr0i3xLSRtsQ2Om2Rfal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K +yQix2Hofg3H96dZXsqbQEvxgyema+A6ptCm7S66eSYoPPeXQaraTsz6nLlVtvhSD +kll2axjAK4NDbSjJuZI/54CkO+FB00bkXDxPFgnfDPWgvPMF1cBuuX0QN1BO8n4C +eA9zyBBdTw9bbzO1kRdeBHLa7n845ecVbEh15Hvtf20/CJB9ua+qRlcXtgxhUf3+ +pm/xbAM22z/F3+RsLwGOG8T0Vy2q//VVqLxSFlawiZW9RkClKyV6A1KH0EA6W84d +GcxiDgwrBHd+d40s3VDE/Wlmj0w73xeebEaXCmaTO/Hp5DIA64LfXHB2ckvwv15I +ISQV2g55+ghnwaD/02uGCGpJl0zJgQ+PKvrFAz+wIUqrQJxXP4epqWycmzG98T7g +pi20lwzO87S6b1GIL9t6Q/Zge8bbB7lG5mBR2U5XyGhfHXGaHTb6nQQYh3hCet8G +5Ow= +=Me4L +-----END PGP PUBLIC KEY BLOCK----- diff --git a/fluent-release/Rakefile b/fluent-release/Rakefile new file mode 100644 index 000000000..529f34ef2 --- /dev/null +++ b/fluent-release/Rakefile @@ -0,0 +1,205 @@ +# -*- ruby -*- + +require_relative "../lib/package-task" +require "rake/clean" +require "time" + +CLEAN.include("yum/tmp") +CLEAN.include("yum/build.sh") +CLEAN.include("yum/env.sh") +CLOBBER.include("yum/repositories") + +class FluentReleasePackageTask < PackageTask + def initialize + super("fluent-release", + repository_version, + latest_commit_time(File.join(__dir__, ".."))) + CLEAN.include(@archive_name) + end + + def repository_version + "2025.6.29" + end + + def repository_label + "Fluentd Project" + end + + def repository_description + "Fluentd Project related packages" + end + + def repository_url + # Navigate to R2 by default + # "https://packages.treasuredata.com" + "https://fluentd.cdn.cncf.io" + end + + def define + super + define_yum_latest_task + end + + def generate_repo_files + targets = [ + { + id: "rhel-compat", + distribution: "redhat", + version: "$releasever", + }, + { + id: "amazonlinux2023", + distribution: "amazon", + version: "2023", + }, + # For v5 + { + id: "amazonlinux2", + distribution: "amazon", + version: "2", + }, + ] + # fluent-release source tar.gz contains some fluent-package-${TARGET_DISTRIBUTION}-${RELEASE_CHANNEL}.repo files + targets.each do |target| + repo_path = "#{@archive_base_name}/fluent-package-#{target[:id]}.repo" + prefix = "gpgkey=" + gpgkey = "" + repository_gpg_key_ids.each do |gpg_key_id| + gpgkey += <<-KEY +#{prefix}file:///etc/pki/rpm-gpg/#{rpm_gpg_key_path(gpg_key_id)} + KEY + prefix = " " * prefix.size + end + File.open(repo_path, "w") do |repo| + repo.puts(<<-REPOSITORY) +[fluent-package-lts-v5] +name=#{repository_label} +baseurl=#{repository_url}/lts/5/#{target[:distribution]}/#{target[:version]}/$basearch/ +gpgcheck=1 +enabled=1 +#{gpgkey} +[fluent-package-lts-v6] +name=#{repository_label} +baseurl=#{repository_url}/lts/6/#{target[:distribution]}/#{target[:version]}/$basearch/ +gpgcheck=1 +enabled=0 +#{gpgkey} + REPOSITORY + end + end + end + + private + + def git_directory?(directory) + candidate_paths = [".git", "HEAD"] + candidate_paths.any? do |candidate_path| + File.exist?(File.join(directory, candidate_path)) + end + end + + def latest_commit_time(git_directory) + return nil unless git_directory?(git_directory) + Dir.chdir(git_directory) do + return Time.iso8601(`git log -n 1 --format=%aI`.chomp).utc + end + end + + def td_agent_key_id + "BEE682289B2217F45AF4CC3F901F9177AB97ACBE" + end + + def fluent_package_key_id + "B40948B6A3B80E90F40E841F977D7A0943FA320E" + end + + def rpm_gpg_key_path(id) + case id + when td_agent_key_id + "RPM-GPG-KEY-td-agent" + when fluent_package_key_id + "RPM-GPG-KEY-fluent-package" + end + end + + def generate_gpg_keys + repository_gpg_key_ids.each do |gpg_key_id| + unless system("gpg", "--list-keys", gpg_key_id, out: IO::NULL) + sh("gpg", + "--keyserver", "keyserver.ubuntu.com", + "--recv-key", gpg_key_id) + end + sh("gpg", "--armor", "--export", gpg_key_id, out: "#{@archive_base_name}/#{rpm_gpg_key_path(gpg_key_id)}") + end + end + + def repository_gpg_key_ids + [td_agent_key_id, fluent_package_key_id] + end + + def define_archive_task + file @archive_name do + rm_rf(@archive_base_name) + mkdir(@archive_base_name) + generate_gpg_keys + generate_repo_files + cp("yum/fluent-release.spec.in", "#{@archive_base_name}/fluent-release.spec.in") + sh("tar", "czf", @archive_name, @archive_base_name) + end + end + + def yum_targets_default + [ + "rockylinux-8", + "almalinux-9", + "almalinux-10", + "amazonlinux-2", + "amazonlinux-2023" + ] + end + + def define_yum_latest_task + namespace :yum do + task :build do + yum_targets.each do |target| + distribution, version, arch = target.split("-", 3) + arch = "x86_64" if arch.nil? + suffix = case version + when "2" + "amzn2" + when "2023" + "amzn2023" + else + "el#{version}" + end + distribution = case distribution + when "rockylinux" + "rocky" + when "amazonlinux" + "amazon" + else + distribution + end + rpm = [ + yum_dir, + "repositories", + distribution, + version, + arch, + "Packages", + "#{@package}-#{@rpm_version}-#{@rpm_release}.#{suffix}.noarch.rpm", + ].join("/") + rpm_dir = File.dirname(rpm) + directory rpm_dir + end + end + end + end + + def enable_apt? + false + end +end + +task = FluentReleasePackageTask.new +task.define diff --git a/fluent-release/yum/almalinux-9-aarch64/from b/fluent-release/yum/almalinux-9-aarch64/from new file mode 100644 index 000000000..5fab1520f --- /dev/null +++ b/fluent-release/yum/almalinux-9-aarch64/from @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +arm64v8/almalinux:9 diff --git a/fluent-release/yum/almalinux-9/Dockerfile b/fluent-release/yum/almalinux-9/Dockerfile new file mode 100644 index 000000000..616347ec1 --- /dev/null +++ b/fluent-release/yum/almalinux-9/Dockerfile @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ARG FROM=almalinux:9 +FROM ${FROM} + +ARG DEBUG + +RUN \ + quiet=$([ "${DEBUG}" = "yes" ] || echo "--quiet") && \ + dnf install redhat-release -y && \ + dnf install --enablerepo=crb -y ${quiet} \ + make \ + rpm-build \ + rpmdevtools \ + redhat-rpm-config \ + rpmlint \ + && \ + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + yum clean ${quiet} all diff --git a/fluent-release/yum/amazonlinux-2-aarch64/from b/fluent-release/yum/amazonlinux-2-aarch64/from new file mode 100644 index 000000000..ea38a8d42 --- /dev/null +++ b/fluent-release/yum/amazonlinux-2-aarch64/from @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +arm64v8/amazonlinux:2 diff --git a/fluent-release/yum/amazonlinux-2/Dockerfile b/fluent-release/yum/amazonlinux-2/Dockerfile new file mode 100644 index 000000000..4c94eea10 --- /dev/null +++ b/fluent-release/yum/amazonlinux-2/Dockerfile @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ARG FROM=amazonlinux:2 +FROM ${FROM} + +ARG DEBUG + +RUN \ + quiet=$([ "${DEBUG}" = "yes" ] || echo "--quiet") && \ + yum update -y ${quiet} && \ + yum install -y ${quiet} yum-utils yum-config-manager && \ + yum-config-manager --enable epel && \ + yum groupinstall -y ${quiet} "Development Tools" && \ + yum install -y ${quiet} \ + rpm-build \ + rpmdevtools \ + redhat-rpm-config \ + rpmlint && \ + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + yum clean ${quiet} all diff --git a/fluent-release/yum/amazonlinux-2023-aarch64/from b/fluent-release/yum/amazonlinux-2023-aarch64/from new file mode 100644 index 000000000..3b6282cc4 --- /dev/null +++ b/fluent-release/yum/amazonlinux-2023-aarch64/from @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +arm64v8/amazonlinux:2023 diff --git a/fluent-release/yum/amazonlinux-2023/Dockerfile b/fluent-release/yum/amazonlinux-2023/Dockerfile new file mode 100644 index 000000000..e8f278996 --- /dev/null +++ b/fluent-release/yum/amazonlinux-2023/Dockerfile @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ARG FROM=amazonlinux:2023 +FROM ${FROM} + +ARG DEBUG + +RUN \ + quiet=$([ "${DEBUG}" = "yes" ] || echo "--quiet") && \ + yum update -y ${quiet} && \ + yum install -y ${quiet} yum-utils && \ + yum groupinstall -y ${quiet} "Development Tools" && \ + yum install -y ${quiet} \ + rpm-build \ + rpmdevtools \ + redhat-rpm-config \ + rpmlint \ + && \ + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + # enable multiplatform feature + yum clean ${quiet} all diff --git a/fluent-release/yum/fluent-release.spec.in b/fluent-release/yum/fluent-release.spec.in new file mode 100644 index 000000000..761825c99 --- /dev/null +++ b/fluent-release/yum/fluent-release.spec.in @@ -0,0 +1,67 @@ +# -*- rpm -*- + +%define _amzn %{?amzn}%{!?amzn:0} +%define is_amazon_linux (%{_amzn} != 0) + +Name: @PACKAGE@ +Version: @VERSION@ +Release: @RELEASE@%{?dist} +Summary: Fluent Package release files +BuildArchitectures: noarch + +License: ASL 2.0 +URL: https://docs.fluentd.org/ +Source0: @PACKAGE@-@VERSION@.tar.gz + +%if ! %{is_amazon_linux} +Requires: epel-release +Requires: dnf-command(config-manager) +%else +%if %{_amzn} == 2 +Requires: yum-utils +%else +Requires: dnf-command(config-manager) +%endif +%endif + +%description +The stable distribution of Fluentd release repository files + +%prep +%setup -q -n @PACKAGE@-%{version} + +%build + +%install + +mkdir -p %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ +%{__install} -Dp -t %{buildroot}%{_sysconfdir}/pki/rpm-gpg/ -m0644 RPM-GPG-KEY-* + +mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d/ + +if grep -qs 'Amazon Linux' /etc/os-release; then + if grep -qs 'VERSION="2"' /etc/os-release; then + echo "Install .repo for Amazon Linux 2" + cp fluent-package-amazonlinux2.repo fluent-package-lts.repo + else + echo "Install .repo for Amazon Linux 2023" + cp fluent-package-amazonlinux2023.repo fluent-package-lts.repo + fi +else + echo "Install .repo for RHEL compatible distribution" + cp fluent-package-rhel-compat.repo fluent-package-lts.repo +fi +%{__install} -D --preserve-timestamps --target-directory %{buildroot}%{_sysconfdir}/yum.repos.d/ --mode=0644 fluent-package-lts.repo + +%files +%defattr(-,root,root,-) +%dir %{_sysconfdir}/yum.repos.d/ +%config(noreplace) %{_sysconfdir}/yum.repos.d/*.repo +%dir %{_sysconfdir}/pki/rpm-gpg/ +%config(noreplace) %{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-td-agent +%config(noreplace) %{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-fluent-package + +%changelog +* Sun Jun 29 2025 Kentaro Hayashi - 2025.6.29-1 +- New upstream release. + diff --git a/fluent-release/yum/rockylinux-8-aarch64/from b/fluent-release/yum/rockylinux-8-aarch64/from new file mode 100644 index 000000000..67c081b2f --- /dev/null +++ b/fluent-release/yum/rockylinux-8-aarch64/from @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +arm64v8/rockylinux:8 diff --git a/fluent-release/yum/rockylinux-8/Dockerfile b/fluent-release/yum/rockylinux-8/Dockerfile new file mode 100644 index 000000000..36bc4ad93 --- /dev/null +++ b/fluent-release/yum/rockylinux-8/Dockerfile @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +ARG FROM=rockylinux:8 +FROM ${FROM} + +ARG DEBUG + +RUN \ + quiet=$([ "${DEBUG}" = "yes" ] || echo "--quiet") && \ + dnf module enable ruby:3.1 -y && \ + dnf install --enablerepo=powertools -y ${quiet} \ + make \ + rpm-build \ + rpmdevtools \ + redhat-rpm-config \ + rpmlint \ + && \ + # raise IPv4 priority + echo "precedence ::ffff:0:0/96 100" > /etc/gai.conf && \ + yum clean ${quiet} all diff --git a/fluent-release/yum/rpmlint.config b/fluent-release/yum/rpmlint.config new file mode 100644 index 000000000..47e2d986c --- /dev/null +++ b/fluent-release/yum/rpmlint.config @@ -0,0 +1,3 @@ +# fluent-release package will be prepared in advance +addFilter("E: changelog-time-in-future") +addFilter("W: no-documentation") diff --git a/fluent-release/yum/systemd-test/install-from-r2.sh b/fluent-release/yum/systemd-test/install-from-r2.sh new file mode 100755 index 000000000..5df1d704f --- /dev/null +++ b/fluent-release/yum/systemd-test/install-from-r2.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -exu + +. $(dirname $0)/../../../fluent-package/yum/systemd-test/commonvar.sh + +sudo $DNF install -y \ + /host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-release-*.noarch.rpm + +test -f /etc/pki/rpm-gpg/RPM-GPG-KEY-td-agent +test -f /etc/pki/rpm-gpg/RPM-GPG-KEY-fluent-package + +test -f /etc/yum.repos.d/fluent-package-lts.repo +grep fluentd.cdn.cncf.io /etc/yum.repos.d/fluent-package-lts.repo +test $($DNF repolist --enabled | grep 'Fluentd Project' | wc -l) -eq 1 +test $($DNF repolist --enabled | grep 'Fluentd Project' | cut -d' ' -f1) = fluent-package-lts-v5 + +sudo $DNF update -y +sudo $DNF install -y fluent-package diff --git a/fluent-release/yum/systemd-test/test.sh b/fluent-release/yum/systemd-test/test.sh new file mode 100755 index 000000000..fee03bd2a --- /dev/null +++ b/fluent-release/yum/systemd-test/test.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +if [ $# -lt 2 ]; then + echo "Error: Need to specify lxc image name and filename." + echo "Ex. CI) $ ./test.sh images:rockylinux/8 install-newly.sh local" + exit 1 +fi + +image=$1 +test_file=$2 +shift 2 +other_args="$@" +dir="/host/fluent-release/yum/systemd-test" + +set -eux + +echo "::group::Run test: launch $image" +sudo incus launch $image target --debug +sleep 5 +echo "::endgroup::" +echo "::group::Run test: configure $image" +echo "setup source=$PWD and path=/host" +sudo incus config device add target host disk source=$PWD path=/host +sudo incus list +echo "::endgroup::" +echo "::group::Run test: $test_file $other_args on $image" +sudo incus exec target -- $dir/$test_file $other_args +echo "::endgroup::" +echo "::group::Run test: cleanup $image" +sudo incus stop target +sudo incus delete target +echo "::endgroup::" +echo -e "\nAll Success!\n"