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

[sonic-telemetry]: Install vendor package management for golang #1977

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions sonic-slave/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ RUN export VERSION=1.8.3 \
&& echo 'export GOROOT=/usr/local/go' >> /etc/bash.bashrc \
&& echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc

# For go telemetry build
RUN wget http://ftp.us.debian.org/debian/pool/main/g/golang-glide/golang-glide_0.12.3-2+b3_amd64.deb \
&& dpkg -i golang-glide_0.12.3-2+b3_amd64.deb
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we just use apt-get to installer?

Copy link
Author

Choose a reason for hiding this comment

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

It's failed to use apt-get to install it. Because the glide apt-repository has no appropriate package for debian jessie/stretch.

$ sudo add-apt-repository ppa:masterminds/glide && sudo apt-get update
You are about to add the following PPA to your system:
 Glide dist
See https://glide.sh
 More info: https://launchpad.net/~masterminds/+archive/ubuntu/glide
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmplu9zsuem/secring.gpg' created
gpg: keyring `/tmp/tmplu9zsuem/pubring.gpg' created
gpg: requesting key 890C81B2 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmplu9zsuem/trustdb.gpg: trustdb created
gpg: key 890C81B2: public key "Launchpad PPA for Masterminds" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

......

Err http://ppa.launchpad.net jessie/main amd64 Packages                                                                                    
  404  Not Found
Get:23 http://debian-archive.trafficmanager.net jessie/contrib amd64 Packages [59.2 kB]                                                    
Get:24 http://debian-archive.trafficmanager.net jessie/non-free amd64 Packages [101 kB]    
Fetched 31.0 MB in 4s (6421 kB/s)                                                         
W: Size of file /var/lib/apt/lists/debian-archive.trafficmanager.net_debian-security_dists_jessie_updates_main_binary-amd64_Packages.gz is not what the server reported 645826 645898
W: Size of file /var/lib/apt/lists/security.debian.org_dists_jessie_updates_main_binary-amd64_Packages.gz is not what the server reported 645826 645898
W: Failed to fetch http://ppa.launchpad.net/masterminds/glide/ubuntu/dists/jessie/main/binary-amd64/Packages  404  Not Found
$
$ sudo apt-get install glide
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package glide

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

why use ppa?

Copy link
Author

Choose a reason for hiding this comment

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

The docker-salve version is debian jessie in our environment, so it's failed to use 'apt-get' to get golang-glide directly. So I tried the recommend method ( use ppa ) in the Glide github.

https://github.com/Masterminds/glide
image

If debian stretch has golang-glide package, we can use 'apt-get'. But for jessie, I think we need to use this way.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

then please back port golang-glide to jessie, or upgrade the telemetry docker to stretch.

Copy link
Collaborator

Choose a reason for hiding this comment

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

directly pull the golang-glide from stretch distribution in jessie docker is not a standard way.

maybe we should just do 'curl https://glide.sh/get | sh' as suggested by the glide website.


# Upgrade pip2
# Note: use pip2 specific version so jinja2 2.10 will install
RUN python2 -m pip install -U pip==9.0.3
Expand Down
1 change: 1 addition & 0 deletions src/telemetry/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ INSTALL := /usr/bin/install
all: sonic-telemetry

sonic-telemetry:
cd ${GOPATH}/src/github.com/Azure/sonic-telemetry && glide install
/usr/local/go/bin/go get -v github.com/Azure/sonic-telemetry/telemetry
/usr/local/go/bin/go get -v github.com/Azure/sonic-telemetry/dialout/dialout_client_cli

Expand Down