def _run_job(
        self,
        ml_client,
        pipeline_job,
        experiment_name: str,
        tmp_dir: Optional[Union[str, Path]] = None,
        tags: dict = None,
        output_name: str = None,
        download_outputs: bool = True,
    ) -> Path:
        """Run a pipeline job and return the path to named-outputs."""
        # submit job
        logger.debug("Submitting pipeline")
        tags = {**self.tags, **(tags or {})}
        job = retry_func(
            ml_client.jobs.create_or_update,
            [pipeline_job],
            {"experiment_name": experiment_name, "tags": tags},
            max_tries=self.azureml_client_config.max_operation_retries,
            delay=self.azureml_client_config.operation_retry_interval,
            exceptions=(HttpResponseError, JobException),
        )
        logger.info("Pipeline submitted. Job name: %s. Job link: %s", job.name, job.studio_url)
        ml_client.jobs.stream(job.name)

        if download_outputs:
            # get output
            if tmp_dir is None:
                raise ValueError("tmp_dir is required to download pipeline output")
            output_dir = Path(tmp_dir) / "pipeline_output"
            output_dir.mkdir(parents=True, exist_ok=True)
            # whether to download a single output or all outputs
            output_arg = {"download_path": output_dir}
            if output_name:
                output_arg["output_name"] = output_name
            else:
                output_arg["all"] = True
            logger.debug("Downloading pipeline output to %s", output_dir)
            retry_func(
                ml_client.jobs.download,
                [job.name],
                output_arg,
                max_tries=self.azureml_client_config.max_operation_retries,
                delay=self.azureml_client_config.operation_retry_interval,
                exceptions=ServiceResponseError,
            )

            return output_dir / "named-outputs"
        return None
Run a pipeline job and return the path to named-outputs.
olive/systems/azureml/aml_system.py