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 cpu and memory constraints #110

Merged
merged 3 commits into from
Apr 10, 2022

Conversation

skant7
Copy link
Contributor

@skant7 skant7 commented Apr 10, 2022

This PR adds the feature to restrict memory and CPU resource constraints and partially addresses #22

Copy link
Collaborator

@idoqo idoqo left a comment

Choose a reason for hiding this comment

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

Cool feature to have, left some comments.

README.md Outdated
@@ -79,7 +79,9 @@ curl -X POST http://localhost:4434/createservice \
"type": "postgres",
"name": "localtest",
"username": "spinup",
"password": "spinup"
"password": "spinup",
"memory": "6000", //In Megabytes
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is 6GB, correct? was curious if someone is running it on say...a system with < 6GB, what would docker do in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right,will have to add error messages for edge cases like this

Copy link
Collaborator

@idoqo idoqo Apr 10, 2022

Choose a reason for hiding this comment

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

Yeah, was just curious anyway. Since this is just an example and users can adjust based on their system...it should likely be fine, plus creating the container will probably fail

internal/postgres/postgres.go Outdated Show resolved Hide resolved
internal/postgres/postgres.go Outdated Show resolved Hide resolved
api/create.go Outdated Show resolved Hide resolved
api/create.go Outdated Show resolved Hide resolved
@skant7 skant7 force-pushed the feature/resource-constraints branch from 760c3f4 to b276190 Compare April 10, 2022 19:48
@viggy28 viggy28 self-requested a review April 10, 2022 22:41
@viggy28 viggy28 merged commit 9667a42 into spinup-host:main Apr 10, 2022
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