Skip to content
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

[Multi-Asic Infra]: asic_index gap in single-asic and multi-asic devices #16476

Open
yejianquan opened this issue Jan 13, 2025 · 1 comment
Open
Assignees
Labels
multi-ASIC Multi ASIC platform

Comments

@yejianquan
Copy link
Collaborator

Issue Description

For single-asic device, the self.asic_index will be set as 0

self.asics = [SonicAsic(self.sonichost, asic_index) for asic_index in self.sonichost.facts[ASICS_PRESENT]]

Sometimes in tests, we compose docker container with the asic_index,
for example, the swss container for asic1(asic_index: 1) will be swss1,
For multi-asic device, the format is f"swss{self.asic_index}"

But the format is not applicable to single-asic,
f"swss{self.asic_index}" -> 'swss0'
but actually the container is 'swss'

This causes the infra and logic to be not compatible between single-asic and multi-asic.
Sample issue: #16314

Results you see

f"swss{self.asic_index}" on single_asic -> swss0
Which != actual value: swss.

Results you expected to see

We should have a compatible function for SonicAsic

class SonicAsic(object):
    def asic_index_for_service(self):
        if self.sonichost.is_multi_asic:
            return self.asic_index
        else:
            return None

then

#Multi-asic
f"swss{sonic_asic.asic_index_for_service()}" = swss0

#Single-asic
f"swss{sonic_asic.asic_index_for_service()}" = swss

Is it platform specific

generic

Relevant log output

No response

Output of show version

No response

Attach files (if any)

No response

@yejianquan yejianquan added the multi-ASIC Multi ASIC platform label Jan 13, 2025
@yejianquan
Copy link
Collaborator Author

@sdszhang please help to follow up on this infra enhancement, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multi-ASIC Multi ASIC platform
Projects
None yet
Development

No branches or pull requests

2 participants