Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cblmemo committed Sep 18, 2023
1 parent e5e400b commit a4b96c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,13 +1132,16 @@ def _make_task_or_dag_from_entrypoint_with_overrides(
old_resources = list(task.resources)[0]
new_resources = old_resources.copy(**override_params)

# We need to update envs before we set resources, since the envs might
# contains docker login config, which will be used in setting up the
# resources.
task.update_envs(env)
task.set_resources({new_resources})

if num_nodes is not None:
task.num_nodes = num_nodes
if name is not None:
task.name = name
task.update_envs(env)
# TODO(wei-lin): move this validation into Python API.
if new_resources.accelerators is not None:
acc, _ = list(new_resources.accelerators.items())[0]
Expand Down
4 changes: 4 additions & 0 deletions sky/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ def update_envs(
Raises:
ValueError: if various invalid inputs errors are detected.
"""
# NOTE(dev): This should be called before task.set_resources() because
# of the docker login config.
if envs is None:
envs = {}
if isinstance(envs, (list, tuple)):
Expand Down Expand Up @@ -559,6 +561,8 @@ def set_resources(
Returns:
self: The current task, with resources set.
"""
# NOTE(dev): This should be called after task.update_envs() because of
# the docker login config.
if isinstance(resources, sky.Resources):
resources = {resources}
# TODO(woosuk): Check if the resources are None.
Expand Down

0 comments on commit a4b96c1

Please sign in to comment.