-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python templates] Error on deploy
after running the api
server locally
#1237
Comments
@rajeshkamal5050 When we were doing manul test according to AzdManualTestPlan.docx, we did not encounter this issue. Because the test scenarios are different. We did not execute Our test scenario for executing
Besides, we ran the test and were able to reproduce this issue in linux VM. But, the issue was not reproduced in Windows.
|
Not a regression. This issue has been there since early versions (as it is within the zip strategy). |
@vhvb1989 We already hardcode the list of ignored files/directories, such as for azure-dev/cli/azd/pkg/project/framework_service_python.go Lines 44 to 48 in 2a8a4ad
azure-dev/cli/azd/pkg/project/framework_service_npm.go Lines 61 to 65 in 2a8a4ad
If it never makes sense to package I think we should also address the following:
|
Similar bug on functions #1039 |
I would also like for azure.yaml to have an ignore/exclude mechanism. I was the one that reported that funcignore isn't being obeyed for functions, but now I'm in an App Service situation where I'm in need of a similar mechanism. I can't re-structure the code in this situation since I'm trying to add azd support to an existing project structure. Deploying is taking a very long time, since it's unnecessarily deploying the node_modules and venv directory. |
@vhvb1989 I was working on a different part of the codebase and stumbled upon the Do you think we can get away with doing hard-copy instead of shallow-copy when handling symlinks for packaging? The library does support it: |
IIRC, shallow copy helps for files that are currently in use/locked. The root cause here is copying files which should not be copied |
Repro:
Root Cause:
When the
api
is launched locally, a new folder is created inside the/api
folder calledapi_env
. This folder contains a virtual python environment where the application dependencies are installed and where the application is launched from.Inside this folder, there are some folders which are
symLinks
to python binaries, likelib64
:When
azd deploy
runs, a zip file is created including all the content from/api
folder, and thecreate zip
implementation fromazd
does not supportsymLinks
(it doesn't see it as a folder, but as a file, and failed to zip it).As a workaround, before running
azd deploy
, we can delete theapi_env
.Fix proposals:
azd
to support excluding known folders while doingdeploy
. Thepython
implementation, for example, should tellazd
to ignore theapi_env
folder when doingdeploy
. With this approach, we could also skip adding the__pycache__
folders to the zip (those folders are created when running the app locally as well)./temp/azdlocalrun/api_env
.azure.yaml
or an extra file (likeapp.deploy.ignore
) to define files/folder which should not be zipped and deployed to Azure. This strategy would allow customers to have control over the deployment files without depending onazd
azd
would have a hardcoded list ofignore paths
and users can also extend the list with configuration files.The text was updated successfully, but these errors were encountered: