Add UV package manager
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
Noam Wasersprung 2025-03-17 12:36:15 +02:00 committed by GitHub
commit 77721a925b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 35 additions and 4 deletions

View File

@ -27,6 +27,7 @@ but can be overridden by command-line arguments.
|**CLEARML_AGENT_DOCKER_ARGS_HIDE_ENV** | Hide 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`](../configs/clearml_conf.md#hide_docker) | |**CLEARML_AGENT_DOCKER_ARGS_HIDE_ENV** | Hide 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`](../configs/clearml_conf.md#hide_docker) |
|**CLEARML_AGENT_DISABLE_SSH_MOUNT** | Disables the auto `.ssh` mount into the docker | |**CLEARML_AGENT_DISABLE_SSH_MOUNT** | Disables the auto `.ssh` mount into the docker |
|**CLEARML_AGENT_FORCE_CODE_DIR**| Allows 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_CODE_DIR**| Allows 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_UV**| If set to `1`, force the agent to use UV as the package manager. Overrides the default manager set in the [clearml.conf](../configs/clearml_conf.md) under `agent.package_manager.type` |
|**CLEARML_AGENT_FORCE_EXEC_SCRIPT**| Allows 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_EXEC_SCRIPT**| Allows 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_INIT**| If 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_TASK_INIT**| If 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_PACKAGES** | If set to `1`, overrides default [`agent.package_manager.system_site_packages: true`](../configs/clearml_conf.md#system_site_packages) behavior when running tasks in containers (docker mode and k8s-glue)| |**CLEARML_AGENT_FORCE_SYSTEM_SITE_PACKAGES** | If set to `1`, overrides default [`agent.package_manager.system_site_packages: true`](../configs/clearml_conf.md#system_site_packages) behavior when running tasks in containers (docker mode and k8s-glue)|

View File

@ -13,6 +13,7 @@ multiple tasks (see [Virtual Environment Reuse](clearml_agent_env_caching.md#vir
ClearML Agent supports working with one of the following package managers: ClearML Agent supports working with one of the following package managers:
* [`pip`](https://en.wikipedia.org/wiki/Pip_(package_manager)) (default) * [`pip`](https://en.wikipedia.org/wiki/Pip_(package_manager)) (default)
* [`conda`](https://docs.conda.io/en/latest/) * [`conda`](https://docs.conda.io/en/latest/)
* [`uv`](https://docs.astral.sh/uv/)
* [`poetry`](https://python-poetry.org/) * [`poetry`](https://python-poetry.org/)
To change the package manager used by the agent, edit the [`package_manager.type`](../configs/clearml_conf.md#agentpackage_manager) To change the package manager used by the agent, edit the [`package_manager.type`](../configs/clearml_conf.md#agentpackage_manager)

View File

@ -515,8 +515,12 @@ These settings define which Docker image and arguments should be used unless [ex
**`agent.package_manager`** (*dict*) **`agent.package_manager`** (*dict*)
* Dictionary containing the options for the Python package manager. The currently supported package managers are pip, conda, * Dictionary containing the options for the Python package manager.
and, if the repository contains a `poetry.lock` file, poetry. * The currently supported package managers are
* pip
* conda
* uv, if the root repository contains a `uv.lock` or `pyproject.toml` file
* poetry, if the repository contains a `poetry.lock` or `pyproject.toml` file
--- ---
@ -661,12 +665,37 @@ Torch Nightly builds are ephemeral and are deleted from time to time.
* `pip` * `pip`
* `conda` * `conda`
* `poetry` * `poetry`
* `uv`
* If `pip` or `conda` are used, the agent installs the required packages based on the "Python Packages" section of the * If `pip` or `conda` are used, the agent installs the required packages based on the "Python Packages" section of the
Task. If the "Python Packages" section is empty, it will revert to using `requirements.txt` from the repository's root Task. If the "Python Packages" section is empty, it will revert to using `requirements.txt` from the repository's root
directory. If `poetry` is selected, and the root repository contains `poetry.lock` or `pyproject.toml`, the "Python directory.
* If `poetry` is selected, and the root repository contains `poetry.lock` or `pyproject.toml`, the "Python
Packages" section is ignored, and `poetry` is used. If `poetry` is selected and no lock file is found, it reverts to Packages" section is ignored, and `poetry` is used. If `poetry` is selected and no lock file is found, it reverts to
`pip` package manager behaviour. `pip` package manager behaviour.
* If `uv` is selected, and the root repository contains `uv.lock` or `pyproject.toml`, the "Python
Packages" section is ignored, and `uv` is used. If `uv` is selected and no lock file is found, it reverts to
`pip` package manager behaviour.
---
**`agent.package_manager.uv_files_from_repo_working_dir`** (*bool*)
* If set to `true`, the agent will look for the `uv.lock` or `pyproject.toml` file in the provided directory path instead of
the repository's root directory.
---
**`agent.package_manager.uv_sync_extra_args`** (*list*)
* List extra command-line arguments to pass when using `uv`.
---
**`agent.package_manager.uv_version`** (*string*)
* The `uv` version requirements. For example, `">0.4"`, `"==0.4"`, `""` (empty string will install the latest version).
<br/> <br/>