-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Lambda/API Gateway integration not working #161
Comments
Here is a little more info on what I'm seeing on the API Gateway logs request/responses in sequential order: Known MISS after code changes:
1 GET - Response - 404, Artifact not found 2a - POST - Request -
2b - POST - Response - 200 3a - PUT - Request 3b - PUT - Response - 200
Should be cache HIT but getting a MISS on the client
1 - GET - Response - 200 (it found the cache!!!)
no 2a - PUT - Request 2b - PUT - Response - 200
So the |
Basically I'm looking for help to get the Lambda server working with AWS API REST Gateway, the setup in the docs works only for AWS API HTTP Gateway |
I'm seeing a similar issue with my AWS deployment. Can see the caches in S3 and can confirm that the requests for the cache objects are returning 200s however it still causes a cache miss :( I'm seeing this issue when running in GitHub Actions. |
As a follow up, I can provide a CDK files or Cloudformation templates if that would assist with triage? |
There is a body size limit for lambda... |
Thanks for the response @WANZARGEN The limit in this case is not the issue, since I'm testing lint and the output is a tiny file. The issue has to do with the lambda server and AWS REST Gateway. Did you happen to front your EC2 with AWS REST Gateway? I'm assuming no. |
Does using the cache from local work for you @Rafael17? As I only see this issue when running turbo in GitHub Actions. I'm wondering if it's an issue with the turbo CLI when running in CI rather than the cache server itself |
@Elliot-Alexander For me everything works correctly when using AWS HTTP Gateway. The problem only appears when I use AWS REST Gateway |
Can you reiterate the issue you are facing, so we can add this information to the documentation? |
I think lambda only can handle files up to 6mb. |
Yeah, did anyone get around the fact that the max payload is 6MB? |
@duveborg Hello mate ;) Long time no see. I think this repo needs to implement presigned urls to workaround that limitation. |
@duveborg I sit in the same boat as you. My workaround right now is to deploy a small docker container using ec2 and run the server below until any lambda turbo repo implementation could handle above. |
I'm not sure if this helps anyone who want to implement this but I think that |
I've created another repo that just solves s3 and lambda with presigned urls that allows bigger files. git clone [email protected]:EloB/turborepo-remote-cache-lambda.git
cd turborepo-remote-cache-lambda/
npm --prefix=function install
sam build
zip -j app.zip .aws-sam/build/TurboRepoRemoteCacheFunction/*
# Create an lambda function. Manually create the lambda function as explained in this repo. Take a look at this file. The actual lambda function is only 130 lines of code. I haven't had time to write documentation but it's working for me. You need to include
{
"teamid": "team_yourteamhere",
"apiurl": "https://YOUR-LAMBDA-URL.lambda-url.eu-central-1.on.aws"
} You also need to set environment variables Also important to use |
🐛 Bug Report
After configuring the server using Lambda/API Gateway setup, I'm running into issues where all the caches are a MISS. Similar to: #28
When there is a cache miss, the server properly adds the caches to S3. However, on a sub sequential
turbo run
with no changes to source code, the server responds with a 200, saying that we have a cache hit on the GET/artifacts/:id
call. But then there is no POST/artifacts/events
, so it thinks it was a cache miss and makes a sub sequential PUT/artifacts/:id
, replacing already existing cache.Running this locally works without problems
here is what my configs for openapi/REST API Gateway look like
The text was updated successfully, but these errors were encountered: