sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

[sonic-mgmt] Call docker cmd on appropriate container in generate_telemetry_config() funct

Open veronica-arista opened this issue 1 year ago • 12 comments

Description of PR

generate_telemetry_config() function already establishes that the GNMI container is 'telemetry' so call docker supervisorctl status using this container name.

Summary: Fixes # https://github.com/aristanetworks/sonic-qual.msft/issues/61

Type of change

  • [x] Bug fix
  • [ ] Testbed and Framework(new/improvement)
  • [ ] Test case(new/improvement)

Back port request

  • [ ] 201911
  • [ ] 202012
  • [ ] 202205
  • [x] 202305
  • [x] 202311

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Ran gnmi tests with this change in our test environment.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

veronica-arista avatar Feb 01 '24 23:02 veronica-arista

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/helpers/gnmi_utils.py:55:121: E501 line too long (123 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Feb 01 '24 23:02 mssonicbld

@ganglyu could you help to review ?

StormLiangMS avatar Feb 23 '24 05:02 StormLiangMS

/azp run

judyjoseph avatar Mar 19 '24 22:03 judyjoseph

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 19 '24 22:03 azure-pipelines[bot]

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/helpers/gnmi_utils.py:55:121: E501 line too long (123 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Mar 19 '24 22:03 mssonicbld

@veronica-arista one of the pre-commit checks is failing, please fix

Pre-commit check results: trim trailing whitespace.................................................Passed fix end of files.........................................................Passed check yaml...........................................(no files to check)Skipped check for added large files..............................................Passed check python ast.........................................................Passed flake8...................................................................Failed

  • hook id: flake8
  • exit code: 1

tests/common/helpers/gnmi_utils.py:55:121: E501 line too long (123 > 120 characters)

judyjoseph avatar Mar 20 '24 06:03 judyjoseph

/azp run Azure.sonic-mgmt

StormLiangMS avatar Mar 22 '24 04:03 StormLiangMS

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 22 '24 04:03 azure-pipelines[bot]

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/helpers/gnmi_utils.py:55:121: E501 line too long (123 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Mar 22 '24 04:03 mssonicbld

@veronica-arista @kenneth-arista please reaolve the flake errors and conflicts before merge - thanks

judyjoseph avatar Apr 10 '24 18:04 judyjoseph

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/helpers/gnmi_utils.py:55:121: E501 line too long (123 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Apr 10 '24 23:04 mssonicbld

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/helpers/gnmi_utils.py:56:23: E128 continuation line under-indented for visual indent

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Apr 10 '24 23:04 mssonicbld

hi @veronica-arista could you run test with 202305 and 202311 branch?

StormLiangMS avatar Apr 21 '24 14:04 StormLiangMS

Hi @StormLiangMS we are running the gnmi tests with this change in our test environment and they are passing for 202305 and 202311

veronica-arista avatar Apr 26 '24 19:04 veronica-arista

Cherry-pick PR to 202305: https://github.com/sonic-net/sonic-mgmt/pull/12867

mssonicbld avatar May 16 '24 04:05 mssonicbld

@veronica-arista PR conflicts with 202311 branch

mssonicbld avatar May 16 '24 04:05 mssonicbld

I created a 202311 version of the PR to resolve the conflict: https://github.com/sonic-net/sonic-mgmt/pull/12873

veronica-arista avatar May 16 '24 17:05 veronica-arista