mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-26 10:05:58 +00:00
Add warning if venv cache is disabled
This commit is contained in:
parent
37ea381d98
commit
7ff6aee20c
@ -3280,6 +3280,11 @@ class Worker(ServiceCommandSection):
|
|||||||
first_time=first_time,
|
first_time=first_time,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# print message so users know they can enable cache
|
||||||
|
if not self.package_api.is_cached_enabled():
|
||||||
|
print('::: Python virtual environment cache is disabled. '
|
||||||
|
'To accelerate spin-up time set `agent.venvs_cache.path=~/.clearml/venvs-cache` :::\n')
|
||||||
|
|
||||||
# check if we have a cached folder
|
# check if we have a cached folder
|
||||||
if cached_requirements and not skip_pip_venv_install and self.package_api.get_cached_venv(
|
if cached_requirements and not skip_pip_venv_install and self.package_api.get_cached_venv(
|
||||||
requirements=cached_requirements,
|
requirements=cached_requirements,
|
||||||
|
@ -213,6 +213,13 @@ class PackageManager(object):
|
|||||||
return
|
return
|
||||||
return self._get_cache_manager().get_last_copied_entry()
|
return self._get_cache_manager().get_last_copied_entry()
|
||||||
|
|
||||||
|
def is_cached_enabled(self):
|
||||||
|
if not self._cache_manager:
|
||||||
|
cache_folder = ENV_VENV_CACHE_PATH.get() or self.session.config.get(self._config_cache_folder, None)
|
||||||
|
if not cache_folder:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _generate_reqs_hash_keys(cls, requirements_list, docker_cmd, python_version, cuda_version):
|
def _generate_reqs_hash_keys(cls, requirements_list, docker_cmd, python_version, cuda_version):
|
||||||
# type: (Union[Dict, List[Dict]], Optional[Union[dict, str]], Optional[str], Optional[str]) -> List[str]
|
# type: (Union[Dict, List[Dict]], Optional[Union[dict, str]], Optional[str], Optional[str]) -> List[str]
|
||||||
|
Loading…
Reference in New Issue
Block a user