Skip to content

Commit

Permalink
add minimal resource requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rokroskar committed Oct 17, 2018
1 parent f76d131 commit b117abe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion helm-chart/renku-notebooks/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: '1.0'
description: A Helm chart for the Renku Notebooks service
name: renku-notebooks
version: 0.0-unclean-03ed7fa
version: 0.2.1
10 changes: 5 additions & 5 deletions helm-chart/renku-notebooks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ replicaCount: 1

image:
repository: renku/renku-notebooks
tag: '0.0-unclean-03ed7fa'
tag: '0.2.1'
pullPolicy: IfNotPresent

## Optionally specify an array of imagePullSecrets.
Expand Down Expand Up @@ -91,7 +91,7 @@ serverOptions:
mem_limit:
displayName: Memory
type: enum
default: 1G
default: 2G
options: [2G, 4G, 8G]
gpu:
displayName: Number of GPUs
Expand All @@ -109,7 +109,7 @@ jupyterhub:
hub:
image:
name: renku/jupyterhub-k8s
tag: '0.0-unclean-03ed7fa'
tag: '0.2.1'
allowNamedServers: true
services:
notebooks:
Expand Down Expand Up @@ -167,14 +167,14 @@ jupyterhub:
singleuser:
image:
name: renku/singleuser
tag: '0.0-unclean-03ed7fa'
tag: '0.2.1'
storage:
type: none
defaultUrl: /lab
singleuser-r:
image:
name: renku/singleuser-r
tag: '0.0-unclean-03ed7fa'
tag: '0.2.1'
# FIXME: bug in prepuller makes helm hang in certain cases. Fixed in 0.7
# so this should be removed eventually.
# https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/477
Expand Down
11 changes: 10 additions & 1 deletion jupyterhub/spawners.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,17 @@ def get_pod_manifest(self):
## Process the requested server options
server_options = options.get('server_options', {})
self.default_url = server_options.get('default_url')
self.cpu_limit = float(server_options['resources'].get('cpu_limit'))
self.cpu_limit = float(
server_options['resources'].get('cpu_limit', 1.0)
)
self.cpu_guarantee = float(
server_options['resources'].get('cpu_guarantee', 0.1)
)
self.mem_limit = server_options['resources'].get('mem_limit')
self.mem_guarantee = server_options['resources'].get(
'mem_guarantee', '500M'
)

gpu = server_options.get('gpu', {})
if gpu:
self.extra_resource_guarantees = {
Expand Down
4 changes: 2 additions & 2 deletions src/notebooks_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ def ui(path):
"""Route for serving a UI for managing running servers."""
if not path:
path = "index.html"
# return send_from_directory('../static', filename=path)
return send_from_directory('../static', filename=path)
# Use this varient for development
return send_from_directory('ui/build', filename=path)
# return send_from_directory('ui/build', filename=path)


@app.route(urljoin(SERVICE_PREFIX, 'user'))
Expand Down

0 comments on commit b117abe

Please sign in to comment.