Skip to main content

ClearML 代理环境变量

本页面列出了用于配置ClearML Agent的可用环境变量。

除了下面列出的环境变量外,ClearML 还支持动态环境变量来覆盖 出现在 agent 部分的 clearml.conf 中的任何配置选项。 有关更多信息,请参阅 动态环境变量

info

ClearML的环境变量会覆盖clearml.conf文件、SDK和 配置库, 但可以被命令行参数覆盖。

NameDescription
CLEARML_DOCKER_IMAGESets the default docker image to use when running an agent in Docker mode
CLEARML_WORKER_NAMESets the Worker's name
CLEARML_WORKER_IDSets the Worker ID
CLEARML_CUDA_VERSIONSets the CUDA version to be used
CLEARML_CUDNN_VERSIONSets the CUDNN version to be used
CLEARML_CPU_ONLYForce CPU only mode
CLEARML_DOCKER_SKIP_GPUS_FLAGSkips the GPUs flag (support for docker V18)
CLEARML_AGENT_DOCKER_ARGS_HIDE_ENVHide Docker environment variables containing secrets when printing out the Docker command. When printed, the variable values will be replaced by ********. See agent.hide_docker_command_env_vars
CLEARML_AGENT_DISABLE_SSH_MOUNTDisables the auto .ssh mount into the docker
CLEARML_AGENT_FORCE_CODE_DIRAllows overriding the remote execution code directory to bypass repository cloning and use a repo already available where the remote agent is running.
CLEARML_AGENT_FORCE_EXEC_SCRIPTAllows overriding the remote execution script to bypass repository cloning and execute code already available where the remote agent is running. Use module:file.py format to specify a module and a script to execute (e.g. .:main.py to run main.py from the working dir)
CLEARML_AGENT_FORCE_TASK_INITIf set to 1, ClearML Agent adds Task.init() to scripts that do not have the call, creating a Task to capture code execution information and output, which is then sent to the ClearML Server. If set to 0 and the script does not include Task.init(), the agent will capture only the output streams and console output, without tracking code execution details, metrics, or models.
CLEARML_AGENT_FORCE_SYSTEM_SITE_PACKAGESIf set to 1, overrides default agent.package_manager.system_site_packages: true behavior when running tasks in containers (docker mode and k8s-glue)
CLEARML_AGENT_GIT_CLONE_VERBOSEIf set to 1, git clone calls will report progress verbosely
CLEARML_AGENT_GIT_USERSets the Git user for ClearML Agent
CLEARML_AGENT_GIT_PASSSets the Git password for ClearML Agent
CLEARML_AGENT_GIT_HOSTSets Git host (only sending login to this host)
CLEARML_AGENT_EXEC_USERUser for Agent executing tasks (root by default)
CLEARML_AGENT_EXTRA_DOCKER_ARGSOverrides extra docker args configuration
CLEARML_AGENT_EXTRA_DOCKER_LABELSList of labels to add to docker container. See Docker documentation.
CLEARML_EXTRA_PIP_INSTALL_FLAGSList of additional flags to use when the agent installs packages. For example: CLEARML_EXTRA_PIP_INSTALL_FLAGS=--use-deprecated=legacy-resolver for a single flag or CLEARML_EXTRA_PIP_INSTALL_FLAGS="--use-deprecated=legacy-resolver --no-warn-conflicts" for multiple flags
CLEARML_AGENT_EXTRA_PYTHON_PATHSets extra python path
CLEARML_AGENT_INITIAL_CONNECT_RETRY_OVERRIDEOverrides initial server connection behavior (true by default), allows explicit number to specify number of connect retries)
CLEARML_AGENT_NO_UPDATEBoolean. Set to 1 to skip agent update in the k8s pod container before the agent executes the task
CLEARML_AGENT_K8S_HOST_MOUNT / CLEARML_AGENT_DOCKER_HOST_MOUNTSpecifies Agent's mount point for Docker / K8s
CLEARML_AGENT_TEMP_STDOUT_FILE_DIRAllows overriding the default /tmp location for agent temporary files
CLEARML_K8S_GLUE_START_AGENT_SCRIPT_PATHProvide an alternate path to place the agent startup script generated inside a k8s task pod (instead of the default ~/~/__start_agent__.sh)
CLEARML_AGENT_PACKAGE_PYTORCH_RESOLVESets the PyTorch resolving mode. The options are:
  • none - 不进行解析。像安装其他包一样安装 PyTorch
  • pip (默认) - 根据cuda设置额外的索引并让pip解析
  • direct - 通过解析pytorch.org的pip仓库,并匹配自动检测到的cuda版本与所需的PyTorch wheel,解析出PyTorch wheel的直接链接。如果找不到所需PyTorch wheel的确切cuda版本,它将尝试较低的cuda版本,直到找到匹配项
CLEARML_AGENT_DEBUG_INFOProvide additional debug information for a specific context (currently only the docker value is supported)
CLEARML_AGENT_CHILD_AGENTS_COUNT_CMDProvide an alternate bash command to list child agents while working in services mode
CLEARML_AGENT_SKIP_PIP_VENV_INSTALLInstead of creating a new virtual environment inheriting from the system packages, use an existing virtual environment and install missing packages directly to it. Specify the python binary of the existing virtual environment. For example: CLEARML_AGENT_SKIP_PIP_VENV_INSTALL=/home/venv/bin/python
CLEARML_AGENT_SKIP_PYTHON_ENV_INSTALLIf set to 1, the agent will not install any required python packages and will just use the preexisting python environment to run the task.
CLEARML_AGENT_VENV_CACHE_PATHOverrides venv cache folder configuration
CLEARML_MULTI_NODE_SINGLE_TASKControl how multi-node resource monitoring is reported. The options are:
  • -1 - 仅报告主节点(排名为零)的控制台/资源
  • 1 - 每个节点的图表,即每个节点的机器/GPU图表(控制台输出前缀为RANK)
  • 2 - 在统一的机器资源图下,每个节点的系列,每种资源类型的图,例如CPU/GPU利用率(控制台输出前缀为RANK)