Skip to content
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

Fixes Error "Request Entity Too Large" #585

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

munishchouhan
Copy link
Member

This PR will add a method to truncate condafile to 14kb if it is bigger than that

Signed-off-by: munishchouhan <[email protected]>
@munishchouhan munishchouhan linked an issue Aug 1, 2024 that may be closed by this pull request
Signed-off-by: munishchouhan <[email protected]>
@munishchouhan munishchouhan self-assigned this Aug 1, 2024
@munishchouhan
Copy link
Member Author

tested on local successfully, will test on dev now

@munishchouhan
Copy link
Member Author

Tested successfully in dev:

(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % wave --conda-file ./enty_too_large/conda.yml --wave-endpoint https://wave.dev-tower.net --tower-endpoint https://dev-tower.net/api  --tower-token token

wave.dev-tower.net/wt/xxxxxxxxx/wave/build/dev:bcc_pipeline--ca4b5736a54f533f
(base) munish.chouhan@Munishs-MacBook-Pro wave_testing % docker pull wave.dev-tower.net/wt/xxxxxxxx/wave/build/dev:bcc_pipeline--ca4b5736a54f533f
bcc_pipeline--ca4b5736a54f533f: Pulling from wt/xxxxxxxxxx/wave/build/dev
6360b3717211: Pull complete 
2ec3f7ad9b3c: Pull complete 
7716ca300600: Pull complete 
4f4fb700ef54: Pull complete 
7834e8feb904: Pull complete 
5ac55ff04773: Pull complete 
77c7a930b7cc: Pull complete 
c864db06f68b: Pull complete 
f628b9cff8d1: Pull complete 
ba94160d36b7: Pull complete 
6f63df1cb8dd: Pull complete 
cc9406b62369: Pull complete 
4f906f85cd2a: Downloading [=====>                                             ]  189.2MB/1.651GB

Signed-off-by: munishchouhan <[email protected]>
* Truncate the payload if it exceeds the maximum size
*/
protected static truncateLargeCondaFile(String condafile) {
int maxSize = 14 * 1024 //14 KB for the file and 2 KB for the rest of the fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make a config option for this as usual

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -95,6 +95,7 @@ class SurrealPersistenceService implements PersistenceService {

@Override
void saveBuild(WaveBuildRecord build) {
build.condaFile = truncateLargeCondaFile(build.condaFile)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think can also happen for the docker file in principle

Copy link
Member Author

@munishchouhan munishchouhan Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will add it too
I think when condafile is present continerfile will be our template so it wont exceed size, but when we only have dockerfile, size can be bigger

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

…lPersistenceService.groovy

Co-authored-by: Paolo Di Tommaso <[email protected]>
@munishchouhan
Copy link
Member Author

munishchouhan commented Sep 10, 2024

Surreal have exposed config variables to modify HTTP request size limit
surrealdb/surrealdb#4670

It will be released in v 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error "Request Entity Too Large"
2 participants