Cherry-pick init path change, should fix
@@ -184,36 +184,47 @@ class ResourceManager(BaseResourceManager):
value=json.dumps(self.experiment_labels)),
]
- def get_init_container(self,
- init_command,
- init_args,
- env_vars,
- context_mounts,
- persistence_outputs,
- persistence_data):
- """Pod init container for setting outputs path."""
- env_vars = to_list(env_vars, check_none=True)
+ def get_init_path_args(self, persistence_outputs):
if self.original_name is not None and self.cloning_strategy == CloningStrategy.RESUME:
- return []
- if self.original_name is not None and self.cloning_strategy == CloningStrategy.COPY:
+ command = InitCommands.CREATE
+ outputs_path = stores.get_experiment_outputs_path(
+ persistence=persistence_outputs,
+ experiment_name=self.original_name)
+ original_outputs_path = None
+ elif self.original_name is not None and self.cloning_strategy == CloningStrategy.COPY:
command = InitCommands.COPY
+ outputs_path = stores.get_experiment_outputs_path(
+ persistence=persistence_outputs,
+ experiment_name=self.experiment_name)
original_outputs_path = stores.get_experiment_outputs_path(
persistence=persistence_outputs,
experiment_name=self.original_name)
else:
command = InitCommands.CREATE
- original_outputs_path = None
-
outputs_path = stores.get_experiment_outputs_path(
persistence=persistence_outputs,
experiment_name=self.experiment_name)
+ original_outputs_path = None
+
+ _, outputs_volume_mount = get_pod_outputs_volume(persistence_outputs=persistence_outputs)
+ return get_output_args(command=command,
+ outputs_path=outputs_path,
+ original_outputs_path=original_outputs_path)
+
+ def get_init_container(self,
+ init_command,
+ init_args,
+ env_vars,
+ context_mounts,
+ persistence_outputs,
+ persistence_data):
+ """Pod init container for setting outputs path."""
+ env_vars = to_list(env_vars, check_none=True)
_, outputs_volume_mount = get_pod_outputs_volume(persistence_outputs=persistence_outputs)
volume_mounts = outputs_volume_mount + to_list(context_mounts, check_none=True)
init_command = init_command or ["/bin/sh", "-c"]
- init_args = init_args or to_list(
- get_output_args(command=command,
- outputs_path=outputs_path,
- original_outputs_path=original_outputs_path))
+ init_args = init_args or []
+ init_args += to_list(self.get_init_path_args(persistence_outputs=persistence_outputs))
init_args += to_list(get_auth_context_args(entity='experiment',
entity_name=self.experiment_name))
return [
