Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GoogleCloudPlatform/google-fluentd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.8
Choose a base ref
...
head repository: GoogleCloudPlatform/google-fluentd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 2,851 additions and 375 deletions.
  1. +12 −0 .github/workflows/auto-approve.yml
  2. +0 −1 .gitignore
  3. +0 −3 .travis.yml
  4. +4 −7 Berksfile
  5. +0 −28 Berksfile.lock
  6. +13 −6 Gemfile
  7. +15 −12 README.md
  8. +7 −5 Vagrantfile
  9. +4 −2 bats/compat_redhat.bats
  10. +4 −0 bats/configtest_redhat.bats
  11. +6 −0 bats/override_redhat.bats
  12. +8 −0 bats/reload_redhat.bats
  13. +16 −40 bats/restart_debian.bats
  14. +15 −13 bats/restart_redhat.bats
  15. +4 −0 bats/start_redhat.bats
  16. +4 −0 bats/status_redhat.bats
  17. +32 −17 bats/stop_debian.bats
  18. +10 −10 bats/stop_redhat.bats
  19. +3 −0 bats/test_helper.bash
  20. +21 −4 bin/gem_downloader
  21. +24 −0 bin/gem_installer
  22. +3 −3 bin/pkg_build
  23. +8 −0 build/README.md
  24. +30 −0 build/x86_64_amzn-2016.09/Dockerfile
  25. +52 −0 build/x86_64_centos6/Dockerfile
  26. +33 −0 build/x86_64_centos7/Dockerfile
  27. +40 −0 build/x86_64_centos8/Dockerfile
  28. +31 −0 build/x86_64_debian/Dockerfile
  29. +37 −0 build/x86_64_sles12/Dockerfile
  30. +33 −0 build/x86_64_sles15/Dockerfile
  31. +13 −0 config/patches/ruby/ruby-2.1-openssl-mode-patch.patch
  32. +12 −0 config/patches/ruby/ruby-2.6.7_c99.patch
  33. +32 −5 config/projects/google-fluentd.rb
  34. +25 −0 config/projects/rpm/google-fluentd-start-service.spec
  35. +2 −2 config/software/bundler.rb
  36. +5 −3 config/software/fluentd-ui.rb
  37. +10 −3 config/software/fluentd.rb
  38. +26 −4 config/software/jemalloc.rb
  39. +184 −0 config/software/openssl.rb
  40. +64 −10 config/software/postgresql.rb
  41. +224 −58 config/software/ruby.rb
  42. +1 −1 config/software/td-agent-cleanup.rb
  43. +3 −2 config/software/td-agent-files.rb
  44. +2 −2 config/software/td-agent-ui.rb
  45. +2 −1 config/software/td-agent.rb
  46. +2 −2 config/software/td.rb
  47. +27 −0 config/software/xz.rb
  48. +11 −10 core_gems.rb
  49. +93 −0 docker/Dockerfile
  50. +30 −0 docker/entrypoint.sh
  51. +9 −1 lib/gems_parser.rb
  52. +40 −19 plugin_gems.rb
  53. +3 −0 resources/google-fluentd/rpm/spec.erb
  54. +42 −31 templates/etc/init.d/deb/td-agent
  55. +59 −32 templates/etc/init.d/rpm/td-agent
  56. +51 −8 templates/etc/td-agent/td-agent.conf
  57. +51 −8 templates/etc/td-agent/td-agent.conf.tmpl
  58. +2 −0 templates/package-scripts/td-agent/deb/postinst
  59. +7 −0 templates/package-scripts/td-agent/rpm/post
  60. +4 −0 templates/package-scripts/td-agent/rpm/posttrans
  61. +25 −22 ui_gems.rb
  62. +1 −0 windows-installer/VERSION
  63. +10 −0 windows-installer/eventlog_rb_replacement.txt
  64. +72 −0 windows-installer/fluent-template.conf
  65. +256 −0 windows-installer/generate_sdl_agent_exe.ps1
  66. +350 −0 windows-installer/setup.nsi
  67. BIN windows-installer/stackdriver_header.bmp
  68. +96 −0 windows-installer/stackdriver_language_util.nsh
  69. +176 −0 windows-installer/stackdriver_license.txt
  70. BIN windows-installer/stackdriver_logo.ico
  71. +121 −0 windows-installer/stackdriver_ui.nsh
  72. +239 −0 windows-installer/stackdriver_util.nsh
  73. BIN windows-installer/stackdriver_welcome.bmp
