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 522de8c commit b58c5df
Show file tree
Hide file tree
Showing 4 changed files with 10 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
6 changes: 1 addition & 5 deletions helm-chart/renku-notebooks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ replicaCount: 1

image:
repository: renku/renku-notebooks
<<<<<<< HEAD
tag: 'latest'
=======
tag: '0.0-unclean-03ed7fa'
>>>>>>> pass server options to spawner and process them
pullPolicy: IfNotPresent

## Optionally specify an array of imagePullSecrets.
Expand Down Expand Up @@ -95,7 +91,7 @@ serverOptions:
mem_limit:
displayName: Memory
type: enum
default: 1G
default: 2G
options: [2G, 4G, 8G]
gpu:
displayName: Number of GPUs
Expand Down
7 changes: 6 additions & 1 deletion jupyterhub/spawners.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,12 @@ def get_pod_manifest(self):
server_options = options.get('server_options', {})
self.log.debug('server_options: {}'.format(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'
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 b58c5df

Please sign in to comment.