mirror of
https://github.com/Ascend/ascend-docker-runtime.git
synced 2025-11-01 21:32:39 +08:00
Match-id-5a6ca6e3c42a6babbbe9904bca30e78ab84de696
This commit is contained in:
@@ -40,13 +40,13 @@ const (
|
||||
operateLogPath = "/var/log/ascend-docker-runtime/hook-operate.log"
|
||||
ascendRuntimeOptions = "ASCEND_RUNTIME_OPTIONS"
|
||||
ascendRuntimeMounts = "ASCEND_RUNTIME_MOUNTS"
|
||||
ascendVisibleDevices = "ASCEND_VISIBLE_DEVICES"
|
||||
ascendDockerCli = "ascend-docker-cli"
|
||||
defaultAscendDockerCli = "/usr/local/bin/ascend-docker-cli"
|
||||
configDir = "/etc/ascend-docker-runtime.d"
|
||||
baseConfig = "base"
|
||||
configFileSuffix = "list"
|
||||
|
||||
borderNum = 2
|
||||
kvPairSize = 2
|
||||
maxCommandLength = 65535
|
||||
)
|
||||
@@ -327,6 +327,10 @@ func doPrestartHook() error {
|
||||
return fmt.Errorf("failed to get container config: %v", err)
|
||||
}
|
||||
|
||||
if visibleDevices := getValueByKey(containerConfig.Env, ascendVisibleDevices); visibleDevices == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
mountConfigs := parseMounts(getValueByKey(containerConfig.Env, ascendRuntimeMounts))
|
||||
|
||||
fileMountList, dirMountList, err := readConfigsOfDir(configDir, mountConfigs)
|
||||
|
||||
Reference in New Issue
Block a user