Skip to content

Commit

Permalink
do not remove worker instructions when using flags -g or -i
Browse files Browse the repository at this point in the history
  • Loading branch information
phueb committed Dec 3, 2021
1 parent 7225df9 commit de426de
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ludwig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


__version__ = '4.0.5'
__version__ = '4.0.6'


def print_ludwig(s):
Expand Down
46 changes: 24 additions & 22 deletions ludwig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,28 +198,30 @@ def submit():

# ---------------------------------------------

# are additional source code files required? (do this before killing active jobs)
# these can be Python packages, which will be importable, or contain data.
# extra_paths is only allowed to be non-empty if not --local
for extra_path in namespace.extra_paths:
p = Path(extra_path)
if not p.is_dir():
raise NotADirectoryError('{} is not a directory'.format(p))
src = str(extra_path)
dst = str(project_path / p.name)
print_ludwig(f'Copying {src} to {dst}')
copy_tree(src, dst)

# delete job instructions for worker saved on server (do this before uploader.to_disk() )
for pkl_path in project_path.glob(f'*.pkl'):
pkl_path.unlink()

if namespace.group is None:
random.shuffle(configs.Remote.online_worker_names)
workers_cycle = cycle(configs.Remote.online_worker_names)
else:
workers_cycle = cycle(configs.Remote.group2workers[namespace.group])
print(f'Using workers in group={namespace.group}')
if not namespace.isolated and not namespace.local:

# are additional source code files required? (do this before killing active jobs)
# these can be Python packages, which will be importable, or contain data.
# extra_paths is only allowed to be non-empty if not --local
for extra_path in namespace.extra_paths:
p = Path(extra_path)
if not p.is_dir():
raise NotADirectoryError('{} is not a directory'.format(p))
src = str(extra_path)
dst = str(project_path / p.name)
print_ludwig(f'Copying {src} to {dst}')
copy_tree(src, dst)

# delete job instructions for worker saved on server (do this before uploader.to_disk() )
for pkl_path in project_path.glob(f'*.pkl'):
pkl_path.unlink()

if namespace.group is None:
random.shuffle(configs.Remote.online_worker_names)
workers_cycle = cycle(configs.Remote.online_worker_names)
else:
workers_cycle = cycle(configs.Remote.group2workers[namespace.group])
print(f'Using workers in group={namespace.group}')

# ---------------------------------------------------

Expand Down

0 comments on commit de426de

Please sign in to comment.