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
48c080c4
Commit
48c080c4
authored
Nov 11, 2025
by
songlinfeng
Browse files
rename dcu-ctk dcu-container-toolkit
parent
0ccfece1
Changes
126
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
100 additions
and
100 deletions
+100
-100
Makefile
Makefile
+2
-2
README.md
README.md
+35
-35
cmd/dcu-cdi-hook/chmod/chmod.go
cmd/dcu-cdi-hook/chmod/chmod.go
+2
-2
cmd/dcu-cdi-hook/commands/commands.go
cmd/dcu-cdi-hook/commands/commands.go
+4
-4
cmd/dcu-cdi-hook/create-symlinks/create-symlinks.go
cmd/dcu-cdi-hook/create-symlinks/create-symlinks.go
+2
-2
cmd/dcu-cdi-hook/main.go
cmd/dcu-cdi-hook/main.go
+2
-2
cmd/dcu-container-runtime/README.md
cmd/dcu-container-runtime/README.md
+2
-2
cmd/dcu-container-runtime/main.go
cmd/dcu-container-runtime/main.go
+2
-2
cmd/dcu-ctk/cdi/cdi.go
cmd/dcu-ctk/cdi/cdi.go
+4
-4
cmd/dcu-ctk/cdi/generate/generate.go
cmd/dcu-ctk/cdi/generate/generate.go
+10
-10
cmd/dcu-ctk/cdi/list/list.go
cmd/dcu-ctk/cdi/list/list.go
+1
-1
cmd/dcu-ctk/cdi/transform/root/root.go
cmd/dcu-ctk/cdi/transform/root/root.go
+3
-3
cmd/dcu-ctk/cdi/transform/transform.go
cmd/dcu-ctk/cdi/transform/transform.go
+2
-2
cmd/dcu-ctk/config/config.go
cmd/dcu-ctk/config/config.go
+4
-4
cmd/dcu-ctk/config/create-default/create-default.go
cmd/dcu-ctk/config/create-default/create-default.go
+3
-3
cmd/dcu-ctk/config/flags/options.go
cmd/dcu-ctk/config/flags/options.go
+0
-0
cmd/dcu-ctk/dcu-tracker/dcu-tracker.go
cmd/dcu-ctk/dcu-tracker/dcu-tracker.go
+13
-13
cmd/dcu-ctk/dcu-tracker/disable/disable.go
cmd/dcu-ctk/dcu-tracker/disable/disable.go
+3
-3
cmd/dcu-ctk/dcu-tracker/enable/enable.go
cmd/dcu-ctk/dcu-tracker/enable/enable.go
+3
-3
cmd/dcu-ctk/dcu-tracker/initialize/initialize.go
cmd/dcu-ctk/dcu-tracker/initialize/initialize.go
+3
-3
No files found.
Makefile
View file @
48c080c4
...
...
@@ -4,7 +4,7 @@ DIST_DIR ?= $(CURDIR)/dist
include
$(CURDIR)/versions.mk
MODULE
:=
d
tk
-container-toolkit
MODULE
:=
d
cu
-container-toolkit
# By default run all native docker-based targets
docker-native
:
...
...
@@ -29,7 +29,7 @@ CLI_VERSION = $(LIB_VERSION)$(if $(LIB_TAG),-$(LIB_TAG))
else
CLI_VERSION
=
$(VERSION)
endif
CLI_VERSION_PACKAGE
=
d
tk
-container-toolkit/internal/info
CLI_VERSION_PACKAGE
=
d
cu
-container-toolkit/internal/info
binaries
:
cmds
ifneq
($(PREFIX),)
...
...
README.md
View file @
48c080c4
...
...
@@ -4,8 +4,8 @@
DTK Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该toolkit包括以下工具包。
-
```d
tk
-container-toolkit```
- DTK容器运行时
-
```d
tk
-ctk```
- DTK容器工具集命令行
-
```d
cu
-container-toolkit```
- DTK容器运行时
-
```d
cu
-ctk```
- DTK容器工具集命令行
## 使用
-
--gpus需要Docker version 19+
...
...
@@ -16,8 +16,8 @@ DTK Container Toolkit 使用户能够构建和运行使用DCU设备的容器,该
使用 dpkg/rpm -i 进行安装。安装后会自动执行以下命令
```
sh
$
d
tk
-ctk
--quiet
config
--config-file
=
/etc/d
tk
-container-runtime/config.toml
--in-place
#生成配置文件
$
d
tk
-ctk runtime configure
--runtime
=
docker
--set-as-default
#修改docker的config.json的runtime
$
d
cu
-ctk
--quiet
config
--config-file
=
/etc/d
cu
-container-runtime/config.toml
--in-place
#生成配置文件
$
d
cu
-ctk runtime configure
--runtime
=
docker
--set-as-default
#修改docker的config.json的runtime
```
重启docker服务
...
...
@@ -35,21 +35,21 @@ $ docker run -it --gpus 1 ubuntu:18.04 # 添加一个HCU设备,HCU 0
$
docker run
-it
--gpus
"device=0,2"
ubuntu:18.04
#添加第0号和第2号GPU
```
#### 通过环境变量 `D
TK
_VISIBLE_DEVICES`
可以通过 docker run 添加环境变量 -e D
TK
_VISIBLE_DEVICES 给容器添加HCU设备。
#### 通过环境变量 `D
CU
_VISIBLE_DEVICES`
可以通过 docker run 添加环境变量 -e D
CU
_VISIBLE_DEVICES 给容器添加HCU设备。
```
sh
docker run
-it
-e
D
TK
_VISIBLE_DEVICES
=
all ubuntu:18.04
# 添加所有HCU设备
docker run
-it
-e
D
TK
_VISIBLE_DEVICES
=
0 ubuntu:18.04
# 添加HCU设备0
docker run
-it
-e
D
TK
_VISIBLE_DEVICES
=
0,1 ubuntu:18.04
# 添加HCU设备0、1
docker run
-it
-e
D
CU
_VISIBLE_DEVICES
=
all ubuntu:18.04
# 添加所有HCU设备
docker run
-it
-e
D
CU
_VISIBLE_DEVICES
=
0 ubuntu:18.04
# 添加HCU设备0
docker run
-it
-e
D
CU
_VISIBLE_DEVICES
=
0,1 ubuntu:18.04
# 添加HCU设备0、1
```
#### 通过CDI方式
-
首先,生成CDI spec文件
```
sh
$
d
tk
-ctk cdi generate
--output
=
/etc/cdi/dtk.json
$
d
cu
-ctk cdi generate
--output
=
/etc/cdi/dtk.json
```
-
配置docker开启CDI
```
sh
$
d
tk
-ctk runtime configure
--runtime
=
docker
--set-as-default
--cdi
.enabled
$
d
cu
-ctk runtime configure
--runtime
=
docker
--set-as-default
--cdi
.enabled
```
-
使用所有的DCU
```
sh
...
...
@@ -63,15 +63,15 @@ $ docker run --rm --device c-3000.com/hcu=0 --device c-3000.com/hcu=1 -it ubuntu
podman 需要version 2.0+
-
首先需要修改podman的runtime
```
sh
$
d
tk
-ctk runtime configure
--runtime
=
podman
--set-as-default
$
d
cu
-ctk runtime configure
--runtime
=
podman
--set-as-default
```
-
通过环境变量方式使用
```
sh
$
podman run
-it
-e
D
TK
_VISIBLE_DEVICES
=
all ubuntu:18.04
$
podman run
-it
-e
D
CU
_VISIBLE_DEVICES
=
all ubuntu:18.04
```
### 列出可使用的DCU
```
sh
$
d
tk
-ctk cdi list
$
d
cu
-ctk cdi list
INFO[0000] Found 3 CDI devices
c-3000.com/hcu
=
0
c-3000.com/hcu
=
1
...
...
@@ -84,34 +84,34 @@ c-3000.com/hcu=hcu-73873c7a6eb040a1
### docker rootless下对文件读写权限的限制
非root用户在使用-v挂载目录时,保留原有权限,无法对ro目录添加w权限,执行该命令需要root权限
```
sh
$
d
tk
-ctk rootless
--runtime
=
docker
$
d
cu
-ctk rootless
--runtime
=
docker
```
### DCU Tracker
DCU Tracker用来监控使用--gpus和-e D
TK
_VISIBLE_DEVICES启动容器的DCU使用情况,也可以设置DCU被独享或共享。默认情况下DCU Tracker是disable状态,用户可以使用d
tk
-ctk的命令行来enable.
DCU Tracker用来监控使用--gpus和-e D
CU
_VISIBLE_DEVICES启动容器的DCU使用情况,也可以设置DCU被独享或共享。默认情况下DCU Tracker是disable状态,用户可以使用d
cu
-ctk的命令行来enable.
DCU Tracker 提供命令行来控制容器对DCU的访问,可以被设置为shared或exclusive.
-
shared 表示DCU可以同时被多个容器一起使用,这是默认状态
-
exclusive 表示DCU同时只能被一个容器使用。
```
sh
$
d
tk
-ctk dcu-tracker
-h
$
d
cu
-ctk dcu-tracker
-h
NAME:
C-3000 DTK Container Toolkit CLI dcu-tracker - DCU Tracker related commands
USAGE:
d
tk
-ctk dcu-tracker
[
dcu-ids]
[
accessibility]
d
cu
-ctk dcu-tracker
[
dcu-ids]
[
accessibility]
Arguments:
dcu-ids Comma-separated list of DCU IDs
(
comma separated list, range operator, all
)
accessibility Must be either
'exclusive'
or
'shared'
Examples:
d
tk
-ctk dcu-tracker 0,1,2 exclusive
d
tk
-ctk dcu-tracker 0,1-2 shared
d
tk
-ctk dcu-tracker all shared
d
cu
-ctk dcu-tracker 0,1,2 exclusive
d
cu
-ctk dcu-tracker 0,1-2 shared
d
cu
-ctk dcu-tracker all shared
OR
d
tk
-ctk dcu-tracker
[
command
]
[
options]
d
cu
-ctk dcu-tracker
[
command
]
[
options]
COMMANDS:
disable Disable the DCU Tracker
...
...
@@ -146,7 +146,7 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
如果DCU Tracker enabled,DCU默认被赋予 shared 权限
```
sh
$
d
tk
-ctk dcu-tracker status
$
d
cu
-ctk dcu-tracker status
------------------------------------------------------------------------------------------------------------------------
GPU Id UUID Accessibility Container Ids
------------------------------------------------------------------------------------------------------------------------
...
...
@@ -157,7 +157,7 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
如果DCU Tracker没有开启,则会有相应提示
```
sh
$
d
tk
-ctk dcu-tracker status
$
d
cu
-ctk dcu-tracker status
DCU Tracker is disabled
```
...
...
@@ -165,20 +165,20 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
```
sh
$
d
tk
-ctk dcu-tracker status
$
d
cu
-ctk dcu-tracker status
DCU Tracker is disabled
$
d
tk
-ctk dcu-tracker
enable
$
d
cu
-ctk dcu-tracker
enable
DCU Tracker has been enabled
$
d
tk
-ctk dcu-tracker
enable
$
d
cu
-ctk dcu-tracker
enable
DCU Tracker is already enabled
```
-
关闭 DCU Tracker
```
sh
$
d
tk
-ctk dcu-tracker disable
$
d
cu
-ctk dcu-tracker disable
DCU Tracker has been disabled
```
...
...
@@ -186,11 +186,11 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
当DCU Tracker开启时,启动容器时会自动记录容器使用DCU的情况
```
sh
$
docker run
--name
slf_dmps
-e
D
TK
_VISIBLE_DEVICES
=
0,1
-it
a4dd5be0ca23
$
docker run
--name
slf_dmps
-e
D
CU
_VISIBLE_DEVICES
=
0,1
-it
a4dd5be0ca23
$
docker run
--name
slf_dmp
-e
D
TK
_VISIBLE_DEVICES
=
0,1
-it
a4dd5be0ca23
$
docker run
--name
slf_dmp
-e
D
CU
_VISIBLE_DEVICES
=
0,1
-it
a4dd5be0ca23
$
d
tk
-ctk dcu-tracker status
$
d
cu
-ctk dcu-tracker status
------------------------------------------------------------------------------------------------------------------------
GPU Id UUID Accessibility Container Ids
------------------------------------------------------------------------------------------------------------------------
...
...
@@ -202,7 +202,7 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
$
docker
rm
slf_dmp
$
d
tk
-ctk dcu-tracker status
$
d
cu
-ctk dcu-tracker status
------------------------------------------------------------------------------------------------------------------------
GPU Id UUID Accessibility Container Ids
------------------------------------------------------------------------------------------------------------------------
...
...
@@ -215,10 +215,10 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
-
设置DCU 为exclusive属性
```
sh
$
d
tk
-ctk dcu-tracker 1 exclusive
$
d
cu
-ctk dcu-tracker 1 exclusive
DCUs
[
1] have been made exclusive
$
d
tk
-ctk dcu-tracker status
$
d
cu
-ctk dcu-tracker status
------------------------------------------------------------------------------------------------------------------------
GPU Id UUID Accessibility Container Ids
------------------------------------------------------------------------------------------------------------------------
...
...
@@ -226,7 +226,7 @@ GPU Temp (DieEdge) AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
1 0x73873C7A6EB008A1 Exclusive dc3c3153ab2e1cde5013a5e5d116cf467894949d1ef4b29ba8caa23a40f66d8d
2 0x73873C7A6EB040A1 Shared None
$
docker run
--name
slf_dmp
-e
D
TK
_VISIBLE_DEVICES
=
0,1
-it
a4dd5be0ca23
$
docker run
--name
slf_dmp
-e
D
CU
_VISIBLE_DEVICES
=
0,1
-it
a4dd5be0ca23
docker: Error response from daemon: failed to create task
for
container: failed to create shim task: OCI runtime create failed: failed to
create DTK Container Runtime: failed to construct OCI spec modifier: failed to reserve DCUs: DCUs
[
1] are exclusive and already
in
use: unknown.
...
...
cmd/d
tk
-cdi-hook/chmod/chmod.go
→
cmd/d
cu
-cdi-hook/chmod/chmod.go
View file @
48c080c4
...
...
@@ -5,8 +5,8 @@
package
chmod
import
(
"d
tk
-container-toolkit/internal/logger"
"d
tk
-container-toolkit/internal/oci"
"d
cu
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/oci"
"errors"
"fmt"
"io/fs"
...
...
cmd/d
tk
-cdi-hook/commands/commands.go
→
cmd/d
cu
-cdi-hook/commands/commands.go
View file @
48c080c4
...
...
@@ -5,15 +5,15 @@
package
commands
import
(
"d
tk
-container-toolkit/cmd/d
tk
-cdi-hook/chmod"
symlinks
"d
tk
-container-toolkit/cmd/d
tk
-cdi-hook/create-symlinks"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/cmd/d
cu
-cdi-hook/chmod"
symlinks
"d
cu
-container-toolkit/cmd/d
cu
-cdi-hook/create-symlinks"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
)
// New creates the commands associated with supported CDI hooks.
// These are shared by the d
tk
-cdi-hook and d
tk
-ctk hook commands.
// These are shared by the d
cu
-cdi-hook and d
cu
-ctk hook commands.
func
New
(
logger
logger
.
Interface
)
[]
*
cli
.
Command
{
return
[]
*
cli
.
Command
{
symlinks
.
NewCommand
(
logger
),
...
...
cmd/d
tk
-cdi-hook/create-symlinks/create-symlinks.go
→
cmd/d
cu
-cdi-hook/create-symlinks/create-symlinks.go
View file @
48c080c4
...
...
@@ -5,8 +5,8 @@
package
symlinks
import
(
"d
tk
-container-toolkit/internal/logger"
"d
tk
-container-toolkit/internal/oci"
"d
cu
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/oci"
"fmt"
"os"
"path/filepath"
...
...
cmd/d
tk
-cdi-hook/main.go
→
cmd/d
cu
-cdi-hook/main.go
View file @
48c080c4
...
...
@@ -5,8 +5,8 @@
package
main
import
(
"d
tk
-container-toolkit/cmd/d
tk
-cdi-hook/commands"
"d
tk
-container-toolkit/internal/info"
"d
cu
-container-toolkit/cmd/d
cu
-cdi-hook/commands"
"d
cu
-container-toolkit/internal/info"
"os"
"github.com/sirupsen/logrus"
...
...
cmd/d
tk
-container-runtime/README.md
→
cmd/d
cu
-container-runtime/README.md
View file @
48c080c4
# DTK Container Runtime
DTK Container Runtime 是一个专为符合 OCI (Open Container Initiative,开放容器计划)规范的底层运行时( 如
[
runc
](
https://github.com/opencontainers/runc
)
)设计的垫片(shim)。当 d
tk
-container-runtime 接收到一个
`create`
命令时,它会对传入的
[
OCI运行时规范
](
https://github.com/opencontainers/runtime-spec
)
进行即时修改,以添加对 HCU 的特殊支持,然后将这个修改后的命令转发给底层的运行时(如runc、containerd等)。
DTK Container Runtime 是一个专为符合 OCI (Open Container Initiative,开放容器计划)规范的底层运行时( 如
[
runc
](
https://github.com/opencontainers/runc
)
)设计的垫片(shim)。当 d
cu
-container-runtime 接收到一个
`create`
命令时,它会对传入的
[
OCI运行时规范
](
https://github.com/opencontainers/runtime-spec
)
进行即时修改,以添加对 HCU 的特殊支持,然后将这个修改后的命令转发给底层的运行时(如runc、containerd等)。
## 配置
DTK Container Runtime (DCR) 使用基于文件的配置方式,其配置文件存储在 /etc/d
tk
-container-runtime/config.toml 路径下。安装 d
tk
-container-toolkit 时会自动生成该文件。
DTK Container Runtime (DCR) 使用基于文件的配置方式,其配置文件存储在 /etc/d
cu
-container-runtime/config.toml 路径下。安装 d
cu
-container-toolkit 时会自动生成该文件。
cmd/d
tk
-container-runtime/main.go
→
cmd/d
cu
-container-runtime/main.go
View file @
48c080c4
...
...
@@ -5,8 +5,8 @@
package
main
import
(
"d
tk
-container-toolkit/internal/dcu-tracker"
"d
tk
-container-toolkit/internal/runtime"
"d
cu
-container-toolkit/internal/dcu-tracker"
"d
cu
-container-toolkit/internal/runtime"
"os"
//"log"
)
...
...
cmd/d
tk
-ctk/cdi/cdi.go
→
cmd/d
cu
-ctk/cdi/cdi.go
View file @
48c080c4
...
...
@@ -5,10 +5,10 @@
package
cdi
import
(
"d
tk
-container-toolkit/cmd/d
tk
-ctk/cdi/generate"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/cdi/list"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/cdi/transform"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/cdi/generate"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/cdi/list"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/cdi/transform"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
)
...
...
cmd/d
tk
-ctk/cdi/generate/generate.go
→
cmd/d
cu
-ctk/cdi/generate/generate.go
View file @
48c080c4
...
...
@@ -5,11 +5,11 @@
package
generate
import
(
"d
tk
-container-toolkit/internal/config"
"d
tk
-container-toolkit/internal/logger"
"d
tk
-container-toolkit/pkg/c3000cdi"
"d
tk
-container-toolkit/pkg/c3000cdi/spec"
"d
tk
-container-toolkit/pkg/c3000cdi/transform"
"d
cu
-container-toolkit/internal/config"
"d
cu
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/pkg/c3000cdi"
"d
cu
-container-toolkit/pkg/c3000cdi/spec"
"d
cu
-container-toolkit/pkg/c3000cdi/transform"
"fmt"
"os"
"path/filepath"
...
...
@@ -110,11 +110,11 @@ func (m command) build() *cli.Command {
Destination
:
&
opts
.
librarySearchPaths
,
},
&
cli
.
StringFlag
{
Name
:
"d
tk
-cdi-hook-path"
,
Aliases
:
[]
string
{
"d
tk
-ctk-path"
},
Usage
:
"Specify the path to use for the d
tk
-cdi-hook in the generated CDI specification. "
+
"If not specified, the PATH will be searched for `d
tk
-cdi-hook`. "
+
"NOTE: That if this is specified as `d
tk
-ctk`, the PATH will be searched for `d
tk
-ctk` instead."
,
Name
:
"d
cu
-cdi-hook-path"
,
Aliases
:
[]
string
{
"d
cu
-ctk-path"
},
Usage
:
"Specify the path to use for the d
cu
-cdi-hook in the generated CDI specification. "
+
"If not specified, the PATH will be searched for `d
cu
-cdi-hook`. "
+
"NOTE: That if this is specified as `d
cu
-ctk`, the PATH will be searched for `d
cu
-ctk` instead."
,
Destination
:
&
opts
.
dtkCDIHookPath
,
},
&
cli
.
StringFlag
{
...
...
cmd/d
tk
-ctk/cdi/list/list.go
→
cmd/d
cu
-ctk/cdi/list/list.go
View file @
48c080c4
...
...
@@ -5,7 +5,7 @@
package
list
import
(
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"errors"
"fmt"
...
...
cmd/d
tk
-ctk/cdi/transform/root/root.go
→
cmd/d
cu
-ctk/cdi/transform/root/root.go
View file @
48c080c4
...
...
@@ -5,9 +5,9 @@
package
root
import
(
"d
tk
-container-toolkit/internal/logger"
"d
tk
-container-toolkit/pkg/c3000cdi/spec"
transformroot
"d
tk
-container-toolkit/pkg/c3000cdi/transform/root"
"d
cu
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/pkg/c3000cdi/spec"
transformroot
"d
cu
-container-toolkit/pkg/c3000cdi/transform/root"
"fmt"
"io"
"os"
...
...
cmd/d
tk
-ctk/cdi/transform/transform.go
→
cmd/d
cu
-ctk/cdi/transform/transform.go
View file @
48c080c4
...
...
@@ -5,8 +5,8 @@
package
transform
import
(
"d
tk
-container-toolkit/cmd/d
tk
-ctk/cdi/transform/root"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/cdi/transform/root"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
)
...
...
cmd/d
tk
-ctk/config/config.go
→
cmd/d
cu
-ctk/config/config.go
View file @
48c080c4
...
...
@@ -5,10 +5,10 @@
package
config
import
(
createdefault
"d
tk
-container-toolkit/cmd/d
tk
-ctk/config/create-default"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/config/flags"
"d
tk
-container-toolkit/internal/config"
"d
tk
-container-toolkit/internal/logger"
createdefault
"d
cu
-container-toolkit/cmd/d
cu
-ctk/config/create-default"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/config/flags"
"d
cu
-container-toolkit/internal/config"
"d
cu
-container-toolkit/internal/logger"
"errors"
"fmt"
"reflect"
...
...
cmd/d
tk
-ctk/config/create-default/create-default.go
→
cmd/d
cu
-ctk/config/create-default/create-default.go
View file @
48c080c4
...
...
@@ -5,9 +5,9 @@
package
defaultsubcommand
import
(
"d
tk
-container-toolkit/cmd/d
tk
-ctk/config/flags"
"d
tk
-container-toolkit/internal/config"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/config/flags"
"d
cu
-container-toolkit/internal/config"
"d
cu
-container-toolkit/internal/logger"
"fmt"
"github.com/urfave/cli/v2"
...
...
cmd/d
tk
-ctk/config/flags/options.go
→
cmd/d
cu
-ctk/config/flags/options.go
View file @
48c080c4
File moved
cmd/d
tk
-ctk/dcu-tracker/dcu-tracker.go
→
cmd/d
cu
-ctk/dcu-tracker/dcu-tracker.go
View file @
48c080c4
package
dcuTracker
import
(
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker/disable"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker/enable"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker/initialize"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker/release"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker/reset"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker/status"
"d
tk
-container-toolkit/internal/dcu-tracker"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker/disable"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker/enable"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker/initialize"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker/release"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker/reset"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker/status"
"d
cu
-container-toolkit/internal/dcu-tracker"
"d
cu
-container-toolkit/internal/logger"
"fmt"
"os/user"
...
...
@@ -30,19 +30,19 @@ func (m command) build() *cli.Command {
dcuTrackerCmd
:=
cli
.
Command
{
Name
:
"dcu-tracker"
,
Usage
:
"DCU Tracker related commands"
,
UsageText
:
`d
tk
-ctk dcu-tracker [dcu-ids] [accessibility]
UsageText
:
`d
cu
-ctk dcu-tracker [dcu-ids] [accessibility]
Arguments:
dcu-ids Comma-separated list of DCU IDs (comma separated list, range operator, all)
accessibility Must be either 'exclusive' or 'shared'
Examples:
d
tk
-ctk dcu-tracker 0,1,2 exclusive
d
tk
-ctk dcu-tracker 0,1-2 shared
d
tk
-ctk dcu-tracker all shared
d
cu
-ctk dcu-tracker 0,1,2 exclusive
d
cu
-ctk dcu-tracker 0,1-2 shared
d
cu
-ctk dcu-tracker all shared
OR
d
tk
-ctk dcu-tracker [command] [options]`
,
d
cu
-ctk dcu-tracker [command] [options]`
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
m
.
validateGenOptions
(
c
)
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
return
m
.
performAction
(
c
)
},
}
...
...
cmd/d
tk
-ctk/dcu-tracker/disable/disable.go
→
cmd/d
cu
-ctk/dcu-tracker/disable/disable.go
View file @
48c080c4
package
disable
import
(
dcuTracker
"d
tk
-container-toolkit/internal/dcu-tracker"
dcuTracker
"d
cu
-container-toolkit/internal/dcu-tracker"
"fmt"
"os/user"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
)
...
...
@@ -26,7 +26,7 @@ func (m command) build() *cli.Command {
dcuTrackerDisableCmd
:=
cli
.
Command
{
Name
:
"disable"
,
Usage
:
"Disable the DCU Tracker"
,
UsageText
:
"d
tk
-ctk dcu-tracker disable [options]"
,
UsageText
:
"d
cu
-ctk dcu-tracker disable [options]"
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
validateGenOptions
(
c
)
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
return
performAction
(
c
)
},
}
...
...
cmd/d
tk
-ctk/dcu-tracker/enable/enable.go
→
cmd/d
cu
-ctk/dcu-tracker/enable/enable.go
View file @
48c080c4
package
enable
import
(
dcuTracker
"d
tk
-container-toolkit/internal/dcu-tracker"
dcuTracker
"d
cu
-container-toolkit/internal/dcu-tracker"
"fmt"
"os/user"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
)
...
...
@@ -26,7 +26,7 @@ func (m command) build() *cli.Command {
dcuTrackerEnableCmd
:=
cli
.
Command
{
Name
:
"enable"
,
Usage
:
"Enable the DCU Tracker"
,
UsageText
:
"d
tk
-ctk dcu-tracker enable [options]"
,
UsageText
:
"d
cu
-ctk dcu-tracker enable [options]"
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
validateGenOptions
(
c
)
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
return
performAction
(
c
)
},
}
...
...
cmd/d
tk
-ctk/dcu-tracker/initialize/initialize.go
→
cmd/d
cu
-ctk/dcu-tracker/initialize/initialize.go
View file @
48c080c4
package
initialize
import
(
dcuTracker
"d
tk
-container-toolkit/internal/dcu-tracker"
dcuTracker
"d
cu
-container-toolkit/internal/dcu-tracker"
"fmt"
"os/user"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
)
...
...
@@ -27,7 +27,7 @@ func (m command) build() *cli.Command {
Name
:
"init"
,
Hidden
:
true
,
Usage
:
"Initialize the DCU Tracker"
,
UsageText
:
"d
tk
-ctk dcu-tracker init [options]"
,
UsageText
:
"d
cu
-ctk dcu-tracker init [options]"
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
validateGenOptions
(
c
)
},
Action
:
func
(
c
*
cli
.
Context
)
error
{
return
performAction
(
c
)
},
}
...
...
Prev
1
2
3
4
5
…
7
Next
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