12 changes: 12 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Automatically approve PRs created by our release robot account.
name: Auto approve
on: pull_request

jobs:
auto-approve:
runs-on: ubuntu-latest
steps:
- uses: hmarr/auto-approve-action@v2.0.0
if: github.actor == 'stackdriver-instrumentation-release'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ bin/*
files/**/cache/
resources/**/cache/
vendor/cookbooks
Gemfile.lock

# td-agent specific package
core_gems/*
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

11 changes: 4 additions & 7 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
source 'https://api.berkshelf.com'
source 'https://supermarket.chef.io'

# The apt cookbook is required to bring the apt cache up-to-date on Ubuntu
# systems, since the cache can become stale on older boxes.
cookbook 'apt', '~> 2.3'
cookbook 'yum-epel', '~> 0.3'
cookbook 'apt', '~> 2.8'
cookbook 'yum-epel', '~> 0.6'

cookbook 'omnibus', '2.6.8'

# Uncomment to use the latest version of the Omnibus cookbook from GitHub
# cookbook 'omnibus', github: 'opscode-cookbooks/omnibus'
cookbook 'omnibus', github: 'chef-boneyard/omnibus'
28 changes: 0 additions & 28 deletions Berksfile.lock

This file was deleted.

19 changes: 13 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -4,15 +4,22 @@ source 'https://rubygems.org'
gem 'berkshelf', '~> 3.0'

# Install omnibus software
#gem 'omnibus', '~> 5.0'
gem 'omnibus', :github => 'chef/omnibus' # for latest omnibus-software
gem 'omnibus-software', :github => 'opscode/omnibus-software' #, :branch => 'omnibus/3.2-stable'
gem 'omnibus', :github => 'chef/omnibus'
gem 'omnibus-software', :github => 'chef/omnibus-software'

gem 'kubeclient', '4.10.1'

gem 'ohai', '>17.7'
gem 'chef-cleanroom', '1.0.5'

# Use open_uri_redirections to allow HTTPS -> HTTP redirections in omnibus
gem 'open_uri_redirections', '0.2.1'

# Use Test Kitchen with Vagrant for convering the build environment
gem 'test-kitchen', '~> 1.2'
gem 'kitchen-vagrant', '~> 0.14'
gem 'test-kitchen', '~> 2.4'
gem 'kitchen-vagrant', '~> 1.6'

group :test do
gem 'rake', '~> 10.1.0'
gem 'rake', '~> 13.0.6'
gem 'serverspec', '~> 2.18.0'
end
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ td-agent package is based on [Omnibus-ruby](https://github.com/opscode/omnibus-r

## Installation

We'll assume you have Ruby 1.9+ and Bundler installed. First ensure all required gems are installed and ready to use:
We'll assume you have Ruby 2.7 and Bundler installed. First ensure all required gems are installed and ready to use:

```shell
$ bundle install --binstubs
@@ -25,6 +25,7 @@ At first, you should download dependent gems using downloder. This is for avodin
```shell
$ bin/gem_downloader core_gems.rb
$ bin/gem_downloader plugin_gems.rb
$ bin/gem_downloader ui_gems.rb
```

Create required directory and add permission
@@ -46,6 +47,11 @@ where the `build project` command is invoked. So running this command on say a
MacBook Pro will generate a Mac OS X specific package. After the build
completes packages will be available in `pkg/`.

#### Build on CentOS 5

td-agent build doesn't work on CentOS 5 by OpenSSL related issues.
Follow this setup instruction before use omnibus: https://gist.github.com/repeatedly/97d4746e83a5ec135abf3eb77f46ff30

### Clean

You can clean up all temporary files generated during the build process with
@@ -100,19 +106,16 @@ NOTE: edit `project_name` in Vagrantfile if required.
td-agent omnibus ships will a project-specific [Berksfile](http://berkshelf.com/) and [Vagrantfile](http://www.vagrantup.com/)
that will allow you to build your projects on the following platforms:

* CentOS 5 64-bit
* CentOS 5 32-bit
* CentOS 6 64-bit
* CentOS 6 32-bit
* CentOS 7 64-bit
* Ubuntu 10.04 64-bit
* Ubuntu 10.04 32-bit
* Ubuntu 12.04 64-bit
* Ubuntu 12.04 32-bit
* Ubuntu 14.04 64-bit
* Debian 7.9 64-bit
* Debian 8.2 64-bit
* Amazon Linux 2015.09 64-bit
* Ubuntu 16.04 64-bit
* Debian 7.10 64-bit
* Debian 8.4 64-bit
* Amazon Linux 2016.03 64-bit

Please note this build-lab is only meant to get you up and running quickly;
there's nothing inherent in Omnibus that restricts you to just building CentOS
@@ -123,7 +126,7 @@ The only requirements for standing up this virtualized build lab are:
* VirtualBox - native packages exist for most platforms and can be downloaded
from the [VirtualBox downloads page](https://www.virtualbox.org/wiki/Downloads).
* Vagrant 1.2.1+ - native packages exist for most platforms and can be downloaded
from the [Vagrant downloads page](http://downloads.vagrantup.com/).
from the [Vagrant downloads page](https://www.vagrantup.com/downloads.html).

The [vagrant-berkshelf](https://github.com/RiotGames/vagrant-berkshelf) and
[vagrant-omnibus](https://github.com/schisamo/vagrant-omnibus) Vagrant plugins
@@ -178,7 +181,7 @@ After that, each package is stored in `td_agent2_pkg` directory.

```sh
% ls td_agent2_pkg/
centos-5.10/ centos-6.5/ ubuntu-10.04/ ubuntu-12.04/
centos-6.7/ centos-7.2/ debian-7.10/ debian-8.4/ ubuntu-12.04/ ubuntu-14.04/ ubuntu-16.04/
```

### Tested environment
@@ -195,7 +198,7 @@ All rights reserved.
5.0.4r102546

% ruby --version
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
```

### NOTE
@@ -215,7 +218,7 @@ changing the list found in the `.kitchen.yml` `platforms` YAML stanza.

This build environment is designed to get you up-and-running quickly. However,
there is nothing that restricts you to building on other platforms. Simply use
the [omnibus cookbook](https://github.com/opscode-cookbooks/omnibus) to setup
the [omnibus cookbook](https://github.com/chef-boneyard/omnibus) to setup
your desired platform and execute the build steps listed above.

The default build environment requires Test Kitchen and VirtualBox for local
12 changes: 7 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ end
host_project_path = File.expand_path('..', __FILE__)
project_name = 'td-agent'
host_name = "#{project_name}-omnibus-build-lab"
bootstrap_chef_version = '11.16.4'
bootstrap_chef_version = '12.10.24'

Vagrant.configure('2') do |config|
#config.vm.hostname = "#{project_name}-omnibus-build-lab"
@@ -24,9 +24,9 @@ Vagrant.configure('2') do |config|
ubuntu-12.04-i386
ubuntu-14.04
ubuntu-14.04-i386
debian-6.0.10
debian-7.9
debian-8.2
ubuntu-16.04
debian-7.10
debian-8.4
centos-5.11
centos-5.11-i386
centos-6.7
@@ -117,6 +117,7 @@ Vagrant.configure('2') do |config|

c.vm.provision :shell, :privileged => false, :inline => <<-OMNIBUS_BUILD
#{export_gcc}
export PATH="/opt/omnibus-toolchain/embedded/bin/:$PATH"
sudo mkdir -p /opt/#{project_name}
sudo chown #{project_build_user} /opt/#{project_name}
cd #{guest_project_path}
@@ -145,7 +146,7 @@ Vagrant.configure('2') do |config|
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
aws.keypair_name = "td-agent-build"

aws.ami = "ami-60b6c60a"
aws.ami = "ami-08111162"
aws.instance_type = 'm3.large'
aws.tags = {'Name' => 'td-agent-build'}
aws.security_groups = ['td-agent-build']
@@ -182,6 +183,7 @@ Vagrant.configure('2') do |config|
REMOVE_OMNIBUS

config.vm.provision :shell, :privileged => false, :inline => <<-OMNIBUS_BUILD
export PATH="/opt/omnibus-toolchain/embedded/bin/:$PATH"
sudo mkdir -p /opt/#{project_name}
sudo chown #{project_build_user} /opt/#{project_name}
cd #{guest_project_path}
6 changes: 4 additions & 2 deletions bats/compat_redhat.bats
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ prog="custom_prog"
EOS

stub daemon "echo; for arg; do echo \" \$arg\"; done"
stub log_success_msg "custom_name : true"

run_service start
assert_output <<EOS
@@ -48,6 +49,7 @@ EOS
[ -f "${TMP}/var/lock/subsys/custom_prog" ]

unstub daemon
unstub log_success_msg
}

@test "stop td-agent with backward-compatible configuration (redhat)" {
@@ -58,7 +60,7 @@ prog="custom_prog"
EOS

stub killproc "custom_prog : true"
stub success "true"
stub log_success_msg "td-agent : true"

run_service stop
assert_output <<EOS
@@ -69,5 +71,5 @@ EOS
[ ! -f "${TMP}/var/lock/subsys/custom_prog" ]

unstub killproc
unstub success
unstub log_success_msg
}
4 changes: 4 additions & 0 deletions bats/configtest_redhat.bats
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ teardown() {

@test "configuration test success (redhat)" {
stub_path /usr/sbin/td-agent "echo td-agent; for arg; do echo \" \$arg\"; done"
stub log_success_msg "td-agent : true"

run_service configtest
assert_output <<EOS
@@ -33,13 +34,16 @@ EOS
assert_success

unstub_path /usr/sbin/td-agent
unstub log_success_msg
}

@test "configuration test failure (redhat)" {
stub_path /usr/sbin/td-agent "false"
stub log_failure_msg "td-agent : true"

run_service configtest
assert_failure

unstub_path /usr/sbin/td-agent
unstub log_failure_msg
}
6 changes: 6 additions & 0 deletions bats/override_redhat.bats
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ custom_run() {
stub getent "group : echo nogroup:x:100:"
rm -f "${TMP}/path/to/td-agent.pid"
stub daemon "echo; for arg; do echo \" \$arg\"; done"
stub log_success_msg "td-agent : true"
custom_run <<EOS
DAEMON_ARGS="--user nobody -10"
PIDFILE="${TMP}/path/to/td-agent.pid"
@@ -51,6 +52,7 @@ EOS
[ -f "${TMP}/var/lock/subsys/td-agent" ]
unstub getent
unstub chown
unstub log_success_msg
}

@test "start td-agent with --user=... and --group=... in configuration variables successfully (redhat)" {
@@ -60,6 +62,7 @@ EOS
stub getent "group : echo nogroup:x:100:"
rm -f "${TMP}/path/to/td-agent.pid"
stub daemon "echo; for arg; do echo \" \$arg\"; done"
stub log_success_msg "td-agent : true"
custom_run <<EOS
DAEMON_ARGS="--user=nobody"
PIDFILE="${TMP}/path/to/td-agent.pid"
@@ -87,6 +90,7 @@ EOS
[ -f "${TMP}/var/lock/subsys/td-agent" ]
unstub getent
unstub chown
unstub log_success_msg
}

@test "start td-agent with custom configurations successfully (redhat)" {
@@ -99,6 +103,7 @@ EOS
chmod +x "${TMP}/path/to/custom_td_agent_ruby"
rm -f "${TMP}/path/to/td-agent.pid"
stub daemon "echo; for arg; do echo \" \$arg\"; done"
stub log_success_msg "custom_td_agent_name : true"
custom_run <<EOS
TD_AGENT_NAME="custom_td_agent_name"
TD_AGENT_HOME="${TMP}/path/to/custom_td_agent_home"
@@ -131,4 +136,5 @@ EOS
[ -f "${TMP}/path/to/custom_td_agent_lock_file" ]
unstub getent
unstub chown
unstub log_success_msg
}
8 changes: 8 additions & 0 deletions bats/reload_redhat.bats
Original file line number Diff line number Diff line change
@@ -16,41 +16,49 @@ teardown() {
echo 1234 > "${TMP}/var/run/td-agent/td-agent.pid"
stub_path /usr/sbin/td-agent "true"
stub kill "-HUP 1234 : true"
stub log_success_msg "td-agent : true"

run_service reload
assert_success

unstub_path /usr/sbin/td-agent
unstub kill
unstub log_success_msg
}

@test "failed to reload td-agent (redhat)" {
echo 1234 > "${TMP}/var/run/td-agent/td-agent.pid"
stub_path /usr/sbin/td-agent "true"
stub kill "-HUP 1234 : false"
stub log_failure_msg "td-agent : true"

run_service reload
assert_failure

unstub_path /usr/sbin/td-agent
unstub kill
unstub log_failure_msg
}

@test "failed to reload td-agent by missing pid file (redhat)" {
rm -f "${TMP}/var/run/td-agent/td-agent.pid"
stub_path /usr/sbin/td-agent "true"
stub log_failure_msg "td-agent : true"

run_service reload
assert_failure

unstub_path /usr/sbin/td-agent
unstub log_failure_msg
}

@test "failed to reload td-agent by configuration test failure (redhat)" {
stub_path /usr/sbin/td-agent "false"
stub log_failure_msg "td-agent : true"

run_service reload
assert_failure

unstub_path /usr/sbin/td-agent
unstub log_failure_msg
}
Loading