Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
52fba596
Commit
52fba596
authored
Feb 19, 2018
by
Graham Dumpleton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OpenShift template for building, but not deploying an image using Source-to-Image builder.
parent
f87dec59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
341 additions
and
232 deletions
+341
-232
examples/source-to-image/templates.json
examples/source-to-image/templates.json
+341
-232
No files found.
examples/source-to-image/templates.json
View file @
52fba596
{
"kind"
:
"
Template
"
,
"kind"
:
"
List
"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"jupyter-notebook-quickstart"
,
"annotations"
:
{
"openshift.io/display-name"
:
"Jupyter Notebook Quickstart"
,
"description"
:
"Template for deploying Jupyter Notebook images with bundled notebooks and files."
,
"iconClass"
:
"icon-python"
,
"tags"
:
"python,jupyter"
}
},
"parameters"
:
[
{
"name"
:
"APPLICATION_NAME"
,
"value"
:
"notebook"
,
"required"
:
true
},
{
"name"
:
"BUILDER_IMAGE"
,
"value"
:
"jupyter/minimal-notebook:latest"
,
"required"
:
true
},
{
"name"
:
"BUILDER_SCRIPTS"
,
"value"
:
"https://raw.githubusercontent.com/jupyter/docker-stacks/source-to-image/examples/source-to-image"
,
"required"
:
true
},
{
"name"
:
"GIT_REPOSITORY_URL"
,
"value"
:
""
,
"required"
:
true
},
{
"name"
:
"GIT_REFERENCE"
,
"value"
:
"master"
,
"required"
:
true
},
{
"name"
:
"CONTEXT_DIR"
,
"value"
:
""
,
"required"
:
false
},
{
"name"
:
"NOTEBOOK_PASSWORD"
,
"from"
:
"[a-f0-9]{32}"
,
"generate"
:
"expression"
}
],
"objects"
:
[
{
"apiVersion"
:
"v1"
,
"kind"
:
"ImageStream"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"lookupPolicy"
:
{
"local"
:
false
}
}
},
{
"apiVersion"
:
"v1"
,
"kind"
:
"BuildConfig"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"output"
:
{
"to"
:
{
"kind"
:
"ImageStreamTag"
,
"name"
:
"${APPLICATION_NAME}:latest"
}
},
"source"
:
{
"type"
:
"Git"
,
"git"
:
{
"uri"
:
"${GIT_REPOSITORY_URL}"
,
"ref"
:
"${GIT_REFERENCE}"
},
"contextDir"
:
"${CONTEXT_DIR}"
},
"strategy"
:
{
"type"
:
"Source"
,
"sourceStrategy"
:
{
"from"
:
{
"kind"
:
"DockerImage"
,
"name"
:
"${BUILDER_IMAGE}"
},
"scripts"
:
"${BUILDER_SCRIPTS}"
}
},
"triggers"
:
[
{
"type"
:
"ConfigChange"
}
]
}
},
{
"kind"
:
"ConfigMap"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}-cfg"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"data"
:
{
"jupyter_notebook_config.py"
:
"import os
\n\n
password = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')
\n\n
if password:
\n
import notebook.auth
\n
c.NotebookApp.password = notebook.auth.passwd(password)
\n
del password
\n
del os.environ['JUPYTER_NOTEBOOK_PASSWORD']
\n\n
image_config_file = '/home/jovyan/work/.jupyter/jupyter_notebook_config.py'
\n\n
if os.path.exists(image_config_file):
\n
with open(image_config_file) as fp:
\n
exec(compile(fp.read(), image_config_file, 'exec'), globals())
\n
"
}
},
"items"
:
[
{
"kind"
:
"
DeploymentConfig
"
,
"kind"
:
"
Template
"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
"name"
:
"jupyter-notebook-builder"
,
"annotations"
:
{
"openshift.io/display-name"
:
"Jupyter Notebook Builder"
,
"description"
:
"Template for building Jupyter Notebook images with bundled notebooks and files."
,
"iconClass"
:
"icon-python"
,
"tags"
:
"python,jupyter"
}
},
"spec"
:
{
"strategy"
:
{
"type"
:
"Recreate"
"parameters"
:
[
{
"name"
:
"IMAGE_NAME"
,
"value"
:
"notebook"
,
"required"
:
true
},
"triggers"
:
[
{
"type"
:
"ConfigChange"
},
{
"type"
:
"ImageChange"
,
"imageChangeParams"
:
{
"automatic"
:
true
,
"containerNames"
:
[
"jupyter-notebook"
],
"from"
:
{
"kind"
:
"ImageStreamTag"
,
"name"
:
"${APPLICATION_NAME}:latest"
}
}
{
"name"
:
"BUILDER_IMAGE"
,
"value"
:
"jupyter/minimal-notebook:latest"
,
"required"
:
true
},
{
"name"
:
"BUILDER_SCRIPTS"
,
"value"
:
"https://raw.githubusercontent.com/jupyter/docker-stacks/source-to-image/examples/source-to-image"
,
"required"
:
true
},
{
"name"
:
"GIT_REPOSITORY_URL"
,
"value"
:
""
,
"required"
:
true
},
{
"name"
:
"GIT_REFERENCE"
,
"value"
:
"master"
,
"required"
:
true
},
{
"name"
:
"CONTEXT_DIR"
,
"value"
:
""
,
"required"
:
false
}
],
"objects"
:
[
{
"apiVersion"
:
"v1"
,
"kind"
:
"ImageStream"
,
"metadata"
:
{
"name"
:
"${IMAGE_NAME}"
,
"labels"
:
{
"app"
:
"${IMAGE_NAME}"
}
}
],
"replicas"
:
1
,
"selector"
:
{
"app"
:
"${APPLICATION_NAME}"
,
"deploymentconfig"
:
"${APPLICATION_NAME}"
},
"template"
:
{
{
"apiVersion"
:
"v1"
,
"kind"
:
"BuildConfig"
,
"metadata"
:
{
"annotations"
:
{
"alpha.image.policy.openshift.io/resolve-names"
:
"*"
},
"name"
:
"${IMAGE_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
,
"deploymentconfig"
:
"${APPLICATION_NAME}"
"app"
:
"${IMAGE_NAME}"
}
},
"spec"
:
{
"containers"
:
[
{
"name"
:
"jupyter-notebook"
,
"image"
:
"${APPLICATION_NAME}:latest"
,
"command"
:
[
"start-notebook.sh"
,
"--config=/home/jovyan/configs/jupyter_notebook_config.py"
,
"--no-browser"
,
"--ip=0.0.0.0"
],
"ports"
:
[
{
"containerPort"
:
8888
,
"protocol"
:
"TCP"
}
],
"env"
:
[
{
"name"
:
"JUPYTER_NOTEBOOK_PASSWORD"
,
"value"
:
"${NOTEBOOK_PASSWORD}"
}
],
"volumeMounts"
:
[
{
"mountPath"
:
"/home/jovyan/configs"
,
"name"
:
"configs"
}
]
"output"
:
{
"to"
:
{
"kind"
:
"ImageStreamTag"
,
"name"
:
"${IMAGE_NAME}:latest"
}
],
"securityContext"
:
{
"supplementalGroups"
:
[
100
]
},
"volumes"
:
[
{
"configMap"
:
{
"name"
:
"${APPLICATION_NAME}-cfg"
},
"name"
:
"configs"
"resources"
:
{
"limits"
:
{
"memory"
:
"1Gi"
}
]
},
"source"
:
{
"type"
:
"Git"
,
"git"
:
{
"uri"
:
"${GIT_REPOSITORY_URL}"
,
"ref"
:
"${GIT_REFERENCE}"
},
"contextDir"
:
"${CONTEXT_DIR}"
},
"strategy"
:
{
"type"
:
"Source"
,
"sourceStrategy"
:
{
"from"
:
{
"kind"
:
"DockerImage"
,
"name"
:
"${BUILDER_IMAGE}"
},
"scripts"
:
"${BUILDER_SCRIPTS}"
}
},
"triggers"
:
[
{
"type"
:
"ConfigChange"
}
]
}
}
}
]
},
{
"kind"
:
"
Rou
te"
,
"kind"
:
"
Templa
te"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
"name"
:
"jupyter-notebook-quickstart"
,
"annotations"
:
{
"openshift.io/display-name"
:
"Jupyter Notebook QuickStart"
,
"description"
:
"Template for deploying Jupyter Notebook images with bundled notebooks and files."
,
"iconClass"
:
"icon-python"
,
"tags"
:
"python,jupyter"
}
},
"spec"
:
{
"host"
:
""
,
"to"
:
{
"kind"
:
"Service"
,
"name"
:
"${APPLICATION_NAME}"
,
"weight"
:
100
"parameters"
:
[
{
"name"
:
"APPLICATION_NAME"
,
"value"
:
"notebook"
,
"required"
:
true
},
"port"
:
{
"targetPort"
:
"8888-tcp"
{
"name"
:
"BUILDER_IMAGE"
,
"value"
:
"jupyter/minimal-notebook:latest"
,
"required"
:
true
},
"tls"
:
{
"termination"
:
"edge"
,
"insecureEdgeTerminationPolicy"
:
"Redirect"
}
}
},
{
"kind"
:
"Service"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
{
"name"
:
"BUILDER_SCRIPTS"
,
"value"
:
"https://raw.githubusercontent.com/jupyter/docker-stacks/source-to-image/examples/source-to-image"
,
"required"
:
true
},
{
"name"
:
"GIT_REPOSITORY_URL"
,
"value"
:
""
,
"required"
:
true
},
{
"name"
:
"GIT_REFERENCE"
,
"value"
:
"master"
,
"required"
:
true
},
{
"name"
:
"CONTEXT_DIR"
,
"value"
:
""
,
"required"
:
false
},
{
"name"
:
"NOTEBOOK_PASSWORD"
,
"from"
:
"[a-f0-9]{32}"
,
"generate"
:
"expression"
}
},
"spec"
:
{
"ports"
:
[
{
"name"
:
"8888-tcp"
,
"protocol"
:
"TCP"
,
"port"
:
8888
,
"targetPort"
:
8888
],
"objects"
:
[
{
"apiVersion"
:
"v1"
,
"kind"
:
"ImageStream"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
}
],
"selector"
:
{
"app"
:
"${APPLICATION_NAME}"
,
"deploymentconfig"
:
"${APPLICATION_NAME}"
},
"type"
:
"ClusterIP"
}
{
"apiVersion"
:
"v1"
,
"kind"
:
"BuildConfig"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"output"
:
{
"to"
:
{
"kind"
:
"ImageStreamTag"
,
"name"
:
"${APPLICATION_NAME}:latest"
}
},
"resources"
:
{
"limits"
:
{
"memory"
:
"1Gi"
}
},
"source"
:
{
"type"
:
"Git"
,
"git"
:
{
"uri"
:
"${GIT_REPOSITORY_URL}"
,
"ref"
:
"${GIT_REFERENCE}"
},
"contextDir"
:
"${CONTEXT_DIR}"
},
"strategy"
:
{
"type"
:
"Source"
,
"sourceStrategy"
:
{
"from"
:
{
"kind"
:
"DockerImage"
,
"name"
:
"${BUILDER_IMAGE}"
},
"scripts"
:
"${BUILDER_SCRIPTS}"
}
},
"triggers"
:
[
{
"type"
:
"ConfigChange"
}
]
}
},
{
"kind"
:
"ConfigMap"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}-cfg"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"data"
:
{
"jupyter_notebook_config.py"
:
"import os
\n\n
password = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')
\n\n
if password:
\n
import notebook.auth
\n
c.NotebookApp.password = notebook.auth.passwd(password)
\n
del password
\n
del os.environ['JUPYTER_NOTEBOOK_PASSWORD']
\n\n
image_config_file = '/home/jovyan/work/.jupyter/jupyter_notebook_config.py'
\n\n
if os.path.exists(image_config_file):
\n
with open(image_config_file) as fp:
\n
exec(compile(fp.read(), image_config_file, 'exec'), globals())
\n
"
}
},
{
"kind"
:
"DeploymentConfig"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"strategy"
:
{
"type"
:
"Recreate"
},
"triggers"
:
[
{
"type"
:
"ConfigChange"
},
{
"type"
:
"ImageChange"
,
"imageChangeParams"
:
{
"automatic"
:
true
,
"containerNames"
:
[
"jupyter-notebook"
],
"from"
:
{
"kind"
:
"ImageStreamTag"
,
"name"
:
"${APPLICATION_NAME}:latest"
}
}
}
],
"replicas"
:
1
,
"selector"
:
{
"app"
:
"${APPLICATION_NAME}"
,
"deploymentconfig"
:
"${APPLICATION_NAME}"
},
"template"
:
{
"metadata"
:
{
"annotations"
:
{
"alpha.image.policy.openshift.io/resolve-names"
:
"*"
},
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
,
"deploymentconfig"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"containers"
:
[
{
"name"
:
"jupyter-notebook"
,
"image"
:
"${APPLICATION_NAME}:latest"
,
"command"
:
[
"start-notebook.sh"
,
"--config=/home/jovyan/configs/jupyter_notebook_config.py"
,
"--no-browser"
,
"--ip=0.0.0.0"
],
"ports"
:
[
{
"containerPort"
:
8888
,
"protocol"
:
"TCP"
}
],
"env"
:
[
{
"name"
:
"JUPYTER_NOTEBOOK_PASSWORD"
,
"value"
:
"${NOTEBOOK_PASSWORD}"
}
],
"volumeMounts"
:
[
{
"mountPath"
:
"/home/jovyan/configs"
,
"name"
:
"configs"
}
]
}
],
"securityContext"
:
{
"supplementalGroups"
:
[
100
]
},
"volumes"
:
[
{
"configMap"
:
{
"name"
:
"${APPLICATION_NAME}-cfg"
},
"name"
:
"configs"
}
]
}
}
}
},
{
"kind"
:
"Route"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"host"
:
""
,
"to"
:
{
"kind"
:
"Service"
,
"name"
:
"${APPLICATION_NAME}"
,
"weight"
:
100
},
"port"
:
{
"targetPort"
:
"8888-tcp"
},
"tls"
:
{
"termination"
:
"edge"
,
"insecureEdgeTerminationPolicy"
:
"Redirect"
}
}
},
{
"kind"
:
"Service"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"${APPLICATION_NAME}"
,
"labels"
:
{
"app"
:
"${APPLICATION_NAME}"
}
},
"spec"
:
{
"ports"
:
[
{
"name"
:
"8888-tcp"
,
"protocol"
:
"TCP"
,
"port"
:
8888
,
"targetPort"
:
8888
}
],
"selector"
:
{
"app"
:
"${APPLICATION_NAME}"
,
"deploymentconfig"
:
"${APPLICATION_NAME}"
},
"type"
:
"ClusterIP"
}
}
]
}
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment