Commit 48c080c4 authored by songlinfeng's avatar songlinfeng
Browse files

rename dcu-ctk dcu-container-toolkit

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