-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform #13100
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Kebo Liu <kebol@nvidia.com>
Signed-off-by: Kebo Liu <kebol@nvidia.com>
keboliu
changed the title
[Mellanox] change the implementation of is_host() to fix a stuck issue on simx
[Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform
Dec 19, 2022
8 tasks
liat-grozovik
pushed a commit
that referenced
this pull request
Dec 20, 2022
…uck issue on simx platform (#13101) This PR is to backport #13100 to the 202205 branch since can not be cleanly cherry-picked. Following code to judge whether a process is running inside a docker could get stuck on the simx platform subprocess.Popen(["docker", "--version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up. root@sonic:/# service config-chassisdb status config-chassisdb.service - Config chassis_db Loaded: loaded (/lib/systemd/system/config-chassisdb.service; enabled; vendor preset: enabled) Active: activating (start) since Thu 2022-12-15 09:23:02 UTC; 29min ago Main PID: 571 (config-chassisd) Tasks: 14 (limit: 9501) Memory: 132.4M CGroup: /system.slice/config-chassisdb.service ├─571 /bin/bash /usr/bin/config-chassisdb ├─575 /usr/bin/python3 /usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform ├─602 /bin/sh -c sudo decode-syseeprom -m ├─603 sudo decode-syseeprom -m ├─607 /usr/bin/python3 /usr/local/bin/decode-syseeprom -m ├─616 /bin/sh -c docker --version 2>/dev/null └─617 docker --version - How I did it Use an alternative way to implement this function and issue can be avoided: docker_env_file = '/.dockerenv' return os.path.exists(docker_env_file) is False - How to verify it run regression on real hardware and simx platform.
liat-grozovik
approved these changes
Dec 20, 2022
mssonicbld
pushed a commit
to mssonicbld/sonic-buildimage
that referenced
this pull request
Feb 3, 2023
…e on simx platform (sonic-net#13100) - Why I did it Following code to judge whether a process is running inside a docker could get stuck on the simx platform subprocess.Popen(["docker", "--version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up. root@sonic:/# service config-chassisdb status config-chassisdb.service - Config chassis_db Loaded: loaded (/lib/systemd/system/config-chassisdb.service; enabled; vendor preset: enabled) Active: activating (start) since Thu 2022-12-15 09:23:02 UTC; 29min ago Main PID: 571 (config-chassisd) Tasks: 14 (limit: 9501) Memory: 132.4M CGroup: /system.slice/config-chassisdb.service ├─571 /bin/bash /usr/bin/config-chassisdb ├─575 /usr/bin/python3 /usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform ├─602 /bin/sh -c sudo decode-syseeprom -m ├─603 sudo decode-syseeprom -m ├─607 /usr/bin/python3 /usr/local/bin/decode-syseeprom -m ├─616 /bin/sh -c docker --version 2>/dev/null └─617 docker --version - How I did it Use an alternative way to implement this function and issue can be avoided: docker_env_file = '/.dockerenv' return os.path.exists(docker_env_file) is False - How to verify it run regression on real hardware and simx platform.
Cherry-pick PR to 202211: #13642 |
mssonicbld
pushed a commit
that referenced
this pull request
Feb 3, 2023
…e on simx platform (#13100) - Why I did it Following code to judge whether a process is running inside a docker could get stuck on the simx platform subprocess.Popen(["docker", "--version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up. root@sonic:/# service config-chassisdb status config-chassisdb.service - Config chassis_db Loaded: loaded (/lib/systemd/system/config-chassisdb.service; enabled; vendor preset: enabled) Active: activating (start) since Thu 2022-12-15 09:23:02 UTC; 29min ago Main PID: 571 (config-chassisd) Tasks: 14 (limit: 9501) Memory: 132.4M CGroup: /system.slice/config-chassisdb.service ├─571 /bin/bash /usr/bin/config-chassisdb ├─575 /usr/bin/python3 /usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform ├─602 /bin/sh -c sudo decode-syseeprom -m ├─603 sudo decode-syseeprom -m ├─607 /usr/bin/python3 /usr/local/bin/decode-syseeprom -m ├─616 /bin/sh -c docker --version 2>/dev/null └─617 docker --version - How I did it Use an alternative way to implement this function and issue can be avoided: docker_env_file = '/.dockerenv' return os.path.exists(docker_env_file) is False - How to verify it run regression on real hardware and simx platform.
mssonicbld
added
Included in 202211 Branch
and removed
Approved for 202211 Branch
Created PR to 202211 Branch
labels
Feb 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
Following code to judge whether a process is running inside a docker could get stuck on the simx platform
When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up.
How I did it
Use an alternative way to implement this function and issue can be avoided:
How to verify it
run regression on real hardware and simx platform.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)