From 019b5a76b048483bd9afa3c068e9362c8fb0ec75 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 7 May 2021 00:34:43 +0300 Subject: [PATCH 1/2] Make css, json and yaml style identical --- .hadolint.yaml | 4 +- .pre-commit-config.yaml | 10 +- docs/_static/custom.css | 2 +- examples/openshift/templates.json | 332 ++++++----- examples/source-to-image/templates.json | 714 ++++++++++++------------ 5 files changed, 530 insertions(+), 532 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 5f550fef5a..3d6d83e9da 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,4 +1,4 @@ --- ignored: - - DL3006 - - DL3008 + - DL3006 + - DL3008 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7d4445de6..219806ac22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,13 +16,13 @@ repos: rev: v1.26.1 hooks: - id: yamllint - args: ['-d {extends: relaxed, rules: {line-length: disable}}', '-s'] + args: ["-d {extends: relaxed, rules: {line-length: disable}}", "-s"] files: \.(yaml|yml)$ - repo: https://github.com/openstack-dev/bashate.git rev: 2.0.0 hooks: - id: bashate - args: ['--ignore=E006'] + args: ["--ignore=E006"] - repo: https://gitlab.com/pycqa/flake8 rev: 3.9.1 hooks: @@ -35,4 +35,8 @@ repos: rev: v0.27.1 hooks: - id: markdownlint - args: ['--fix'] + args: ["--fix"] + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.2.1 + hooks: + - id: prettier diff --git a/docs/_static/custom.css b/docs/_static/custom.css index af20b7aff2..1ceffe0b68 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,3 +1,3 @@ body div.sphinxsidebarwrapper p.logo { - text-align: left; + text-align: left; } diff --git a/examples/openshift/templates.json b/examples/openshift/templates.json index 5bfa68e0a8..d3ecdf5416 100644 --- a/examples/openshift/templates.json +++ b/examples/openshift/templates.json @@ -1,178 +1,176 @@ { - "kind": "Template", - "apiVersion": "v1", - "metadata": { - "name": "jupyter-notebook", - "annotations": { - "openshift.io/display-name": "Jupyter Notebook", - "description": "Template for deploying Jupyter Notebook images.", - "iconClass": "icon-python", - "tags": "python,jupyter" + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "jupyter-notebook", + "annotations": { + "openshift.io/display-name": "Jupyter Notebook", + "description": "Template for deploying Jupyter Notebook images.", + "iconClass": "icon-python", + "tags": "python,jupyter" + } + }, + "parameters": [ + { + "name": "APPLICATION_NAME", + "value": "notebook", + "required": true + }, + { + "name": "NOTEBOOK_IMAGE", + "value": "jupyter/minimal-notebook:latest", + "required": true + }, + { + "name": "NOTEBOOK_PASSWORD", + "from": "[a-f0-9]{32}", + "generate": "expression" + } + ], + "objects": [ + { + "kind": "ConfigMap", + "apiVersion": "v1", + "metadata": { + "name": "${APPLICATION_NAME}-cfg", + "labels": { + "app": "${APPLICATION_NAME}" } + }, + "data": { + "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" + } }, - "parameters": [ - { - "name": "APPLICATION_NAME", - "value": "notebook", - "required": true - }, - { - "name": "NOTEBOOK_IMAGE", - "value": "jupyter/minimal-notebook:latest", - "required": true - }, - { - "name": "NOTEBOOK_PASSWORD", - "from": "[a-f0-9]{32}", - "generate": "expression" - } - ], - "objects": [ - { - "kind": "ConfigMap", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}-cfg", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "data": { - "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" - } - }, - { - "kind": "DeploymentConfig", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - }, - "spec": { - "strategy": { - "type": "Recreate" - }, - "triggers": [ - { - "type": "ConfigChange" - } - ], - "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": "${NOTEBOOK_IMAGE}", - "command": [ - "start-notebook.sh", - "--config=/etc/jupyter/openshift/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": "/etc/jupyter/openshift", - "name": "configs" - } - ] - } - ], - "automountServiceAccountToken": false, - "securityContext": { - "supplementalGroups": [ - 100 - ] - }, - "volumes": [ - { - "configMap": { - "name": "${APPLICATION_NAME}-cfg" - }, - "name": "configs" - } - ] - } - } - } + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "${APPLICATION_NAME}", + "labels": { + "app": "${APPLICATION_NAME}" + } + }, + "spec": { + "strategy": { + "type": "Recreate" }, - { - "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" - } - } + "triggers": [ + { + "type": "ConfigChange" + } + ], + "replicas": 1, + "selector": { + "app": "${APPLICATION_NAME}", + "deploymentconfig": "${APPLICATION_NAME}" }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } + "template": { + "metadata": { + "annotations": { + "alpha.image.policy.openshift.io/resolve-names": "*" }, - "spec": { + "labels": { + "app": "${APPLICATION_NAME}", + "deploymentconfig": "${APPLICATION_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "jupyter-notebook", + "image": "${NOTEBOOK_IMAGE}", + "command": [ + "start-notebook.sh", + "--config=/etc/jupyter/openshift/jupyter_notebook_config.py", + "--no-browser", + "--ip=0.0.0.0" + ], + "ports": [ - { - "name": "8888-tcp", - "protocol": "TCP", - "port": 8888, - "targetPort": 8888 - } + { + "containerPort": 8888, + "protocol": "TCP" + } ], - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" + "env": [ + { + "name": "JUPYTER_NOTEBOOK_PASSWORD", + "value": "${NOTEBOOK_PASSWORD}" + } + ], + "volumeMounts": [ + { + "mountPath": "/etc/jupyter/openshift", + "name": "configs" + } + ] + } + ], + "automountServiceAccountToken": false, + "securityContext": { + "supplementalGroups": [100] + }, + "volumes": [ + { + "configMap": { + "name": "${APPLICATION_NAME}-cfg" }, - "type": "ClusterIP" - } + "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" + } + } + ] } diff --git a/examples/source-to-image/templates.json b/examples/source-to-image/templates.json index b91daa64d6..592cd3fa0f 100644 --- a/examples/source-to-image/templates.json +++ b/examples/source-to-image/templates.json @@ -1,376 +1,372 @@ { - "kind": "List", - "apiVersion": "v1", - "items": [ + "kind": "List", + "apiVersion": "v1", + "items": [ + { + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "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" + } + }, + "parameters": [ { - "kind": "Template", - "apiVersion": "v1", - "metadata": { - "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" - } + "name": "IMAGE_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/master/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}" + } + } + }, + { + "apiVersion": "v1", + "kind": "BuildConfig", + "metadata": { + "name": "${IMAGE_NAME}", + "labels": { + "app": "${IMAGE_NAME}" + } + }, + "spec": { + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "${IMAGE_NAME}:latest" + } }, - "parameters": [ - { - "name": "IMAGE_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/master/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}" - } - } + "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}" }, - { - "apiVersion": "v1", - "kind": "BuildConfig", - "metadata": { - "name": "${IMAGE_NAME}", - "labels": { - "app": "${IMAGE_NAME}" - } - }, - "spec": { - "output": { - "to": { - "kind": "ImageStreamTag", - "name": "${IMAGE_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" - } - ] - } - } + "scripts": "${BUILDER_SCRIPTS}" + } + }, + "triggers": [ + { + "type": "ConfigChange" + } ] + } + } + ] + }, + { + "kind": "Template", + "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 }, { - "kind": "Template", - "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" - } + "name": "BUILDER_IMAGE", + "value": "jupyter/minimal-notebook:latest", + "required": true + }, + { + "name": "BUILDER_SCRIPTS", + "value": "https://raw.githubusercontent.com/jupyter/docker-stacks/master/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}" + } + } + }, + { + "apiVersion": "v1", + "kind": "BuildConfig", + "metadata": { + "name": "${APPLICATION_NAME}", + "labels": { + "app": "${APPLICATION_NAME}" + } + }, + "spec": { + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "${APPLICATION_NAME}:latest" + } }, - "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/master/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 + "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}" }, - { - "name": "NOTEBOOK_PASSWORD", - "from": "[a-f0-9]{32}", - "generate": "expression" + "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\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" + } + }, + { + "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" + } } + } ], - "objects": [ - { - "apiVersion": "v1", - "kind": "ImageStream", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } - } - }, - { - "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\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" - } + "replicas": 1, + "selector": { + "app": "${APPLICATION_NAME}", + "deploymentconfig": "${APPLICATION_NAME}" + }, + "template": { + "metadata": { + "annotations": { + "alpha.image.policy.openshift.io/resolve-names": "*" }, - { - "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=/etc/jupyter/openshift/jupyter_notebook_config.py", - "--no-browser", - "--ip=0.0.0.0" - ], + "labels": { + "app": "${APPLICATION_NAME}", + "deploymentconfig": "${APPLICATION_NAME}" + } + }, + "spec": { + "containers": [ + { + "name": "jupyter-notebook", + "image": "${APPLICATION_NAME}:latest", + "command": [ + "start-notebook.sh", + "--config=/etc/jupyter/openshift/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": "/etc/jupyter/openshift", - "name": "configs" - } - ] - } - ], - "automountServiceAccountToken": false, - "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" - } - } + "ports": [ + { + "containerPort": 8888, + "protocol": "TCP" + } + ], + "env": [ + { + "name": "JUPYTER_NOTEBOOK_PASSWORD", + "value": "${NOTEBOOK_PASSWORD}" + } + ], + "volumeMounts": [ + { + "mountPath": "/etc/jupyter/openshift", + "name": "configs" + } + ] + } + ], + "automountServiceAccountToken": false, + "securityContext": { + "supplementalGroups": [100] }, - { - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "${APPLICATION_NAME}", - "labels": { - "app": "${APPLICATION_NAME}" - } + "volumes": [ + { + "configMap": { + "name": "${APPLICATION_NAME}-cfg" }, - "spec": { - "ports": [ - { - "name": "8888-tcp", - "protocol": "TCP", - "port": 8888, - "targetPort": 8888 - } - ], - "selector": { - "app": "${APPLICATION_NAME}", - "deploymentconfig": "${APPLICATION_NAME}" - }, - "type": "ClusterIP" - } - } - ] + "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" + } } - ] + ] + } + ] } From caa653ba18f352eb62753cf2d2cdab153bbab7c7 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 7 May 2021 00:39:44 +0300 Subject: [PATCH 2/2] Do not add pre-commit hook --- .pre-commit-config.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 219806ac22..2f4fe0c11d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,3 @@ repos: hooks: - id: markdownlint args: ["--fix"] - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.2.1 - hooks: - - id: prettier