Skip to content

Commit ea73eca

Browse files
committed
Update dsc_job_runtime.py to fix error when extracting runtime.
1 parent 5fe617c commit ea73eca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ads/jobs/builders/infrastructure/dsc_job_runtime.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,13 @@ def _extract_envs(self, dsc_job) -> dict:
680680
"""
681681
spec = super()._extract_envs(dsc_job)
682682
envs = spec.pop(PythonRuntime.CONST_ENV_VAR, {})
683-
if self.__class__ == PythonRuntimeHandler and self.CONST_CODE_ENTRYPOINT not in envs:
683+
if (
684+
self.__class__ == PythonRuntimeHandler
685+
and self.CONST_CODE_ENTRYPOINT not in envs
686+
):
684687
raise IncompatibleRuntime()
685-
envs.pop(PythonRuntimeHandler.CONST_JOB_ENTRYPOINT)
688+
# PyTorchDistributedRuntime does not require entrypoint.
689+
envs.pop(PythonRuntimeHandler.CONST_JOB_ENTRYPOINT, None)
686690
spec.update(self._extract_specs(envs, self.SPEC_MAPPINGS))
687691
if PythonRuntime.CONST_PYTHON_PATH in spec:
688692
spec[PythonRuntime.CONST_PYTHON_PATH] = spec[

0 commit comments

Comments
 (0)