-
Notifications
You must be signed in to change notification settings - Fork 471
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
SAM run/debug: eliminate temporary directory #2050
Comments
This would be amazing. We wait over two minutes every time we invoke a function because the cache is wiped out. Super frustrating when trying to develop. @justinmk3 Regarding JetBrains, we experience the same problem. |
The next release (1.30.0) will include a way to set a directory via a "type": "aws-sam",
"request": "direct-invoke",
"name": "lambda-go1.x:HelloWorldFunction (go1.x)",
"invokeTarget": {
"target": "template",
"templatePath": "${workspaceFolder}/lambda-go1.x/template.yaml",
"logicalId": "HelloWorldFunction"
},
"lambda": {
"payload": {},
"environmentVariables": {},
"runtime": "go1.x"
},
"sam": {
"buildDir": "${workspaceFolder}/buildDir"
} |
#2755 mitigates some issues with the temporary directory by setting the process working directory. |
Problem: All of our SAM CLI invocations are ran without an explicit working directory. This creates tons of hard-to-diagnose problems. Solution: * Explicitly set a working directory for `sam build` to the template's directory. This mimics the typical situation when running `sam build` in a terminal. * This correctly creates a `.aws-sam` directory adjacent to the target template. * Other `sam` commands are still affected although they are harder to change without breaking things due to the temporary directory :/ * The way the Toolkit + SAM CLI interact is incredibly brittle and this solution is just a mitigation. ref #2050 ref #2395
Problem
Toolkit currently always builds and runs from a temporary
/tmp/vstck-xx
directory. This confuses tooling and may defeat SAM CLI "cache" functionality.Reason for the temporary directory:
Related notes:
template.yaml
to a temporary counterpart.Proposal
.git/info/excludes
?.aws-sam/
directory?sam
invocations outside of the ToolkitAlternative:
/tmp/vstck-xx
directory for the sametemplate.yaml
Alternative:
--build-dir
correctly? Maybe this will avoid needing to remap the paths in the temporary template.yaml YAML Handling Improvements #1159 Use existing template for template invoke-targets #990 ?The text was updated successfully, but these errors were encountered: