Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
songlinfeng
container-toolkit
Commits
2477e403
Commit
2477e403
authored
Dec 01, 2025
by
songlinfeng
Browse files
update readme
parent
3440c625
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
README.md
README.md
+25
-0
build.sh
build.sh
+7
-1
cmd/dcu-ctk/runtime/configure/configure.go
cmd/dcu-ctk/runtime/configure/configure.go
+6
-6
internal/query/query.go
internal/query/query.go
+1
-1
No files found.
README.md
View file @
2477e403
...
@@ -284,3 +284,28 @@ services:
...
@@ -284,3 +284,28 @@ services:
```
sh
```
sh
docker stack deploy
-c
docker-compose.yml rocm-stack
docker stack deploy
-c
docker-compose.yml rocm-stack
```
```
### containerd 配置
配置 containerd 需要先配置 containerd 的配置文件
`/etc/containerd/config.toml`
```
shell
$
dcu-ctk runtime configure
--runtime
=
containerd
--set-as-default
--cdi
.enabled
$
systemctl restart containerd
```
若用于kubernetes,则需要配合dcu-device-plugin使用
https://download.sourcefind.cn:65024/5/main/Kubernetes%E6%8F%92%E4%BB%B6
若使用nerdctl命令行工具,则需要使用--runtime
```
shell
$
nerdctl run
--rm
--runtime
dcu
-e
DCU_VISIBLE_DEVICES
=
0,1 ubuntu:18.04 bash
```
### 查询DCU被docker容器使用情况
若开启了dcu-tracker, 则可以使用dcu-tracker查询DCU被docker容器使用情况,若没有开启dcu-tracker,则可以使用该功能查询被docker容器使用中的DCU
情况,若只是被挂载到容器而没有被使用,则不会显示在该列表中。
```
shell
$
dcu-ctk docker
------------------------------------------------------------------------------------------------------------------------
DCU Id UUID Container Names
------------------------------------------------------------------------------------------------------------------------
0 0x73873C7A6EB02041 peaceful_hawking
------------------------------------------------------------------------------------------------------------------------
```
build.sh
View file @
2477e403
...
@@ -21,7 +21,13 @@ export PATH=${HOME}/go/bin:$PATH
...
@@ -21,7 +21,13 @@ export PATH=${HOME}/go/bin:$PATH
make cmds
make cmds
source
=(
"dcu-container-runtime"
"dcu-cdi-hook"
"dcu-ctk"
"dcu-docker"
)
source
=(
"dcu-container-runtime"
"dcu-cdi-hook"
"dcu-ctk"
"dcu-docker"
)
mkdir
SOURCES RPMS BUILD SRPMS BUILDROOT
dirs
=(
"SOURCES"
"RPMS"
"BUILD"
"SRPMS"
"BUILDROOT"
)
for
dir
in
"
${
dirs
[@]
}
"
do
if
[
!
-d
$dir
]
;
then
mkdir
$dir
fi
done
for
file
in
"
${
source
[@]
}
"
for
file
in
"
${
source
[@]
}
"
do
do
rm
-rf
SOURCES/
$file
>
/dev/null 2>&1
rm
-rf
SOURCES/
$file
>
/dev/null 2>&1
...
...
cmd/dcu-ctk/runtime/configure/configure.go
View file @
2477e403
...
@@ -108,22 +108,22 @@ func (m command) build() *cli.Command {
...
@@ -108,22 +108,22 @@ func (m command) build() *cli.Command {
Destination
:
&
config
.
mode
,
Destination
:
&
config
.
mode
,
},
},
&
cli
.
StringFlag
{
&
cli
.
StringFlag
{
Name
:
"d
tk
-runtime-name"
,
Name
:
"d
cu
-runtime-name"
,
Usage
:
"specify the name of the D
TK
runtime that will be added"
,
Usage
:
"specify the name of the D
CU
runtime that will be added"
,
Value
:
defaultDTKRuntimeName
,
Value
:
defaultDTKRuntimeName
,
Destination
:
&
config
.
dtkRuntime
.
name
,
Destination
:
&
config
.
dtkRuntime
.
name
,
},
},
&
cli
.
StringFlag
{
&
cli
.
StringFlag
{
Name
:
"d
tk
-runtime-path"
,
Name
:
"d
cu
-runtime-path"
,
Aliases
:
[]
string
{
"runtime-path"
},
Aliases
:
[]
string
{
"runtime-path"
},
Usage
:
"specify the path to the D
TK
runtime executable"
,
Usage
:
"specify the path to the D
CU
runtime executable"
,
Value
:
defaultDTKRuntimeExecutable
,
Value
:
defaultDTKRuntimeExecutable
,
Destination
:
&
config
.
dtkRuntime
.
path
,
Destination
:
&
config
.
dtkRuntime
.
path
,
},
},
&
cli
.
BoolFlag
{
&
cli
.
BoolFlag
{
Name
:
"d
tk
-set-as-default"
,
Name
:
"d
cu
-set-as-default"
,
Aliases
:
[]
string
{
"set-as-default"
},
Aliases
:
[]
string
{
"set-as-default"
},
Usage
:
"set the D
TK
runtime as the default runtime"
,
Usage
:
"set the D
CU
runtime as the default runtime"
,
Destination
:
&
config
.
dtkRuntime
.
setAsDefault
,
Destination
:
&
config
.
dtkRuntime
.
setAsDefault
,
},
},
&
cli
.
BoolFlag
{
&
cli
.
BoolFlag
{
...
...
internal/query/query.go
View file @
2477e403
...
@@ -243,7 +243,7 @@ func ShowStatus(dcus string) error {
...
@@ -243,7 +243,7 @@ func ShowStatus(dcus string) error {
}
}
fmt
.
Println
(
strings
.
Repeat
(
"-"
,
120
))
fmt
.
Println
(
strings
.
Repeat
(
"-"
,
120
))
fmt
.
Printf
(
"%-40s%-50s%-20s
\n
"
,
"
GP
U Id"
,
"UUID"
,
"Container Names"
)
fmt
.
Printf
(
"%-40s%-50s%-20s
\n
"
,
"
DC
U Id"
,
"UUID"
,
"Container Names"
)
fmt
.
Println
(
strings
.
Repeat
(
"-"
,
120
))
fmt
.
Println
(
strings
.
Repeat
(
"-"
,
120
))
for
dcuId
:=
range
dcuinfos
{
for
dcuId
:=
range
dcuinfos
{
for
idx
,
name
:=
range
dcuinfos
[
dcuId
]
.
ContainerName
{
for
idx
,
name
:=
range
dcuinfos
[
dcuId
]
.
ContainerName
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment