From 8cd055f79c9aceebd2d05b0c8c9fee39d08e0ffe Mon Sep 17 00:00:00 2001 From: Arthur Bellal Date: Mon, 30 Jul 2018 15:27:28 +0200 Subject: [PATCH 1/8] ship prebuilt go-metro --- config/software/datadog-metro.rb | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/config/software/datadog-metro.rb b/config/software/datadog-metro.rb index 94467b499..91af93e0e 100644 --- a/config/software/datadog-metro.rb +++ b/config/software/datadog-metro.rb @@ -10,6 +10,11 @@ dependency "libpcap" +if ohai["platform_family"] == "rhel" + source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6", + :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f", +end + #TODO: complete OSX support. if ohai["platform_family"] == "mac_os_x" env.delete "GOROOT" @@ -21,16 +26,21 @@ build do ship_license "https://raw.githubusercontent.com/DataDog/go-metro/master/LICENSE" ship_license "https://raw.githubusercontent.com/DataDog/go-metro/master/THIRD_PARTY_LICENSES.md" - command "mkdir -p /var/cache/omnibus/src/datadog-metro/src/github.com/DataDog", :env => env - command "#{gobin} get -v -d github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - command "git checkout #{default_version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro/src/github.com/DataDog/go-metro" - command "#{gobin} get -v -d github.com/cihub/seelog", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - command "#{gobin} get -v -d github.com/google/gopacket", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - command "#{gobin} get -v -d github.com/DataDog/datadog-go/statsd", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - command "#{gobin} get -v -d gopkg.in/tomb.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - command "#{gobin} get -v -d gopkg.in/yaml.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - patch :source => "libpcap-static-link.patch", :plevel => 1, - :acceptable_output => "Reversed (or previously applied) patch detected", - :target => "/var/cache/omnibus/src/datadog-metro/src/github.com/google/gopacket/pcap/pcap.go" - command "#{gobin} build -o #{install_dir}/bin/go-metro github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + + if ohai["platform_family"] == "rhel" + command "mv gometro-centos6 #{install_dir}/bin/go-metro" + else + command "mkdir -p /var/cache/omnibus/src/datadog-metro/src/github.com/DataDog", :env => env + command "#{gobin} get -v -d github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + command "git checkout #{default_version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro/src/github.com/DataDog/go-metro" + command "#{gobin} get -v -d github.com/cihub/seelog", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + command "#{gobin} get -v -d github.com/google/gopacket", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + command "#{gobin} get -v -d github.com/DataDog/datadog-go/statsd", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + command "#{gobin} get -v -d gopkg.in/tomb.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + command "#{gobin} get -v -d gopkg.in/yaml.v2", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + patch :source => "libpcap-static-link.patch", :plevel => 1, + :acceptable_output => "Reversed (or previously applied) patch detected", + :target => "/var/cache/omnibus/src/datadog-metro/src/github.com/google/gopacket/pcap/pcap.go" + command "#{gobin} build -o #{install_dir}/bin/go-metro github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" + end end From 4315b1f97163faa0e4066b503b61fce93c51518b Mon Sep 17 00:00:00 2001 From: Arthur Bellal Date: Mon, 30 Jul 2018 15:59:58 +0200 Subject: [PATCH 2/8] fix --- config/software/datadog-metro.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/datadog-metro.rb b/config/software/datadog-metro.rb index 91af93e0e..815994349 100644 --- a/config/software/datadog-metro.rb +++ b/config/software/datadog-metro.rb @@ -12,7 +12,7 @@ if ohai["platform_family"] == "rhel" source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6", - :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f", + :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f" end #TODO: complete OSX support. From bb24201e87447ba7c3ab283efb3b4de74041c0a6 Mon Sep 17 00:00:00 2001 From: Arthur Bellal Date: Mon, 30 Jul 2018 17:57:28 +0200 Subject: [PATCH 3/8] use custom gohai --- config/software/datadog-gohai.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/datadog-gohai.rb b/config/software/datadog-gohai.rb index 270c58a2f..c8006d6a2 100644 --- a/config/software/datadog-gohai.rb +++ b/config/software/datadog-gohai.rb @@ -1,5 +1,5 @@ name "datadog-gohai" -default_version "last-stable" +default_version "arbll/go1.10" always_build true From ecffa2d5fc6c4640aafa26bc579d882051ab559d Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 20 Aug 2018 14:15:38 +0200 Subject: [PATCH 4/8] version --- config/software/datadog-metro.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/datadog-metro.rb b/config/software/datadog-metro.rb index 815994349..7dfa405b5 100644 --- a/config/software/datadog-metro.rb +++ b/config/software/datadog-metro.rb @@ -11,7 +11,7 @@ dependency "libpcap" if ohai["platform_family"] == "rhel" - source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6", + source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-1.0.0", :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f" end From 6679bd8d769a87fb08e65b98eccb996b0e6818ff Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 20 Aug 2018 15:52:34 +0200 Subject: [PATCH 5/8] Update datadog-gohai.rb --- config/software/datadog-gohai.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/datadog-gohai.rb b/config/software/datadog-gohai.rb index c8006d6a2..270c58a2f 100644 --- a/config/software/datadog-gohai.rb +++ b/config/software/datadog-gohai.rb @@ -1,5 +1,5 @@ name "datadog-gohai" -default_version "arbll/go1.10" +default_version "last-stable" always_build true From 3afcbc5be80f132a1035dcca2b2f00e55d76a588 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 20 Aug 2018 16:58:54 +0200 Subject: [PATCH 6/8] feedback on version --- config/software/datadog-metro.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/software/datadog-metro.rb b/config/software/datadog-metro.rb index 7dfa405b5..9bec4c341 100644 --- a/config/software/datadog-metro.rb +++ b/config/software/datadog-metro.rb @@ -1,5 +1,5 @@ name "datadog-metro" -default_version "last-stable" +default_version "1.0.0" always_build true @@ -10,9 +10,12 @@ dependency "libpcap" +version "1.0.0" do + source :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f" +end + if ohai["platform_family"] == "rhel" - source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-1.0.0", - :sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f" + source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-#{version}", end #TODO: complete OSX support. From 56c798a24c4f390d861ea51c95f8ba66cb15008d Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 20 Aug 2018 16:59:57 +0200 Subject: [PATCH 7/8] checkout default_version => version --- config/software/datadog-metro.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/datadog-metro.rb b/config/software/datadog-metro.rb index 9bec4c341..5f6776370 100644 --- a/config/software/datadog-metro.rb +++ b/config/software/datadog-metro.rb @@ -35,7 +35,7 @@ else command "mkdir -p /var/cache/omnibus/src/datadog-metro/src/github.com/DataDog", :env => env command "#{gobin} get -v -d github.com/DataDog/go-metro", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" - command "git checkout #{default_version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro/src/github.com/DataDog/go-metro" + command "git checkout #{version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro/src/github.com/DataDog/go-metro" command "#{gobin} get -v -d github.com/cihub/seelog", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" command "#{gobin} get -v -d github.com/google/gopacket", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" command "#{gobin} get -v -d github.com/DataDog/datadog-go/statsd", :env => env, :cwd => "/var/cache/omnibus/src/datadog-metro" From 4fa8d2ce2d87005561d5727ef33b008dc55d98c3 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 20 Aug 2018 17:06:40 +0200 Subject: [PATCH 8/8] missed a comma --- config/software/datadog-metro.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/software/datadog-metro.rb b/config/software/datadog-metro.rb index 5f6776370..2be5623c1 100644 --- a/config/software/datadog-metro.rb +++ b/config/software/datadog-metro.rb @@ -15,7 +15,7 @@ end if ohai["platform_family"] == "rhel" - source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-#{version}", + source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-#{version}" end #TODO: complete OSX support.