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

Refactor DPU Tools into a uniform interface #27

Merged
merged 54 commits into from
Nov 22, 2024

Conversation

SamD2021
Copy link
Contributor

@SamD2021 SamD2021 commented Nov 8, 2024

  • All scripts have been either turned into modules, or been housed in existing modules.
  • Merged Dockerfiles together.
  • Added a new DPU Types enum class.
  • Added DPU Hardware Detection.
  • Refactored DPU Tools script into a class, since there were many variables that should be shared between functions
  • Transformed pxeboot script into a module and refactored it into a class.
  • Added firmware class for Bluefields into fwutils module.
  • Made capture output the default for the run function in the common module.
  • Most tools can be utilized with auto hardware detection
  • Added Console check for DPU Hardware Type

This is in preparation for making a unified interface for dpu tools that
is able to detected the hardware its running on an call its respective
tools

ipu: Remove IPU dir
Remove redundant fwversion

Remove redundant fwup

Remove redundant fwdefaults

Remove listbf script

The list bf script has been integrated into the list dpus command and
function. Now we can use this information to auto detect hardware and
have the tool behave accordingly depending on its hardware
Make the imports match the new structure
Many of these functions aren't necessarily tied to the ipu so moving it
to the common module makes more sense
Matching imports to new structure
Since we want to unify the scripts behind dpu-tools we should also build
the tools using the same Dockerfile
This enum keeps us with a structured way to track different DPU types.
Previously we would just use hardcoded strings, but with this class we
can even validate if the DPU Type is within our tracked types
Since DPU tools often relies passing the args to each function, it would
be nice to have a data structure to bundle all of this in. Likewise it
would be good if we could also keep track of what DPU type are working
with.
This script is useful because it lets rshim run in the background, which
the Bluefields DPUs need to console into them.
By making this class we can keep together related logic to reset,
upgrade and version firmware across dpu types
Copy link
Contributor

@SalDaniele SalDaniele left a comment

Choose a reason for hiding this comment

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

Overall, I am happy to merge if @bn222 approves.

From a user-perspective, I feel everything is working and intuitive (i.e. help for each subcommand provides good output).

From a maintainers persepctive, this could use a little more work to make it easy to extend this in the future for whatever DPUs we add support for moving forward.

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
dpu-tools Outdated Show resolved Hide resolved
dpu-tools Outdated Show resolved Hide resolved
dpu-tools Outdated Show resolved Hide resolved
dpu-tools Outdated Show resolved Hide resolved
utils/common_bf.py Show resolved Hide resolved
@bn222
Copy link
Owner

bn222 commented Nov 12, 2024

I'm also happy with the changes. We will need to specify which dpu type we're using since we can't detect it.

- Requires the user to provide the imc address, like with the firmware
command, if the dpu-tools are in ipu mode.
- The new reset command uses that imc address to call reboot on the imc.
- It either takes the dpu_type given by the user or auto detects it
otherwise.
@SalDaniele
Copy link
Contributor

Nice, I really like the changes, looks good to me. @bn222 can we merge this?

@bn222 bn222 merged commit 40f0e90 into bn222:main Nov 22, 2024
1 check passed
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.

3 participants