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

Add runtime size configuration feature #5805

Merged
merged 48 commits into from
Jan 6, 2025

Conversation

neubig
Copy link
Contributor

@neubig neubig commented Dec 26, 2024

This PR adds a new feature to configure the runtime size in the settings modal. Users can now choose between 1x (2 core, 8G) and 2x (4 core, 16G) options.

Changes include:

  • Added a new REMOTE_RUNTIME_RESOURCE_FACTOR field to the Settings type
  • Created a new RuntimeSizeSelector component
  • Updated the SettingsForm component to include the new selector
  • Modified getSettings and saveSettings functions to handle the new setting
  • Updated tests to include the new setting
  • Added documentation about the new runtime size option in the README.md file

Please review and let me know if any changes are needed.


Notes:

  1. Fixes [Feature Request]: Set RemoteRuntime size in frontend #5797
  2. This is pending review by @neubig

To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:626a4fb-nikolaik   --name openhands-app-626a4fb   docker.all-hands.dev/all-hands-ai/openhands:626a4fb

@neubig neubig marked this pull request as draft December 26, 2024 00:43
@neubig neubig added the lint-fix Attempts to fix lint issues on the PR label Dec 26, 2024
@neubig neubig self-assigned this Dec 26, 2024
@neubig neubig removed the lint-fix Attempts to fix lint issues on the PR label Dec 29, 2024
Copy link
Contributor Author

@neubig neubig left a comment

Choose a reason for hiding this comment

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

This looks good to me now, @amanape it'd be great if you could do a second review.

@neubig neubig requested a review from amanape December 29, 2024 05:20
@neubig neubig assigned amanape and unassigned neubig Dec 29, 2024
Copy link
Member

@amanape amanape left a comment

Choose a reason for hiding this comment

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

Is the backend already set to recognize these new setting keys?

@neubig
Copy link
Contributor Author

neubig commented Dec 31, 2024

@amanape : yes it is

remote_runtime_resource_factor: int = 1

UPDATE: but now that I think about it, I didn't carefully check the backend code that receives the changes from the frontend, I will check that.

@neubig neubig marked this pull request as ready for review January 3, 2025 14:40
@neubig
Copy link
Contributor Author

neubig commented Jan 3, 2025

OK, I think this is ready now @amanape ! This is what it looks like for now, and we'll enable the menu in a future PR once we have a way to pipe in info about which users should have access to this feature.

Screenshot 2025-01-03 at 11 40 08 PM

@neubig neubig requested a review from amanape January 3, 2025 14:42
@neubig
Copy link
Contributor Author

neubig commented Jan 3, 2025

Actually, sorry, let me take another look at this. Please cancel that.

@neubig neubig marked this pull request as draft January 3, 2025 14:44
openhands-agent and others added 12 commits January 4, 2025 20:52
- Revert settings-up-to-date-context.tsx back to base branch version
- Move getCurrentSettingsVersion back to its original position in settings.ts
- Fix import path in use-maybe-migrate-settings.ts
- Add REMOTE_RUNTIME_RESOURCE_FACTOR to Settings and ApiSettings types
- Add getSettings function
- Update getLocalStorageSettings to include new field
@neubig neubig marked this pull request as ready for review January 5, 2025 01:00
@neubig
Copy link
Contributor Author

neubig commented Jan 5, 2025

OK @amanape , I believe this is ready for review, thanks for the patience!

@neubig neubig assigned amanape and unassigned neubig Jan 6, 2025
Copy link
Member

@amanape amanape left a comment

Choose a reason for hiding this comment

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

I've simplified FE tests and removed the services/settings test since it doesn't actually test relevant logic properly and also includes always passing tests e.g.,

vi.mocked(OpenHands.saveSettings).mockResolvedValueOnce(false);
const result = await OpenHands.saveSettings(apiSettings);

expect(result).toBe(false);

Makes it more confusing too

The rest LGTM!

@xingyaoww xingyaoww merged commit 1f8a018 into main Jan 6, 2025
16 checks passed
@xingyaoww xingyaoww deleted the feature/runtime-size-configuration branch January 6, 2025 22:23
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.

[Feature Request]: Set RemoteRuntime size in frontend
4 participants