Skip to content

[MultiDB] libswsscommon.deb install default database_config.json if it doesn't exist#315

Closed
dzhangalibaba wants to merge 2 commits intosonic-net:masterfrom
dzhangalibaba:p2
Closed

[MultiDB] libswsscommon.deb install default database_config.json if it doesn't exist#315
dzhangalibaba wants to merge 2 commits intosonic-net:masterfrom
dzhangalibaba:p2

Conversation

@dzhangalibaba
Copy link
Copy Markdown
Contributor

@dzhangalibaba dzhangalibaba commented Nov 13, 2019

  • copy database_config.json into /var/run/redis/sonic-db/ when install libswsscommon.deb in postinst script
  • this is used when the environment has no database docker running which means NO database_config,json, mostly it is used in testing environment
  • after this changes, we can do the C++ API and redis-cli replacement without affect VS test since the config file is there.

Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com

@dzhangalibaba
Copy link
Copy Markdown
Contributor Author

@qiluo-msft

@dzhangalibaba
Copy link
Copy Markdown
Contributor Author

retest this please

DST_PATH="/var/run/redis/sonic-db"
DST_FILE="database_config.json"
SRC_PATH="/usr/share/swss"
# if there is no $DST_FILE, it is for testing, it is needed to copy one default $DST_FILE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if there is no $DST_FILE, it is for testing, it is needed to copy one default $DST_FILE [](start = 2, length = 87)

For vs test, libswsscommon is installed on the host, and python code will call it. Is your PR for this case? If yes, it does not make sense to cp to host DST_PATH.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes . it is for vs test cases. cp file on host:DST_PATH make sense.

when conftest.py run vs, it mount host:/var/run/redis-vs/{sw_name} to vs:var/run/redis/, so we need to copy the host:/var/run/redis/sonic-db/database_config.json to host:/var/run/redis-vs/{sw_name}/sonic-db/ and the vs can use this database_config.json file. thsi is done at sonic-net/sonic-swss#1131

I am not sure why the mount name is different from /var/run/redis/, if it is the same like /var/run/redis/:/var/run/redis/, then we don't need the copy and just this PR is enough.

@dzhangalibaba
Copy link
Copy Markdown
Contributor Author

will do changes in docker-sonic-vs images itself instead of using libswsscommon

@dzhangalibaba dzhangalibaba deleted the p2 branch November 14, 2019 08:13
prgeor pushed a commit to prgeor/sonic-swss-common that referenced this pull request Feb 27, 2025
…onic-net#315)

* Add get_transceiver_status to API interface

* Add test_ccmis support

* Add get_transceiver_pm API interface

* Add debug log and more description for interface

* Remove unnecessary pass
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.

2 participants