From 91f503ed8eb8c6a88794c302ac66e069ab056189 Mon Sep 17 00:00:00 2001 From: Rok Roskar Date: Fri, 10 May 2019 15:21:47 +0200 Subject: [PATCH] fix: enforce memory limits for user pods closes #147 --- jupyterhub/spawners.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jupyterhub/spawners.py b/jupyterhub/spawners.py index 58073c6bb..ccbeb2965 100644 --- a/jupyterhub/spawners.py +++ b/jupyterhub/spawners.py @@ -159,7 +159,11 @@ def get_pod_manifest(self): server_options = options.get('server_options', {}) self.default_url = server_options.get('defaultUrl') self.cpu_guarantee = float(server_options.get('cpu_request', 0.1)) + + # Make the user pods be in Guaranteed QoS class if the user + # had specified a memory request. Otherwise use a sensible default. self.mem_guarantee = server_options.get('mem_request', '500M') + self.mem_limit = server_options.get('mem_request','1G') gpu = server_options.get('gpu_request', {}) if gpu: