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

Install dotnet core to fix python gcov warning for code covery color bar showing #215

Merged
merged 35 commits into from
Jul 8, 2021

Conversation

pettershao-ragilenetworks
Copy link
Contributor

- What I did
fix python gcov warning "Please install dotnet core to enable automatic generation of Html report"
- How I did it
install dotnet core
- How to verify it

- Description for the changelog

@pettershao-ragilenetworks
Copy link
Contributor Author

pettershao-ragilenetworks commented May 7, 2021

@lguohan report is now coveried by red & green bar, help review, then i will try to fix all other python components. check pipeline: https://dev.azure.com/mssonic/build/_build/results?buildId=13993&view=codecoverage-tab

@pettershao-ragilenetworks pettershao-ragilenetworks changed the title install dotnet core to fix python gcov warning Install dotnet core to fix python gcov warning for code covery color bar showing May 7, 2021
#sudo apt-get install libhiredis0.14 libnl-3-200 libnl-route-3-200
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
displayName: "Unit tests"
Copy link
Collaborator

@xumia xumia May 10, 2021

Choose a reason for hiding this comment

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

It is better to create a new step to install the .net core, not in the "Unit tests" step.
Looks like we can remove the Line 66.

@pettershao-ragilenetworks
Copy link
Contributor Author

pettershao-ragilenetworks commented May 11, 2021

ok, done! @xumia help forward!

@pettershao-ragilenetworks
Copy link
Contributor Author

hi @xumia help forward!

sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
displayName: "Install publish Dependencies"
Copy link
Contributor

@qiluo-msft qiluo-msft Jun 10, 2021

Choose a reason for hiding this comment

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

publish

Is it a typo? Do you mean "Install .NET CORE" ? #Closed

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt --fix-broken install -y
Copy link
Contributor

@qiluo-msft qiluo-msft Jun 10, 2021

Choose a reason for hiding this comment

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

broken

What is broken and why? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also for directlly install dot sdk:
https://dev.azure.com/mssonic/build/_build/results?buildId=19148&view=logs&j=83516c17-6666-5250-abde-63983ce72a49&t=c10d5f44-55ce-55d7-7975-407ed75d9a96

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 dotnet-sdk-5.0 : Depends: dotnet-runtime-5.0 (>= 5.0.7) but it is not going to be installed
                  Depends: netstandard-targeting-pack-2.1 (>= 2.1.0) but it is not going to be installed
                  Depends: aspnetcore-runtime-5.0 (>= 5.0.7) but it is not going to be installed
                  Depends: dotnet-targeting-pack-5.0 (>= 5.0.0) but it is not going to be installed
                  Depends: aspnetcore-targeting-pack-5.0 (>= 5.0.0) but it is not going to be installed
                  Depends: dotnet-apphost-pack-5.0 (>= 5.0.7) but it is not going to be installed
 libhiredis-dev : Depends: libhiredis0.14 (= 0.14.0-3) but 0.14.0-3~bpo9+1 is to be installed
 libnl-3-dev : Depends: libnl-3-200 (= 3.4.0-1) but 3.5.0-1 is to be installed
 libnl-route-3-dev : Depends: libnl-route-3-200 (= 3.4.0-1) but 3.5.0-1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Copy link
Collaborator

Choose a reason for hiding this comment

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

It should be caused by wrong package packages-microsoft-prod installed, the script is run inside the container, so we need to install the package for debian buster, not ubuntu 20.04.
Please follow https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian, and try again, thanks.

sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt --fix-broken install -y
sudo apt-get install -y apt-transport-https
Copy link
Contributor

@qiluo-msft qiluo-msft Jun 10, 2021

Choose a reason for hiding this comment

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

apt-transport-https

Why you need this? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, seems no use, removed!

sudo apt-get update
sudo apt --fix-broken install -y
sudo apt-get install -y apt-transport-https
sudo apt-get update
Copy link
Contributor

@qiluo-msft qiluo-msft Jun 10, 2021

Choose a reason for hiding this comment

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

update

Why update twice? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, fixed!

@pettershao-ragilenetworks
Copy link
Contributor Author

