mirror of
https://github.com/clearml/clearml
synced 2025-03-10 05:50:13 +00:00
Support requirements detection using pip freeze (development.detect_with_pip_freeze configuration setting)
This commit is contained in:
parent
d642639890
commit
25fd425bf7
@ -161,6 +161,9 @@ sdk {
|
|||||||
# this value can be overwritten with os environment variable TRAINS_SUPPRESS_UPDATE_MESSAGE=1
|
# this value can be overwritten with os environment variable TRAINS_SUPPRESS_UPDATE_MESSAGE=1
|
||||||
suppress_update_message: false
|
suppress_update_message: false
|
||||||
|
|
||||||
|
# If this flag is true (default is false), instead of analyzing the code with Pigar, analyze with `pip freeze`
|
||||||
|
detect_with_pip_freeze: false
|
||||||
|
|
||||||
# Development mode worker
|
# Development mode worker
|
||||||
worker {
|
worker {
|
||||||
# Status report period in seconds
|
# Status report period in seconds
|
||||||
|
@ -42,6 +42,7 @@ from ...storage.helper import StorageHelper, StorageError
|
|||||||
from .access import AccessMixin
|
from .access import AccessMixin
|
||||||
from .log import TaskHandler
|
from .log import TaskHandler
|
||||||
from .repo import ScriptInfo
|
from .repo import ScriptInfo
|
||||||
|
from .repo.util import get_command_output
|
||||||
from ...config import config, PROC_MASTER_ID_ENV_VAR, SUPPRESS_UPDATE_MESSAGE_ENV_VAR
|
from ...config import config, PROC_MASTER_ID_ENV_VAR, SUPPRESS_UPDATE_MESSAGE_ENV_VAR
|
||||||
|
|
||||||
|
|
||||||
@ -287,8 +288,13 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
if result.script and script_requirements:
|
if result.script and script_requirements:
|
||||||
entry_point_filename = None if config.get('development.force_analyze_entire_repo', False) else \
|
entry_point_filename = None if config.get('development.force_analyze_entire_repo', False) else \
|
||||||
os.path.join(result.script['working_dir'], entry_point)
|
os.path.join(result.script['working_dir'], entry_point)
|
||||||
requirements, conda_requirements = script_requirements.get_requirements(
|
if config.get('development.detect_with_pip_freeze', False):
|
||||||
entry_point_filename=entry_point_filename)
|
conda_requirements = ""
|
||||||
|
requirements = '# Python ' + sys.version.replace('\n', ' ').replace('\r', ' ') + '\n\n'\
|
||||||
|
+ get_command_output([sys.executable, "-m", "pip", "freeze"])
|
||||||
|
else:
|
||||||
|
requirements, conda_requirements = script_requirements.get_requirements(
|
||||||
|
entry_point_filename=entry_point_filename)
|
||||||
|
|
||||||
if requirements:
|
if requirements:
|
||||||
if not result.script['requirements']:
|
if not result.script['requirements']:
|
||||||
|
@ -151,6 +151,9 @@
|
|||||||
# this value can be overwritten with os environment variable TRAINS_SUPPRESS_UPDATE_MESSAGE=1
|
# this value can be overwritten with os environment variable TRAINS_SUPPRESS_UPDATE_MESSAGE=1
|
||||||
suppress_update_message: false
|
suppress_update_message: false
|
||||||
|
|
||||||
|
# If this flag is true (default is false), instead of analyzing the code with Pigar, analyze with `pip freeze`
|
||||||
|
detect_with_pip_freeze: false
|
||||||
|
|
||||||
# Development mode worker
|
# Development mode worker
|
||||||
worker {
|
worker {
|
||||||
# Status report period in seconds
|
# Status report period in seconds
|
||||||
|
Loading…
Reference in New Issue
Block a user