Skip to content

Commit f4c0193

Browse files
authored
Merge pull request #1292 from mathbunnyru/asalikhov/css_json_yaml_style
Make css, json and yaml style identical
2 parents f5464d1 + caa653b commit f4c0193

File tree

5 files changed

+526
-532
lines changed

5 files changed

+526
-532
lines changed

.hadolint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
ignored:
3-
- DL3006
4-
- DL3008
3+
- DL3006
4+
- DL3008

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ repos:
1616
rev: v1.26.1
1717
hooks:
1818
- id: yamllint
19-
args: ['-d {extends: relaxed, rules: {line-length: disable}}', '-s']
19+
args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"]
2020
files: \.(yaml|yml)$
2121
- repo: https://github.com/openstack-dev/bashate.git
2222
rev: 2.0.0
2323
hooks:
2424
- id: bashate
25-
args: ['--ignore=E006']
25+
args: ["--ignore=E006"]
2626
- repo: https://gitlab.com/pycqa/flake8
2727
rev: 3.9.1
2828
hooks:
@@ -35,4 +35,4 @@ repos:
3535
rev: v0.27.1
3636
hooks:
3737
- id: markdownlint
38-
args: ['--fix']
38+
args: ["--fix"]

docs/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
body div.sphinxsidebarwrapper p.logo {
2-
text-align: left;
2+
text-align: left;
33
}

examples/openshift/templates.json

Lines changed: 165 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,176 @@
11
{
2-
"kind": "Template",
3-
"apiVersion": "v1",
4-
"metadata": {
5-
"name": "jupyter-notebook",
6-
"annotations": {
7-
"openshift.io/display-name": "Jupyter Notebook",
8-
"description": "Template for deploying Jupyter Notebook images.",
9-
"iconClass": "icon-python",
10-
"tags": "python,jupyter"
2+
"kind": "Template",
3+
"apiVersion": "v1",
4+
"metadata": {
5+
"name": "jupyter-notebook",
6+
"annotations": {
7+
"openshift.io/display-name": "Jupyter Notebook",
8+
"description": "Template for deploying Jupyter Notebook images.",
9+
"iconClass": "icon-python",
10+
"tags": "python,jupyter"
11+
}
12+
},
13+
"parameters": [
14+
{
15+
"name": "APPLICATION_NAME",
16+
"value": "notebook",
17+
"required": true
18+
},
19+
{
20+
"name": "NOTEBOOK_IMAGE",
21+
"value": "jupyter/minimal-notebook:latest",
22+
"required": true
23+
},
24+
{
25+
"name": "NOTEBOOK_PASSWORD",
26+
"from": "[a-f0-9]{32}",
27+
"generate": "expression"
28+
}
29+
],
30+
"objects": [
31+
{
32+
"kind": "ConfigMap",
33+
"apiVersion": "v1",
34+
"metadata": {
35+
"name": "${APPLICATION_NAME}-cfg",
36+
"labels": {
37+
"app": "${APPLICATION_NAME}"
1138
}
39+
},
40+
"data": {
41+
"jupyter_notebook_config.py": "import os\n\npassword = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')\n\nif password:\n import notebook.auth\n c.NotebookApp.password = notebook.auth.passwd(password)\n del password\n del os.environ['JUPYTER_NOTEBOOK_PASSWORD']\n\nimage_config_file = '/home/jovyan/.jupyter/jupyter_notebook_config.py'\n\nif 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"
42+
}
1243
},
13-
"parameters": [
14-
{
15-
"name": "APPLICATION_NAME",
16-
"value": "notebook",
17-
"required": true
18-
},
19-
{
20-
"name": "NOTEBOOK_IMAGE",
21-
"value": "jupyter/minimal-notebook:latest",
22-
"required": true
23-
},
24-
{
25-
"name": "NOTEBOOK_PASSWORD",
26-
"from": "[a-f0-9]{32}",
27-
"generate": "expression"
28-
}
29-
],
30-
"objects": [
31-
{
32-
"kind": "ConfigMap",
33-
"apiVersion": "v1",
34-
"metadata": {
35-
"name": "${APPLICATION_NAME}-cfg",
36-
"labels": {
37-
"app": "${APPLICATION_NAME}"
38-
}
39-
},
40-
"data": {
41-
"jupyter_notebook_config.py": "import os\n\npassword = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')\n\nif password:\n import notebook.auth\n c.NotebookApp.password = notebook.auth.passwd(password)\n del password\n del os.environ['JUPYTER_NOTEBOOK_PASSWORD']\n\nimage_config_file = '/home/jovyan/.jupyter/jupyter_notebook_config.py'\n\nif 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"
42-
}
43-
},
44-
{
45-
"kind": "DeploymentConfig",
46-
"apiVersion": "v1",
47-
"metadata": {
48-
"name": "${APPLICATION_NAME}",
49-
"labels": {
50-
"app": "${APPLICATION_NAME}"
51-
}
52-
},
53-
"spec": {
54-
"strategy": {
55-
"type": "Recreate"
56-
},
57-
"triggers": [
58-
{
59-
"type": "ConfigChange"
60-
}
61-
],
62-
"replicas": 1,
63-
"selector": {
64-
"app": "${APPLICATION_NAME}",
65-
"deploymentconfig": "${APPLICATION_NAME}"
66-
},
67-
"template": {
68-
"metadata": {
69-
"annotations": {
70-
"alpha.image.policy.openshift.io/resolve-names": "*"
71-
},
72-
"labels": {
73-
"app": "${APPLICATION_NAME}",
74-
"deploymentconfig": "${APPLICATION_NAME}"
75-
}
76-
},
77-
"spec": {
78-
"containers": [
79-
{
80-
"name": "jupyter-notebook",
81-
"image": "${NOTEBOOK_IMAGE}",
82-
"command": [
83-
"start-notebook.sh",
84-
"--config=/etc/jupyter/openshift/jupyter_notebook_config.py",
85-
"--no-browser",
86-
"--ip=0.0.0.0"
87-
],
88-
89-
"ports": [
90-
{
91-
"containerPort": 8888,
92-
"protocol": "TCP"
93-
}
94-
],
95-
"env": [
96-
{
97-
"name": "JUPYTER_NOTEBOOK_PASSWORD",
98-
"value": "${NOTEBOOK_PASSWORD}"
99-
}
100-
],
101-
"volumeMounts": [
102-
{
103-
"mountPath": "/etc/jupyter/openshift",
104-
"name": "configs"
105-
}
106-
]
107-
}
108-
],
109-
"automountServiceAccountToken": false,
110-
"securityContext": {
111-
"supplementalGroups": [
112-
100
113-
]
114-
},
115-
"volumes": [
116-
{
117-
"configMap": {
118-
"name": "${APPLICATION_NAME}-cfg"
119-
},
120-
"name": "configs"
121-
}
122-
]
123-
}
124-
}
125-
}
44+
{
45+
"kind": "DeploymentConfig",
46+
"apiVersion": "v1",
47+
"metadata": {
48+
"name": "${APPLICATION_NAME}",
49+
"labels": {
50+
"app": "${APPLICATION_NAME}"
51+
}
52+
},
53+
"spec": {
54+
"strategy": {
55+
"type": "Recreate"
12656
},
127-
{
128-
"kind": "Route",
129-
"apiVersion": "v1",
130-
"metadata": {
131-
"name": "${APPLICATION_NAME}",
132-
"labels": {
133-
"app": "${APPLICATION_NAME}"
134-
}
135-
},
136-
"spec": {
137-
"host": "",
138-
"to": {
139-
"kind": "Service",
140-
"name": "${APPLICATION_NAME}",
141-
"weight": 100
142-
},
143-
"port": {
144-
"targetPort": "8888-tcp"
145-
},
146-
"tls": {
147-
"termination": "edge",
148-
"insecureEdgeTerminationPolicy": "Redirect"
149-
}
150-
}
57+
"triggers": [
58+
{
59+
"type": "ConfigChange"
60+
}
61+
],
62+
"replicas": 1,
63+
"selector": {
64+
"app": "${APPLICATION_NAME}",
65+
"deploymentconfig": "${APPLICATION_NAME}"
15166
},
152-
{
153-
"kind": "Service",
154-
"apiVersion": "v1",
155-
"metadata": {
156-
"name": "${APPLICATION_NAME}",
157-
"labels": {
158-
"app": "${APPLICATION_NAME}"
159-
}
67+
"template": {
68+
"metadata": {
69+
"annotations": {
70+
"alpha.image.policy.openshift.io/resolve-names": "*"
16071
},
161-
"spec": {
72+
"labels": {
73+
"app": "${APPLICATION_NAME}",
74+
"deploymentconfig": "${APPLICATION_NAME}"
75+
}
76+
},
77+
"spec": {
78+
"containers": [
79+
{
80+
"name": "jupyter-notebook",
81+
"image": "${NOTEBOOK_IMAGE}",
82+
"command": [
83+
"start-notebook.sh",
84+
"--config=/etc/jupyter/openshift/jupyter_notebook_config.py",
85+
"--no-browser",
86+
"--ip=0.0.0.0"
87+
],
88+
16289
"ports": [
163-
{
164-
"name": "8888-tcp",
165-
"protocol": "TCP",
166-
"port": 8888,
167-
"targetPort": 8888
168-
}
90+
{
91+
"containerPort": 8888,
92+
"protocol": "TCP"
93+
}
16994
],
170-
"selector": {
171-
"app": "${APPLICATION_NAME}",
172-
"deploymentconfig": "${APPLICATION_NAME}"
95+
"env": [
96+
{
97+
"name": "JUPYTER_NOTEBOOK_PASSWORD",
98+
"value": "${NOTEBOOK_PASSWORD}"
99+
}
100+
],
101+
"volumeMounts": [
102+
{
103+
"mountPath": "/etc/jupyter/openshift",
104+
"name": "configs"
105+
}
106+
]
107+
}
108+
],
109+
"automountServiceAccountToken": false,
110+
"securityContext": {
111+
"supplementalGroups": [100]
112+
},
113+
"volumes": [
114+
{
115+
"configMap": {
116+
"name": "${APPLICATION_NAME}-cfg"
173117
},
174-
"type": "ClusterIP"
175-
}
118+
"name": "configs"
119+
}
120+
]
121+
}
122+
}
123+
}
124+
},
125+
{
126+
"kind": "Route",
127+
"apiVersion": "v1",
128+
"metadata": {
129+
"name": "${APPLICATION_NAME}",
130+
"labels": {
131+
"app": "${APPLICATION_NAME}"
176132
}
177-
]
133+
},
134+
"spec": {
135+
"host": "",
136+
"to": {
137+
"kind": "Service",
138+
"name": "${APPLICATION_NAME}",
139+
"weight": 100
140+
},
141+
"port": {
142+
"targetPort": "8888-tcp"
143+
},
144+
"tls": {
145+
"termination": "edge",
146+
"insecureEdgeTerminationPolicy": "Redirect"
147+
}
148+
}
149+
},
150+
{
151+
"kind": "Service",
152+
"apiVersion": "v1",
153+
"metadata": {
154+
"name": "${APPLICATION_NAME}",
155+
"labels": {
156+
"app": "${APPLICATION_NAME}"
157+
}
158+
},
159+
"spec": {
160+
"ports": [
161+
{
162+
"name": "8888-tcp",
163+
"protocol": "TCP",
164+
"port": 8888,
165+
"targetPort": 8888
166+
}
167+
],
168+
"selector": {
169+
"app": "${APPLICATION_NAME}",
170+
"deploymentconfig": "${APPLICATION_NAME}"
171+
},
172+
"type": "ClusterIP"
173+
}
174+
}
175+
]
178176
}

0 commit comments

Comments
 (0)