mirror of
https://github.com/clearml/clearml
synced 2025-02-02 01:54:23 +00:00
Add --import-offline-session
command line option to clearml-task
This commit is contained in:
parent
d25b0868b3
commit
0c0739379b
@ -70,6 +70,12 @@ def setup_parser(parser):
|
||||
parser.add_argument('--base-task-id', type=str, default=None,
|
||||
help='Use a pre-existing task in the system, instead of a local repo/script. '
|
||||
'Essentially clones an existing task and overrides arguments/requirements.')
|
||||
parser.add_argument(
|
||||
"--import-offline-session",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Specify the path to the offline session you want to import.",
|
||||
)
|
||||
|
||||
|
||||
def cli():
|
||||
@ -89,7 +95,7 @@ def cli():
|
||||
print('Version {}'.format(__version__))
|
||||
exit(0)
|
||||
|
||||
if not args.name:
|
||||
if not args.name and not args.import_offline_session:
|
||||
raise ValueError("Task name must be provided, use `--name <task-name>`")
|
||||
|
||||
if args.docker_bash_setup_script and Path(args.docker_bash_setup_script).is_file():
|
||||
@ -101,6 +107,10 @@ def cli():
|
||||
else:
|
||||
bash_setup_script = args.docker_bash_setup_script or None
|
||||
|
||||
if args.import_offline_session:
|
||||
print("Importing offline session: {}".format(args.import_offline_session))
|
||||
Task.import_offline_session(args.import_offline_session)
|
||||
else:
|
||||
create_populate = CreateAndPopulate(
|
||||
project_name=args.project,
|
||||
task_name=args.name,
|
||||
@ -123,7 +133,6 @@ def cli():
|
||||
)
|
||||
# verify args before creating the Task
|
||||
create_populate.update_task_args(args.args)
|
||||
|
||||
print('Creating new task')
|
||||
create_populate.create_task()
|
||||
# update Task args
|
||||
|
Loading…
Reference in New Issue
Block a user