9f08f88a0d
Sub PRs: sonic-net/sonic-host-services#84 #17191 Why I did it According to the design, the database instances of DPU will be kept in the NPU host. Microsoft ADO (number only): 25072889 How I did it To follow the multiple ASIC design, I assume a new platform environment variable NUM_DPU will be defined in the /usr/share/sonic/device/$PLATFORM/platform_env.conf. Based on this number, NPU host will launch a corresponding number of instances for the DPU database. Signed-off-by: Ze Gan <ganze718@gmail.com>
43 lines
879 B
Django/Jinja
43 lines
879 B
Django/Jinja
{% set namespace_cnt = NAMESPACE_COUNT|int %}
|
|
{% if NUM_DPU is defined %}
|
|
{% set dpu_cnt = NUM_DPU | int %}
|
|
{% else %}
|
|
{% set dpu_cnt = 0 %}
|
|
{% endif %}
|
|
{
|
|
"INCLUDES" : [
|
|
{
|
|
"include" : "../../redis/sonic-db/database_config.json"
|
|
},
|
|
|
|
{% if namespace_cnt > 1 %}
|
|
{% for ns in range(namespace_cnt) %}
|
|
{
|
|
"namespace" : "{{NAMESPACE_PREFIX}}{{ns}}",
|
|
"include" : "../../redis{{ns}}/sonic-db/database_config.json"
|
|
{% if ns == namespace_cnt-1 %}
|
|
}
|
|
{% else %}
|
|
},
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if dpu_cnt > 0 %}
|
|
{% for dpu in range(dpu_cnt) %}
|
|
{
|
|
"database_type" : "dpudb",
|
|
"include" : "../../redisdpu{{dpu}}/sonic-db/database_config.json"
|
|
{% if dpu == dpu_cnt-1 %}
|
|
}
|
|
{% else %}
|
|
},
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
],
|
|
"VERSION" : "1.0"
|
|
}
|
|
|