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
"vscode:/vscode.git/clone" did not exist on "24c0a147d8b92124e75a1463812c267ef9042f9e"
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
83 additions
and
82 deletions
+83
-82
cmd/dcu-ctk/dcu-tracker/release/release.go
cmd/dcu-ctk/dcu-tracker/release/release.go
+4
-4
cmd/dcu-ctk/dcu-tracker/reset/reset.go
cmd/dcu-ctk/dcu-tracker/reset/reset.go
+3
-3
cmd/dcu-ctk/dcu-tracker/status/status.go
cmd/dcu-ctk/dcu-tracker/status/status.go
+3
-3
cmd/dcu-ctk/hook/hook.go
cmd/dcu-ctk/hook/hook.go
+2
-2
cmd/dcu-ctk/main.go
cmd/dcu-ctk/main.go
+7
-7
cmd/dcu-ctk/rootless/main.go
cmd/dcu-ctk/rootless/main.go
+3
-3
cmd/dcu-ctk/runtime/configure/configure.go
cmd/dcu-ctk/runtime/configure/configure.go
+8
-8
cmd/dcu-ctk/runtime/runtime.go
cmd/dcu-ctk/runtime/runtime.go
+2
-2
cmd/dcu-docker/main.go
cmd/dcu-docker/main.go
+0
-0
config.toml
config.toml
+9
-9
dist/rocky8/x86_64/dcu-container-toolkit-1.2.3-1.x86_64.rpm
dist/rocky8/x86_64/dcu-container-toolkit-1.2.3-1.x86_64.rpm
+0
-0
docker/Dockerfile.debian
docker/Dockerfile.debian
+3
-3
docker/Dockerfile.kylin
docker/Dockerfile.kylin
+4
-4
docker/Dockerfile.opensuse-leap
docker/Dockerfile.opensuse-leap
+4
-4
docker/Dockerfile.rocky
docker/Dockerfile.rocky
+6
-5
docker/Dockerfile.rpm-yum
docker/Dockerfile.rpm-yum
+4
-4
docker/Dockerfile.ubuntu
docker/Dockerfile.ubuntu
+4
-4
go.mod
go.mod
+1
-1
internal/config/config.go
internal/config/config.go
+15
-15
internal/config/image/devices.go
internal/config/image/devices.go
+1
-1
No files found.
cmd/d
tk
-ctk/dcu-tracker/release/release.go
→
cmd/d
cu
-ctk/dcu-tracker/release/release.go
View file @
48c080c4
package
release
package
release
import
(
import
(
dcuTracker
"d
tk
-container-toolkit/internal/dcu-tracker"
dcuTracker
"d
cu
-container-toolkit/internal/dcu-tracker"
"fmt"
"fmt"
"os/user"
"os/user"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
@@ -27,13 +27,13 @@ func (m command) build() *cli.Command {
...
@@ -27,13 +27,13 @@ func (m command) build() *cli.Command {
Name
:
"release"
,
Name
:
"release"
,
Hidden
:
true
,
Hidden
:
true
,
Usage
:
"Release DCUs used by a container"
,
Usage
:
"Release DCUs used by a container"
,
UsageText
:
`d
tk
-ctk dcu-tracker release [container_id]
UsageText
:
`d
cu
-ctk dcu-tracker release [container_id]
Arguments:
Arguments:
container_id container ID of the container
container_id container ID of the container
Examples:
Examples:
d
tk
-ctk dcu-tracker release a4e19862b4e2a1b04a1f793f346d0411f4a0a3857578c526a25ac6c858168fd8`
,
d
cu
-ctk dcu-tracker release a4e19862b4e2a1b04a1f793f346d0411f4a0a3857578c526a25ac6c858168fd8`
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
validateGenOptions
(
c
)
return
validateGenOptions
(
c
)
},
},
...
...
cmd/d
tk
-ctk/dcu-tracker/reset/reset.go
→
cmd/d
cu
-ctk/dcu-tracker/reset/reset.go
View file @
48c080c4
package
reset
package
reset
import
(
import
(
dcuTracker
"d
tk
-container-toolkit/internal/dcu-tracker"
dcuTracker
"d
cu
-container-toolkit/internal/dcu-tracker"
"fmt"
"fmt"
"os/user"
"os/user"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
@@ -25,7 +25,7 @@ func (m command) build() *cli.Command {
...
@@ -25,7 +25,7 @@ func (m command) build() *cli.Command {
dcuTrackerResetCmd
:=
cli
.
Command
{
dcuTrackerResetCmd
:=
cli
.
Command
{
Name
:
"reset"
,
Name
:
"reset"
,
Usage
:
"Reset the DCU Tracker"
,
Usage
:
"Reset the DCU Tracker"
,
UsageText
:
"d
tk
-ctk dcu-tracker reset [options]"
,
UsageText
:
"d
cu
-ctk dcu-tracker reset [options]"
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
validateGenOptions
(
c
)
return
validateGenOptions
(
c
)
},
},
...
...
cmd/d
tk
-ctk/dcu-tracker/status/status.go
→
cmd/d
cu
-ctk/dcu-tracker/status/status.go
View file @
48c080c4
package
status
package
status
import
(
import
(
dcuTracker
"d
tk
-container-toolkit/internal/dcu-tracker"
dcuTracker
"d
cu
-container-toolkit/internal/dcu-tracker"
"fmt"
"fmt"
"os/user"
"os/user"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
@@ -24,7 +24,7 @@ func (c *command) build() *cli.Command {
...
@@ -24,7 +24,7 @@ func (c *command) build() *cli.Command {
dcuTrackerStatusCmd
:=
cli
.
Command
{
dcuTrackerStatusCmd
:=
cli
.
Command
{
Name
:
"status"
,
Name
:
"status"
,
Usage
:
"Show Status of DCUs"
,
Usage
:
"Show Status of DCUs"
,
UsageText
:
"d
tk
-ctk dcu-tracker status [options]"
,
UsageText
:
"d
cu
-ctk dcu-tracker status [options]"
,
Before
:
func
(
c
*
cli
.
Context
)
error
{
Before
:
func
(
c
*
cli
.
Context
)
error
{
return
validateGenOptions
(
c
)
return
validateGenOptions
(
c
)
},
},
...
...
cmd/d
tk
-ctk/hook/hook.go
→
cmd/d
cu
-ctk/hook/hook.go
View file @
48c080c4
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
package
hook
package
hook
import
(
import
(
"d
tk
-container-toolkit/cmd/d
tk
-cdi-hook/commands"
"d
cu
-container-toolkit/cmd/d
cu
-cdi-hook/commands"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
...
cmd/d
tk
-ctk/main.go
→
cmd/d
cu
-ctk/main.go
View file @
48c080c4
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
package
main
package
main
import
(
import
(
"d
tk
-container-toolkit/cmd/d
tk
-ctk/cdi"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/cdi"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/config"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/config"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/dcu-tracker"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/dcu-tracker"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/hook"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/hook"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/runtime"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/runtime"
"d
tk
-container-toolkit/cmd/d
tk
-ctk/rootless"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/rootless"
"d
tk
-container-toolkit/internal/info"
"d
cu
-container-toolkit/internal/info"
"os"
"os"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
...
...
cmd/d
tk
-ctk/rootless/main.go
→
cmd/d
cu
-ctk/rootless/main.go
View file @
48c080c4
package
rootless
package
rootless
import
(
import
(
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"fmt"
"fmt"
"os"
"os"
"os/exec"
"os/exec"
...
@@ -76,10 +76,10 @@ func run(c *cli.Context, opts *options) error {
...
@@ -76,10 +76,10 @@ func run(c *cli.Context, opts *options) error {
os
.
Remove
(
"/usr/bin/"
+
runtime
)
os
.
Remove
(
"/usr/bin/"
+
runtime
)
}
}
cmd
:=
exec
.
Command
(
"cp"
,
"/usr/bin/d
tk
-docker"
,
"/usr/bin/"
+
runtime
)
cmd
:=
exec
.
Command
(
"cp"
,
"/usr/bin/d
cu
-docker"
,
"/usr/bin/"
+
runtime
)
err
=
cmd
.
Run
()
err
=
cmd
.
Run
()
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to copy d
tk
-docker to /usr/bin/%s: %w"
,
runtime
,
err
)
return
fmt
.
Errorf
(
"failed to copy d
cu
-docker to /usr/bin/%s: %w"
,
runtime
,
err
)
}
}
return
nil
return
nil
}
}
...
...
cmd/d
tk
-ctk/runtime/configure/configure.go
→
cmd/d
cu
-ctk/runtime/configure/configure.go
View file @
48c080c4
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
package
configure
package
configure
import
(
import
(
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"d
tk
-container-toolkit/pkg/config/engine"
"d
cu
-container-toolkit/pkg/config/engine"
"d
tk
-container-toolkit/pkg/config/engine/containerd"
"d
cu
-container-toolkit/pkg/config/engine/containerd"
"d
tk
-container-toolkit/pkg/config/engine/crio"
"d
cu
-container-toolkit/pkg/config/engine/crio"
"d
tk
-container-toolkit/pkg/config/engine/docker"
"d
cu
-container-toolkit/pkg/config/engine/docker"
"d
tk
-container-toolkit/pkg/config/engine/podman"
"d
cu
-container-toolkit/pkg/config/engine/podman"
"encoding/json"
"encoding/json"
"fmt"
"fmt"
"path/filepath"
"path/filepath"
...
@@ -25,8 +25,8 @@ const (
...
@@ -25,8 +25,8 @@ const (
defaultDTKRuntimeName
=
"dtk"
defaultDTKRuntimeName
=
"dtk"
// defaultDTKRuntimeExecutable is the default DTK Container Runtime executable file name
// defaultDTKRuntimeExecutable is the default DTK Container Runtime executable file name
defaultDTKRuntimeExecutable
=
"d
tk
-container-runtime"
defaultDTKRuntimeExecutable
=
"d
cu
-container-runtime"
defaultDTKRuntimeExpecutablePath
=
"/usr/bin/d
tk
-container-runtime"
defaultDTKRuntimeExpecutablePath
=
"/usr/bin/d
cu
-container-runtime"
defaultPodmanConfigFilePath
=
"/usr/share/containers/containers.conf"
defaultPodmanConfigFilePath
=
"/usr/share/containers/containers.conf"
defaultContainerdConfigFilePath
=
"/etc/containerd/config.toml"
defaultContainerdConfigFilePath
=
"/etc/containerd/config.toml"
...
...
cmd/d
tk
-ctk/runtime/runtime.go
→
cmd/d
cu
-ctk/runtime/runtime.go
View file @
48c080c4
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
package
runtime
package
runtime
import
(
import
(
"d
tk
-container-toolkit/cmd/d
tk
-ctk/runtime/configure"
"d
cu
-container-toolkit/cmd/d
cu
-ctk/runtime/configure"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
...
cmd/d
tk
-docker/main.go
→
cmd/d
cu
-docker/main.go
View file @
48c080c4
File moved
config.toml
View file @
48c080c4
...
@@ -4,28 +4,28 @@ disable-require = false
...
@@ -4,28 +4,28 @@ disable-require = false
#swarm-resource = "DOCKER_RESOURCE_HCU"
#swarm-resource = "DOCKER_RESOURCE_HCU"
[dtk-container-cli]
[dtk-container-cli]
#debug = "/var/log/d
tk
-container-toolkit.log"
#debug = "/var/log/d
cu
-container-toolkit.log"
#ldcache = "/etc/ld.so.cache"
#ldcache = "/etc/ld.so.cache"
#no-cgroups = false
#no-cgroups = false
#path = "/usr/bin/dtk-container-cli"
#path = "/usr/bin/dtk-container-cli"
#root = "/run/dtk/driver"
#root = "/run/dtk/driver"
#user = "root:video"
#user = "root:video"
[d
tk
-container-runtime]
[d
cu
-container-runtime]
#debug = "/var/log/d
tk
-container-runtime.log"
#debug = "/var/log/d
cu
-container-runtime.log"
log-level
=
"info"
log-level
=
"info"
mode
=
"auto"
mode
=
"auto"
runtimes
=
[
"docker-runc"
,
"runc"
,
"crun"
]
runtimes
=
[
"docker-runc"
,
"runc"
,
"crun"
]
[d
tk
-container-runtime.modes]
[d
cu
-container-runtime.modes]
[d
tk
-container-runtime.modes.cdi]
[d
cu
-container-runtime.modes.cdi]
annotation-prefixes
=
["cdi.k8s.io/"]
annotation-prefixes
=
["cdi.k8s.io/"]
default-kind
=
"dcuopt.com/hcu"
default-kind
=
"dcuopt.com/hcu"
spec-dirs
=
[
"/etc/cdi"
,
"/var/run/cdi"
]
spec-dirs
=
[
"/etc/cdi"
,
"/var/run/cdi"
]
[d
tk
-container-runtime.modes.csv]
[d
cu
-container-runtime.modes.csv]
mount-spec-path
=
"/etc/d
tk
-container-runtime/host-files-for-container.d"
mount-spec-path
=
"/etc/d
cu
-container-runtime/host-files-for-container.d"
[d
tk
-ctk]
[d
cu
-ctk]
path
=
"d
tk
-ctk"
path
=
"d
cu
-ctk"
dist/rocky8/x86_64/dcu-container-toolkit-1.2.3-1.x86_64.rpm
0 → 100644
View file @
48c080c4
File added
docker/Dockerfile.debian
View file @
48c080c4
...
@@ -43,11 +43,11 @@ ENV REVISION "$PKG_VERS-$PKG_REV"
...
@@ -43,11 +43,11 @@ ENV REVISION "$PKG_VERS-$PKG_REV"
ENV SECTION ""
ENV SECTION ""
# output directory
# output directory
ENV DIST_DIR=/tmp/d
tk
-container-toolkit-$PKG_VERS
ENV DIST_DIR=/tmp/d
cu
-container-toolkit-$PKG_VERS
RUN mkdir -p $DIST_DIR /dist
RUN mkdir -p $DIST_DIR /dist
# d
tk
-container-toolkit
# d
cu
-container-toolkit
WORKDIR $GOPATH/src/d
tk
-container-toolkit
WORKDIR $GOPATH/src/d
cu
-container-toolkit
COPY . .
COPY . .
ARG GIT_COMMIT
ARG GIT_COMMIT
...
...
docker/Dockerfile.kylin
View file @
48c080c4
...
@@ -46,11 +46,11 @@ ENV PKG_VERS ${PKG_VERS}
...
@@ -46,11 +46,11 @@ ENV PKG_VERS ${PKG_VERS}
ENV PKG_REV ${PKG_REV}
ENV PKG_REV ${PKG_REV}
# output directory
# output directory
ENV DIST_DIR=/tmp/d
tk
-container-toolkit-$PKG_VERS/SOURCES
ENV DIST_DIR=/tmp/d
cu
-container-toolkit-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR /dist
RUN mkdir -p $DIST_DIR /dist
# d
tk
-container-toolkit
# d
cu
-container-toolkit
WORKDIR $GOPATH/src/d
tk
-container-toolkit
WORKDIR $GOPATH/src/d
cu
-container-toolkit
COPY . .
COPY . .
ARG GIT_COMMIT
ARG GIT_COMMIT
...
@@ -67,5 +67,5 @@ CMD arch=$(uname -m) && \
...
@@ -67,5 +67,5 @@ CMD arch=$(uname -m) && \
-D "git_commit ${GIT_COMMIT}" \
-D "git_commit ${GIT_COMMIT}" \
-D "version ${PKG_VERS}" \
-D "version ${PKG_VERS}" \
-D "release ${PKG_REV}" \
-D "release ${PKG_REV}" \
SPECS/d
tk
-container-toolkit.spec && \
SPECS/d
cu
-container-toolkit.spec && \
mv RPMS/$arch/*.rpm /dist
mv RPMS/$arch/*.rpm /dist
docker/Dockerfile.opensuse-leap
View file @
48c080c4
...
@@ -35,11 +35,11 @@ ENV PKG_VERS ${PKG_VERS}
...
@@ -35,11 +35,11 @@ ENV PKG_VERS ${PKG_VERS}
ENV PKG_REV ${PKG_REV}
ENV PKG_REV ${PKG_REV}
# output directory
# output directory
ENV DIST_DIR=/tmp/d
tk
-container-toolkit-$PKG_VERS/SOURCES
ENV DIST_DIR=/tmp/d
cu
-container-toolkit-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR /dist
RUN mkdir -p $DIST_DIR /dist
# d
tk
-container-toolkit
# d
cu
-container-toolkit
WORKDIR $GOPATH/src/d
tk
-container-toolkit
WORKDIR $GOPATH/src/d
cu
-container-toolkit
COPY . .
COPY . .
ARG GIT_COMMIT
ARG GIT_COMMIT
...
@@ -56,5 +56,5 @@ CMD arch=$(uname -m) && \
...
@@ -56,5 +56,5 @@ CMD arch=$(uname -m) && \
-D "git_commit ${GIT_COMMIT}" \
-D "git_commit ${GIT_COMMIT}" \
-D "version ${PKG_VERS}" \
-D "version ${PKG_VERS}" \
-D "release ${PKG_REV}" \
-D "release ${PKG_REV}" \
SPECS/d
tk
-container-toolkit.spec && \
SPECS/d
cu
-container-toolkit.spec && \
mv RPMS/$arch/*.rpm /dist
mv RPMS/$arch/*.rpm /dist
docker/Dockerfile.rocky
View file @
48c080c4
...
@@ -46,15 +46,16 @@ ENV PKG_VERS ${PKG_VERS}
...
@@ -46,15 +46,16 @@ ENV PKG_VERS ${PKG_VERS}
ENV PKG_REV ${PKG_REV}
ENV PKG_REV ${PKG_REV}
# output directory
# output directory
ENV DIST_DIR=/tmp/d
tk
-container-toolkit-$PKG_VERS/SOURCES
ENV DIST_DIR=/tmp/d
cu
-container-toolkit-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR /dist
RUN mkdir -p $DIST_DIR /dist
# d
tk
-container-toolkit
# d
cu
-container-toolkit
WORKDIR $GOPATH/src/d
tk
-container-toolkit
WORKDIR $GOPATH/src/d
cu
-container-toolkit
COPY . .
COPY . .
ENV GOPROXY=https://goproxy.cn,direct
ARG GIT_COMMIT
ARG GIT_COMMIT
ENV GIT_COMMIT ${GIT_COMMIT}
ENV GIT_COMMIT ${GIT_COMMIT}
RUN make PREFIX=${DIST_DIR} cmds
RUN make PREFIX=${DIST_DIR} cmds
WORKDIR $DIST_DIR/..
WORKDIR $DIST_DIR/..
...
@@ -67,5 +68,5 @@ CMD arch=$(uname -m) && \
...
@@ -67,5 +68,5 @@ CMD arch=$(uname -m) && \
-D "git_commit ${GIT_COMMIT}" \
-D "git_commit ${GIT_COMMIT}" \
-D "version ${PKG_VERS}" \
-D "version ${PKG_VERS}" \
-D "release ${PKG_REV}" \
-D "release ${PKG_REV}" \
SPECS/d
tk
-container-toolkit.spec && \
SPECS/d
cu
-container-toolkit.spec && \
mv RPMS/$arch/*.rpm /dist
mv RPMS/$arch/*.rpm /dist
docker/Dockerfile.rpm-yum
View file @
48c080c4
...
@@ -56,11 +56,11 @@ ENV PKG_VERS ${PKG_VERS}
...
@@ -56,11 +56,11 @@ ENV PKG_VERS ${PKG_VERS}
ENV PKG_REV ${PKG_REV}
ENV PKG_REV ${PKG_REV}
# output directory
# output directory
ENV DIST_DIR=/tmp/d
tk
-container-toolkit-$PKG_VERS/SOURCES
ENV DIST_DIR=/tmp/d
cu
-container-toolkit-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR /dist
RUN mkdir -p $DIST_DIR /dist
# d
tk
-container-toolkit
# d
cu
-container-toolkit
WORKDIR $GOPATH/src/d
tk
-container-toolkit
WORKDIR $GOPATH/src/d
cu
-container-toolkit
COPY . .
COPY . .
ARG GIT_COMMIT
ARG GIT_COMMIT
...
@@ -77,5 +77,5 @@ CMD arch=$(uname -m) && \
...
@@ -77,5 +77,5 @@ CMD arch=$(uname -m) && \
-D "git_commit ${GIT_COMMIT}" \
-D "git_commit ${GIT_COMMIT}" \
-D "version ${PKG_VERS}" \
-D "version ${PKG_VERS}" \
-D "release ${PKG_REV}" \
-D "release ${PKG_REV}" \
SPECS/d
tk
-container-toolkit.spec && \
SPECS/d
cu
-container-toolkit.spec && \
mv RPMS/$arch/*.rpm /dist
mv RPMS/$arch/*.rpm /dist
docker/Dockerfile.ubuntu
View file @
48c080c4
...
@@ -48,11 +48,11 @@ ENV REVISION "$PKG_VERS-$PKG_REV"
...
@@ -48,11 +48,11 @@ ENV REVISION "$PKG_VERS-$PKG_REV"
ENV SECTION ""
ENV SECTION ""
# output directory
# output directory
ENV DIST_DIR=/tmp/d
tk
-container-toolkit-$PKG_VERS
ENV DIST_DIR=/tmp/d
cu
-container-toolkit-$PKG_VERS
RUN mkdir -p $DIST_DIR /dist
RUN mkdir -p $DIST_DIR /dist
# d
tk
-container-toolkit
# d
cu
-container-toolkit
WORKDIR $GOPATH/src/d
tk
-container-toolkit
WORKDIR $GOPATH/src/d
cu
-container-toolkit
COPY . .
COPY . .
ARG GIT_COMMIT
ARG GIT_COMMIT
...
@@ -64,7 +64,7 @@ COPY packaging/debian ./debian
...
@@ -64,7 +64,7 @@ COPY packaging/debian ./debian
RUN dch --create --package="${PKG_NAME}" \
RUN dch --create --package="${PKG_NAME}" \
--newversion "${REVISION}" \
--newversion "${REVISION}" \
"See ${GOPATH}/src/d
tk
-container-toolkit/CHANGELOG.md for the changelog" && \
"See ${GOPATH}/src/d
cu
-container-toolkit/CHANGELOG.md for the changelog" && \
dch -r "" && \
dch -r "" && \
if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then exit 1; fi
if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then exit 1; fi
...
...
go.mod
View file @
48c080c4
module d
tk
-container-toolkit
module d
cu
-container-toolkit
go 1.24.0
go 1.24.0
...
...
internal/config/config.go
View file @
48c080c4
...
@@ -6,8 +6,8 @@ package config
...
@@ -6,8 +6,8 @@ package config
import
(
import
(
"bufio"
"bufio"
"d
tk
-container-toolkit/internal/logger"
"d
cu
-container-toolkit/internal/logger"
"d
tk
-container-toolkit/internal/lookup"
"d
cu
-container-toolkit/internal/lookup"
"os"
"os"
"path/filepath"
"path/filepath"
"strings"
"strings"
...
@@ -17,14 +17,14 @@ import (
...
@@ -17,14 +17,14 @@ import (
const
(
const
(
configOverride
=
"XDG_CONFIG_HOME"
configOverride
=
"XDG_CONFIG_HOME"
configFilePath
=
"d
tk
-container-runtime/config.toml"
configFilePath
=
"d
cu
-container-runtime/config.toml"
dtkCTKExecutable
=
"d
tk
-ctk"
dtkCTKExecutable
=
"d
cu
-ctk"
dtkCTKDefaultFilePath
=
"/usr/bin/d
tk
-ctk"
dtkCTKDefaultFilePath
=
"/usr/bin/d
cu
-ctk"
dtkCDIHookDefaultFilePath
=
"/usr/bin/d
tk
-cdi-hook"
dtkCDIHookDefaultFilePath
=
"/usr/bin/d
cu
-cdi-hook"
// dtkContainerRuntimeHookExecutable = "d
tk
-container-runtime-hook"
// dtkContainerRuntimeHookExecutable = "d
cu
-container-runtime-hook"
// dtkContainerRuntimeHookDefaultPath = "/usr/bin/d
tk
-container-runtime-hook"
// dtkContainerRuntimeHookDefaultPath = "/usr/bin/d
cu
-container-runtime-hook"
)
)
var
(
var
(
...
@@ -32,9 +32,9 @@ var (
...
@@ -32,9 +32,9 @@ var (
DefaultExecutableDir
=
"/usr/bin"
DefaultExecutableDir
=
"/usr/bin"
// DTKContainerRuntimeHookExecutable is the executable name for the DTK Container Runtime Hook
// DTKContainerRuntimeHookExecutable is the executable name for the DTK Container Runtime Hook
DTKContainerRuntimeHookExecutable
=
"d
tk
-container-runtime-hook"
DTKContainerRuntimeHookExecutable
=
"d
cu
-container-runtime-hook"
// DTKContainerToolkitExecutable is the executable name for the DTK Container Toolkit (an alias for the DTK Container Runtime Hook)
// DTKContainerToolkitExecutable is the executable name for the DTK Container Toolkit (an alias for the DTK Container Runtime Hook)
DTKContainerToolkitExecutable
=
"d
tk
-container-toolkit"
DTKContainerToolkitExecutable
=
"d
cu
-container-toolkit"
)
)
// Config represents the contents of the config.toml file for the DTK Container Toolkit
// Config represents the contents of the config.toml file for the DTK Container Toolkit
...
@@ -45,8 +45,8 @@ type Config struct {
...
@@ -45,8 +45,8 @@ type Config struct {
AcceptDeviceListAsVolumeMounts
bool
`toml:"accept-dtk-visible-devices-as-volume-mounts"`
AcceptDeviceListAsVolumeMounts
bool
`toml:"accept-dtk-visible-devices-as-volume-mounts"`
// SupportedDriverCapabilities string `toml:"supported-driver-capabilities"`
// SupportedDriverCapabilities string `toml:"supported-driver-capabilities"`
DTKCTKConfig
CTKConfig
`toml:"d
tk
-ctk"`
DTKCTKConfig
CTKConfig
`toml:"d
cu
-ctk"`
DTKContainerRuntimeConfig
RuntimeConfig
`toml:"d
tk
-container-runtime"`
DTKContainerRuntimeConfig
RuntimeConfig
`toml:"d
cu
-container-runtime"`
}
}
// GetConfigFilePath returns the path to the config file for the configured system
// GetConfigFilePath returns the path to the config file for the configured system
...
@@ -85,7 +85,7 @@ func GetDefault() (*Config, error) {
...
@@ -85,7 +85,7 @@ func GetDefault() (*Config, error) {
Mode
:
"auto"
,
Mode
:
"auto"
,
Modes
:
modesConfig
{
Modes
:
modesConfig
{
CSV
:
csvModeConfig
{
CSV
:
csvModeConfig
{
MountSpecPath
:
"/etc/d
tk
-container-runtime/host-files-for-container.d"
,
MountSpecPath
:
"/etc/d
cu
-container-runtime/host-files-for-container.d"
,
},
},
CDI
:
cdiModeConfig
{
CDI
:
cdiModeConfig
{
DefaultKind
:
"c-3000.com/hcu"
,
DefaultKind
:
"c-3000.com/hcu"
,
...
@@ -141,12 +141,12 @@ var getDistIDLike = func() []string {
...
@@ -141,12 +141,12 @@ var getDistIDLike = func() []string {
return
nil
return
nil
}
}
// ResolveDTKCDIHookPath resolves the path to the d
tk
-cdi-hook binary.
// ResolveDTKCDIHookPath resolves the path to the d
cu
-cdi-hook binary.
// This executable is used in hooks and needs to be an absolute path.
// This executable is used in hooks and needs to be an absolute path.
// If the path is specified as an absolute path, it is used directly
// If the path is specified as an absolute path, it is used directly
// without checking for existence of an executable at that path.
// without checking for existence of an executable at that path.
func
ResolveDTKCDIHookPath
(
logger
logger
.
Interface
,
dtkCDIHookPath
string
)
string
{
func
ResolveDTKCDIHookPath
(
logger
logger
.
Interface
,
dtkCDIHookPath
string
)
string
{
if
filepath
.
Base
(
dtkCDIHookPath
)
==
"d
tk
-ctk"
{
if
filepath
.
Base
(
dtkCDIHookPath
)
==
"d
cu
-ctk"
{
return
resolveWithDefault
(
return
resolveWithDefault
(
logger
,
logger
,
"DTK Container Toolkit CLI"
,
"DTK Container Toolkit CLI"
,
...
...
internal/config/image/devices.go
View file @
48c080c4
...
@@ -7,7 +7,7 @@ package image
...
@@ -7,7 +7,7 @@ package image
import
"strings"
import
"strings"
// VisibleDevices represents the devices selected in a container image
// VisibleDevices represents the devices selected in a container image
// through the D
TK
_VISIBLE_DEVICES or other environment variables
// through the D
CU
_VISIBLE_DEVICES or other environment variables
type
VisibleDevices
interface
{
type
VisibleDevices
interface
{
List
()
[]
string
List
()
[]
string
Has
(
string
)
bool
Has
(
string
)
bool
...
...
Prev
1
2
3
4
5
6
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