Skip to content

Commit

Permalink
Add golang tools to chef
Browse files Browse the repository at this point in the history
Summary:
TSIA. We kept on running into issues where people didn't have
mockgen or bindata installed or there were version mismatches between machines.

Test Plan: Ran it.

Reviewers: zasgar, philkuz, michelle

Reviewed By: zasgar, michelle

Subscribers: vjain

Differential Revision: https://phab.corp.pixielabs.ai/D8777

GitOrigin-RevId: ff0e418
  • Loading branch information
vihangm authored and copybaranaut committed May 28, 2021
1 parent 7b460cc commit f0fb2ba
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DOCKER_IMAGE_TAG=202105171514
DOCKER_IMAGE_TAG=202105271710
20 changes: 18 additions & 2 deletions tools/chef/cookbooks/pixielabs/recipes/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@
action :create
end

directory '/opt/pixielabs/gopath' do
owner user
group root_group
mode '0755'
action :create
end

execute 'install go binaries' do
ENV['GOPATH'] = "/opt/pixielabs/gopath"
command %(go get \
golang.org/x/lint/golint@v0.0.0-20210508222113-6edffad5e616 \
golang.org/x/tools/cmd/goimports@v0.1.2 \
github.com/golang/mock/mockgen@v1.5.0 \
github.com/cheekybits/genny@v1.0.0 \
sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 \
github.com/go-bindata/go-bindata/go-bindata@v3.1.2+incompatible)
end

template '/opt/pixielabs/plenv.inc' do
source 'plenv.inc.erb'
owner user
Expand Down Expand Up @@ -103,7 +121,6 @@
action :delete
end


remote_file '/opt/pixielabs/bin/prototool' do
source node['prototool']['download_path']
mode 0755
Expand Down Expand Up @@ -170,7 +187,6 @@
action :delete
end


directory '/opt/antlr' do
owner user
group root_group
Expand Down
8 changes: 0 additions & 8 deletions tools/chef/cookbooks/pixielabs/recipes/docker_extras.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,3 @@
mode '0755'
action :create
end

execute 'Install golint' do
command 'go get -u golang.org/x/lint/golint'
end

execute 'Install goimports' do
command 'go get -u golang.org/x/tools/cmd/goimports'
end
1 change: 1 addition & 0 deletions tools/chef/cookbooks/pixielabs/templates/plenv.inc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export PATH=/opt/node/bin:$PATH
export PATH=/opt/phab/arcanist/bin:$PATH
export PATH=${CLANG_PATH}/bin:$PATH
export PATH=/opt/golang/bin:$PATH
export PATH=/opt/pixielabs/gopath/bin:$PATH
export LD_LIBRARY_PATH=${CLANG_PATH}/lib:${LD_LIBRARY_PATH}

export CC=clang
Expand Down

0 comments on commit f0fb2ba

Please sign in to comment.