Replace the dotenv package with python-dotenv package in the requirements.txt for the promptflow
Promptflow deployment failing in Azure AI Studio
I'm using Azure AI Studio for deployment of prompt flows. Deployment of smaller prompt flows(3 nodes, only 1 LLM tool node) are successfully deployed with an endpoint, however when I try to deploy bigger prompt flows(>5nodes, containing building index, skillset and indexer in Azure AI search and generating completion using LLM api call ) in prompt flow, deployment and endpoint creation ends up failing, I have tried increasing the VM size for deployment and number of instances to 3 with no change in the fail status. Is there an infra issue/bug on the Azure AI studio side of things? If not, What could be the reason of this failure. And the failure notifications in Azure AI studio are not helpful for the user to figure out themselves...Is there any other way to find failure logs and how could I prevent this from occurring? TIA
Update: I was able to locate the logs, for which I have to go to my corresponding AzureML workspace. Apparently the deployment is failing to build failier in environment
2024-07-03T05:10:18Z Deployment failed due to no Environment Image available. Check Environment Build Log in ML Studio Workspace or Workspace storage for potential failures.
Status: Downloaded newer image for mcr.microsoft.com/azureml/promptflow/promptflow-runtime:20240619.v2
2024-07-03T05:05:19: ---> 013668ed0dab
2024-07-03T05:05:19: Step 2/3 : COPY requirements.txt .
2024-07-03T05:05:23: ---> c111ccde2181
2024-07-03T05:05:23: Step 3/3 : RUN pip install -r requirements.txt
2024-07-03T05:05:23: ---> Running in 38bd23d8c7a0
2024-07-03T05:05:23: Requirement already satisfied: promptflow in /azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (1.12.0)
2024-07-03T05:05:23: Requirement already satisfied: promptflow-tools in /azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.5.0rc11)
2024-07-03T05:05:23: Collecting dotenv
2024-07-03T05:05:23: Downloading dotenv-0.0.5.tar.gz (2.4 kB)
2024-07-03T05:05:23: Preparing metadata (setup.py): started
2024-07-03T05:05:24: Preparing metadata (setup.py): finished with status 'error'
2024-07-03T05:05:24: [91m error: subprocess-exited-with-error
2024-07-03T05:05:24:
2024-07-03T05:05:24: × python setup.py egg_info did not run successfully.
2024-07-03T05:05:24: │ exit code: 1
2024-07-03T05:05:24: ╰─> [76 lines of output]
2024-07-03T05:05:24: /azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
2024-07-03T05:05:24: !!
2024-07-03T05:05:24:
2024-07-03T05:05:24: ********************************************************************************
2024-07-03T05:05:24: Requirements should be satisfied by a PEP 517 installer.
2024-07-03T05:05:24: If you are using pip, you can try `pip install --use-pep517`.
2024-07-03T05:05:24: ********************************************************************************
2024-07-03T05:05:24:
2024-07-03T05:05:24: !!
2024-07-03T05:05:24: dist.fetch_build_eggs(dist.setup_requires)
2024-07-03T05:05:24: error: subprocess-exited-with-error
2024-07-03T05:05:24:
2024-07-03T05:05:24: × python setup.py egg_info did not run successfully.
2024-07-03T05:05:24: │ exit code: 1
2024-07-03T05:05:24: ╰─> [16 lines of output]
2024-07-03T05:05:24: Traceback (most recent call last):
2024-07-03T05:05:24: File "<string>", line 2, in <module>
2024-07-03T05:05:24: File "<pip-setuptools-caller>", line 14, in <module>
2024-07-03T05:05:24: File "/tmp/pip-wheel-jfvhijgw/distribute_21fa89b0cc6d4cf2bd6cab29b8bd19f1/setuptools/__init__.py", line 2, in <module>
2024-07-03T05:05:24: from setuptools.extension import Extension, Library
2024-07-03T05:05:24: File "/tmp/pip-wheel-jfvhijgw/distribute_21fa89b0cc6d4cf2bd6cab29b8bd19f1/setuptools/extension.py", line 5, in <module>
2024-07-03T05:05:24: from setuptools.dist import _get_unpatched
2024-07-03T05:05:24: File "/tmp/pip-wheel-jfvhijgw/distribute_21fa89b0cc6d4cf2bd6cab29b8bd19f1/setuptools/dist.py", line 7, in <module>
2024-07-03T05:05:24: from setuptools.command.install import install
2024-07-03T05:05:24: File "/tmp/pip-wheel-jfvhijgw/distribute_21fa89b0cc6d4cf2bd6cab29b8bd19f1/setuptools/command/__init__.py", line 8, in <module>
2024-07-03T05:05:24: from setuptools.command import install_scripts
2024-07-03T05:05:24: File "/tmp/pip-wheel-jfvhijgw/distribute_21fa89b0cc6d4cf2bd6cab29b8bd19f1/setuptools/command/install_scripts.py", line 3, in <module>
2024-07-03T05:05:24: from pkg_resources import Distribution, PathMetadata, ensure_directory
2024-07-03T05:05:24: File "/tmp/pip-wheel-jfvhijgw/distribute_21fa89b0cc6d4cf2bd6cab29b8bd19f1/pkg_resources.py", line 1518, in <module>
2024-07-03T05:05:24: register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
2024-07-03T05:05:24: AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
2024-07-03T05:05:24: [end of output]
2024-07-03T05:05:24:
2024-07-03T05:05:24: note: This error originates from a subprocess, and is likely not a problem with pip.
2024-07-03T05:05:24: error: metadata-generation-failed
2024-07-03T05:05:24:
2024-07-03T05:05:24: × Encountered error while generating package metadata.
2024-07-03T05:05:24: ╰─> See above for output.
2024-07-03T05:05:24:
2024-07-03T05:05:24: note: This is an issue with the package mentioned above, not pip.
2024-07-03T05:05:24: hint: See above for details.
2024-07-03T05:05:24: Traceback (most recent call last):
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
2024-07-03T05:05:24: subprocess.check_call(cmd)
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/subprocess.py", line 373, in check_call
2024-07-03T05:05:24: raise CalledProcessError(retcode, cmd)
2024-07-03T05:05:24: subprocess.CalledProcessError: Command '['/azureml-envs/prompt-flow/runtime/bin/python3.9', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp_48cyd7l', '--quiet', 'distribute']' returned non-zero exit status 1.
2024-07-03T05:05:24:
2024-07-03T05:05:24: The above exception was the direct cause of the following exception:
2024-07-03T05:05:24:
2024-07-03T05:05:24: Traceback (most recent call last):
2024-07-03T05:05:24: File "<string>", line 2, in <module>
2024-07-03T05:05:24: File "<pip-setuptools-caller>", line 34, in <module>
2024-07-03T05:05:24: File "/tmp/pip-install-di05e07j/dotenv_89414884d40849959a21212178ef71aa/setup.py", line 13, in <module>
2024-07-03T05:05:24: setup(name='dotenv',
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/__init__.py", line 102, in setup
2024-07-03T05:05:24: _install_setup_requires(attrs)
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/__init__.py", line 75, in _install_setup_requires
2024-07-03T05:05:24: _fetch_build_eggs(dist)
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/__init__.py", line 80, in _fetch_build_eggs
2024-07-03T05:05:24: dist.fetch_build_eggs(dist.setup_requires)
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/dist.py", line 641, in fetch_build_eggs
2024-07-03T05:05:24: return _fetch_build_eggs(self, requires)
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
2024-07-03T05:05:24: resolved_dists = pkg_resources.working_set.resolve(
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/pkg_resources/__init__.py", line 787, in resolve
2024-07-03T05:05:24: dist = self._resolve_dist(
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/pkg_resources/__init__.py", line 823, in _resolve_dist
2024-07-03T05:05:24: dist = best[req.key] = env.best_match(
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1093, in best_match
2024-07-03T05:05:24: return self.obtain(req, installer)
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1104, in obtain
2024-07-03T05:05:24: return installer(requirement) if installer else None
2024-07-03T05:05:24: File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/setuptools/installer.py", line 103, in _fetch_build_egg_no_warn
2024-07-03T05:05:24: raise DistutilsError(str(e)) from e
2024-07-03T05:05:24: distutils.errors.DistutilsError: Command '['/azureml-envs/prompt-flow/runtime/bin/python3.9', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp_48cyd7l', '--quiet', 'distribute']' returned non-zero exit status 1.
2024-07-03T05:05:24: [end of output]
2024-07-03T05:05:24:
2024-07-03T05:05:24: note: This error originates from a subprocess, and is likely not a problem with pip.
2024-07-03T05:05:24: [0m[91merror: metadata-generation-failed
2024-07-03T05:05:24: × Encountered error while generating package metadata.
2024-07-03T05:05:24: ╰─> See above for output.
2024-07-03T05:05:24: note: This is an issue with the package mentioned above, not pip.
2024-07-03T05:05:24: hint: See above for details.
2024-07-03T05:05:25: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
2024-07-03T05:05:25: [0m
2024-07-03T05:05:25: CalledProcessError(1, ['docker', 'build', '-f', 'Dockerfile', '.', '-t', '5938d8e7a2e94ca294b4af6e7d73ee39.azurecr.io/0877db71-cb24-4c92-9b2c-c1f776eb741b/azureml/azureml_01dbb54749c05838a95e72b0296b1e8a', '-t', '5938d8e7a2e94ca294b4af6e7d73ee39.azurecr.io/0877db71-cb24-4c92-9b2c-c1f776eb741b/azureml/azureml_01dbb54749c05838a95e72b0296b1e8a:6'])
2024-07-03T05:05:25: Building docker image failed with exit code: 1
2024-07-03T05:05:25: Logging out of Docker registry: 5938d8e7a2e94ca294b4af6e7d73ee39.azurecr.io
2024-07-03T05:05:25: Removing login credentials for https://index.docker.io/v1/
2024-07-03T05:05:25: Cleaning up all outstanding Run operations, waiting 300.0 seconds
2024-07-03T05:05:25: 0 items cleaning up...
2024-07-03T05:05:25: Cleanup took 9.5367431640625e-07 seconds
2024-07-03T05:05:25: Traceback (most recent call last):
File "/mnt/azureml/cr/j/efad79c4e780455e937526231656fa96/exe/wd/docker_utilities.py", line 152, in _docker_build_or_error
docker_execute_function(docker_command, build_command, print_command_args=True)
File "/mnt/azureml/cr/j/efad79c4e780455e937526231656fa96/exe/wd/docker_utilities.py", line 23, in docker_execute_function
return killable_subprocess.check_call(command_args, *popen_args,
File "/mnt/azureml/cr/j/efad79c4e780455e937526231656fa96/exe/wd/killable_subprocess.py", line 261, in check_call
raise subprocess.CalledProcessError(process.returncode, cmd)
subprocess.CalledProcessError: Command '['docker', 'build', '-f', 'Dockerfile', '.', '-t', '5938d8e7a2e94ca294b4af6e7d73ee39.azurecr.io/0877db71-cb24-4c92-9b2c-c1f776eb741b/azureml/azureml_01dbb54749c05838a95e72b0296b1e8a', '-t', '5938d8e7a2e94ca294b4af6e7d73ee39.azurecr.io/0877db71-cb24-4c92-9b2c-c1f776eb741b/azureml/azureml_01dbb54749c05838a95e72b0296b1e8a:6']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "script.py", line 108, in <module>
docker_utilities._docker_build_or_error(
File "/mnt/azureml/cr/j/efad79c4e780455e937526231656fa96/exe/wd/docker_utilities.py", line 156, in _docker_build_or_error
_write_error_and_exit(error_msg, error_file_path=error_file_path)
File "/mnt/azureml/cr/j/efad79c4e780455e937526231656fa96/exe/wd/docker_utilities.py", line 217, in _write_error_and_exit
sys.exit(1)
SystemExit: 1
2 answers
Sort by: Most helpful
-
-
AshokPeddakotla-MSFT 35,091 Reputation points
2024-07-03T07:30:17.8166667+00:00 Das Gupta, Abhijeet I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.
Error Message:
I'm using Azure AI Studio for deployment of prompt flows. Deployment of smaller prompt flows(3 nodes, only 1 LLM tool node) are successfully deployed with an endpoint, however when I try to deploy bigger prompt flows(>5nodes, containing building index, skillset and indexer in Azure AI search and generating completion using LLM api call ) in prompt flow, deployment and endpoint creation ends up failing, I have tried increasing the VM size for deployment and number of instances to 3 with no change in the fail status. Is there an infra issue/bug on the Azure AI studio side of things? If not, What could be the reason of this failure. And the failure notifications in Azure AI studio are not helpful for the user to figure out themselves...Is there any other way to find failure logs and how could I prevent this from occurring?
Solution:
Replace the dotenv package with python-dotenv package in the requirements.txt for the promptflow
If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.