Skip to content

Commit

Permalink
Merge pull request #27 from SamD2021/refactor_until_uniform
Browse files Browse the repository at this point in the history
Refactor DPU Tools into a uniform interface
  • Loading branch information
bn222 authored Nov 22, 2024
2 parents e0cb598 + ae6f8dc commit 40f0e90
Show file tree
Hide file tree
Showing 30 changed files with 1,427 additions and 1,499 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM quay.io/centos/centos:stream9

RUN dnf install -y \
rshim minicom python39 lshw mstflint wget unzip expect nfs-utils iproute httpd hwdata \
vsftpd tftp-server dhcp-server iptables hostname tcpdump python3-pexpect iputils pciutils && \
vsftpd tftp-server dhcp-server iptables hostname tcpdump python3-pexpect iputils pciutils \
procps-ng openssh-clients minicom python3-requests && \
dnf clean all && \
rm -rf /var/cache/* && \
ln -s /usr/bin/pip3.9 /usr/bin/pip && \
Expand All @@ -21,9 +22,12 @@ RUN dnf install -y rust cargo python3-pip && \

RUN wget https://www.mellanox.com/downloads/firmware/mlxup/4.26.0/SFX/linux_x64/mlxup

COPY * /
COPY . .

RUN echo "echo 'running rshim'; rshim; sleep infinity" > rshim.sh && chmod +x rshim.sh
ENTRYPOINT /rshim.sh
COPY entry.sh /entry.sh

# Ensure the script is executable
RUN chmod +x /entry.sh

ENTRYPOINT ["/entry.sh"]
# sudo podman run --pid host --network host --user 0 --name bf -dit --privileged -v /dev:/dev quay.io/bnemeth/bf
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# Bluefield tools
This repository contains tools and a Containerfile to build a container which provides a conveniant way to manage Bluefield-2 (BF-2) and Bluefield-3 (BF-3). Make sure that the underlying system has kernel-modules-extra installed (since cuse is a dependency) and run the container as follows (a build is available on quay.io):
# Dpu tools
This repository contains tools and a Containerfile to build a container which provides a conveniant way to manage DPU's such as Bluefield-2 (BF-2) and Bluefield-3 (BF-3), Intel IPU, Marvell Octeon. Make sure that the underlying system has kernel-modules-extra installed (since cuse is a dependency) and run the container as follows (a build is available on quay.io):

```
sudo podman run --pull always --replace --pid host --network host --user 0 --name bf -dit --privileged -v /dev:/dev quay.io/bnemeth/bf
sudo podman run --pull always --replace --pid host --network host --user 0 --name bf -dit --privileged -v /dev:/dev quay.io/bnemeth/dpu-tools <SUBCOMMAND>
```

## Tools

All the tools can directly be ran inside the container. All the tools automatically find and act on the first BF in the system.
All the tools can directly be interacted with through the dpu-tools interface. All the tools automatically find and act on the first DPU in the system.
Note: Using the console subcommand requires specifying what DPU type you are working with. Check out its help page by passing the `-h` flag.

```
sudo podman exec -it bf /<TOOL_NAME>
```

| Tool | Purpose |
| Tool/Subcommand | Purpose |
|--------------|------------------------------------------------------------------------------------------|
| `reset` | Reboots the BF. |
| `listbf` | List all B2 on the system. |
| `fwup` | Updates the firmware on the BF to the latest. |
| `fwversion` | Shows firmware version |
| `console` | Starts a minicom console to access the BF. |
| `reset` | Reboots the DPU. |
| `list` | List all DPUs on the system. |
| `firmware` | Manages the firmware of the DPU. {version, reset, up} |
| `console` | Starts a minicom console to access the DPU. |
| `pxeboot` | Starts a pxe server and tells BF to boot from it. An coreos iso file needs to be passed. |
| `fwdefaults` | Resets the firmware settings on the BF to defaults. |
| `bfb` | Downloads BFB images and sends it to the BF. |
| `set_mode` | Sets the BF mode to either dpu or nic. One argument is required |
| `get_mode` | Gets the BF mode. |
| `cx_fwup` | Upgrades the firmware on a CX |
| `mode` | Gets the BF mode. Use `--set-mode` to change the mode to either dpu or nic |
| `utils` | Access common or non-dpu specific utilities. {cw_fwup, bfb} |

The only tool that requires an argument is the `pxeboot` tool. It expect an iso file with coreos that should
The `pxeboot` tool requires an argument; It expect an iso file with coreos that should
be booted through the rshim. The iso file can optionally be on an nfs mount point.
File renamed without changes.
41 changes: 0 additions & 41 deletions bfb

This file was deleted.

87 changes: 0 additions & 87 deletions common_bf.py

This file was deleted.

30 changes: 0 additions & 30 deletions console

This file was deleted.

14 changes: 0 additions & 14 deletions cx_fwup

This file was deleted.

Loading

0 comments on commit 40f0e90

Please sign in to comment.