├── .gitignore ├── LICENSE ├── README.md ├── charts ├── index.yaml └── presto-1.tgz ├── image ├── .dockerignore ├── Dockerfile ├── hive-aux-jars │ ├── aws-emr-jsonserde.jar │ └── json-serde-1.3.8-jar-with-dependencies.jar ├── manager.py ├── presto-entrypoint.py └── template_configs │ ├── config.properties.jinja2 │ ├── jvm.config │ ├── log.properties.jinja2 │ └── node.properties.jinja2 └── presto ├── .helmignore ├── Chart.yaml ├── README.md ├── templates ├── NOTES.txt ├── _helpers.tpl ├── configmap-catalog.yaml ├── configmap-coordinator.yaml ├── configmap-worker.yaml ├── deployment-coordinator.yaml ├── deployment-worker.yaml └── service.yaml └── values.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Python template 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | local_settings.py 59 | db.sqlite3 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | target/ 73 | 74 | # Jupyter Notebook 75 | .ipynb_checkpoints 76 | 77 | # pyenv 78 | .python-version 79 | 80 | # celery beat schedule file 81 | celerybeat-schedule 82 | 83 | # SageMath parsed files 84 | *.sage.py 85 | 86 | # Environments 87 | .env 88 | .venv 89 | env/ 90 | venv/ 91 | ENV/ 92 | env.bak/ 93 | venv.bak/ 94 | 95 | # Spyder project settings 96 | .spyderproject 97 | .spyproject 98 | 99 | # Rope project settings 100 | .ropeproject 101 | 102 | # mkdocs documentation 103 | /site 104 | 105 | # mypy 106 | .mypy_cache/ 107 | ### JetBrains template 108 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 109 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 110 | 111 | # User-specific stuff 112 | .idea/**/workspace.xml 113 | .idea/**/tasks.xml 114 | .idea/**/usage.statistics.xml 115 | .idea/**/dictionaries 116 | .idea/**/shelf 117 | .idea 118 | 119 | # Sensitive or high-churn files 120 | .idea/**/dataSources/ 121 | .idea/**/dataSources.ids 122 | .idea/**/dataSources.local.xml 123 | .idea/**/sqlDataSources.xml 124 | .idea/**/dynamic.xml 125 | .idea/**/uiDesigner.xml 126 | .idea/**/dbnavigator.xml 127 | 128 | # Gradle 129 | .idea/**/gradle.xml 130 | .idea/**/libraries 131 | 132 | # Gradle and Maven with auto-import 133 | # When using Gradle or Maven with auto-import, you should exclude module files, 134 | # since they will be recreated, and may cause churn. Uncomment if using 135 | # auto-import. 136 | # .idea/modules.xml 137 | # .idea/*.iml 138 | # .idea/modules 139 | 140 | # CMake 141 | cmake-build-*/ 142 | 143 | # Mongo Explorer plugin 144 | .idea/**/mongoSettings.xml 145 | 146 | # File-based project format 147 | *.iws 148 | 149 | # IntelliJ 150 | out/ 151 | 152 | # mpeltonen/sbt-idea plugin 153 | .idea_modules/ 154 | 155 | # JIRA plugin 156 | atlassian-ide-plugin.xml 157 | 158 | # Cursive Clojure plugin 159 | .idea/replstate.xml 160 | 161 | # Crashlytics plugin (for Android Studio and IntelliJ) 162 | com_crashlytics_export_strings.xml 163 | crashlytics.properties 164 | crashlytics-build.properties 165 | fabric.properties 166 | 167 | # Editor-based Rest Client 168 | .idea/httpRequests 169 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 wiwdata 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Presto Helm Chart 2 | 3 | Highly configurable Helm Presto Chart based on the `stable/presto` chart 4 | but significantly altered for greater flexibility: 5 | 6 | - Specify connectors within the values.yaml file to easily manage them 7 | without modifying the image. 8 | - Separated resources and selectors/affinities for coordinator and 9 | worker deployments given the different naturesmofmthe two 10 | deployments. 11 | - Override and add configuration properties and JVM configuration 12 | within the values.yaml file. 13 | - Templated bootstrapping within the containers allows for 14 | additional runtime configuration makes for more natural 15 | injection of environmental data. Particularly useful for 16 | rendering secrets into configurations and connectors via 17 | container environment variables. 18 | 19 | Check out the example [values.yaml](presto/values.yaml) file for 20 | more detailed documentation and examples of how the above chamges 21 | work. 22 | 23 | # Basic Chart Installation 24 | 25 | This chart is packaged for easy install and any of the packaged versions stored 26 | in the [charts](charts) directory can be installed via their download URL: 27 | 28 | ```bash 29 | $ helm install \ 30 | --name my-presto \ 31 | --namespace my-presto-namespace \ 32 | --values values.yaml \ 33 | https://github.com/wiwdata/presto-chart/raw/master/charts/presto-1.tgz 34 | ``` 35 | 36 | where the `values.yaml` is one you've created locally. For more details about 37 | the chart see the chart [README](presto/README.md). 38 | -------------------------------------------------------------------------------- /charts/index.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | entries: 3 | presto: 4 | - apiVersion: v1 5 | created: 2019-03-03T14:42:11.3460718-06:00 6 | description: Distributed SQL query engine for running interactive analytic queries 7 | digest: f9e484a68b1f5cf5f446e5d24893edb2ea6d8430bc4bded159568568b2949549 8 | home: https://prestodb.io 9 | icon: https://prestodb.io/static/presto.png 10 | maintainers: 11 | - email: data@wheniwork.com 12 | name: Scott Ernst 13 | name: presto 14 | sources: 15 | - https://github.com/facebook/presto 16 | urls: 17 | - presto-1.tgz 18 | version: "1" 19 | generated: 2019-03-03T14:42:11.3450725-06:00 20 | -------------------------------------------------------------------------------- /charts/presto-1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwdata/presto-chart/24410fc64231e0778950a23f961d1b9f771348d9/charts/presto-1.tgz -------------------------------------------------------------------------------- /image/.dockerignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Python template 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | local_settings.py 59 | db.sqlite3 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | target/ 73 | 74 | # Jupyter Notebook 75 | .ipynb_checkpoints 76 | 77 | # pyenv 78 | .python-version 79 | 80 | # celery beat schedule file 81 | celerybeat-schedule 82 | 83 | # SageMath parsed files 84 | *.sage.py 85 | 86 | # Environments 87 | .env 88 | .venv 89 | env/ 90 | venv/ 91 | ENV/ 92 | env.bak/ 93 | venv.bak/ 94 | 95 | # Spyder project settings 96 | .spyderproject 97 | .spyproject 98 | 99 | # Rope project settings 100 | .ropeproject 101 | 102 | # mkdocs documentation 103 | /site 104 | 105 | # mypy 106 | .mypy_cache/ 107 | ### JetBrains template 108 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 109 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 110 | 111 | # User-specific stuff 112 | .idea/**/workspace.xml 113 | .idea/**/tasks.xml 114 | .idea/**/usage.statistics.xml 115 | .idea/**/dictionaries 116 | .idea/**/shelf 117 | 118 | # Sensitive or high-churn files 119 | .idea/**/dataSources/ 120 | .idea/**/dataSources.ids 121 | .idea/**/dataSources.local.xml 122 | .idea/**/sqlDataSources.xml 123 | .idea/**/dynamic.xml 124 | .idea/**/uiDesigner.xml 125 | .idea/**/dbnavigator.xml 126 | 127 | # Gradle 128 | .idea/**/gradle.xml 129 | .idea/**/libraries 130 | 131 | # Gradle and Maven with auto-import 132 | # When using Gradle or Maven with auto-import, you should exclude module files, 133 | # since they will be recreated, and may cause churn. Uncomment if using 134 | # auto-import. 135 | # .idea/modules.xml 136 | # .idea/*.iml 137 | # .idea/modules 138 | 139 | # CMake 140 | cmake-build-*/ 141 | 142 | # Mongo Explorer plugin 143 | .idea/**/mongoSettings.xml 144 | 145 | # File-based project format 146 | *.iws 147 | 148 | # IntelliJ 149 | out/ 150 | 151 | # mpeltonen/sbt-idea plugin 152 | .idea_modules/ 153 | 154 | # JIRA plugin 155 | atlassian-ide-plugin.xml 156 | 157 | # Cursive Clojure plugin 158 | .idea/replstate.xml 159 | 160 | # Crashlytics plugin (for Android Studio and IntelliJ) 161 | com_crashlytics_export_strings.xml 162 | crashlytics.properties 163 | crashlytics-build.properties 164 | fabric.properties 165 | 166 | # Editor-based Rest Client 167 | .idea/httpRequests 168 | 169 | -------------------------------------------------------------------------------- /image/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-slim 2 | 3 | ARG PRESTO_VERSION 4 | ARG MIRROR="https://repo1.maven.org/maven2/com/facebook/presto" 5 | ARG PRESTO_BIN="${MIRROR}/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz" 6 | ARG PRESTO_CLI_BIN="${MIRROR}/presto-cli/${PRESTO_VERSION}/presto-cli-${PRESTO_VERSION}-executable.jar" 7 | 8 | USER root 9 | 10 | RUN apt-get update \ 11 | && apt-get install -y --allow-unauthenticated \ 12 | curl \ 13 | wget \ 14 | less \ 15 | vim \ 16 | python3 \ 17 | python3-pip \ 18 | && apt-get clean \ 19 | && rm -rf /var/lib/apt/lists/* \ 20 | && ln -s /usr/bin/python3 /usr/bin/python \ 21 | && pip3 install \ 22 | jinja2 23 | 24 | ENV PRESTO_HOME /presto 25 | ENV PRESTO_USER presto 26 | ENV PRESTO_DATA_DIR ${PRESTO_HOME}/data 27 | ENV PRESTO_CONFIGS_DIR ${PRESTO_HOME}/etc/conf 28 | ENV PRESTO_CATALOG_DIR ${PRESTO_HOME}/etc/catalog 29 | ENV TEMPLATE_DIR ${PRESTO_HOME}/templates 30 | ENV TEMPLATE_DEFAULT_DIR ${TEMPLATE_DIR}/default_conf 31 | ENV TEMPLATE_CUSTOM_DIR ${TEMPLATE_DIR}/custom_conf 32 | ENV TEMPLATE_CATALOG_DIR ${TEMPLATE_DIR}/catalog 33 | ENV PATH $PATH:$PRESTO_HOME/bin 34 | 35 | RUN useradd \ 36 | --create-home \ 37 | --home-dir ${PRESTO_HOME} \ 38 | --shell /bin/bash \ 39 | $PRESTO_USER \ 40 | && mkdir -p $PRESTO_HOME \ 41 | && wget --quiet $PRESTO_BIN \ 42 | && tar xzf presto-server-${PRESTO_VERSION}.tar.gz \ 43 | && rm -rf presto-server-${PRESTO_VERSION}.tar.gz \ 44 | && mv presto-server-${PRESTO_VERSION}/* $PRESTO_HOME \ 45 | && rm -rf presto-server-${PRESTO_VERSION} \ 46 | && mkdir -p ${PRESTO_CONFIGS_DIR} \ 47 | && mkdir -p ${PRESTO_CATALOG_DIR} \ 48 | && mkdir -p ${TEMPLATE_DIR} \ 49 | && mkdir -p ${TEMPLATE_DEFAULT_DIR} \ 50 | && mkdir -p ${TEMPLATE_CUSTOM_DIR} \ 51 | && mkdir -p ${TEMPLATE_CATALOG_DIR} \ 52 | && mkdir -p ${PRESTO_DATA_DIR} \ 53 | && cd ${PRESTO_HOME}/bin \ 54 | && wget --quiet ${PRESTO_CLI_BIN} \ 55 | && mv presto-cli-${PRESTO_VERSION}-executable.jar presto \ 56 | && chmod +x presto \ 57 | && chown -R ${PRESTO_USER}:${PRESTO_USER} ${PRESTO_HOME} 58 | 59 | COPY hive-aux-jars/aws-emr-jsonserde.jar \ 60 | ${PRESTO_HOME}/plugin/hive-hadoop2/aws-emr-jsonserde.jar 61 | COPY hive-aux-jars/json-serde-1.3.8-jar-with-dependencies.jar \ 62 | ${PRESTO_HOME}/plugin/hive-hadoop2/openx-json-serde.jar 63 | COPY template_configs ${TEMPLATE_DEFAULT_DIR} 64 | COPY presto-entrypoint.py ${PRESTO_HOME}/presto-entrypoint.py 65 | 66 | RUN chown ${PRESTO_USER}:${PRESTO_USER} \ 67 | ${PRESTO_HOME}/plugin/hive-hadoop2/aws-emr-jsonserde.jar \ 68 | ${PRESTO_HOME}/plugin/hive-hadoop2/openx-json-serde.jar \ 69 | && chmod 644 \ 70 | ${PRESTO_HOME}/plugin/hive-hadoop2/aws-emr-jsonserde.jar \ 71 | ${PRESTO_HOME}/plugin/hive-hadoop2/openx-json-serde.jar \ 72 | && chmod -R 755 ${TEMPLATE_DIR} 73 | 74 | USER ${PRESTO_USER} 75 | WORKDIR ${PRESTO_HOME} 76 | 77 | EXPOSE 8080 78 | 79 | CMD ["python3", "presto-entrypoint.py"] 80 | -------------------------------------------------------------------------------- /image/hive-aux-jars/aws-emr-jsonserde.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwdata/presto-chart/24410fc64231e0778950a23f961d1b9f771348d9/image/hive-aux-jars/aws-emr-jsonserde.jar -------------------------------------------------------------------------------- /image/hive-aux-jars/json-serde-1.3.8-jar-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiwdata/presto-chart/24410fc64231e0778950a23f961d1b9f771348d9/image/hive-aux-jars/json-serde-1.3.8-jar-with-dependencies.jar -------------------------------------------------------------------------------- /image/manager.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import subprocess 4 | 5 | import requests 6 | 7 | IMAGE = 'wiwdata/presto' 8 | VERSION_URL = 'https://api.github.com/repos/prestodb/presto/tags' 9 | 10 | 11 | def build(version: str): 12 | """Build image""" 13 | return subprocess.run([ 14 | 'docker', 'build', 15 | '--tag', f'{IMAGE}:{version}', 16 | '--build-arg', 'PRESTO_VERSION={}'.format(version), 17 | os.path.realpath(os.path.dirname(__file__)) 18 | ]) 19 | 20 | 21 | def run(version: str): 22 | """Run container with bash shell.""" 23 | return subprocess.run([ 24 | 'docker', 'run', 25 | '--rm', '-it', 26 | f'{IMAGE}:{version}', 27 | '/bin/bash' 28 | ]) 29 | 30 | 31 | def push(version: str): 32 | """Push image to docker hub.""" 33 | return subprocess.run(['docker', 'push', f'{IMAGE}:{version}']) 34 | 35 | 36 | def main(): 37 | """Manages the presto image.""" 38 | parser = argparse.ArgumentParser() 39 | parser.add_argument('action', choices=['build', 'run', 'push', 'version']) 40 | parser.add_argument('--version') 41 | args = parser.parse_args() 42 | 43 | version = args.version 44 | if version is None: 45 | version = requests.get(VERSION_URL).json()[0]['name'] 46 | 47 | if args.action == 'version': 48 | print(f'Presto Version {version}') 49 | return 50 | 51 | actions = {'build': build, 'run': run, 'push': push} 52 | actions[args.action](version) 53 | 54 | 55 | if __name__ == '__main__': 56 | main() 57 | -------------------------------------------------------------------------------- /image/presto-entrypoint.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import glob 5 | import os 6 | from pathlib import Path 7 | import shutil 8 | import subprocess 9 | import textwrap 10 | import typing 11 | from uuid import uuid4 12 | 13 | from jinja2 import Environment 14 | from jinja2 import FileSystemLoader 15 | 16 | # Environment-variables for directory locations set during docker build. 17 | HOME_DIRECTORY = os.environ['PRESTO_HOME'] 18 | CONFIGS_DIRECTORY = os.environ['PRESTO_CONFIGS_DIR'] 19 | CATALOG_DIRECTORY = os.environ['PRESTO_CATALOG_DIR'] 20 | DATA_DIRECTORY = os.environ['PRESTO_DATA_DIR'] 21 | TEMPLATE_DIRECTORY = os.environ['TEMPLATE_DIR'] 22 | TEMPLATE_DEFAULT_DIRECTORY = os.environ['TEMPLATE_DEFAULT_DIR'] 23 | TEMPLATE_CUSTOM_DIRECTORY = os.environ['TEMPLATE_CUSTOM_DIR'] 24 | TEMPLATE_CATALOG_DIRECTORY = os.environ['TEMPLATE_CATALOG_DIR'] 25 | 26 | ENVIRONMENT = Environment( 27 | loader=FileSystemLoader(TEMPLATE_DIRECTORY) 28 | ) 29 | 30 | 31 | def _explode(line: str) -> typing.Tuple[str, str]: 32 | """ 33 | Explodes a properties config line into a key value pair 34 | and returns that as a tuple. Lines without values are 35 | returned with an empty string as the value. 36 | """ 37 | parts = line.split('=', 1) 38 | key = parts[0].strip() 39 | value = parts[1].strip() if len(parts) > 1 else '' 40 | return key, value 41 | 42 | 43 | def _get_custom_values(directory: str, filename: str) -> dict: 44 | """ 45 | Loads the user-specified custom properties file and explodes it into a 46 | dictionary for merging with the default values stored in the container. 47 | """ 48 | path = os.path.join(directory, filename) 49 | if not os.path.exists(path): 50 | return {} 51 | 52 | with open(path, 'r') as f: 53 | lines = f.read().strip().split('\n') 54 | 55 | return dict([_explode(line) for line in lines if line.strip()]) 56 | 57 | 58 | def render( 59 | template_name: str, 60 | output_directory: str, 61 | custom_directory: str = None, 62 | **kwargs 63 | ) -> str: 64 | """ 65 | Renders a template configuration file with the given 66 | arguments if the file does not already exist. The file may 67 | exist if a ConfigMap has been used to override the template 68 | entirely. 69 | """ 70 | filename = os.path.basename(template_name).replace('.jinja2', '') 71 | template = ENVIRONMENT.get_template(template_name) 72 | lines = template.render(**kwargs).strip().split('\n') 73 | 74 | # Create output by merging default and custom configuration 75 | # file contents such that custom values override the default 76 | # ones if they are specified. 77 | defaults = dict([_explode(line) for line in lines if line.strip()]) 78 | custom = ( 79 | _get_custom_values(custom_directory, filename) 80 | if custom_directory else 81 | {} 82 | ) 83 | configs = list({**defaults, **custom}.items()) 84 | configs.sort(key=lambda x: x[0]) 85 | output = '\n'.join(['{}={}'.format(*c) for c in configs]) 86 | 87 | path = os.path.join(output_directory, filename) 88 | with open(path, 'w') as f: 89 | f.write(output) 90 | os.chmod(path, 0o755) 91 | 92 | print('\n[RENDERED]: {}'.format(path)) 93 | print(textwrap.indent(output, ' ')) 94 | return path 95 | 96 | 97 | def bootstrap(arguments: dict): 98 | """ 99 | Executes pre-launch run-time configurations using the given arguments 100 | to modify the configuration process. 101 | """ 102 | target_path = os.path.join(CONFIGS_DIRECTORY, 'jvm.config') 103 | path = os.path.join(TEMPLATE_CUSTOM_DIRECTORY, 'jvm.config') 104 | if not os.path.exists(path): 105 | path = os.path.join(TEMPLATE_DEFAULT_DIRECTORY, 'jvm.config') 106 | shutil.copy2(path, target_path) 107 | os.chmod(target_path, 0o755) 108 | print('\n[ADDED]: jvm.config from {}'.format(path)) 109 | 110 | print('\n--- Bootstrapping Configuration Files ---') 111 | glob_path = os.path.join(TEMPLATE_DEFAULT_DIRECTORY, '*.properties.jinja2') 112 | for path in glob.iglob(glob_path): 113 | template_path = path.replace(TEMPLATE_DIRECTORY, '').strip('/') 114 | render( 115 | template_name=template_path, 116 | output_directory=CONFIGS_DIRECTORY, 117 | custom_directory=TEMPLATE_CUSTOM_DIRECTORY, 118 | **arguments 119 | ) 120 | # Render custom configs that don't have a default template 121 | default_directory = Path(TEMPLATE_DEFAULT_DIRECTORY) 122 | default_config_names = { 123 | path.stem 124 | for path in default_directory.glob("*.properties.jinja2") 125 | } 126 | custom_directory = Path(TEMPLATE_CUSTOM_DIRECTORY) 127 | for path in custom_directory.glob("*.properties"): 128 | if path.name not in default_config_names: 129 | render( 130 | template_name=str(path.relative_to(Path(TEMPLATE_DIRECTORY))), 131 | output_directory=CONFIGS_DIRECTORY, 132 | **arguments 133 | ) 134 | 135 | print('\n--- Boostrapping Catalog Files ---') 136 | glob_path = os.path.join(TEMPLATE_CATALOG_DIRECTORY, '*.properties') 137 | for path in glob.iglob(glob_path): 138 | template_path = path.replace(TEMPLATE_DIRECTORY, '').strip('/') 139 | render( 140 | template_name=template_path, 141 | output_directory=CATALOG_DIRECTORY, 142 | **arguments 143 | ) 144 | 145 | 146 | def launch(arguments: dict): 147 | """Starts the presto service running within the container.""" 148 | conf_dir = CONFIGS_DIRECTORY 149 | print('\n[LAUNCH]: Starting Presto') 150 | cmd = [ 151 | 'launcher', 'run', 152 | '--node-config={}/node.properties'.format(conf_dir), 153 | '--jvm-config={}/jvm.config'.format(conf_dir), 154 | '--config={}/config.properties'.format(conf_dir), 155 | '--log-levels-file={}/log.properties'.format(conf_dir) 156 | ] 157 | 158 | print(textwrap.indent('\n'.join(cmd), ' '), '\n\n') 159 | if not arguments['dry_run']: 160 | subprocess.run(cmd) 161 | else: 162 | print('[DRY-RUN]: Skipped launch call\n\n') 163 | 164 | 165 | def parse() -> dict: 166 | """ 167 | Parses command line arguments and returns a dictionary of results that 168 | also includes specific environment variables that can be used. 169 | """ 170 | default_node_id = os.environ.get('POD_NAME') or str(uuid4()) 171 | parser = argparse.ArgumentParser() 172 | parser.add_argument('--coordinator', action='store_true') 173 | parser.add_argument('--node-id', default=default_node_id) 174 | parser.add_argument('--log-level', default='INFO') 175 | parser.add_argument('--environment', default='production') 176 | parser.add_argument('--discovery-uri', default='127.0.0.1') 177 | parser.add_argument('--discovery-port', default='80') 178 | parser.add_argument('--dry-run', action='store_true') 179 | 180 | # Include environment variables with specific prefixes so these can be 181 | # rendered into the template. 182 | envs = { 183 | k: str(v) 184 | for k, v in os.environ.items() 185 | if k.startswith(('PRESTO_', 'TEMPLATE_', 'SECRET_', 'USER_')) 186 | } 187 | return {**envs, **vars(parser.parse_args())} 188 | 189 | 190 | def run(): 191 | """Executes the launch process with bootstrapped configuration.""" 192 | arguments = parse() 193 | print('\n\n============== SETTINGS ==============') 194 | print('\n'.join([ 195 | ' * {k}: {v}'.format(k=k, v=v) 196 | for k, v in sorted(arguments.items(), key=lambda x: x[0]) 197 | ])) 198 | 199 | print('\n\n============== BOOTSTRAPPING ==============') 200 | bootstrap(arguments) 201 | 202 | print('\n\n============== LAUNCHING ==============') 203 | launch(arguments) 204 | 205 | 206 | if __name__ == '__main__': 207 | run() 208 | -------------------------------------------------------------------------------- /image/template_configs/config.properties.jinja2: -------------------------------------------------------------------------------- 1 | coordinator={{ "true" if coordinator else "false" }} 2 | {% if coordinator %} 3 | node-scheduler.include-coordinator=false 4 | discovery-server.enabled=true 5 | http-server.log.path={{ data_root }}/http-request.log 6 | {% endif %} 7 | http-server.http.port=8080 8 | discovery.uri=http://{{ discovery_uri }}:{{ discovery_port }} -------------------------------------------------------------------------------- /image/template_configs/jvm.config: -------------------------------------------------------------------------------- 1 | -server 2 | -Xmx4G 3 | -XX:+UseG1GC 4 | -XX:G1HeapRegionSize=32M 5 | -XX:+UseGCOverheadLimit 6 | -XX:+ExplicitGCInvokesConcurrent 7 | -XX:+HeapDumpOnOutOfMemoryError 8 | -XX:+ExitOnOutOfMemoryError 9 | -------------------------------------------------------------------------------- /image/template_configs/log.properties.jinja2: -------------------------------------------------------------------------------- 1 | com.facebook.presto={{ log_level }} 2 | -------------------------------------------------------------------------------- /image/template_configs/node.properties.jinja2: -------------------------------------------------------------------------------- 1 | node.environment={{ environment }} 2 | node.id={{ node_id }} 3 | node.data-dir=/presto/data 4 | catalog.config-dir=/presto/etc/catalog 5 | plugin.dir=/presto/plugin 6 | -------------------------------------------------------------------------------- /presto/.helmignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Python template 3 | # Byte-compiled / optimized / DLL files 4 | __pycache__/ 5 | *.py[cod] 6 | *$py.class 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Distribution / packaging 12 | .Python 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | local_settings.py 59 | db.sqlite3 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | target/ 73 | 74 | # Jupyter Notebook 75 | .ipynb_checkpoints 76 | 77 | # pyenv 78 | .python-version 79 | 80 | # celery beat schedule file 81 | celerybeat-schedule 82 | 83 | # SageMath parsed files 84 | *.sage.py 85 | 86 | # Environments 87 | .env 88 | .venv 89 | env/ 90 | venv/ 91 | ENV/ 92 | env.bak/ 93 | venv.bak/ 94 | 95 | # Spyder project settings 96 | .spyderproject 97 | .spyproject 98 | 99 | # Rope project settings 100 | .ropeproject 101 | 102 | # mkdocs documentation 103 | /site 104 | 105 | # mypy 106 | .mypy_cache/ 107 | ### JetBrains template 108 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 109 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 110 | 111 | # User-specific stuff 112 | .idea/ 113 | 114 | # CMake 115 | cmake-build-*/ 116 | 117 | # File-based project format 118 | *.iws 119 | 120 | # IntelliJ 121 | out/ 122 | 123 | # mpeltonen/sbt-idea plugin 124 | .idea_modules/ 125 | 126 | # JIRA plugin 127 | atlassian-ide-plugin.xml 128 | 129 | # Crashlytics plugin (for Android Studio and IntelliJ) 130 | com_crashlytics_export_strings.xml 131 | crashlytics.properties 132 | crashlytics-build.properties 133 | fabric.properties 134 | -------------------------------------------------------------------------------- /presto/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Distributed SQL query engine for running interactive analytic queries 3 | name: presto 4 | version: 1.0 5 | home: https://prestodb.io 6 | icon: https://prestodb.io/static/presto.png 7 | sources: 8 | - https://github.com/facebook/presto 9 | maintainers: 10 | - name: Scott Ernst 11 | email: data@wheniwork.com 12 | -------------------------------------------------------------------------------- /presto/README.md: -------------------------------------------------------------------------------- 1 | # Presto Chart 2 | 3 | [Presto](http://prestodb.io/) is an open source distributed SQL query engine 4 | originally created by Facebook that is used for running interactive analytic 5 | queries against data sources of all sizes. 6 | 7 | ## Chart Details 8 | 9 | This chart will do the following: 10 | 11 | * Install a deployment with a single coordinator. 12 | * Install a configmap to manage the settings of the coordinator. 13 | * Install a deployment with N number of workers for distributed processing. 14 | * Install a configmap to manage the settings of the workers. 15 | * Install a configmap containing the catalog of connectors from which presto 16 | will query. 17 | * Install a service that exposes the http UI and API of the coordinator as 18 | desired. 19 | 20 | ## Installing the Chart 21 | 22 | To install the chart with the release name `my-release`: 23 | 24 | ```bash 25 | $ helm install --name my-release --namespace my-namespace ./presto 26 | ``` 27 | 28 | ## Configuration 29 | 30 | Configurable values are documented in the `values.yaml`. 31 | 32 | Specify each parameter using the `--set key=value[,key=value]` argument to 33 | `helm install`. 34 | 35 | Alternatively, a YAML file that specifies the values for the parameters can 36 | be provided while installing the chart. For example, 37 | 38 | ```bash 39 | $ helm install --name my-release -f values.yaml ./presto 40 | ``` 41 | 42 | > **Tip**: You can use the default [values.yaml](values.yaml) 43 | -------------------------------------------------------------------------------- /presto/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Get the application URL by running these commands: 2 | {{- if contains "NodePort" .Values.service.type }} 3 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "presto.fullname" . }}) 4 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 5 | echo http://$NODE_IP:$NODE_PORT 6 | {{- else if contains "ClusterIP" .Values.service.type }} 7 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "presto.name" . }},release={{ .Release.Name }},component=coordinator" -o jsonpath="{.items[0].metadata.name}") 8 | echo "Visit http://127.0.0.1:8080 to use your application" 9 | kubectl port-forward $POD_NAME 8080:8080 10 | {{- end }} 11 | -------------------------------------------------------------------------------- /presto/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "presto.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "presto.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{- define "presto.coordinator" -}} 28 | {{ template "presto.fullname" . }}-coordinator 29 | {{- end -}} 30 | 31 | {{- define "presto.worker" -}} 32 | {{ template "presto.fullname" . }}-worker 33 | {{- end -}} 34 | 35 | {{/* 36 | Create chart name and version as used by the chart label. 37 | */}} 38 | {{- define "presto.chart" -}} 39 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 40 | {{- end -}} 41 | -------------------------------------------------------------------------------- /presto/templates/configmap-catalog.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "presto.name" . }}-catalog 5 | labels: 6 | app: {{ template "presto.name" . }} 7 | chart: {{ template "presto.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | data: 11 | {{ toYaml .Values.catalog | indent 2 }} 12 | 13 | --- 14 | -------------------------------------------------------------------------------- /presto/templates/configmap-coordinator.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "presto.coordinator" . }} 5 | labels: 6 | app: {{ template "presto.name" . }} 7 | chart: {{ template "presto.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: coordinator 11 | data: 12 | {{ toYaml .Values.coordinatorConfigs | indent 2 }} 13 | 14 | --- 15 | -------------------------------------------------------------------------------- /presto/templates/configmap-worker.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "presto.worker" . }} 5 | labels: 6 | app: {{ template "presto.name" . }} 7 | chart: {{ template "presto.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: worker 11 | data: 12 | {{ toYaml .Values.workerConfigs | indent 2 }} 13 | --- 14 | -------------------------------------------------------------------------------- /presto/templates/deployment-coordinator.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta2 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "presto.coordinator" . }} 5 | labels: 6 | app: {{ template "presto.name" . }} 7 | chart: {{ template "presto.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: coordinator 11 | spec: 12 | selector: 13 | matchLabels: 14 | app: {{ template "presto.name" . }} 15 | release: {{ .Release.Name }} 16 | component: coordinator 17 | template: 18 | metadata: 19 | labels: 20 | app: {{ template "presto.name" . }} 21 | release: {{ .Release.Name }} 22 | component: coordinator 23 | spec: 24 | {{ if .Values.containerSpec }} 25 | {{ toYaml .Values.containerSpec | indent 6 }} 26 | {{ end }} 27 | volumes: 28 | - name: catalog-volume 29 | configMap: 30 | name: {{ template "presto.name" . }}-catalog 31 | - name: config-volume 32 | configMap: 33 | name: {{ template "presto.coordinator" . }} 34 | containers: 35 | - name: {{ .Chart.Name }}-coordinator 36 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 37 | imagePullPolicy: {{ default "IfNotPresent" .Values.image.pullPolicy }} 38 | command: ["python3", "presto-entrypoint.py"] 39 | args: 40 | - "--environment={{ default "production" .Values.presto.environment }}" 41 | - "--discovery-uri={{ template "presto.fullname" . }}" 42 | - "--discovery-port={{ default 80 .Values.presto.servicePort }}" 43 | - "--log-level={{ default "ERROR" .Values.presto.logLevel }}" 44 | - "--coordinator" 45 | tty: true 46 | ports: 47 | - containerPort: 8080 48 | protocol: TCP 49 | env: 50 | - name: NODE_NAME 51 | valueFrom: 52 | fieldRef: 53 | fieldPath: spec.nodeName 54 | - name: POD_NAME 55 | valueFrom: 56 | fieldRef: 57 | fieldPath: metadata.name 58 | {{ if .Values.environmentVariables }} 59 | {{ toYaml .Values.environmentVariables | indent 12 }} 60 | {{ end }} 61 | volumeMounts: 62 | - mountPath: /presto/templates/catalog 63 | name: catalog-volume 64 | - mountPath: /presto/templates/custom_conf 65 | name: config-volume 66 | resources: 67 | {{ toYaml .Values.coordinatorResources | indent 12 }} 68 | {{- with .Values.coordinatorNodeSelector }} 69 | nodeSelector: 70 | {{ toYaml . | indent 8 }} 71 | {{- end }} 72 | {{- with .Values.coordinatorAffinity }} 73 | affinity: 74 | {{ toYaml . | indent 8 }} 75 | {{- end }} 76 | {{- with .Values.coordinatorTolerations }} 77 | tolerations: 78 | {{ toYaml . | indent 8 }} 79 | {{- end }} 80 | 81 | --- 82 | -------------------------------------------------------------------------------- /presto/templates/deployment-worker.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta2 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "presto.worker" . }} 5 | labels: 6 | app: {{ template "presto.name" . }} 7 | chart: {{ template "presto.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | component: worker 11 | spec: 12 | replicas: {{ default 0 .Values.presto.workers }} 13 | selector: 14 | matchLabels: 15 | app: {{ template "presto.name" . }} 16 | release: {{ .Release.Name }} 17 | component: worker 18 | template: 19 | metadata: 20 | labels: 21 | app: {{ template "presto.name" . }} 22 | release: {{ .Release.Name }} 23 | component: worker 24 | spec: 25 | {{ if .Values.containerSpec }} 26 | {{ toYaml .Values.containerSpec | indent 6 }} 27 | {{ end }} 28 | volumes: 29 | - name: catalog-volume 30 | configMap: 31 | name: {{ template "presto.name" . }}-catalog 32 | - name: configs-volume 33 | configMap: 34 | name: {{ template "presto.worker" . }} 35 | containers: 36 | - name: {{ .Chart.Name }}-worker 37 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 38 | imagePullPolicy: {{ .Values.image.pullPolicy }} 39 | command: ["python3", "presto-entrypoint.py"] 40 | args: 41 | - "--environment={{ default "production" .Values.presto.environment }}" 42 | - "--discovery-uri={{ template "presto.fullname" . }}" 43 | - "--log-level={{ default "ERROR" .Values.presto.logLevel }}" 44 | tty: true 45 | env: 46 | - name: NODE_NAME 47 | valueFrom: 48 | fieldRef: 49 | fieldPath: spec.nodeName 50 | - name: POD_NAME 51 | valueFrom: 52 | fieldRef: 53 | fieldPath: metadata.name 54 | {{ if .Values.environmentVariables }} 55 | {{ toYaml .Values.environmentVariables | indent 12 }} 56 | {{ end }} 57 | volumeMounts: 58 | - mountPath: /presto/templates/catalog 59 | name: catalog-volume 60 | - mountPath: /presto/templates/custom_conf 61 | name: configs-volume 62 | resources: 63 | {{ toYaml .Values.workerResources | indent 12 }} 64 | {{- with .Values.workerNodeSelector }} 65 | nodeSelector: 66 | {{ toYaml . | indent 8 }} 67 | {{- end }} 68 | {{- with .Values.workerAffinity }} 69 | affinity: 70 | {{ toYaml . | indent 8 }} 71 | {{- end }} 72 | {{- with .Values.workerTolerations }} 73 | tolerations: 74 | {{ toYaml . | indent 8 }} 75 | {{- end }} 76 | 77 | --- 78 | -------------------------------------------------------------------------------- /presto/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "presto.fullname" . }} 5 | labels: 6 | app: {{ template "presto.name" . }} 7 | chart: {{ template "presto.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | - port: {{ default 80 .Values.presto.servicePort }} 14 | targetPort: 8080 15 | protocol: TCP 16 | selector: 17 | app: {{ template "presto.name" . }} 18 | release: {{ .Release.Name }} 19 | component: coordinator 20 | -------------------------------------------------------------------------------- /presto/values.yaml: -------------------------------------------------------------------------------- 1 | presto: 2 | # environment is the name given to the presto environment within all presto nodes 3 | # (containers). This value can be used to more easily distinguish colocated 4 | # installations. This value isn't as useful in kubernetes where installs are 5 | # already distinguished by kubernetes and helm. The most useful place for this 6 | # is in the presto web UI to identify the installation. 7 | environment: "production" 8 | 9 | # workers specifies the number of worker nodes (containers) to launch during 10 | # installation. This can be scaled later if desired. 11 | workers: 2 12 | 13 | # logLevel is the logging level for the presto service on each node. Should be 14 | # one of "DEBUG", "INFO", "WARN", or "ERROR". 15 | logLevel: "INFO" 16 | 17 | image: 18 | # repository is the name of the docker image that will be used in the Presto 19 | # coordinator and worker deployments. 20 | repository: "wiwdata/presto" 21 | 22 | # tag of the docker image that will be used by the coordinator and worker 23 | # deployments. 24 | tag: "0.217" 25 | 26 | # pullPolicy specifies the image pull policy for both the worker and 27 | # coordinator deployment containers. 28 | pullPolicy: "Always" 29 | 30 | # containerSpec allows for adding arbitrary yaml to the spec under which the 31 | # coordinator and worker definitions reside. This can be useful in cases where 32 | # private registry credentials are necessary pulling images. 33 | containerSpec: {} 34 | 35 | service: 36 | type: ClusterIP 37 | 38 | # catalog defines the connectors available within the presto environment. 39 | # Specify each value as a NAME.properties key and the values as the desired 40 | # contents of that catalog file. These will be loaded into the image as the 41 | # connector files. Prior to loading them in as connectors, they will be 42 | # rendered by Jinja2 using any supplied environment variables in the container 43 | # that begin with the prefixes USER_ or SECRET_. This can be used to 44 | # include secrets in catalog files at runtime using standard kubernetes 45 | # secret mapping techniques. 46 | catalog: {} 47 | # hive.properties: | 48 | # connector.name=hive-hadoop2 49 | # hive.metastore-cache-ttl=20m 50 | # hive.non-managed-table-writes-enabled=false 51 | # hive.s3-file-system-type=PRESTO 52 | # hive.hdfs.impersonation.enabled=true 53 | # hive.metastore=glue 54 | 55 | # coordinatorConfigs are configuration file values applied to the coordinator 56 | # container. Required and recommended defaults will be applied where any of 57 | # these are missing. For more details on files and options see: 58 | # https://prestodb.github.io/docs/current/installation/deployment.html 59 | # 60 | # If a jvm.config is specified here it will fully override the default 61 | # jvm.config bcause unlike the other properties independent settings are 62 | # not necessarily compatible and could lead to unstable behavior. 63 | # 64 | # These values are rendered with Jinja2 just like the catalog values above 65 | # to allow for greater flexibility in runtime configuration. 66 | coordinatorConfigs: {} 67 | # config.properties: | 68 | # http-server.log.max-size=10MB 69 | # http-server.log.max-history=5 70 | 71 | # workerConfigs are configuration file values applied to the worker containers. 72 | # This has the same behaviors as the coordinatorConfigs defined above. 73 | workerConfigs: {} 74 | 75 | 76 | # Additional environment variables to include in the containers. 77 | environmentVariables: 78 | # - name: SECRET_USERNAME 79 | # valueFrom: 80 | # secretKeyRef: 81 | # name: test-secret 82 | # key: username 83 | 84 | 85 | coordinatorResources: {} 86 | # We usually recommend not to specify default resources and to leave this as a conscious 87 | # choice for the user. This also increases chances charts run on environments with little 88 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 89 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 90 | # limits: 91 | # cpu: 100m 92 | # memory: 128Mi 93 | # requests: 94 | # cpu: 100m 95 | # memory: 128Mi 96 | 97 | workerResources: {} 98 | # We usually recommend not to specify default resources and to leave this as a conscious 99 | # choice for the user. This also increases chances charts run on environments with little 100 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 101 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 102 | # limits: 103 | # cpu: 100m 104 | # memory: 128Mi 105 | # requests: 106 | # cpu: 100m 107 | # memory: 128Mi 108 | 109 | coordinatorNodeSelector: {} 110 | workerNodeSelector: {} 111 | 112 | coordinatorTolerations: [] 113 | workerTolerations: {} 114 | 115 | coordinatorAffinity: {} 116 | workerAffinity: {} 117 | --------------------------------------------------------------------------------