Skip to content

[202012][sonic_sfp]: prefer Config DB port index mapping over platform.json/port_config.ini#258

Merged
prgeor merged 5 commits intosonic-net:202012from
nazariig:202012-port-index-cfgdb-fix
Jan 18, 2022
Merged

[202012][sonic_sfp]: prefer Config DB port index mapping over platform.json/port_config.ini#258
prgeor merged 5 commits intosonic-net:202012from
nazariig:202012-port-index-cfgdb-fix

Conversation

@nazariig
Copy link
Collaborator

@nazariig nazariig commented Jan 14, 2022

Description

Approach:

  1. Always use Config DB to get port mapping when it's available
  2. When port mapping is missing in Config DB, use either platform.json or port_config.ini

On multiasic platforms the relevant Config DB instance will be used

Motivation and Context

  • Always read port mapping from Config DB when it's available
  • Fallback to platform.json or port_config.ini if needed

How Has This Been Tested?

  • manually tested

Additional Information (Optional)

  • N/A

…ort_config.ini

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 258 in repo Azure/sonic-platform-common

@prgeor
Copy link
Collaborator

prgeor commented Jan 17, 2022

@nazariig could you please check build error

@nazariig
Copy link
Collaborator Author

@prgeor seems to be an environmental issue:

Starting: Install Python dependencies
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.182.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /__w/_temp/2c4b8f31-9c15-4c84-a0e1-7c3ea9af57f3.sh
+ sudo pip2 install swsssdk-2.0.1-py2-none-any.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Requirement 'swsssdk-2.0.1-py2-none-any.whl' looks like a filename, but the file does not exist
Processing ./swsssdk-2.0.1-py2-none-any.whl
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/__w/1/target/python-wheels/swsssdk-2.0.1-py2-none-any.whl'

##[error]Bash exited with code '1'.
Finishing: Install Python dependencies

@prgeor
Copy link
Collaborator

prgeor commented Jan 17, 2022

@prgeor seems to be an environmental issue:

Starting: Install Python dependencies
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.182.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /__w/_temp/2c4b8f31-9c15-4c84-a0e1-7c3ea9af57f3.sh
+ sudo pip2 install swsssdk-2.0.1-py2-none-any.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Requirement 'swsssdk-2.0.1-py2-none-any.whl' looks like a filename, but the file does not exist
Processing ./swsssdk-2.0.1-py2-none-any.whl
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/__w/1/target/python-wheels/swsssdk-2.0.1-py2-none-any.whl'

##[error]Bash exited with code '1'.
Finishing: Install Python dependencies

Ack. python2 support has been removed in latest master, so i will have to update the pipeline to skip py2.

@nazariig
Copy link
Collaborator Author

@prgeor FYI. This fix is for Azure:202012 only

@prgeor
Copy link
Collaborator

prgeor commented Jan 17, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prgeor
Copy link
Collaborator

prgeor commented Jan 17, 2022

@samaity could you review this change?

@prgeor
Copy link
Collaborator

prgeor commented Jan 18, 2022

@nazariig looks like pipeline is failing because its downloading the artifacts from master branch. Can you fix https://github.com/Azure/sonic-platform-common/blob/master/azure-pipelines.yml#L30 as:

runBranch: 'refs/heads/202012'

@liat-grozovik
Copy link
Collaborator

/azp run Azure.sonic-platform-common

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig nazariig force-pushed the 202012-port-index-cfgdb-fix branch 2 times, most recently from 09e87ce to bc60f14 Compare January 18, 2022 10:08
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@nazariig nazariig force-pushed the 202012-port-index-cfgdb-fix branch from bc60f14 to 8ead647 Compare January 18, 2022 10:27
@prgeor prgeor merged commit 93eedd0 into sonic-net:202012 Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants