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

Bump demo site's size limit to 2GB from 250MB #805

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

ashfame
Copy link
Member

@ashfame ashfame commented Jan 14, 2025

Bump demo site's max size limit to 2GB from 250MB

Note: Requires 170040-ghe-Automattic/wpcom deployed first

Related issues

Proposed Changes

  • Bump max size limit both in studio app and JN endpoint

Testing Instructions

  • Create a new site under studio app
  • Create a dummy.zip file under uploads dir to inflate the backup size dd if=/dev/urandom bs=1M count=1800 | zip -0 dummy.zip -
  • Create a demo site, which should succeed. Previously it failed with The site exceeds the maximum size of 250MB.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@ashfame ashfame self-assigned this Jan 14, 2025
@ashfame ashfame changed the title bump demo site size limit to 2GB from 250MB Bump demo site's size limit to 2GB from 250MB Jan 14, 2025
@ashfame ashfame requested a review from sejas January 14, 2025 16:51
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

Nice work! The changes are clear and the feature works as expected.

I've tested it along with 170040-ghe-Automattic/wpcom and I was able to create a Demo site of 1.5GB 🥳. It took 17 mins to upload it.

Screenshot 2025-01-15 at 13 29 10

I also tested trying to upload a bigger site and I got this alert:

alert

So we are getting a generic alert that we catch from archiveSite IPC call.
The messages updated in this PR are displayed when we got the CORS response from Nginx.

Comment on lines +9 to 12
export const DEMO_SITE_SIZE_LIMIT_GB = 2;
export const DEMO_SITE_SIZE_LIMIT_BYTES = DEMO_SITE_SIZE_LIMIT_GB * 1024 * 1024 * 1024; // 2GB
export const SYNC_PUSH_SIZE_LIMIT_GB = 2;
export const SYNC_PUSH_SIZE_LIMIT_BYTES = SYNC_PUSH_SIZE_LIMIT_GB * 1024 * 1024 * 1024; // 2GB
Copy link
Member

Choose a reason for hiding this comment

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

In the past, we separated the limits for Demo sites and Sync Push. Now that we’ve decided both should share the same limit, I considered if it would make sense to consolidate them into a single variable again. However, keeping two distinct variables seems cleaner and provides greater flexibility for future adjustments.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree! Consolidating only makes sense if it's guaranteed to not diverge in future.

@wojtekn
Copy link
Contributor

wojtekn commented Jan 15, 2025

So we are getting a generic alert that we catch from archiveSite IPC call.
The messages updated in this PR are displayed when we got the CORS response from Nginx.

Should we explicitly check for the size and not rely on the Node limit, which is accidentally equal to the current limit we want to use for demo sites and sync? In other case, the validation would stop working as soon as we fix https://github.com/Automattic/dotcom-forge/issues/8689.

@ashfame
Copy link
Member Author

ashfame commented Jan 15, 2025

@wojtekn Not sure I fully understand what's being discussed, but in https://github.com/Automattic/dotcom-forge/issues/9174 I proposed showing a user friendly message as opposed to the error itself & rely on our defined constants to error out as opposed to remote api call rejection/failure

@sejas
Copy link
Member

sejas commented Jan 15, 2025

Should we explicitly check for the size and not rely on the Node limit, which is accidentally equal to the current limit we want to use for demo sites and sync? In other case, the validation would stop working as soon as we fix https://github.com/Automattic/dotcom-forge/issues/8689.

@wojtekn , Agreed. We are already checking the file size, but what happens is that const archiveContent = fs.readFileSync( archivePath ); throws an error before returning the file size.

Let's handle the custom alert and checking the file size on https://github.com/Automattic/dotcom-forge/issues/9174 so we can merge this PR.

@ashfame
Copy link
Member Author

ashfame commented Jan 16, 2025

Deployed on wpcom, so merging this PR.

@ashfame ashfame merged commit 3cebcaf into trunk Jan 16, 2025
7 checks passed
@ashfame ashfame deleted the bump_demo_site_size_limit branch January 16, 2025 07:18
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.

3 participants