@qiluo-msft hi, help forward this, thanks!

qiluo-msft
qiluo-msft previously approved these changes Jun 15, 2021
Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

LGTM. Please also check with other reviewers.

curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
sudo apt-get update
sudo apt-get -y install -f
Copy link
Contributor

@qiluo-msft qiluo-msft Jun 29, 2021

Choose a reason for hiding this comment

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

sudo apt-get -y install -f

Is this line really needed? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From test result, 'sudo apt-get -y install -f' can and only can be set at this place.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried these commands and removed sudo apt-get -y install -f. Seems working. Could you check again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I compared the log with previous one, and the previous one seems suspicious

2021-06-29T03:04:13.8494132Z The following additional packages will be installed:
2021-06-29T03:04:13.8499448Z   libhiredis0.14
2021-06-29T03:04:13.8986264Z The following packages will be REMOVED:
2021-06-29T03:04:13.8993644Z   libibverbs-dev libnl-3-dev libnl-route-3-dev libopenmpi-dev
2021-06-29T03:04:13.9005991Z The following packages will be upgraded:
2021-06-29T03:04:13.9011224Z   libhiredis0.14
2021-06-29T03:04:13.9242794Z 1 upgraded, 0 newly installed, 4 to remove and 2 not upgraded.

The new apt source messed up the local package database. So it replaced our local built libhiredis0.14. I have not experiment, but propose several options:

  1. Do not add apt source. Download the required deb packages and sudo dpkg -i them.
  2. Or, add the apt source at the very beginning, before installing any other deb packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiluo-msft
Copy link
Contributor

qiluo-msft commented Jul 6, 2021

The root issue is wrong packages are installed in slave docker. Please check the patch

From 71094dd101a8a4fb47f82b6d7fc175c9cbfb2791 Mon Sep 17 00:00:00 2001
From: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Tue, 6 Jul 2021 06:19:40 +0000
Subject: [PATCH] Remove vanilla packages before installing local build ones

---
 azure-pipelines.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index f9cc32c..f73a8e0 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -44,6 +44,7 @@ stages:
 
     - script: |
         set -ex
+        sudo apt-get -y purge libhiredis-dev libnl-3-dev libnl-route-3-dev
         sudo dpkg -i ../target/debs/buster/{libswsscommon_1.0.0_amd64.deb,python3-swsscommon_1.0.0_amd64.deb,libnl-3-200_*.deb,libnl-genl-3-200_*.deb,libnl-nf-3-200_*.deb,libnl-route-3-200_*.deb,libhiredis0.14_*.deb}
         sudo python3 -m pip install ../target/python-wheels/swsssdk*-py3-*.whl
         sudo python3 -m pip install ../target/python-wheels/sonic_py_common-1.0-py3-none-any.whl
@@ -61,10 +62,9 @@ stages:
     - script: |
         set -ex
         # Install .NET CORE
-        wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
-        sudo dpkg -i packages-microsoft-prod.deb
+        curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
+        sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
         sudo apt-get update
-        sudo apt-get -y install -f
         sudo apt-get install -y dotnet-sdk-5.0
       displayName: "Install .NET CORE"

In reply to: 874551271

@pettershao-ragilenetworks
Copy link
Contributor Author

@qiluo-msft right, seems fine now. help foward this!

@qiluo-msft qiluo-msft merged commit 7a78703 into sonic-net:master Jul 8, 2021
lguohan pushed a commit to sonic-net/sonic-platform-common that referenced this pull request Jul 19, 2021
fix python gcov warning "Please install dotnet core to enable automatic generation of Html report"
more info check: sonic-net/sonic-snmpagent#215

Signed-off-by: pettershao-ragilenetworks <pettershao@ragilenetworks.com>
judyjoseph pushed a commit to sonic-net/sonic-platform-common that referenced this pull request Aug 20, 2021
fix python gcov warning "Please install dotnet core to enable automatic generation of Html report"
more info check: sonic-net/sonic-snmpagent#215

Signed-off-by: pettershao-ragilenetworks <pettershao@ragilenetworks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants