├── .gitignore ├── Makefile ├── README.md ├── build.sh ├── geodocker-accumulo-geomesa ├── .dockerignore ├── .gitignore ├── .travis.yml ├── Dockerfile.template ├── LICENSE ├── Makefile ├── README.md ├── docker-compose.yml └── fs │ └── sbin │ └── register.sh ├── geodocker-accumulo ├── .gitignore ├── .travis.yml ├── Dockerfile.template ├── LICENSE ├── Makefile ├── README.md ├── docker-compose.yml ├── emr │ ├── README.md │ └── bootstrap-geodocker-accumulo.sh └── fs │ ├── opt │ └── accumulo │ │ └── conf │ │ ├── accumulo-env.sh │ │ ├── accumulo-site.xml.template │ │ ├── client.conf.template │ │ ├── generic_logger.xml │ │ ├── log4j.properties │ │ └── monitor_logger.xml │ └── sbin │ ├── accumulo-lib.sh │ └── entrypoint.sh ├── geodocker-base ├── .travis.yml ├── Dockerfile.template ├── LICENSE ├── Makefile └── README.md ├── geodocker-geomesa-jupyter ├── Dockerfile.template ├── GDELT+Analysis.ipynb ├── Makefile ├── js │ ├── countries.geo.json │ ├── leaflet.css │ ├── leaflet.js │ └── leaflet.wms.js ├── jupyter_notebook_config.py ├── start-notebook.sh ├── start-singleuser.sh ├── start.sh └── toree-0.2.0.dev1.tar.gz ├── geodocker-geoserver ├── .gitignore ├── .travis.yml ├── Dockerfile.template ├── LICENSE ├── Makefile ├── README.md └── server.xml ├── geodocker-hdfs ├── .travis.yml ├── Dockerfile.template ├── LICENSE ├── Makefile ├── README.md ├── docker-compose.yml └── fs │ ├── etc │ └── hadoop │ │ └── conf │ │ ├── core-site.xml.template │ │ ├── hdfs-site.xml.template │ │ └── log4j.properties │ └── sbin │ ├── entrypoint.sh │ └── hdfs-lib.sh └── geodocker-zookeeper ├── .travis.yml ├── Dockerfile.template ├── LICENSE ├── Makefile ├── README.md └── fs ├── opt └── zookeeper │ └── conf │ └── zoo.cfg └── sbin └── entrypoint.sh /.gitignore: -------------------------------------------------------------------------------- 1 | */ivy*jar 2 | geodocker-geomesa-jupyter/lib 3 | build 4 | build/zinc* 5 | build/scala* 6 | build/*.jar 7 | build/build.out 8 | docs/_build 9 | docs/common.pyc 10 | *.iws 11 | *.ipr 12 | *.iml 13 | *.idea/ 14 | *.log 15 | .*.swp 16 | .idea/** 17 | **/.classpath 18 | **/.project 19 | **/.settings 20 | target 21 | atlassian* 22 | geomesa-*.*.*-* 23 | **/src/main/resources/git.properties 24 | **/*.db 25 | .ipynb_checkpoints 26 | *.ipynb 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #build: base hdfs accumulo geomesa geoserver geomesa-jupyter 2 | build: 3 | cd geodocker-base && make 4 | cd geodocker-hdfs && make 5 | cd geodocker-accumulo && make 6 | cd geodocker-accumulo-geomesa && make 7 | cd geodocker-geoserver && make 8 | cd geodocker-geomesa-jupyter && make 9 | 10 | publish: base hdfs accumulo geomesa geoserver geomesa-jupyter 11 | 12 | base: 13 | cd geodocker-base && make publish 14 | 15 | hdfs: 16 | cd geodocker-hdfs && make publish 17 | 18 | accumulo: 19 | cd geodocker-accumulo && make publish 20 | 21 | geomesa: 22 | cd geodocker-accumulo-geomesa && make publish 23 | 24 | geoserver: 25 | cd geodocker-geoserver && make publish 26 | 27 | geomesa-jupyter: 28 | cd geodocker-geomesa-jupyter && make publish 29 | 30 | clean: 31 | cd geodocker-base && make clean 32 | cd geodocker-hdfs && make clean 33 | cd geodocker-accumulo && make cleanest 34 | cd geodocker-accumulo-geomesa && make cleanest 35 | cd geodocker-geoserver && make clean 36 | cd geodocker-geomesa-jupyter && make clean 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GeoDocker Geomesa 2 | 3 | Pre-built images are available on [quay.io](https://quay.io/organization/geomesa). 4 | 5 | To create a GeoMesa Accumulo instance, clone the repo and execute the following commands: 6 | 7 | ``` 8 | $ cd geodocker-accumulo-geomesa 9 | $ docker-compose up 10 | ``` 11 | 12 | This will create a small cluster consisting of HDFS, Zookeeper, Accumulo and GeoServer. The GeoMesa 13 | distributed-runtime jar is installed in the Accumulo classpath. The GeoMesa command line tools are 14 | installed in the Accumulo master instance under `/opt/geomesa/`. 15 | 16 | Accumulo is available on the standard ports, and GeoServer is available on port `9090`. 17 | 18 | # Image Versions 19 | 20 | The images used are specified in `docker-compose.yml`. 21 | 22 | By default, images from [quay.io](https://quay.io/organization/geomesa) are used, but you may modify 23 | the file to point to local images or another repository. 24 | 25 | # Quick Start 26 | 27 | To connect to the Accumulo master instance, run: 28 | 29 | ``` 30 | $ docker exec -ti geodocker-accumulo-geomesa_accumulo-master_1 /usr/bin/bash 31 | ``` 32 | 33 | To ingest some sample data, use the GeoMesa command line tools: 34 | 35 | ``` 36 | $ cd /opt/geomesa/bin 37 | $ ./geomesa-accumulo ingest -C example-csv -c example -u root -p GisPwd -s example-csv ../examples/ingest/csv/example.csv 38 | ``` 39 | 40 | To export data: 41 | 42 | ``` 43 | $ ./geomesa-accumulo export -c example -u root -p GisPwd -f example-csv 44 | ``` 45 | 46 | To view data in GeoServer, go to `http://localhost:9090/geoserver/web`, login with `admin:geoserver`, click 47 | 'Stores' in the left gutter, then 'Add new store', then `Accumulo (GeoMesa)`. Use the following parameters: 48 | 49 | * accumulo.instance.id = accumulo 50 | * accumulo.zookeepers = zookeeper 51 | * accumulo.user = root 52 | * accumulo.password = GisPwd 53 | * accumulo.catalog = example (from the ingest command above) 54 | 55 | Click 'save'. You should see the 'example-csv' layer available to publish. 56 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage() { echo "Usage: $0 [-t ] [-g ] [-a ]" 1>&2; exit 1; } 4 | 5 | ACCUMULO_VERSION=1.9.2 6 | GEOMESA_VERSION=2.2.1 7 | THRIFT_VERSION=0.9.3 8 | 9 | while getopts ":t:g:a:" o; do 10 | case "${o}" in 11 | a) 12 | ACCUMULO_VERSION=${OPTARG} 13 | ;; 14 | g) 15 | GEOMESA_VERSION=${OPTARG} 16 | ;; 17 | t) 18 | TAG=${OPTARG} 19 | ;; 20 | *) 21 | usage 22 | ;; 23 | esac 24 | done 25 | shift $((OPTIND-1)) 26 | 27 | if [ -z "$TAG" ]; then TAG=geomesa-${GEOMESA_VERSION}-accumulo-${ACCUMULO_VERSION}; fi 28 | 29 | echo "GEOMESA_VERSION = ${GEOMESA_VERSION}" 30 | echo "ACCUMULO_VERSION = ${ACCUMULO_VERSION}" 31 | echo "TAG = ${TAG}" 32 | 33 | export ACCUMULO_VERSION GEOMESA_VERSION TAG THRIFT_VERSION 34 | make publish 35 | 36 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/.dockerignore: -------------------------------------------------------------------------------- 1 | geomesa-1.2.? 2 | tarballs/geomesa-dist-1.2.?-bin.tar.gz 3 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/.gitignore: -------------------------------------------------------------------------------- 1 | geomesa-* 2 | geomesa-accumulo-distributed-runtime* 3 | tarballs/geomesa-* 4 | geomesa-tools-* 5 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: bash 3 | services: 4 | - docker 5 | env: 6 | global: 7 | - DOCKER_COMPOSE_VERSION=1.8.0 8 | - ORG=${TRAVIS_REPO_SLUG%/*} 9 | - REPO=${TRAVIS_REPO_SLUG#*/*-} 10 | - TAG=${TRAVIS_TAG:-${TRAVIS_COMMIT:0:7}} 11 | before_install: 12 | - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose 13 | - chmod +x docker-compose 14 | - sudo mv -f docker-compose /usr/local/bin 15 | install: 16 | - make -e build 17 | cache: 18 | directories: 19 | - ./tarballs 20 | script: 21 | - make -e test 22 | before_deploy: 23 | - docker login -p "${QUAY_PASSWORD}" -u "${QUAY_USER}" quay.io 24 | deploy: 25 | - provider: script 26 | script: make -e publish 27 | skip_cleanup: true 28 | on: 29 | branch: master 30 | - provider: script 31 | script: make -e publish 32 | skip_cleanup: true 33 | on: 34 | tags: true 35 | notifications: 36 | slack: 37 | secure: idqmmD0RAZS5TfMmE/bRGFUJpC4SSGnM7Sjs9dFVnlab64Po6SxdheMWzqweXAFHbVCtZYYBBw3Gq9gt5Rpv3+YfBAxgWq02xK3UlKwfPTL2NNqv8N28hCH7xuZL0VhdT5q8xDBO4Cmr2rNmg5LKTnY5WK+rnWAdhLaS/MtbMLaPLpS4NjyDlBsShF4NmqgBQUe5JFtgOtG21a13j7uTtixp5Xg8DvK0wnlLHiwsB43hA6BbKKn3Nrc9+BcLJ1OsvVhcGk8OPvw2d007bY+FjJ4CI+PjyvuXen+96B+W4cy8IJRak+/nSnPdCkk3QjTJBLTOPto5wgs4pDCYJcBW7OnXONZrfr/prrJjyCxcwy+b/cPtcoszDCVrZRUfdnqboRGbtrgp8qBr02tKcMD5xW2gAQW/rSXsWnU2b00goONSJ8ICZYM583D5LVaw+hzQfnlKONGnxMkHipNsJsNwgw4G2wzKS2+1N976IVD8FarUBhjmbZfMeO//4fg21N0YDWs9ZPp+kS36Mo7HRgzlYT9koCizF4JfBSlde6KybFF/pxVQx/5XLSzjsWiDTKwvKiureIXwG482Ku1gsHx7uR2k2V+1wmVEZgsrwGzJCRJVgptgpVng4ouVJfd4fmDENUo7F98vPNdRxNauY1sDq0DaVhmEHhlkyVkLC53818E= 38 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/Dockerfile.template: -------------------------------------------------------------------------------- 1 | FROM quay.io/geomesa/accumulo:__TAG__ 2 | 3 | ARG TAG 4 | ARG GEOMESA_VERSION 5 | ARG ACCUMULO_VERSION 6 | ARG THRIFT_VERSION 7 | 8 | ARG GEOMESA_VERSION 9 | ENV GEOMESA_VERSION ${GEOMESA_VERSION} 10 | ENV GEOMESA_DIST /opt/geomesa 11 | ENV GEOMESA_RUNTIME ${GEOMESA_DIST}/accumulo 12 | ENV GEOMESA_HOME ${GEOMESA_DIST} 13 | ENV PATH="${PATH}:${GEOMESA_HOME}/bin" 14 | 15 | ADD geomesa-accumulo_2.11-${GEOMESA_VERSION} ${GEOMESA_HOME} 16 | ADD geomesa-accumulo-distributed-runtime_2.11-${GEOMESA_VERSION}.jar ${ACCUMULO_HOME}/lib/ext/ 17 | 18 | RUN set -x \ 19 | && (echo yes | ${GEOMESA_DIST}/bin/install-jai.sh) \ 20 | && (echo yes | ${GEOMESA_DIST}/bin/install-jline.sh) 21 | 22 | COPY ./fs / 23 | ENTRYPOINT [ "/sbin/entrypoint.sh" ] 24 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/Makefile: -------------------------------------------------------------------------------- 1 | BASE := $(subst -, ,$(notdir ${CURDIR})) 2 | ORG := geomesa 3 | REPO := $(word 2, ${BASE})-$(word 3, ${BASE}) 4 | IMG := quay.io/${ORG}/${REPO} 5 | DIST_TARBALL := tarballs/geomesa-accumulo-dist_2.11-${GEOMESA_VERSION}-bin.tar.gz 6 | RUNTIME := geomesa-accumulo-distributed-runtime_2.11-${GEOMESA_VERSION}.jar 7 | 8 | build: ${RUNTIME} dockerfile 9 | docker build \ 10 | --build-arg GEOMESA_VERSION=${GEOMESA_VERSION} \ 11 | --build-arg TAG=${TAG} \ 12 | --build-arg ACCUMULO_VERSION=${ACCUMULO_VERSION} \ 13 | -f target/Dockerfile \ 14 | -t ${IMG}:${TAG} . 15 | 16 | dockerfile: 17 | mkdir -p target 18 | sed 's/__TAG__/'"${TAG}"'/' Dockerfile.template > target/Dockerfile 19 | 20 | 21 | ${DIST_TARBALL}: 22 | (mkdir -p tarballs; cd tarballs ; cp ${HOME}/.m2/repository/org/locationtech/geomesa/geomesa-accumulo-dist_2.11/${GEOMESA_VERSION}/geomesa-accumulo-dist_2.11-${GEOMESA_VERSION}-bin.tar.gz . ) 23 | 24 | ${RUNTIME}: ${DIST_TARBALL} 25 | tar zxvf $< 26 | cp geomesa-accumulo_2.11-${GEOMESA_VERSION}/dist/accumulo/${RUNTIME} . 27 | 28 | publish: build 29 | docker push ${IMG}:${TAG} 30 | 31 | clean: 32 | rm -rf geomesa-accumulo_2.11-* 33 | rm -rf tarballs 34 | 35 | cleanest: clean 36 | rm -f geomesa-accumulo-dist* 37 | rm -rf tarballs 38 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/README.md: -------------------------------------------------------------------------------- 1 | # GeoDocker Accumulo GeoMesa 2 | 3 | [![Build Status](https://api.travis-ci.org/geodocker/geodocker-accumulo.svg)](http://travis-ci.org/geodocker/geodocker-accumulo-geomesa) 4 | [![Docker Repository on Quay](https://quay.io/repository/geodocker/base/status "Docker Repository on Quay")](https://quay.io/repository/geodocker/accumulo) 5 | [![Join the chat at https://gitter.im/geotrellis/geotrellis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/geotrellis/geotrellis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | [Apache Accumulo](https://accumulo.apache.org/) container for [GeoDocker Cluster](https://github.com/geodocker/geodocker) 8 | 9 | # Roles 10 | This container has three roles that can be supplied as `CMD`: 11 | 12 | - `master` - master instance, handles synchronization 13 | - `--auto-init` - initialize an accumulo instance if one is not found at `hdfs://${HADOOP_MASTER_ADDRESS}/accumulo` 14 | - `tserver` - tablet server, serves data 15 | - `monitor` - monitor instance, provides Web GUI at 50095 16 | - `gc` - garbage collector for accumulo tablets 17 | - `tracer` - trace for debugging 18 | 19 | # Environment 20 | - `HADOOP_MASTER_ADDRESS` - hostname for accumulo root, required for all roles 21 | - `ZOOKEEPERS` - list of zookeeper instance, at least one 22 | - `ACCUMULO_SECRET` - secret value for inter-instance communication 23 | - `INSTANCE_NAME` - accumulo instance name 24 | - `ACCUMULO_PASSWORD` - root password 25 | 26 | # Testing 27 | This container should be tested with `docker-compose` and through `make test` 28 | 29 | # Use on Amazon EMR 30 | For information on the use of this container and its siblings on top of 31 | EMR, go 32 | [here](https://github.com/geodocker/geodocker-accumulo/tree/master/emr). 33 | 34 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | geoserver: 4 | image: quay.io/geomesa/geoserver:geomesa-2.2.1-accumulo-1.9.2 5 | ports: 6 | - 9090:9090 7 | hdfs-name: 8 | image: quay.io/geomesa/hdfs:geomesa-2.2.1-accumulo-1.9.2 9 | command: name 10 | environment: 11 | HADOOP_MASTER_ADDRESS: hdfs-name 12 | ports: 13 | - 50070:50070 14 | hdfs-data: 15 | image: quay.io/geomesa/hdfs:geomesa-2.2.1-accumulo-1.9.2 16 | command: data 17 | environment: 18 | HADOOP_MASTER_ADDRESS: hdfs-name 19 | depends_on: 20 | - hdfs-name 21 | zookeeper: 22 | image: quay.io/geomesa/zookeeper:latest 23 | ports: 24 | - 2181:2181 25 | accumulo-master: 26 | image: quay.io/geomesa/accumulo-geomesa:geomesa-2.2.1-accumulo-1.9.2 27 | command: master --auto-init 28 | environment: 29 | HADOOP_MASTER_ADDRESS: hdfs-name 30 | ZOOKEEPERS: zookeeper 31 | ACCUMULO_PASSWORD: GisPwd 32 | depends_on: 33 | - zookeeper 34 | accumulo-monitor: 35 | image: quay.io/geomesa/accumulo-geomesa:geomesa-2.2.1-accumulo-1.9.2 36 | command: monitor 37 | environment: 38 | HADOOP_MASTER_ADDRESS: hdfs-name 39 | ZOOKEEPERS: zookeeper 40 | ports: 41 | - 9995:9995 42 | - 50095:50095 43 | depends_on: 44 | - zookeeper 45 | - accumulo-master 46 | accumulo-tserver: 47 | image: quay.io/geomesa/accumulo-geomesa:geomesa-2.2.1-accumulo-1.9.2 48 | command: tserver 49 | environment: 50 | HADOOP_MASTER_ADDRESS: hdfs-name 51 | ZOOKEEPERS: zookeeper 52 | depends_on: 53 | - zookeeper 54 | - accumulo-master 55 | 56 | -------------------------------------------------------------------------------- /geodocker-accumulo-geomesa/fs/sbin/register.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | source /sbin/accumulo-lib.sh 5 | 6 | ACCUMULO_USER=${ACCUMULO_USER:-root} 7 | 8 | wait_until_accumulo_is_available ${INSTANCE_NAME} ${ZOOKEEPERS} 9 | accumulo shell -u ${ACCUMULO_USER} -p ${ACCUMULO_PASSWORD} -e \ 10 | "createnamespace geomesa" 11 | accumulo shell -u ${ACCUMULO_USER} -p ${ACCUMULO_PASSWORD} -e \ 12 | "config -s general.vfs.context.classpath.geomesa=file:///opt/geomesa/accumulo/[^.].*.jar" 13 | accumulo shell -u ${ACCUMULO_USER} -p ${ACCUMULO_PASSWORD} -e \ 14 | "config -ns geomesa -s table.classpath.context=geomesa" 15 | echo "Accumulo namespace configured: geomesa" 16 | 17 | -------------------------------------------------------------------------------- /geodocker-accumulo/.gitignore: -------------------------------------------------------------------------------- 1 | accumulo-1.?.?-bin.tar.gz 2 | -------------------------------------------------------------------------------- /geodocker-accumulo/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: bash 3 | services: 4 | - docker 5 | env: 6 | global: 7 | - DOCKER_COMPOSE_VERSION=1.8.0 8 | - ORG=${TRAVIS_REPO_SLUG%/*} 9 | - REPO=${TRAVIS_REPO_SLUG##*-} 10 | - TAG=${TRAVIS_TAG:-${TRAVIS_COMMIT:0:7}} 11 | before_install: 12 | - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose 13 | - chmod +x docker-compose 14 | - sudo mv -f docker-compose /usr/local/bin 15 | install: 16 | - make -e build 17 | script: 18 | - make -e test 19 | before_deploy: 20 | - docker login -p "${QUAY_PASSWORD}" -u "${QUAY_USER}" quay.io 21 | - export PATH="$PATH:$HOME/.rvm/bin" 22 | deploy: 23 | - provider: script 24 | script: make -e publish 25 | skip_cleanup: true 26 | on: 27 | branch: master 28 | - provider: script 29 | script: make -e publish 30 | skip_cleanup: true 31 | on: 32 | tags: true 33 | notifications: 34 | slack: 35 | secure: idqmmD0RAZS5TfMmE/bRGFUJpC4SSGnM7Sjs9dFVnlab64Po6SxdheMWzqweXAFHbVCtZYYBBw3Gq9gt5Rpv3+YfBAxgWq02xK3UlKwfPTL2NNqv8N28hCH7xuZL0VhdT5q8xDBO4Cmr2rNmg5LKTnY5WK+rnWAdhLaS/MtbMLaPLpS4NjyDlBsShF4NmqgBQUe5JFtgOtG21a13j7uTtixp5Xg8DvK0wnlLHiwsB43hA6BbKKn3Nrc9+BcLJ1OsvVhcGk8OPvw2d007bY+FjJ4CI+PjyvuXen+96B+W4cy8IJRak+/nSnPdCkk3QjTJBLTOPto5wgs4pDCYJcBW7OnXONZrfr/prrJjyCxcwy+b/cPtcoszDCVrZRUfdnqboRGbtrgp8qBr02tKcMD5xW2gAQW/rSXsWnU2b00goONSJ8ICZYM583D5LVaw+hzQfnlKONGnxMkHipNsJsNwgw4G2wzKS2+1N976IVD8FarUBhjmbZfMeO//4fg21N0YDWs9ZPp+kS36Mo7HRgzlYT9koCizF4JfBSlde6KybFF/pxVQx/5XLSzjsWiDTKwvKiureIXwG482Ku1gsHx7uR2k2V+1wmVEZgsrwGzJCRJVgptgpVng4ouVJfd4fmDENUo7F98vPNdRxNauY1sDq0DaVhmEHhlkyVkLC53818E= 36 | -------------------------------------------------------------------------------- /geodocker-accumulo/Dockerfile.template: -------------------------------------------------------------------------------- 1 | FROM quay.io/geomesa/hdfs:__TAG__ 2 | 3 | MAINTAINER Pomadchin Grigory 4 | 5 | ARG TAG 6 | ARG GEOMESA_VERSION 7 | ARG ACCUMULO_VERSION 8 | ARG THRIFT_VERSION 9 | 10 | ENV ACCUMULO_VERSION ${ACCUMULO_VERSION} 11 | ENV ACCUMULO_HOME /opt/accumulo 12 | ENV ACCUMULO_CONF_DIR $ACCUMULO_HOME/conf 13 | ENV ZOOKEEPER_HOME /usr/lib/zookeeper 14 | ENV PATH=$PATH:$ACCUMULO_HOME/bin 15 | 16 | ADD accumulo-${ACCUMULO_VERSION}-bin.tar.gz /opt 17 | 18 | # Accumulo and Zookeeper client 19 | RUN set -x \ 20 | && mv /opt/accumulo-${ACCUMULO_VERSION} ${ACCUMULO_HOME} \ 21 | && yum install -y make gcc-c++ \ 22 | && bash -c "${ACCUMULO_HOME}/bin/build_native_library.sh" \ 23 | && yum -y autoremove gcc-c++ 24 | # TODO: Clean up after build_native_library 25 | 26 | WORKDIR "${ACCUMULO_HOME}" 27 | COPY ./fs / 28 | ENTRYPOINT [ "/sbin/entrypoint.sh" ] 29 | -------------------------------------------------------------------------------- /geodocker-accumulo/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /geodocker-accumulo/Makefile: -------------------------------------------------------------------------------- 1 | BASE := $(subst -, ,$(notdir ${CURDIR})) 2 | ORG := geomesa 3 | REPO := $(word 2, ${BASE}) 4 | IMG := quay.io/${ORG}/${REPO} 5 | 6 | build: accumulo-${ACCUMULO_VERSION}-bin.tar.gz dockerfile 7 | docker build \ 8 | --build-arg GEOMESA_VERSION=${GEOMESA_VERSION} \ 9 | --build-arg TAG=${TAG} \ 10 | --build-arg ACCUMULO_VERSION=${ACCUMULO_VERSION} \ 11 | -f target/Dockerfile \ 12 | -t ${IMG}:${TAG} . 13 | 14 | dockerfile: 15 | mkdir -p target 16 | sed 's/__TAG__/'"${TAG}"'/' Dockerfile.template > target/Dockerfile 17 | 18 | 19 | accumulo-${ACCUMULO_VERSION}-bin.tar.gz: 20 | curl -L -C - -O "https://archive.apache.org/dist/accumulo/${ACCUMULO_VERSION}/accumulo-${ACCUMULO_VERSION}-bin.tar.gz" 21 | 22 | publish: build 23 | docker push ${IMG}:${TAG} 24 | 25 | clean: 26 | 27 | cleaner: clean 28 | 29 | cleanest: cleaner 30 | rm -f accumulo-*-bin.tar.gz 31 | -------------------------------------------------------------------------------- /geodocker-accumulo/README.md: -------------------------------------------------------------------------------- 1 | # GeoDocker Accumulo 2 | 3 | [![Build Status](https://api.travis-ci.org/geodocker/geodocker-accumulo.svg)](http://travis-ci.org/geodocker/geodocker-accumulo) 4 | [![Docker Repository on Quay](https://quay.io/repository/geodocker/base/status "Docker Repository on Quay")](https://quay.io/repository/geodocker/accumulo) 5 | [![Join the chat at https://gitter.im/geotrellis/geotrellis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/geotrellis/geotrellis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | [Apache Accumulo](https://accumulo.apache.org/) container for [GeoDocker Cluster](https://github.com/geodocker/geodocker) 8 | 9 | # Roles 10 | This container has three roles that can be supplied as `CMD`: 11 | 12 | - `master` - master instance, handles synchronization 13 | - `--auto-init` - initialize an accumulo instance if one is not found at `hdfs://${HADOOP_MASTER_ADDRESS}/accumulo` 14 | - `tserver` - tablet server, serves data 15 | - `monitor` - monitor instance, provides Web GUI at 50095 16 | - `gc` - garbage collector for accumulo tablets 17 | - `tracer` - trace for debugging 18 | 19 | # Configuration 20 | 21 | Accumulo container requires HDFS as well as Accumulo configuration. This configuration will be generated from a template if you provide the required environment variables. 22 | 23 | Additionally you have an option of volume mounting the configuration files to `/etc/hadoop/conf` to configure HDFS and `/opt/accumulo/conf` to configure Accumulo. 24 | 25 | # Environment 26 | - `HADOOP_MASTER_ADDRESS` - hostname for accumulo root, required for all roles 27 | - `ZOOKEEPERS` - list of zookeeper instance, at least one 28 | - `ACCUMULO_SECRET` - secret value for inter-instance communication (default: `DEFAULT`) 29 | - `INSTANCE_NAME` - accumulo instance name (default: `accumulo`) 30 | - `ACCUMULO_PASSWORD` - root password 31 | - `INSTANCE_VOLUME` - HDFS path to accumulo instance volume, generated if not provided 32 | - `TSERVER_XMX` - JVM `-Xmx` parameter value for Accumulo tserver (default: `3g`) 33 | - `MASTER_XMX` - JVM `-Xmx` parameter value for Accumulo master (default: `2g`) 34 | - `MONITOR_XMX` - JVM `-Xmx` parameter value for Accumulo monitor (default: `1g`) 35 | - `GC_XMX` - JVM `-Xmx` parameter value for Accumulo garbage collector (default: `1g`) 36 | - `TSERVER_CACHE_DATA_SIZE` - `tserver.cache.data.size` in `accumulo-site.xml` 37 | - `TSERVER_CACHE_INDEX_SIZE` - `tserver.cache.index.size` in `accumulo-site.xml` 38 | - `TSERVER_MEMORY_MAPS_MAX` - `tserver.memory.maps.max` in `accumulo-site.xml` 39 | 40 | `HADOOP_MASTER_ADDRESS` need not be provided if `core-site.xml` is volume mounted in `/etc/hadoop/conf` or `INSTANCE_VOLUME` is provided. 41 | 42 | # Testing 43 | This container should be tested with `docker-compose` and through `make test` 44 | -------------------------------------------------------------------------------- /geodocker-accumulo/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | hdfs-name: 4 | image: quay.io/geomesa/hdfs:geomesa-2.2.1-accumulo-1.9.2 5 | command: name 6 | environment: 7 | HADOOP_MASTER_ADDRESS: hdfs-name 8 | ports: 9 | - 50070:50070 10 | # volumes: 11 | # - '/data/gt/hdfs:/data/hdfs' 12 | hdfs-data: 13 | image: quay.io/geomesa/hdfs:geomesa-2.2.1-accumulo-1.9.2 14 | command: data 15 | environment: 16 | HADOOP_MASTER_ADDRESS: hdfs-name 17 | depends_on: 18 | - hdfs-name 19 | # volumes: 20 | # - '/data/gt/hdfs:/data/hdfs' 21 | zookeeper: 22 | image: quay.io/geomesa/zookeeper:latest 23 | ports: 24 | - 2181:2181 25 | # volumes: 26 | # - '/data/gt/hdfs:/data/hdfs' 27 | accumulo-master: 28 | image: quay.io/geomesa/accumulo:geomesa-2.2.1-accumulo-1.9.2 29 | command: master --auto-init 30 | environment: 31 | HADOOP_MASTER_ADDRESS: hdfs-name 32 | ZOOKEEPERS: zookeeper 33 | ACCUMULO_PASSWORD: GisPwd 34 | depends_on: 35 | - zookeeper 36 | accumulo-monitor: 37 | image: quay.io/geomesa/accumulo:geomesa-2.2.1-accumulo-1.9.2 38 | command: monitor 39 | environment: 40 | HADOOP_MASTER_ADDRESS: hdfs-name 41 | ZOOKEEPERS: zookeeper 42 | ports: 43 | - 9995:9995 44 | - 50095:50095 45 | depends_on: 46 | - zookeeper 47 | - accumulo-master 48 | accumulo-tserver: 49 | image: quay.io/geomesa/accumulo:geomesa-2.2.1-accumulo-1.9.2 50 | command: tserver 51 | environment: 52 | HADOOP_MASTER_ADDRESS: hdfs-name 53 | ZOOKEEPERS: zookeeper 54 | depends_on: 55 | - zookeeper 56 | - accumulo-master 57 | -------------------------------------------------------------------------------- /geodocker-accumulo/emr/README.md: -------------------------------------------------------------------------------- 1 | # Amazon EMR Docker Accumulo Bootstrap 2 | 3 | Amazon EMR already provides an environment with HDFS, Zookeeper, and YARN. This bootstrap script enables us to deploy Apache Accumulo on top of EMR cluster through docker containers. The main advantage of using docker in this scenario is ability to extend the container, for instance by adding GeoWave or GeoMesa iterator jars and still use the same bootstrap scripts. 4 | 5 | ## Parameters 6 | 7 | The script is parametrized on following arguments: 8 | 9 | - `-i | --image` docker image to be used for accumulo 10 | - `-s | --accumulo-secret` accumulo secret to be used 11 | - `-p | --accumulo-password` accumulo password for root account 12 | - `-n | --instance-name` accumulo instance name 13 | - `-e | --env` additional environment variables for docker containers 14 | 15 | These parameters have default values defined at the top of the bootstrap script. 16 | 17 | ## Usage 18 | 19 | In order to use this bootstrap script it should be copied to an S3 bucket under your control so it accessed by the EMR cluster during the bootstrap phase. 20 | 21 | ```console 22 | aws emr create-cluster --name "GeoDocker Accumulo" \ 23 | --release-label emr-5.0.0 \ 24 | --output text \ 25 | --use-default-roles \ 26 | --ec2-attributes KeyName=geotrellis-cluster \ 27 | --applications Name=Hadoop Name=Zookeeper \ 28 | --instance-groups \ 29 | Name=Master,BidPrice=0.5,InstanceCount=1,InstanceGroupType=MASTER,InstanceType=m3.xlarge \ 30 | Name=Workers,BidPrice=0.5,InstanceCount=1,InstanceGroupType=CORE,InstanceType=m3.xlarge \ 31 | --bootstrap-actions \ 32 | Name=BootstrapGeoWave,Path=s3://geotrellis-test/geodocker/accumulo-0.2/bootstrap-geodocker-accumulo.sh,\ 33 | Args=[-i=quay.io/geodocker/accumulo:geomesa-2.2.1-accumulo-1.9.2,-n=gis,-p=secret,\ 34 | -e=TSERVER_XMX=10G,-e=TSERVER_CACHE_DATA_SIZE=6G,-e=TSERVER_CACHE_INDEX_SIZE=2G] 35 | ``` 36 | -------------------------------------------------------------------------------- /geodocker-accumulo/emr/bootstrap-geodocker-accumulo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Bootstrap docker and accumulo on EMR cluster 4 | # 5 | 6 | REPO=quay.io/geomesa 7 | ACCUMULO_SECRET=DEFAULT 8 | ACCUMULO_PASSWORD=secret 9 | INSTANCE_NAME=accumulo 10 | ARGS=$@ 11 | 12 | for i in "$@" 13 | do 14 | case $i in 15 | --continue) 16 | CONTINUE=true 17 | shift 18 | ;; 19 | -t=*|--tag=*) 20 | TAG="${i#*=}" 21 | shift 22 | ;; 23 | -s=*|--accumulo-secret=*) 24 | ACCUMULO_SECRET="${i#*=}" 25 | shift 26 | ;; 27 | -p=*|--accumulo-password=*) 28 | ACCUMULO_PASSWORD="${i#*=}" 29 | shift 30 | ;; 31 | -n=*|--instance-name=*) 32 | INSTANCE_NAME="${i#*=}" 33 | shift 34 | ;; 35 | -e=*|--env=*) 36 | ENV_VARS+=("-e ${i#*=}") 37 | shift 38 | ;; 39 | *) 40 | ;; 41 | esac 42 | done 43 | 44 | # Parses a configuration file put in place by EMR to determine the role of this node 45 | is_master() { 46 | if [ $(jq '.isMaster' /mnt/var/lib/info/instance.json) = 'true' ]; then 47 | return 0 48 | else 49 | return 1 50 | fi 51 | } 52 | 53 | ### MAIN #### 54 | 55 | # EMR bootstrap runs before HDFS or YARN are initilized 56 | if [ ! $CONTINUE ]; then 57 | sudo yum -y install docker 58 | sudo usermod -aG docker hadoop 59 | sudo service docker start 60 | 61 | THIS_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" 62 | TIMEOUT= is_master && TIMEOUT=3 || TIMEOUT=4 63 | echo "bash -x $THIS_SCRIPT --continue $ARGS > /tmp/geodocker-accumulo-bootstrap.log" | at now + $TIMEOUT min 64 | exit 0 # Bail and let EMR finish initializing 65 | fi 66 | 67 | YARN_RM=$(xmllint --xpath "//property[name='yarn.resourcemanager.hostname']/value/text()" /etc/hadoop/conf/yarn-site.xml) 68 | DOCKER_ENV="-e USER=hadoop \ 69 | -e ZOOKEEPERS=$YARN_RM \ 70 | -e ACCUMULO_SECRET=$ACCUMULO_SECRET \ 71 | -e ACCUMULO_PASSWORD=$ACCUMULO_PASSWORD \ 72 | -e INSTANCE_NAME=$INSTANCE_NAME \ 73 | ${ENV_VARS[@]} \ 74 | -v /etc/hadoop/conf:/etc/hadoop/conf \ 75 | -v /usr/lib/hadoop-hdfs/bin:/usr/lib/hadoop-hdfs/bin" 76 | 77 | IMAGE=${REPO}/accumulo-geomesa:${TAG} 78 | 79 | DOCKER_OPT="-d --net=host --restart=always --memory-swappiness=0" 80 | if is_master ; then 81 | docker run $DOCKER_OPT --name=accumulo-master $DOCKER_ENV $IMAGE master --auto-init 82 | docker run $DOCKER_OPT --name=accumulo-monitor $DOCKER_ENV $IMAGE monitor 83 | docker run $DOCKER_OPT --name=accumulo-tracer $DOCKER_ENV $IMAGE tracer 84 | docker run $DOCKER_OPT --name=accumulo-gc $DOCKER_ENV $IMAGE gc 85 | docker run $DOCKER_OPT --name=geoserver quay.io/geomesa/geoserver:$TAG 86 | docker run $DOCKER_OPT --name=jupyter $DOCKER_ENV quay.io/geomesa/geomesa-jupyter:$TAG 87 | else # is worker 88 | docker run -d --net=host --name=accumulo-tserver $DOCKER_ENV $IMAGE tserver 89 | fi 90 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/opt/accumulo/conf/accumulo-env.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | ### 19 | ### Configure these environment variables to point to your local installations. 20 | ### 21 | ### The functional tests require conditional values, so keep this style: 22 | ### 23 | ### test -z "$JAVA_HOME" && export JAVA_HOME=/usr/lib/jvm/java 24 | ### 25 | ### 26 | ### Note that the -Xmx -Xms settings below require substantial free memory: 27 | ### you may want to use smaller values, especially when running everything 28 | ### on a single machine. 29 | ### 30 | if [[ -z $HADOOP_HOME ]] ; then 31 | test -z "$HADOOP_PREFIX" && export HADOOP_PREFIX=/path/to/hadoop 32 | else 33 | HADOOP_PREFIX="$HADOOP_HOME" 34 | unset HADOOP_HOME 35 | fi 36 | 37 | # hadoop-2.0: 38 | test -z "$HADOOP_CONF_DIR" && export HADOOP_CONF_DIR="$HADOOP_PREFIX/etc/hadoop" 39 | 40 | test -z "$JAVA_HOME" && export JAVA_HOME=/path/to/java 41 | test -z "$ZOOKEEPER_HOME" && export ZOOKEEPER_HOME=/path/to/zookeeper 42 | test -z "$ACCUMULO_LOG_DIR" && export ACCUMULO_LOG_DIR=$ACCUMULO_HOME/logs 43 | if [[ -f ${ACCUMULO_CONF_DIR}/accumulo.policy ]] 44 | then 45 | POLICY="-Djava.security.manager -Djava.security.policy=${ACCUMULO_CONF_DIR}/accumulo.policy" 46 | fi 47 | test -z "$ACCUMULO_TSERVER_OPTS" && export ACCUMULO_TSERVER_OPTS="${POLICY} -Xms2g -Xmx${TSERVER_XMX:-3g} -XX:NewSize=1G -XX:MaxNewSize=1G" 48 | test -z "$ACCUMULO_MASTER_OPTS" && export ACCUMULO_MASTER_OPTS="${POLICY} -Xms1g -Xmx${MASTER_XMX:-2g}" 49 | test -z "$ACCUMULO_MONITOR_OPTS" && export ACCUMULO_MONITOR_OPTS="${POLICY} -Xms256m -Xmx${MONITOR_XMX:-1g}" 50 | test -z "$ACCUMULO_GC_OPTS" && export ACCUMULO_GC_OPTS="-Xms512m -Xmx${GC_XMX:-1g}" 51 | test -z "$ACCUMULO_GENERAL_OPTS" && export ACCUMULO_GENERAL_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Djava.net.preferIPv4Stack=true" 52 | test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xms256m -Xmx1g" 53 | # what do when the JVM runs out of heap memory 54 | export ACCUMULO_KILL_CMD='kill -9 %p' 55 | 56 | ### Optionally look for hadoop and accumulo native libraries for your 57 | ### platform in additional directories. (Use DYLD_LIBRARY_PATH on Mac OS X.) 58 | ### May not be necessary for Hadoop 2.x or using an RPM that installs to 59 | ### the correct system library directory. 60 | # export LD_LIBRARY_PATH=${HADOOP_PREFIX}/lib/native/${PLATFORM}:${LD_LIBRARY_PATH} 61 | 62 | # Should the monitor bind to all network interfaces -- default: false 63 | # export ACCUMULO_MONITOR_BIND_ALL="true" 64 | 65 | # Should process be automatically restarted 66 | # export ACCUMULO_WATCHER="true" 67 | 68 | # What settings should we use for the watcher, if enabled 69 | export UNEXPECTED_TIMESPAN="3600" 70 | export UNEXPECTED_RETRIES="2" 71 | 72 | export OOM_TIMESPAN="3600" 73 | export OOM_RETRIES="5" 74 | 75 | export ZKLOCK_TIMESPAN="600" 76 | export ZKLOCK_RETRIES="5" 77 | 78 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/opt/accumulo/conf/accumulo-site.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | instance.volumes 23 | ${INSTANCE_VOLUME} 24 | 25 | 26 | instance.zookeeper.host 27 | ${ZOOKEEPERS} 28 | comma separated list of zookeeper servers 29 | 30 | 31 | general.vfs.classpaths 32 | ${INSTANCE_VOLUME}-classpath/[^.].*.jar 33 | Configuration for a system level vfs classloader. Accumulo jars can be configured here and loaded out of HDFS. 34 | 35 | 45 | 46 | general.dynamic.classpaths 47 | 48 | $ACCUMULO_HOME/lib/ext/[^.].*.jar, 49 | ${INSTANCE_VOLUME}-classpath/[^.].*.jar 50 | 51 | Classpaths that accumulo checks for updates and class files. 52 | 53 | 54 | logger.dir.walog 55 | walogs 56 | The property only needs to be set if upgrading from 1.4 which used to store write-ahead logs on the local 57 | filesystem. In 1.5 write-ahead logs are stored in DFS. When 1.5 is started for the first time it will copy any 1.4 58 | write ahead logs into DFS. It is possible to specify a comma-separated list of directories. 59 | 60 | 61 | 62 | instance.secret 63 | ${ACCUMULO_SECRET} 64 | A secret unique to a given instance that all servers must know in order to communicate with one another. 65 | Change it before initialization. To 66 | change it later use ./bin/accumulo org.apache.accumulo.server.util.ChangeSecret --old [oldpasswd] --new [newpasswd], 67 | and then update this file. 68 | 69 | 70 | 71 | tserver.memory.maps.max 72 | ${TSERVER_MEMORY_MAPS_MAX} 73 | 74 | 75 | tserver.memory.maps.native.enabled 76 | true 77 | 78 | 79 | tserver.cache.data.size 80 | ${TSERVER_CACHE_DATA_SIZE} 81 | 82 | 83 | tserver.cache.index.size 84 | ${TSERVER_CACHE_INDEX_SIZE} 85 | 86 | 87 | trace.user 88 | root 89 | 90 | 91 | tserver.sort.buffer.size 92 | 200M 93 | 94 | 95 | tserver.walog.max.size 96 | 1G 97 | 98 | 99 | general.classpaths 100 | 101 | 102 | $ACCUMULO_HOME/lib/accumulo-server.jar, 103 | $ACCUMULO_HOME/lib/accumulo-core.jar, 104 | $ACCUMULO_HOME/lib/accumulo-start.jar, 105 | $ACCUMULO_HOME/lib/accumulo-fate.jar, 106 | $ACCUMULO_HOME/lib/accumulo-proxy.jar, 107 | $ACCUMULO_HOME/lib/[^.].*.jar, 108 | 109 | $ZOOKEEPER_HOME/zookeeper[^.].*.jar, 110 | 111 | $HADOOP_CONF_DIR, 112 | 113 | /usr/lib/hadoop/[^.].*.jar, 114 | /usr/lib/hadoop/lib/[^.].*.jar, 115 | /usr/lib/hadoop-hdfs/[^.].*.jar, 116 | /usr/lib/hadoop-mapreduce/[^.].*.jar, 117 | /usr/lib/hadoop-yarn/[^.].*.jar, 118 | /usr/lib/hadoop-yarn/lib/jersey.*.jar, 119 | 120 | 121 | Classpaths that accumulo checks for updates and class files. 122 | 123 | 124 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/opt/accumulo/conf/client.conf.template: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # instance.name=${INSTANCE_NAME:=accumulo} 17 | # instance.zookeeper.host=localhost 18 | 19 | # instance.rpc.ssl.enabled=false 20 | # instance.rcp.sasl.enabled=false 21 | # rpc.sasl.qop=auth 22 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/opt/accumulo/conf/generic_logger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/opt/accumulo/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # default logging properties: 17 | # by default, log everything at INFO or higher to the console 18 | log4j.rootLogger=INFO,A1 19 | 20 | # hide Jetty junk 21 | log4j.logger.org.mortbay.log=WARN,A1 22 | 23 | # hide "Got brand-new compressor" messages 24 | log4j.logger.org.apache.hadoop.io.compress=WARN,A1 25 | log4j.logger.org.apache.accumulo.core.file.rfile.bcfile.Compression=WARN,A1 26 | 27 | # hide junk from TestRandomDeletes 28 | log4j.logger.org.apache.accumulo.test.TestRandomDeletes=WARN,A1 29 | 30 | # hide junk from VFS 31 | log4j.logger.org.apache.commons.vfs2.impl.DefaultFileSystemManager=WARN,A1 32 | 33 | # hide almost everything from zookeeper 34 | log4j.logger.org.apache.zookeeper=ERROR,A1 35 | 36 | # hide AUDIT messages in the shell, alternatively you could send them to a different logger 37 | log4j.logger.org.apache.accumulo.shell.Shell.audit=WARN,A1 38 | 39 | # Send most things to the console 40 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 41 | log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} [%-8c{2}] %-5p: %m%n 42 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 43 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/opt/accumulo/conf/monitor_logger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/sbin/accumulo-lib.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source /sbin/hdfs-lib.sh 4 | 5 | function accumulo_instance_exists() { 6 | local INSTANCE=$1 7 | local ZOOKEEPERS=$2 8 | local LS=$(zookeeper-client -server $ZOOKEEPERS ls /accumulo/instances/$INSTANCE 2>&1 > /dev/null) 9 | if [[ $LS == *"does not exist"* ]]; then 10 | return 1 11 | else 12 | return 0 13 | fi 14 | } 15 | 16 | function wait_until_accumulo_is_available() { 17 | local INSTANCE=$1 18 | local ZOOKEEPERS=$2 19 | wait_until_hdfs_is_available 20 | with_backoff accumulo_instance_exists $INSTANCE $ZOOKEEPERS 21 | } 22 | 23 | function zookeeper_is_available(){ 24 | local ZOOKEEPERS=$1 25 | [ $(nc ${ZOOKEEPERS} 2181 <<< ruok) == imok ] 26 | return $? 27 | } 28 | 29 | function ensure_user() { 30 | if [ ! $(id -u $1) ]; then useradd $1 -g root; fi 31 | } 32 | -------------------------------------------------------------------------------- /geodocker-accumulo/fs/sbin/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | source /sbin/accumulo-lib.sh 5 | 6 | # Set default configurations if not provided 7 | : ${ACCUMULO_SECRET:=DEFAULT} 8 | : ${INSTANCE_NAME:=accumulo} 9 | : ${TSERVER_CACHE_DATA_SIZE:=128M} 10 | : ${TSERVER_CACHE_INDEX_SIZE:=128M} 11 | : ${TSERVER_MEMORY_MAPS_MAX:=1G} 12 | : ${TSERVER_XMX:=3g} 13 | : ${MASTER_XMX:=2g} 14 | : ${MONITOR_XMX:=1g} 15 | : ${GC_XMX:=1g} 16 | 17 | # HDFS Configuration 18 | template $HADOOP_CONF_DIR/core-site.xml 19 | 20 | # Accumulo Configuration 21 | # core-site.xml could have been volume mounted, use it as default 22 | DEFAULT_FS=$(xmllint --xpath "//property[name='fs.defaultFS']/value/text()" $HADOOP_CONF_DIR/core-site.xml) 23 | INSTANCE_VOLUME=${INSTANCE_VOLUME:-$DEFAULT_FS/$INSTANCE_NAME} 24 | template $ACCUMULO_CONF_DIR/accumulo-site.xml 25 | template $ACCUMULO_CONF_DIR/client.conf 26 | 27 | # The first argument determines this container's role in the accumulo cluster 28 | ROLE=${1:-} 29 | if [ -z $ROLE ]; then 30 | echo "Select the role for this container with the docker cmd 'master', 'monitor', 'gc', 'tracer', or 'tserver'" 31 | exit 1 32 | else 33 | case $ROLE in 34 | "master" | "tserver" | "monitor" | "gc" | "tracer") 35 | ATTEMPTS=7 # ~2 min before timeout failure 36 | with_backoff zookeeper_is_available "$ZOOKEEPERS" || exit 1 37 | wait_until_hdfs_is_available || exit 1 38 | 39 | USER=${USER:-root} 40 | ensure_user $USER 41 | echo "Running as $USER" 42 | 43 | # Initialize Accumulo if required 44 | if [[ ($ROLE = "master") && (${2:-} = "--auto-init")]]; then 45 | if accumulo_instance_exists $INSTANCE_NAME $ZOOKEEPERS; then 46 | echo "Found accumulo instance at: $INSTANCE_VOLUME" 47 | else 48 | echo "Initializing accumulo instance $INSTANCE_VOLUME ..." 49 | runuser -p -u $USER hdfs -- dfs -mkdir -p ${INSTANCE_VOLUME}-classpath 50 | runuser -p -u $USER accumulo -- init --instance-name ${INSTANCE_NAME} --password ${ACCUMULO_PASSWORD} 51 | 52 | if [[ -n ${POSTINIT:-} ]]; then 53 | echo "Post-initializing accumulo instance $INSTANCE_VOLUME ..." 54 | (setsid $POSTINIT &> /tmp/${INSTANCE_NAME}-postinit.log &) 55 | fi 56 | fi 57 | fi 58 | 59 | if [[ $ROLE != "master" ]]; then 60 | with_backoff accumulo_instance_exists $INSTANCE_NAME $ZOOKEEPERS || exit 1 61 | fi 62 | 63 | exec runuser -p -u $USER accumulo -- $ROLE ;; 64 | *) 65 | exec "$@" 66 | esac 67 | fi 68 | -------------------------------------------------------------------------------- /geodocker-base/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: bash 3 | services: 4 | - docker 5 | 6 | env: 7 | global: 8 | - ORG=${TRAVIS_REPO_SLUG%/*} 9 | - REPO=${TRAVIS_REPO_SLUG##*-} 10 | - TAG=${TRAVIS_TAG:-${TRAVIS_COMMIT:0:7}} 11 | 12 | install: 13 | - make -e build 14 | 15 | script: 16 | - make -e test 17 | 18 | before_deploy: 19 | - docker login -p "${QUAY_PASSWORD}" -u "${QUAY_USER}" quay.io 20 | 21 | deploy: 22 | - provider: script 23 | script: make -e publish 24 | skip_cleanup: true 25 | on: 26 | branch: master 27 | - provider: script 28 | script: make -e publish 29 | skip_cleanup: true 30 | on: 31 | tags: true 32 | 33 | notifications: 34 | slack: 35 | secure: 1FvaXFWHHoTHisPTA9Mgd/msSQefF5Ocd8jVIQCGnKYs9/wLnlBsUhZ4DzXPmPjdaFw/fVJ8uy/TkVxqaCLempzOsTxa+LbUabcHqWhCBoLqBh3Ado/wUwKDpF47eD5a5dmWtw3aNXyKl649cAGZq7vrDO5YwNScpbfz8FTEd4w/IlHGnIp0eqHvZSmXcyn2uGWdoG2iLrgLrb1GPN0UlgHE9yGsPeYBdTaDqYABCGJlrgANJYZD4rzowX/5oPRjT/RlHExwIDyL6uZ3tU/IcShZH+RMnitlhLxODpsEanDpbdyENo0UBat29ZV8bLJXVhn9h5V3g0ZnOLGcXemi2gxrOiF9R4H4F+li33nO1LAmzy0jhT7YWvBTEwAf6gHHXMGcbLrQ5etoGz3ZAqu3GfnUuS8rcLMcXdfksNxsR9/dxK0slxKQt2FQsLWnFtvSyljq0W7trinHUi07H4Tn5h2AeXlTltRGpBJPHJ7TBkMHp2L4aGfo94i4dbGFtPY0JWlU/pt+cGgLlRRHr/57QhN+VGYp/eh55FRFgasBS/fN+T+D0nllTBf7pkJOqKIz3eC3g0ODU6Q+bHo/PXNpnKO6XaFnVPcxVLh7K0RTieJROHTuP0J54QCWf0wwnP/PzdPKgNogLae6Z7z10spfdNEz8r+fISvwb95GTaX4WXQ= 36 | -------------------------------------------------------------------------------- /geodocker-base/Dockerfile.template: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | 3 | MAINTAINER Nathan Zimmerman, npzimmerman@gmail.com 4 | 5 | RUN yum install -y wget curl unzip which nc bzip2 6 | 7 | ARG TAG 8 | ARG GEOMESA_VERSION 9 | ARG ACCUMULO_VERSION 10 | ARG THRIFT_VERSION 11 | 12 | # JAVA 13 | ENV JAVA_VERSION_MAJOR=8 \ 14 | JAVA_VERSION_MINOR=131 \ 15 | JAVA_VERSION_BUILD=11 \ 16 | JAVA_URL_HASH=d54c1d3a095b4ff2b6607d096fa80163 17 | 18 | ENV JAVA_HOME /usr/java/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} 19 | ENV PATH $PATH:$JAVA_HOME/bin 20 | 21 | RUN set -x \ 22 | && curl -sS -LO -H 'Cookie: oraclelicense=accept-securebackup-cookie' "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_URL_HASH}/jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.rpm" \ 23 | && rpm -Uvh jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.rpm \ 24 | && rm -rf jdk-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.rpm \ 25 | && curl -sS http://www.apache.org/dist/bigtop/stable/repos/centos7/bigtop.repo > /etc/yum.repos.d/bigtop.repo 26 | -------------------------------------------------------------------------------- /geodocker-base/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /geodocker-base/Makefile: -------------------------------------------------------------------------------- 1 | BASE := $(subst -, ,$(notdir ${CURDIR})) 2 | ORG := geomesa 3 | REPO := $(word 2, ${BASE}) 4 | IMG := quay.io/${ORG}/${REPO} 5 | 6 | build: dockerfile 7 | docker build \ 8 | --build-arg GEOMESA_VERSION=${GEOMESA_VERSION} \ 9 | --build-arg TAG=${TAG} \ 10 | --build-arg ACCUMULO_VERSION=${ACCUMULO_VERSION} \ 11 | -f target/Dockerfile \ 12 | -t ${IMG}:${TAG} . 13 | 14 | dockerfile: 15 | mkdir -p target 16 | sed 's/__TAG__/'"${TAG}"'/' Dockerfile.template > target/Dockerfile 17 | 18 | 19 | publish: build 20 | docker push ${IMG}:${TAG} 21 | 22 | test: build 23 | docker run -it --rm ${IMG}:${TAG} java -version 24 | 25 | clean: 26 | -------------------------------------------------------------------------------- /geodocker-base/README.md: -------------------------------------------------------------------------------- 1 | # GeoDocker Base 2 | 3 | [![Build Status](https://api.travis-ci.org/geodocker/geodocker-base.svg)](http://travis-ci.org/geodocker/geodocker-base) 4 | [![Docker Repository on Quay](https://quay.io/repository/geodocker/base/status "Docker Repository on Quay")](https://quay.io/repository/geodocker/base) 5 | [![Join the chat at https://gitter.im/geotrellis/geotrellis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/geotrellis/geotrellis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | Base container for [GeoDocker Cluster](https://github.com/geodocker/geodocker). 8 | -------------------------------------------------------------------------------- /geodocker-geomesa-jupyter/Dockerfile.template: -------------------------------------------------------------------------------- 1 | FROM quay.io/geomesa/accumulo-geomesa:__TAG__ 2 | 3 | MAINTAINER GeoMesa team 4 | 5 | ARG TAG 6 | ARG GEOMESA_VERSION 7 | ARG ACCUMULO_VERSION 8 | ARG THRIFT_VERSION 9 | 10 | ENV GEOMESA_VERSION ${GEOMESA_VERSION} 11 | 12 | USER root 13 | 14 | # Install Tini 15 | RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.10.0/tini && \ 16 | echo "1361527f39190a7338a0b434bd8c88ff7233ce7b9a4876f3315c22fce7eca1b0 *tini" | sha256sum -c - && \ 17 | mv tini /usr/local/bin/tini && \ 18 | chmod +x /usr/local/bin/tini 19 | 20 | # Configure environment 21 | ENV CONDA_DIR /opt/conda 22 | ENV PATH $CONDA_DIR/bin:$PATH 23 | ENV SHELL /bin/bash 24 | ENV NB_USER hdfs 25 | ENV NB_UID 1000 26 | ENV LC_ALL en_US.UTF-8 27 | ENV LANG en_US.UTF-8 28 | ENV LANGUAGE en_US.UTF-8 29 | 30 | ENV NB_HOME /var/lib/hadoop-hdfs 31 | # Setup work directory 32 | RUN mkdir $CONDA_DIR && chown hdfs:hdfs $CONDA_DIR 33 | 34 | USER $NB_USER 35 | 36 | # Setup hdfs home directory 37 | RUN mkdir -p ${NB_HOME}/work && \ 38 | mkdir ${NB_HOME}/.jupyter && \ 39 | mkdir ${NB_HOME}/work/js 40 | 41 | COPY js/ ${NB_HOME}/work/js/ 42 | 43 | # copy the sample notebook 44 | USER root 45 | COPY GDELT+Analysis.ipynb ${NB_HOME}/work/ 46 | RUN chmod a+rw ${NB_HOME}/work/*.ipynb 47 | USER $NB_USER 48 | 49 | # Install conda as hdfs 50 | RUN cd /tmp && \ 51 | wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.1.11-Linux-x86_64.sh && \ 52 | echo "efd6a9362fc6b4085f599a881d20e57de628da8c1a898c08ec82874f3bad41bf *Miniconda3-4.1.11-Linux-x86_64.sh" | sha256sum -c - && \ 53 | /bin/bash Miniconda3-4.1.11-Linux-x86_64.sh -f -b -p $CONDA_DIR && \ 54 | rm Miniconda3-4.1.11-Linux-x86_64.sh && \ 55 | $CONDA_DIR/bin/conda install --quiet --yes conda==4.1.11 && \ 56 | $CONDA_DIR/bin/conda config --system --add channels conda-forge && \ 57 | $CONDA_DIR/bin/conda config --system --set auto_update_conda false && \ 58 | conda clean -tipsy 59 | 60 | # Install Jupyter notebook as hdfs 61 | RUN conda install --quiet --yes \ 62 | 'notebook=4.2*' \ 63 | jupyterhub=0.7 \ 64 | && conda clean -tipsy 65 | 66 | USER root 67 | 68 | EXPOSE 8888 69 | WORKDIR ${NB_HOME}/work 70 | 71 | # Configure container startup 72 | ENTRYPOINT ["tini", "--"] 73 | CMD ["start-notebook.sh"] 74 | 75 | # Add local files as late as possible to avoid cache busting 76 | COPY start.sh /usr/local/bin/ 77 | COPY start-notebook.sh /usr/local/bin/ 78 | COPY start-singleuser.sh /usr/local/bin/ 79 | COPY jupyter_notebook_config.py ${NB_HOME}/.jupyter/ 80 | RUN chown -R $NB_USER:hdfs ${NB_HOME}/.jupyter 81 | 82 | # install toree 83 | COPY toree-0.2.0.dev1.tar.gz /tmp 84 | RUN pip install --upgrade --pre /tmp/toree-0.2.0.dev1.tar.gz 85 | 86 | # install Spark 87 | ENV APACHE_SPARK_VERSION 2.0.2 88 | ENV HADOOP_VERSION 2.8.4 89 | 90 | RUN cd /tmp && \ 91 | wget -q http://d3kbcqa49mib13.cloudfront.net/spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz && \ 92 | echo "e6349dd38ded84831e3ff7d391ae7f2525c359fb452b0fc32ee2ab637673552a *spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz" | sha256sum -c - && \ 93 | tar xzf spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz -C /usr/local && \ 94 | rm spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz 95 | RUN cd /usr/local && ln -s spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION} spark 96 | 97 | # Spark and Mesos config 98 | ENV SPARK_HOME /usr/local/spark 99 | ENV PYTHONPATH $SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.3-src.zip 100 | ENV MESOS_NATIVE_LIBRARY /usr/local/lib/libmesos.so 101 | 102 | # copy vegas libs to spark jars dir 103 | COPY lib/* /usr/local/spark/jars/ 104 | 105 | # Switch back to hdfs to avoid accidental container runs as root 106 | USER $NB_USER 107 | 108 | ENV GEOMESA_SPARK_HOME file:///opt/geomesa/dist/spark 109 | ENV GEOMESA_SPARK_JARS ${GEOMESA_SPARK_HOME}/geomesa-accumulo-spark-runtime_2.11-${GEOMESA_VERSION}.jar,${GEOMESA_SPARK_HOME}/geomesa-spark-converter_2.11-${GEOMESA_VERSION}.jar,${GEOMESA_SPARK_HOME}/geomesa-spark-geotools_2.11-${GEOMESA_VERSION}.jar 110 | 111 | # install GeoMesa kernel 112 | RUN jupyter toree install \ 113 | --replace \ 114 | --user \ 115 | --kernel_name="GeoMesa Spark" \ 116 | --spark_home=${SPARK_HOME} \ 117 | --spark_opts="--driver-java-options=-Xmx4096M --driver-java-options=-Dlog4j.logLevel=info --master yarn --jars ${GEOMESA_SPARK_JARS}" 118 | -------------------------------------------------------------------------------- /geodocker-geomesa-jupyter/GDELT+Analysis.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 0, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "val zookeepers = \"X.X.X.X\"\n" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 14, 17 | "metadata": { 18 | "collapsed": true 19 | }, 20 | "outputs": [], 21 | "source": [ 22 | "import org.locationtech.geomesa.jupyter.L\n", 23 | "import org.locationtech.geomesa.utils.geotools.Conversions._\n", 24 | "import scala.collection.JavaConversions._\n", 25 | "import vegas._\n", 26 | "import vegas.render.HTMLRenderer._\n", 27 | "import vegas.sparkExt._\n", 28 | "\n", 29 | "implicit val displayer: String => Unit = { s => kernel.display.content(\"text/html\", s) }" 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": 2, 35 | "metadata": { 36 | "collapsed": false 37 | }, 38 | "outputs": [], 39 | "source": [ 40 | "val df = spark.read.\n", 41 | " format(\"geomesa\").\n", 42 | " option(\"zookeepers\", zookeepers).\n", 43 | " option(\"instanceId\", \"gis\").\n", 44 | " option(\"user\", \"root\").\n", 45 | " option(\"password\", \"secret\").\n", 46 | " option(\"tableName\", \"geomesa.gdelt\").\n", 47 | " option(\"geomesa.feature\", \"gdelt\").\n", 48 | " load()" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": 3, 54 | "metadata": { 55 | "collapsed": true 56 | }, 57 | "outputs": [], 58 | "source": [ 59 | "df.createOrReplaceTempView(\"gdelt\")" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": 4, 65 | "metadata": { 66 | "collapsed": false 67 | }, 68 | "outputs": [ 69 | { 70 | "name": "stdout", 71 | "output_type": "stream", 72 | "text": [ 73 | "+-------------------+---------+-------+\n", 74 | "| col_name|data_type|comment|\n", 75 | "+-------------------+---------+-------+\n", 76 | "| __fid__| string| null|\n", 77 | "| globalEventId| string| null|\n", 78 | "| eventCode| string| null|\n", 79 | "| eventBaseCode| string| null|\n", 80 | "| eventRootCode| string| null|\n", 81 | "| isRootEvent| int| null|\n", 82 | "| actor1Name| string| null|\n", 83 | "| actor1Code| string| null|\n", 84 | "| actor1CountryCode| string| null|\n", 85 | "| actor1GroupCode| string| null|\n", 86 | "| actor1EthnicCode| string| null|\n", 87 | "|actor1Religion1Code| string| null|\n", 88 | "|actor1Religion2Code| string| null|\n", 89 | "| actor2Name| string| null|\n", 90 | "| actor2Code| string| null|\n", 91 | "| actor2CountryCode| string| null|\n", 92 | "| actor2GroupCode| string| null|\n", 93 | "| actor2EthnicCode| string| null|\n", 94 | "|actor2Religion1Code| string| null|\n", 95 | "|actor2Religion2Code| string| null|\n", 96 | "+-------------------+---------+-------+\n", 97 | "only showing top 20 rows\n", 98 | "\n" 99 | ] 100 | } 101 | ], 102 | "source": [ 103 | "spark.sql(\"DESCRIBE gdelt\").show()" 104 | ] 105 | }, 106 | { 107 | "cell_type": "code", 108 | "execution_count": 5, 109 | "metadata": { 110 | "collapsed": false 111 | }, 112 | "outputs": [ 113 | { 114 | "name": "stdout", 115 | "output_type": "stream", 116 | "text": [ 117 | "+-------------+--------------------+--------------------+\n", 118 | "|globalEventId| geom| dtg|\n", 119 | "+-------------+--------------------+--------------------+\n", 120 | "| 609167622|POINT (105.667 -1...|2006-12-19 00:00:...|\n", 121 | "| 609167628|POINT (143.876 -9...|2006-12-19 00:00:...|\n", 122 | "| 609167626|POINT (143.876 -9...|2006-12-19 00:00:...|\n", 123 | "| 608826829|POINT (-122.637 3...|2006-12-18 00:00:...|\n", 124 | "| 608800220|POINT (-106.237 3...|2006-12-18 00:00:...|\n", 125 | "| 608837377| POINT (-97 38)|2006-12-18 00:00:...|\n", 126 | "| 609122526| POINT (-97 38)|2006-12-19 00:00:...|\n", 127 | "| 608695865| POINT (-8 12.65)|2006-12-18 00:00:...|\n", 128 | "| 608624384|POINT (-77.0364 3...|2006-12-18 00:00:...|\n", 129 | "| 608870504|POINT (-74.9384 4...|2006-12-19 00:00:...|\n", 130 | "+-------------+--------------------+--------------------+\n", 131 | "\n" 132 | ] 133 | } 134 | ], 135 | "source": [ 136 | "spark.sql(\"select globalEventId,geom,dtg from gdelt limit 10\").show()" 137 | ] 138 | }, 139 | { 140 | "cell_type": "code", 141 | "execution_count": 6, 142 | "metadata": { 143 | "collapsed": false 144 | }, 145 | "outputs": [ 146 | { 147 | "name": "stdout", 148 | "output_type": "stream", 149 | "text": [ 150 | "+-------------+--------------------+--------------------+\n", 151 | "|globalEventId| geom| dtg|\n", 152 | "+-------------+--------------------+--------------------+\n", 153 | "| 610438414|POINT (-97.0384 3...|2016-12-21 00:00:...|\n", 154 | "| 610438451|POINT (-97.0384 3...|2016-12-21 00:00:...|\n", 155 | "| 610248202|POINT (-97.0384 3...|2016-12-20 00:00:...|\n", 156 | "| 610438450|POINT (-97.0384 3...|2016-12-21 00:00:...|\n", 157 | "| 610248264|POINT (-96.8336 3...|2016-12-20 00:00:...|\n", 158 | "| 610231190|POINT (-96.8336 3...|2016-12-20 00:00:...|\n", 159 | "| 608550784|POINT (-96.8336 3...|2016-12-15 00:00:...|\n", 160 | "| 610231236|POINT (-96.8336 3...|2016-12-20 00:00:...|\n", 161 | "| 608761515|POINT (-96.2336 3...|2016-12-15 00:00:...|\n", 162 | "| 608760419|POINT (-96.2336 3...|2016-12-15 00:00:...|\n", 163 | "+-------------+--------------------+--------------------+\n", 164 | "\n" 165 | ] 166 | } 167 | ], 168 | "source": [ 169 | "spark.sql(\n", 170 | "\"\"\"\n", 171 | "select globalEventId,geom,dtg \n", 172 | "from gdelt \n", 173 | "where st_contains(geom,st_geomFromWKT('POLYGON((-98 37,-95 37,-95 40,-98 40,-98 37))')) limit 10\n", 174 | "\"\"\"\n", 175 | ").show()" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": 7, 181 | "metadata": { 182 | "collapsed": false 183 | }, 184 | "outputs": [], 185 | "source": [ 186 | "val ds = org.geotools.data.DataStoreFinder.getDataStore(\n", 187 | "Map(\n", 188 | "\"zookeepers\" -> zookeepers,\n", 189 | "\"instanceId\" -> \"gis\",\n", 190 | "\"user\" -> \"root\",\n", 191 | "\"password\" -> \"secret\",\n", 192 | "\"tableName\" -> \"geomesa.gdelt\"))\n" 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": 8, 198 | "metadata": { 199 | "collapsed": true 200 | }, 201 | "outputs": [], 202 | "source": [ 203 | "val fs = ds.getFeatureSource(\"gdelt\")" 204 | ] 205 | }, 206 | { 207 | "cell_type": "code", 208 | "execution_count": 9, 209 | "metadata": { 210 | "collapsed": false 211 | }, 212 | "outputs": [], 213 | "source": [ 214 | "val sf = fs.getFeatures().features.take(5).toList.map(_.getDefaultGeometry.asInstanceOf[com.vividsolutions.jts.geom.Point]).map { p => L.Circle(p.getX, p.getY, 50, L.StyleOptions())}" 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 10, 220 | "metadata": { 221 | "collapsed": false 222 | }, 223 | "outputs": [ 224 | { 225 | "data": { 226 | "text/html": [ 227 | "\n", 228 | "\n", 301 | "\n", 313 | " " 314 | ] 315 | }, 316 | "metadata": {}, 317 | "output_type": "display_data" 318 | } 319 | ], 320 | "source": [ 321 | "L.show(sf)" 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": 16, 327 | "metadata": { 328 | "collapsed": true 329 | }, 330 | "outputs": [], 331 | "source": [ 332 | "val df = spark.sql(\"select eventCode,count(eventCode) as count from gdelt group by eventCode order by count desc limit 20\")" 333 | ] 334 | }, 335 | { 336 | "cell_type": "code", 337 | "execution_count": 17, 338 | "metadata": { 339 | "collapsed": false 340 | }, 341 | "outputs": [ 342 | { 343 | "name": "stdout", 344 | "output_type": "stream", 345 | "text": [ 346 | "\r", 347 | " \r", 348 | "+---------+------+\n", 349 | "|eventCode| count|\n", 350 | "+---------+------+\n", 351 | "| 010|100980|\n", 352 | "| 042| 79710|\n", 353 | "| 043| 76407|\n", 354 | "| 020| 71148|\n", 355 | "| 051| 68348|\n", 356 | "| 040| 65268|\n", 357 | "| 190| 48817|\n", 358 | "| 036| 42550|\n", 359 | "| 173| 40695|\n", 360 | "| 046| 33845|\n", 361 | "| 090| 26066|\n", 362 | "| 013| 25580|\n", 363 | "| 111| 25370|\n", 364 | "| 120| 25263|\n", 365 | "| 112| 23002|\n", 366 | "| 012| 22725|\n", 367 | "| 193| 22351|\n", 368 | "| 030| 21840|\n", 369 | "| 110| 21369|\n", 370 | "| 071| 19856|\n", 371 | "+---------+------+\n", 372 | "\n" 373 | ] 374 | } 375 | ], 376 | "source": [ 377 | "df.show()" 378 | ] 379 | }, 380 | { 381 | "cell_type": "code", 382 | "execution_count": 18, 383 | "metadata": { 384 | "collapsed": false 385 | }, 386 | "outputs": [ 387 | { 388 | "data": { 389 | "text/html": [ 390 | "\n", 391 | " \n", 506 | " \n", 517 | " " 518 | ] 519 | }, 520 | "metadata": {}, 521 | "output_type": "display_data" 522 | } 523 | ], 524 | "source": [ 525 | "Vegas(\"Event Code\").\n", 526 | " withDataFrame(df).\n", 527 | " encodeX(\"eventCode\", Nom).\n", 528 | " encodeY(\"count\", Quant).\n", 529 | " mark(Bar).\n", 530 | " show(displayer)" 531 | ] 532 | }, 533 | { 534 | "cell_type": "code", 535 | "execution_count": null, 536 | "metadata": { 537 | "collapsed": true 538 | }, 539 | "outputs": [], 540 | "source": [] 541 | } 542 | ], 543 | "metadata": { 544 | "kernelspec": { 545 | "display_name": "GeoMesa Spark - Scala", 546 | "language": "scala", 547 | "name": "geomesa_spark_scala" 548 | }, 549 | "language_info": { 550 | "file_extension": ".scala", 551 | "name": "scala", 552 | "version": "2.11.8" 553 | } 554 | }, 555 | "nbformat": 4, 556 | "nbformat_minor": 2 557 | } 558 | -------------------------------------------------------------------------------- /geodocker-geomesa-jupyter/Makefile: -------------------------------------------------------------------------------- 1 | BASE := $(subst -, ,$(notdir ${CURDIR})) 2 | ORG := geomesa 3 | REPO := $(word 2, ${BASE})-$(word 3, ${BASE}) 4 | IMG := quay.io/${ORG}/${REPO} 5 | 6 | build: vegas dockerfile 7 | docker build \ 8 | --build-arg GEOMESA_VERSION=${GEOMESA_VERSION} \ 9 | --build-arg TAG=${TAG} \ 10 | --build-arg ACCUMULO_VERSION=${ACCUMULO_VERSION} \ 11 | -f target/Dockerfile \ 12 | -t ${IMG}:${TAG} . 13 | 14 | dockerfile: 15 | mkdir -p target 16 | sed 's/__TAG__/'"${TAG}"'/' Dockerfile.template > target/Dockerfile 17 | 18 | 19 | ivy-2.3.0.jar: 20 | curl -L -O 'http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar' 21 | 22 | vegas: ivy-2.3.0.jar 23 | java -jar ivy-2.3.0.jar -dependency org.vegas-viz vegas-spark_2.11 0.3.6 -retrieve "lib/[artifact]-[revision](-[classifier]).[ext]" 24 | 25 | publish: build 26 | docker push ${IMG}:${TAG} 27 | 28 | clean: 29 | rm -rf ivy-2.3.0.jar 30 | rm -rf lib 31 | -------------------------------------------------------------------------------- /geodocker-geomesa-jupyter/js/leaflet.css: -------------------------------------------------------------------------------- 1 | /* required styles */ 2 | 3 | .leaflet-pane, 4 | .leaflet-tile, 5 | .leaflet-marker-icon, 6 | .leaflet-marker-shadow, 7 | .leaflet-tile-container, 8 | .leaflet-map-pane svg, 9 | .leaflet-map-pane canvas, 10 | .leaflet-zoom-box, 11 | .leaflet-image-layer, 12 | .leaflet-layer { 13 | position: absolute; 14 | left: 0; 15 | top: 0; 16 | } 17 | .leaflet-container { 18 | overflow: hidden; 19 | } 20 | .leaflet-tile, 21 | .leaflet-marker-icon, 22 | .leaflet-marker-shadow { 23 | -webkit-user-select: none; 24 | -moz-user-select: none; 25 | user-select: none; 26 | -webkit-user-drag: none; 27 | } 28 | /* Safari renders non-retina tile on retina better with this, but Chrome is worse */ 29 | .leaflet-safari .leaflet-tile { 30 | image-rendering: -webkit-optimize-contrast; 31 | } 32 | /* hack that prevents hw layers "stretching" when loading new tiles */ 33 | .leaflet-safari .leaflet-tile-container { 34 | width: 1600px; 35 | height: 1600px; 36 | -webkit-transform-origin: 0 0; 37 | } 38 | .leaflet-marker-icon, 39 | .leaflet-marker-shadow { 40 | display: block; 41 | } 42 | /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ 43 | /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ 44 | .leaflet-container .leaflet-overlay-pane svg, 45 | .leaflet-container .leaflet-marker-pane img, 46 | .leaflet-container .leaflet-tile-pane img, 47 | .leaflet-container img.leaflet-image-layer { 48 | max-width: none !important; 49 | } 50 | 51 | .leaflet-container.leaflet-touch-zoom { 52 | -ms-touch-action: pan-x pan-y; 53 | touch-action: pan-x pan-y; 54 | } 55 | .leaflet-container.leaflet-touch-drag { 56 | -ms-touch-action: pinch-zoom; 57 | } 58 | .leaflet-container.leaflet-touch-drag.leaflet-touch-drag { 59 | -ms-touch-action: none; 60 | touch-action: none; 61 | } 62 | .leaflet-tile { 63 | filter: inherit; 64 | visibility: hidden; 65 | } 66 | .leaflet-tile-loaded { 67 | visibility: inherit; 68 | } 69 | .leaflet-zoom-box { 70 | width: 0; 71 | height: 0; 72 | -moz-box-sizing: border-box; 73 | box-sizing: border-box; 74 | z-index: 800; 75 | } 76 | /* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ 77 | .leaflet-overlay-pane svg { 78 | -moz-user-select: none; 79 | } 80 | 81 | .leaflet-pane { z-index: 400; } 82 | 83 | .leaflet-tile-pane { z-index: 200; } 84 | .leaflet-overlay-pane { z-index: 400; } 85 | .leaflet-shadow-pane { z-index: 500; } 86 | .leaflet-marker-pane { z-index: 600; } 87 | .leaflet-tooltip-pane { z-index: 650; } 88 | .leaflet-popup-pane { z-index: 700; } 89 | 90 | .leaflet-map-pane canvas { z-index: 100; } 91 | .leaflet-map-pane svg { z-index: 200; } 92 | 93 | .leaflet-vml-shape { 94 | width: 1px; 95 | height: 1px; 96 | } 97 | .lvml { 98 | behavior: url(#default#VML); 99 | display: inline-block; 100 | position: absolute; 101 | } 102 | 103 | 104 | /* control positioning */ 105 | 106 | .leaflet-control { 107 | position: relative; 108 | z-index: 800; 109 | pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ 110 | pointer-events: auto; 111 | } 112 | .leaflet-top, 113 | .leaflet-bottom { 114 | position: absolute; 115 | z-index: 1000; 116 | pointer-events: none; 117 | } 118 | .leaflet-top { 119 | top: 0; 120 | } 121 | .leaflet-right { 122 | right: 0; 123 | } 124 | .leaflet-bottom { 125 | bottom: 0; 126 | } 127 | .leaflet-left { 128 | left: 0; 129 | } 130 | .leaflet-control { 131 | float: left; 132 | clear: both; 133 | } 134 | .leaflet-right .leaflet-control { 135 | float: right; 136 | } 137 | .leaflet-top .leaflet-control { 138 | margin-top: 10px; 139 | } 140 | .leaflet-bottom .leaflet-control { 141 | margin-bottom: 10px; 142 | } 143 | .leaflet-left .leaflet-control { 144 | margin-left: 10px; 145 | } 146 | .leaflet-right .leaflet-control { 147 | margin-right: 10px; 148 | } 149 | 150 | 151 | /* zoom and fade animations */ 152 | 153 | .leaflet-fade-anim .leaflet-tile { 154 | will-change: opacity; 155 | } 156 | .leaflet-fade-anim .leaflet-popup { 157 | opacity: 0; 158 | -webkit-transition: opacity 0.2s linear; 159 | -moz-transition: opacity 0.2s linear; 160 | -o-transition: opacity 0.2s linear; 161 | transition: opacity 0.2s linear; 162 | } 163 | .leaflet-fade-anim .leaflet-map-pane .leaflet-popup { 164 | opacity: 1; 165 | } 166 | .leaflet-zoom-animated { 167 | -webkit-transform-origin: 0 0; 168 | -ms-transform-origin: 0 0; 169 | transform-origin: 0 0; 170 | } 171 | .leaflet-zoom-anim .leaflet-zoom-animated { 172 | will-change: transform; 173 | } 174 | .leaflet-zoom-anim .leaflet-zoom-animated { 175 | -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); 176 | -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); 177 | -o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1); 178 | transition: transform 0.25s cubic-bezier(0,0,0.25,1); 179 | } 180 | .leaflet-zoom-anim .leaflet-tile, 181 | .leaflet-pan-anim .leaflet-tile { 182 | -webkit-transition: none; 183 | -moz-transition: none; 184 | -o-transition: none; 185 | transition: none; 186 | } 187 | 188 | .leaflet-zoom-anim .leaflet-zoom-hide { 189 | visibility: hidden; 190 | } 191 | 192 | 193 | /* cursors */ 194 | 195 | .leaflet-interactive { 196 | cursor: pointer; 197 | } 198 | .leaflet-grab { 199 | cursor: -webkit-grab; 200 | cursor: -moz-grab; 201 | } 202 | .leaflet-crosshair, 203 | .leaflet-crosshair .leaflet-interactive { 204 | cursor: crosshair; 205 | } 206 | .leaflet-popup-pane, 207 | .leaflet-control { 208 | cursor: auto; 209 | } 210 | .leaflet-dragging .leaflet-grab, 211 | .leaflet-dragging .leaflet-grab .leaflet-interactive, 212 | .leaflet-dragging .leaflet-marker-draggable { 213 | cursor: move; 214 | cursor: -webkit-grabbing; 215 | cursor: -moz-grabbing; 216 | } 217 | 218 | /* marker & overlays interactivity */ 219 | .leaflet-marker-icon, 220 | .leaflet-marker-shadow, 221 | .leaflet-image-layer, 222 | .leaflet-pane > svg path, 223 | .leaflet-tile-container { 224 | pointer-events: none; 225 | } 226 | 227 | .leaflet-marker-icon.leaflet-interactive, 228 | .leaflet-image-layer.leaflet-interactive, 229 | .leaflet-pane > svg path.leaflet-interactive { 230 | pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ 231 | pointer-events: auto; 232 | } 233 | 234 | /* visual tweaks */ 235 | 236 | .leaflet-container { 237 | background: #ddd; 238 | outline: 0; 239 | } 240 | .leaflet-container a { 241 | color: #0078A8; 242 | } 243 | .leaflet-container a.leaflet-active { 244 | outline: 2px solid orange; 245 | } 246 | .leaflet-zoom-box { 247 | border: 2px dotted #38f; 248 | background: rgba(255,255,255,0.5); 249 | } 250 | 251 | 252 | /* general typography */ 253 | .leaflet-container { 254 | font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; 255 | } 256 | 257 | 258 | /* general toolbar styles */ 259 | 260 | .leaflet-bar { 261 | box-shadow: 0 1px 5px rgba(0,0,0,0.65); 262 | border-radius: 4px; 263 | } 264 | .leaflet-bar a, 265 | .leaflet-bar a:hover { 266 | background-color: #fff; 267 | border-bottom: 1px solid #ccc; 268 | width: 26px; 269 | height: 26px; 270 | line-height: 26px; 271 | display: block; 272 | text-align: center; 273 | text-decoration: none; 274 | color: black; 275 | } 276 | .leaflet-bar a, 277 | .leaflet-control-layers-toggle { 278 | background-position: 50% 50%; 279 | background-repeat: no-repeat; 280 | display: block; 281 | } 282 | .leaflet-bar a:hover { 283 | background-color: #f4f4f4; 284 | } 285 | .leaflet-bar a:first-child { 286 | border-top-left-radius: 4px; 287 | border-top-right-radius: 4px; 288 | } 289 | .leaflet-bar a:last-child { 290 | border-bottom-left-radius: 4px; 291 | border-bottom-right-radius: 4px; 292 | border-bottom: none; 293 | } 294 | .leaflet-bar a.leaflet-disabled { 295 | cursor: default; 296 | background-color: #f4f4f4; 297 | color: #bbb; 298 | } 299 | 300 | .leaflet-touch .leaflet-bar a { 301 | width: 30px; 302 | height: 30px; 303 | line-height: 30px; 304 | } 305 | 306 | 307 | /* zoom control */ 308 | 309 | .leaflet-control-zoom-in, 310 | .leaflet-control-zoom-out { 311 | font: bold 18px 'Lucida Console', Monaco, monospace; 312 | text-indent: 1px; 313 | } 314 | .leaflet-control-zoom-out { 315 | font-size: 20px; 316 | } 317 | 318 | .leaflet-touch .leaflet-control-zoom-in { 319 | font-size: 22px; 320 | } 321 | .leaflet-touch .leaflet-control-zoom-out { 322 | font-size: 24px; 323 | } 324 | 325 | 326 | /* layers control */ 327 | 328 | .leaflet-control-layers { 329 | box-shadow: 0 1px 5px rgba(0,0,0,0.4); 330 | background: #fff; 331 | border-radius: 5px; 332 | } 333 | .leaflet-control-layers-toggle { 334 | background-image: url(images/layers.png); 335 | width: 36px; 336 | height: 36px; 337 | } 338 | .leaflet-retina .leaflet-control-layers-toggle { 339 | background-image: url(images/layers-2x.png); 340 | background-size: 26px 26px; 341 | } 342 | .leaflet-touch .leaflet-control-layers-toggle { 343 | width: 44px; 344 | height: 44px; 345 | } 346 | .leaflet-control-layers .leaflet-control-layers-list, 347 | .leaflet-control-layers-expanded .leaflet-control-layers-toggle { 348 | display: none; 349 | } 350 | .leaflet-control-layers-expanded .leaflet-control-layers-list { 351 | display: block; 352 | position: relative; 353 | } 354 | .leaflet-control-layers-expanded { 355 | padding: 6px 10px 6px 6px; 356 | color: #333; 357 | background: #fff; 358 | } 359 | .leaflet-control-layers-scrollbar { 360 | overflow-y: scroll; 361 | padding-right: 5px; 362 | } 363 | .leaflet-control-layers-selector { 364 | margin-top: 2px; 365 | position: relative; 366 | top: 1px; 367 | } 368 | .leaflet-control-layers label { 369 | display: block; 370 | } 371 | .leaflet-control-layers-separator { 372 | height: 0; 373 | border-top: 1px solid #ddd; 374 | margin: 5px -10px 5px -6px; 375 | } 376 | 377 | 378 | /* attribution and scale controls */ 379 | 380 | .leaflet-container .leaflet-control-attribution { 381 | background: #fff; 382 | background: rgba(255, 255, 255, 0.7); 383 | margin: 0; 384 | } 385 | .leaflet-control-attribution, 386 | .leaflet-control-scale-line { 387 | padding: 0 5px; 388 | color: #333; 389 | } 390 | .leaflet-control-attribution a { 391 | text-decoration: none; 392 | } 393 | .leaflet-control-attribution a:hover { 394 | text-decoration: underline; 395 | } 396 | .leaflet-container .leaflet-control-attribution, 397 | .leaflet-container .leaflet-control-scale { 398 | font-size: 11px; 399 | } 400 | .leaflet-left .leaflet-control-scale { 401 | margin-left: 5px; 402 | } 403 | .leaflet-bottom .leaflet-control-scale { 404 | margin-bottom: 5px; 405 | } 406 | .leaflet-control-scale-line { 407 | border: 2px solid #777; 408 | border-top: none; 409 | line-height: 1.1; 410 | padding: 2px 5px 1px; 411 | font-size: 11px; 412 | white-space: nowrap; 413 | overflow: hidden; 414 | -moz-box-sizing: border-box; 415 | box-sizing: border-box; 416 | 417 | background: #fff; 418 | background: rgba(255, 255, 255, 0.5); 419 | } 420 | .leaflet-control-scale-line:not(:first-child) { 421 | border-top: 2px solid #777; 422 | border-bottom: none; 423 | margin-top: -2px; 424 | } 425 | .leaflet-control-scale-line:not(:first-child):not(:last-child) { 426 | border-bottom: 2px solid #777; 427 | } 428 | 429 | .leaflet-touch .leaflet-control-attribution, 430 | .leaflet-touch .leaflet-control-layers, 431 | .leaflet-touch .leaflet-bar { 432 | box-shadow: none; 433 | } 434 | .leaflet-touch .leaflet-control-layers, 435 | .leaflet-touch .leaflet-bar { 436 | border: 2px solid rgba(0,0,0,0.2); 437 | background-clip: padding-box; 438 | } 439 | 440 | 441 | /* popup */ 442 | 443 | .leaflet-popup { 444 | position: absolute; 445 | text-align: center; 446 | margin-bottom: 20px; 447 | } 448 | .leaflet-popup-content-wrapper { 449 | padding: 1px; 450 | text-align: left; 451 | border-radius: 12px; 452 | } 453 | .leaflet-popup-content { 454 | margin: 13px 19px; 455 | line-height: 1.4; 456 | } 457 | .leaflet-popup-content p { 458 | margin: 18px 0; 459 | } 460 | .leaflet-popup-tip-container { 461 | width: 40px; 462 | height: 20px; 463 | position: absolute; 464 | left: 50%; 465 | margin-left: -20px; 466 | overflow: hidden; 467 | pointer-events: none; 468 | } 469 | .leaflet-popup-tip { 470 | width: 17px; 471 | height: 17px; 472 | padding: 1px; 473 | 474 | margin: -10px auto 0; 475 | 476 | -webkit-transform: rotate(45deg); 477 | -moz-transform: rotate(45deg); 478 | -ms-transform: rotate(45deg); 479 | -o-transform: rotate(45deg); 480 | transform: rotate(45deg); 481 | } 482 | .leaflet-popup-content-wrapper, 483 | .leaflet-popup-tip { 484 | background: white; 485 | color: #333; 486 | box-shadow: 0 3px 14px rgba(0,0,0,0.4); 487 | } 488 | .leaflet-container a.leaflet-popup-close-button { 489 | position: absolute; 490 | top: 0; 491 | right: 0; 492 | padding: 4px 4px 0 0; 493 | border: none; 494 | text-align: center; 495 | width: 18px; 496 | height: 14px; 497 | font: 16px/14px Tahoma, Verdana, sans-serif; 498 | color: #c3c3c3; 499 | text-decoration: none; 500 | font-weight: bold; 501 | background: transparent; 502 | } 503 | .leaflet-container a.leaflet-popup-close-button:hover { 504 | color: #999; 505 | } 506 | .leaflet-popup-scrolled { 507 | overflow: auto; 508 | border-bottom: 1px solid #ddd; 509 | border-top: 1px solid #ddd; 510 | } 511 | 512 | .leaflet-oldie .leaflet-popup-content-wrapper { 513 | zoom: 1; 514 | } 515 | .leaflet-oldie .leaflet-popup-tip { 516 | width: 24px; 517 | margin: 0 auto; 518 | 519 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; 520 | filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); 521 | } 522 | .leaflet-oldie .leaflet-popup-tip-container { 523 | margin-top: -1px; 524 | } 525 | 526 | .leaflet-oldie .leaflet-control-zoom, 527 | .leaflet-oldie .leaflet-control-layers, 528 | .leaflet-oldie .leaflet-popup-content-wrapper, 529 | .leaflet-oldie .leaflet-popup-tip { 530 | border: 1px solid #999; 531 | } 532 | 533 | 534 | /* div icon */ 535 | 536 | .leaflet-div-icon { 537 | background: #fff; 538 | border: 1px solid #666; 539 | } 540 | 541 | 542 | /* Tooltip */ 543 | /* Base styles for the element that has a tooltip */ 544 | .leaflet-tooltip { 545 | position: absolute; 546 | padding: 6px; 547 | background-color: #fff; 548 | border: 1px solid #fff; 549 | border-radius: 3px; 550 | color: #222; 551 | white-space: nowrap; 552 | -webkit-user-select: none; 553 | -moz-user-select: none; 554 | -ms-user-select: none; 555 | user-select: none; 556 | pointer-events: none; 557 | box-shadow: 0 1px 3px rgba(0,0,0,0.4); 558 | } 559 | .leaflet-tooltip.leaflet-clickable { 560 | cursor: pointer; 561 | pointer-events: auto; 562 | } 563 | .leaflet-tooltip-top:before, 564 | .leaflet-tooltip-bottom:before, 565 | .leaflet-tooltip-left:before, 566 | .leaflet-tooltip-right:before { 567 | position: absolute; 568 | pointer-events: none; 569 | border: 6px solid transparent; 570 | background: transparent; 571 | content: ""; 572 | } 573 | 574 | /* Directions */ 575 | 576 | .leaflet-tooltip-bottom:before, 577 | .leaflet-tooltip-top:before { 578 | left: 50%; 579 | margin-left: -6px; 580 | } 581 | .leaflet-tooltip-top:before { 582 | bottom: 0; 583 | margin-bottom: -12px; 584 | border-top-color: #fff; 585 | } 586 | .leaflet-tooltip-bottom:before { 587 | top: 0; 588 | margin-top: -12px; 589 | margin-left: -6px; 590 | border-bottom-color: #fff; 591 | } 592 | .leaflet-tooltip-left:before, 593 | .leaflet-tooltip-right:before { 594 | top: 50%; 595 | margin-top: -6px; 596 | } 597 | .leaflet-tooltip-left:before { 598 | right: 0; 599 | margin-right: -12px; 600 | border-left-color: #fff; 601 | } 602 | .leaflet-tooltip-right:before { 603 | left: 0; 604 | margin-left: -12px; 605 | border-right-color: #fff; 606 | } 607 | -------------------------------------------------------------------------------- /geodocker-geomesa-jupyter/js/leaflet.wms.js: -------------------------------------------------------------------------------- 1 | (function(factory){if(typeof define==="function"&&define.amd){define(["leaflet"],factory)}else if(typeof module!=="undefined"){module.exports=factory(require("leaflet"))}else{if(typeof this.L==="undefined")throw"Leaflet must be loaded first!";this.L.WMS=this.L.wms=factory(this.L)}})(function(L){var wms={};if(!("keys"in Object)){Object.keys=function(obj){var result=[];for(var i in obj){if(obj.hasOwnProperty(i)){result.push(i)}}return result}}wms.Source=L.Layer.extend({options:{untiled:true,identify:true},initialize:function(url,options){L.setOptions(this,options);if(this.options.tiled){this.options.untiled=false}this._url=url;this._subLayers={};this._overlay=this.createOverlay(this.options.untiled)},createOverlay:function(untiled){var overlayOptions={};for(var opt in this.options){if(opt!="untiled"&&opt!="identify"){overlayOptions[opt]=this.options[opt]}}if(untiled){return wms.overlay(this._url,overlayOptions)}else{return wms.tileLayer(this._url,overlayOptions)}},onAdd:function(){this.refreshOverlay()},getEvents:function(){if(this.options.identify){return{click:this.identify}}else{return{}}},setOpacity:function(opacity){this.options.opacity=opacity;if(this._overlay){this._overlay.setOpacity(opacity)}},bringToBack:function(){this.options.isBack=true;if(this._overlay){this._overlay.bringToBack()}},bringToFront:function(){this.options.isBack=false;if(this._overlay){this._overlay.bringToFront()}},getLayer:function(name){return wms.layer(this,name)},addSubLayer:function(name){this._subLayers[name]=true;this.refreshOverlay()},removeSubLayer:function(name){delete this._subLayers[name];this.refreshOverlay()},refreshOverlay:function(){var subLayers=Object.keys(this._subLayers).join(",");if(!this._map){return}if(!subLayers){this._overlay.remove()}else{this._overlay.setParams({layers:subLayers});this._overlay.addTo(this._map)}},identify:function(evt){var layers=this.getIdentifyLayers();if(!layers.length){return}this.getFeatureInfo(evt.containerPoint,evt.latlng,layers,this.showFeatureInfo)},getFeatureInfo:function(point,latlng,layers,callback){var params=this.getFeatureInfoParams(point,layers),url=this._url+L.Util.getParamString(params,this._url);this.showWaiting();this.ajax(url,done);function done(result){this.hideWaiting();var text=this.parseFeatureInfo(result,url);callback.call(this,latlng,text)}},ajax:function(url,callback){ajax.call(this,url,callback)},getIdentifyLayers:function(){if(this.options.identifyLayers)return this.options.identifyLayers;return Object.keys(this._subLayers)},getFeatureInfoParams:function(point,layers){var wmsParams,overlay;if(this.options.untiled){wmsParams=this._overlay.wmsParams}else{overlay=this.createOverlay(true);overlay.updateWmsParams(this._map);wmsParams=overlay.wmsParams;wmsParams.layers=layers.join(",")}var infoParams={request:"GetFeatureInfo",query_layers:layers.join(","),X:Math.round(point.x),Y:Math.round(point.y)};return L.extend({},wmsParams,infoParams)},parseFeatureInfo:function(result,url){if(result=="error"){result="