Git Product home page Git Product logo

godpu's Introduction

godpu

Linters CodeQL OpenSSF Scorecard Go Docker License codecov Go Report Card Go Doc Pulls Last Release GitHub stars GitHub Contributors

Go library and cli to communicate with DPUs and IPUs.

I Want To Contribute

This project welcomes contributions and suggestions. We are happy to have the Community involved via submission of Issues and Pull Requests (with substantive content or even just fixes). We are hoping for the documents, test framework, etc. to become a community process with active engagement. PRs can be reviewed by any number of people, and a maintainer may accept.

See CONTRIBUTING and GitHub Basic Process for more details.

Installation

There are several ways of running this CLI.

Docker

docker pull opiproject/godpu:<version>

You can specify a version like 0.1.1 or use latest to get the most up-to-date version.

Run latest version of the CLI in a container:

docker run --rm opiproject/godpu:latest --help

Replace --help with any godpu command, without godpu itself.

Golang

go install -v github.com/opiproject/godpu@latest

or import

import (
        "github.com/opiproject/godpu"
)

Tests

Test your APIs even if unmerged using your private fork like this:

chmod a+w go.*
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod edit -replace github.com/opiproject/opi-api@main=github.com/YOURUSERNAME/opi-api@main
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go get -u github.com/YOURUSERNAME/opi-api/storage/v1alpha1/gen/go@a98ca449468a
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod tidy

Generate mocks like this:

go install github.com/vektra/mockery/v2@latest
make mock-generate

CLI

Storage

alias dpu="docker run --rm --network host ghcr.io/opiproject/godpu:main"

# connect to remote nvme/tcp controller
nvmf0=$(dpu storage create backend nvme controller --id nvmf0 --multipath disable)
path0=$(dpu storage create backend nvme path tcp --controller "$nvmf0" --id path0 --ip "11.11.11.2" --port 4444 --nqn nqn.2016-06.io.spdk:cnode1 --hostnqn nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c)
dpu storage get backend nvme controller --name $nvmf0
dpu storage get backend nvme path --name $path0

# connect to local nvme/pcie ssd controller
nvmf1=$(dpu storage create backend nvme controller --id nvmf1 --multipath disable)
path1=$(dpu storage create backend nvme path pcie --controller "$nvmf1" --id path1 --bdf "0000:40:00.0")
dpu storage get backend nvme controller --name $nvmf1
dpu storage get backend nvme path --name $path1

# expose volume over nvme/tcp controller
ss0=$(dpu storage create frontend nvme subsystem --id subsys0 --nqn "nqn.2022-09.io.spdk:opitest0")
ns0=$(dpu storage create frontend nvme namespace --id namespace0 --volume "Malloc0" --subsystem "$ss0")
ctrl0=$(dpu storage create frontend nvme controller tcp --id ctrl0 --ip "127.0.0.1" --port 4420 --subsystem "$ss0")

# expose volume over emulated nvme/pcie controller
ss1=$(dpu storage create frontend nvme subsystem --id subsys1 --nqn "nqn.2022-09.io.spdk:opitest1")
ns1=$(dpu storage create frontend nvme namespace --id namespace1 --volume "Malloc1" --subsystem "$ss1")
ctrl1=$(dpu storage create frontend nvme controller pcie --id ctrl1 --port 0 --pf 0 --vf 0 --subsystem "$ss1")

# delete emulated nvme/pcie controller
dpu storage delete frontend nvme controller --name "$ctrl1"
dpu storage delete frontend nvme namespace --name "$ns1"
dpu storage delete frontend nvme subsystem --name "$ss1"

# delete nvme/tcp controller
dpu storage delete frontend nvme controller --name "$ctrl0"
dpu storage delete frontend nvme namespace --name "$ns0"
dpu storage delete frontend nvme subsystem --name "$ss0"

# disconnect from local nvme/pcie ssd controller
dpu storage delete backend nvme path --name "$path1"
dpu storage delete backend nvme controller --name "$nvmf1"

# disconnect from remote nvme/tcp controller
dpu storage delete backend nvme path --name "$path0"
dpu storage delete backend nvme controller --name "$nvmf0"

godpu's People

Contributors

renovate[bot] avatar glimchb avatar artek-koltun avatar atulpatel261194 avatar brianroch avatar harishp8889 avatar harshitap26 avatar sandersms avatar pwalessi-dell avatar alknopfler avatar mestery avatar seroyer avatar jainvipin avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.