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

[OpenShift] Adding property to set workspaces memory request on OpenShift #4671

Merged
merged 1 commit into from
Apr 3, 2017

Conversation

l0rd
Copy link
Contributor

@l0rd l0rd commented Apr 3, 2017

Adding a new property che.openshift.workspace.memory.request. If this property is set it will be used in the spec of the workspace containers (c.f. OpenShift documentation on memory requests).

This fixes "Insufficient memory" problem we currently have on Minishift.

Changelog

Adding property to set workspaces memory request on OpenShift

@l0rd l0rd force-pushed the resources-requests branch from 45bfa1a to 29e80ae Compare April 3, 2017 09:54
@l0rd l0rd requested review from ibuziuk and amisevsk April 3, 2017 09:55
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Apr 3, 2017

wdyt about adding measurement to the name of property like che.workspace.default_memory_mb=1024?

@l0rd
Copy link
Contributor Author

l0rd commented Apr 3, 2017

@skabashnyuk we want to stay as close as possible to openshift spec and there the unit of measure is part of the value (e.g. che.workspace.default_memory=1024Mi). But that may eventually be a good idea because it would be consistent with other che properties. @amisevsk what do you think?

@amisevsk
Copy link
Contributor

amisevsk commented Apr 3, 2017

@skabashnyuk @l0rd The String used for this property can be anything that OpenShift will accept, as it is passed pretty much directly to OpenShift. I worry that including units could cause more confusion, since e.g. setting the property to 1024Mi can result in OpenShift returning 1Gi when you get the limit from OpenShift. If this value needs to be used for anything other than passing it to OpenShift, it would probably need pretty careful handling no matter what we specify as a unit.

Perhaps a better solution is to add documentation to the che.properties file specifying the constraints on these Strings?

Copy link
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

LGTM. I've added a few questions but think it's good to merge as-is.

@@ -294,8 +294,10 @@ che.openshift.liveness.probe.delay=300
che.openshift.liveness.probe.timeout=1
che.openshift.workspaces.pvc.name=claim-che-workspace
che.openshift.workspaces.pvc.quantity=10Gi
che.openshift.workspace.cpu.limit=1
# Override memory limit used for openshift workspaces. String, e.g. 1300Mi
# The amount of memory required for a workspace container to run e.g. 512Mi
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT about leaving the cpu.limit in place? It does make things longer and less readable, but in terms of a general solution it would be useful to be able to specify this value, even if it doesn't apply to our specific case. It would be handy e.g. if running on minishift with a simple quota in place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amisevsk Yes I think it makes sense to have cpu limit and request. Even if we don't need that right now we may need it later. But I would rather add it in second PR.

# Override memory limit used for openshift workspaces. String, e.g. 1300Mi
# The amount of memory required for a workspace container to run e.g. 512Mi
che.openshift.workspace.memory.request=NULL
# The max amount of memory the container can use.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there is some confusion about the format of these properties, maybe we can link to the OpenShift documentation in the description. This does have the problem of having to keep that link up to date though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the che.properties pointing to the documentation

@garagatyi
Copy link

@amisevsk We usually don't hesitate to explicitly set measurement unit in name of a property. Example https://github.com/eclipse/che/blob/master/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties#L91-L91

I agree that allowing to set it is quite error prone.
BTW if you choose to use single measurement unit instead of clever, please, add it into property name - it is not official rule for the project that makes properties consistent.

Signed-off-by: Mario Loriedo <mloriedo@redhat.com>
@l0rd l0rd force-pushed the resources-requests branch from 29e80ae to 09525f4 Compare April 3, 2017 22:09
@l0rd l0rd merged commit f6d12b6 into eclipse-che:openshift-connector Apr 3, 2017
@JamesDrummond JamesDrummond added this to the 5.7.0 milestone Apr 9, 2017
@JamesDrummond JamesDrummond mentioned this pull request Apr 9, 2017
9 tasks
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.

6 participants