forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [incubator/tensorflow-notebook] add tensorflow notebook and tensorboard add hook * update helmignore * add home * change Always to IfNotPresent * move to stable
- Loading branch information
1 parent
0cbc762
commit e9cadca
Showing
11 changed files
with
306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.jpg | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
description: A Helm chart for tensorflow notebook and tensorboard | ||
name: tensorflow-notebook | ||
version: 0.1.0 | ||
appVersion: 1.6.0 | ||
sources: | ||
- https://github.com/tensorflow/tensorflow | ||
- https://github.com/jupyter | ||
home: https://www.tensorflow.org | ||
maintainers: | ||
- name: cheyang | ||
email: cheyang@163.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# TensorFlow Notebook Helm Chart | ||
|
||
TensorFlow is an open source software library for numerical computation using data flow graphs, and tensorboard is the tool visualizing TensorFlow programs. Using Jupyter notebook to get into TensorFlow and develop models is the great way for data scientist. With these three tools you are able to start your machine learning work in two minutes. | ||
|
||
- https://www.tensorflow.org | ||
- https://www.tensorflow.org/programmers_guide/summaries_and_tensorboard | ||
- http://jupyter.org/ | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes cluster v1.8+ | ||
|
||
## Chart Details | ||
|
||
This chart will deploy the followings: | ||
|
||
- Jupyter Notebook with TensorFlow | ||
- Tensorboard | ||
|
||
## Installing the Chart | ||
|
||
* To install the chart with the release name `notebook`: | ||
|
||
```bash | ||
$ helm install --name notebook stable/tensorflow-notebook | ||
``` | ||
|
||
* To install with custom values via file : | ||
|
||
``` | ||
$ helm install --values values.yaml --name notebook stable/tensorflow-notebook | ||
``` | ||
|
||
Below is an example of the custom value file values.yaml with GPU support. | ||
|
||
``` | ||
jupyter: | ||
image: | ||
repository: tensorflow/tensorflow | ||
tag: 1.6.0-devel-gpu | ||
pullPolicy: IfNotPresent | ||
password: tensorflow | ||
resources: | ||
limits: | ||
nvidia.com/gpu: 1 | ||
requests: | ||
nvidia.com/gpu: 1 | ||
tensorboard: | ||
image: | ||
repository: tensorflow/tensorflow | ||
tag: 1.6.0-devel | ||
pullPolicy: IfNotPresent | ||
service: | ||
type: LoadBalancer | ||
``` | ||
|
||
|
||
## Run TensorFlow Example [tensorboard_basic.ipynb](https://github.com/cheyang/TensorFlow-Examples/blob/master/notebooks/4_Utils/tensorboard_basic.ipynb) | ||
|
||
> Notice: you should set the log_path `/output/training_logs` | ||
![](jupyter.jpg) | ||
|
||
## Check the TensorBoard | ||
|
||
![](tensorboard.jpg) | ||
|
||
## Uninstalling the Chart | ||
|
||
* To uninstall/delete the `notebook` deployment: | ||
|
||
```bash | ||
$ helm delete notebook | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following tables lists the configurable parameters of the Service Tensorflow Development | ||
chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
|-----------|-------------|---------| | ||
| `jupyter.image.repository` | TensorFlow Development image repository | `tensorflow/tensorflow` | | ||
| `jupyter.image.tag` | TensorFlow Development image tag | `1.5.0-devel-gpu` | | ||
| `jupyter.password` | The password to access jupyter | `mytest` | | ||
| `jupyter.image.pullPolicy` | image pullPolicy for the jupyter | `IfNotPresent` | | ||
| `tensorboard.image.repository` | TensorFlow Development image repository | `tensorflow/tensorflow` | | ||
| `tensorboard.image.tag` | TensorFlow Development image tag | `1.5.0-devel-gpu` | | ||
| `tensorboard.image.pullPolicy` | image pullPolicy for the tensorboard | `IfNotPresent` | | ||
| `resources` | Set the resource to be allocated and allowed for the Pods | `{}` | | ||
| `service.type` | service type | `LoadBalancer` | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
1. Get the application URL by running these commands: | ||
|
||
{{- if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get svc -w {{ template "tensorflow-notebook.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "tensorflow-notebook.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo notebook_url=http://$SERVICE_IP:8888 | ||
echo tensorboard_url=http://$SERVICE_IP:6006 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "tensorflow-notebook.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "tensorflow-notebook.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "tensorflow-notebook.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
apiVersion: apps/v1beta2 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "tensorflow-notebook.fullname" . }} | ||
labels: | ||
app: {{ template "tensorflow-notebook.name" . }} | ||
chart: {{ template "tensorflow-notebook.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ template "tensorflow-notebook.name" . }} | ||
release: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "tensorflow-notebook.name" . }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: jupyter | ||
image: "{{ .Values.jupyter.image.repository }}:{{ .Values.jupyter.image.tag }}" | ||
imagePullPolicy: {{ .Values.jupyter.image.pullPolicy }} | ||
ports: | ||
- containerPort: 8888 | ||
name: jupyter | ||
command: | ||
- jupyter | ||
args: | ||
- notebook | ||
- --allow-root | ||
env: | ||
- name: PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "tensorflow-notebook.fullname" . }} | ||
key: password | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 8888 | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: 8888 | ||
volumeMounts: | ||
- mountPath: /output/training_logs | ||
name: training-logs-volume | ||
- name: tensorboard | ||
image: "{{ .Values.tensorboard.image.repository }}:{{ .Values.tensorboard.image.tag }}" | ||
imagePullPolicy: {{ .Values.tensorboard.image.pullPolicy }} | ||
ports: | ||
- containerPort: 6006 | ||
name: tensorboard | ||
command: | ||
- tensorboard | ||
args: | ||
- --logdir | ||
- /output/training_logs | ||
- --host | ||
- 0.0.0.0 | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 6006 | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: 6006 | ||
volumeMounts: | ||
- mountPath: /output/training_logs | ||
name: training-logs-volume | ||
volumes: | ||
- name: training-logs-volume | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "tensorflow-notebook.fullname" . }} | ||
labels: | ||
app: {{ template "tensorflow-notebook.name" . }} | ||
chart: {{ template "tensorflow-notebook.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
annotations: | ||
"helm.sh/hook": pre-install,pre-upgrade | ||
type: Opaque | ||
data: | ||
password: {{ .Values.jupyter.password | b64enc | quote }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "tensorflow-notebook.fullname" . }} | ||
labels: | ||
app: {{ template "tensorflow-notebook.name" . }} | ||
chart: {{ template "tensorflow-notebook.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: 6006 | ||
targetPort: tensorboard | ||
protocol: TCP | ||
name: tensorboard | ||
- port: 8888 | ||
targetPort: jupyter | ||
protocol: TCP | ||
name: jupyter | ||
selector: | ||
app: {{ template "tensorflow-notebook.name" . }} | ||
release: {{ .Release.Name }} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Default values for ack-tensorflow-dev. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
jupyter: | ||
image: | ||
repository: tensorflow/tensorflow | ||
tag: 1.6.0-devel | ||
pullPolicy: IfNotPresent | ||
password: tensorflow | ||
resources: {} | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# nvidia.com/gpu: 1 | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# nvidia.com/gpu: 1 | ||
tensorboard: | ||
image: | ||
repository: tensorflow/tensorflow | ||
tag: 1.6.0-devel | ||
pullPolicy: IfNotPresent | ||
service: | ||
type: LoadBalancer |