Skip to content

Commit

Permalink
Merge pull request #23 from pomadchin/feature/json-etl-support
Browse files Browse the repository at this point in the history
All backends support with etl refactor
  • Loading branch information
echeipesh authored Aug 19, 2016
2 parents 1bab1dd + 7cba587 commit 9f58a2d
Show file tree
Hide file tree
Showing 15 changed files with 451 additions and 118 deletions.
78 changes: 59 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a demo of GeoTrellis functionality. Demo consists of two parts: tile ingest process and demo server to query ingested data.

To run ingest, use `./ingest.sh`, to run server, use `./sbt run`. Web map would be available here `http://locahost:8777/`.
To run ingest, use `./ingest.sh`, to run server, use `./run-server.sh`. Web map would be available here `http://locahost:8777/`.

## Short description

Expand Down Expand Up @@ -54,18 +54,13 @@ If the `mask` option is set to a polygon, `{zoom}/{x}/{y}` tiles masked by polyg
This service takes layers, weights and a polygon.
It will compute a weighted summary of the area under the polygon.

## Runing demo using [GeoDocker cluster](https://github.com/geotrellis/geodocker-cluster)
## Runing demo using [GeoDocker cluster](https://github.com/geodocker/geodocker)

To compile and run this demo, we prepared a development environment.

* Clone GeoDocker cluster repository:
```bash
git clone https://github.com/geotrellis/geodocker-cluster ./
```
To compile and run this demo, we prepared an [environment](https://github.com/geodocker/geodocker). To run cluster we have a bit modified [docker-compose.yml](docker-compose.yml) file:

* To run cluster:
```bash
cd ./geodocker-cluster/nodes; ./start-cluster.sh -n=2 # n >= 1, nodes amount
docker-compose up
```

To check that cluster is operating normally check pages availability:
Expand All @@ -78,14 +73,59 @@ To compile and run this demo, we prepared a development environment.
```bash
docker ps -a | grep geodocker
```
Runing containers have names `master1`, `slave1`, ..., `slaveN`, `N = n - 1`.

* Install and run this demo on cluster
```bash
cd ./geodocker-cluster/install/geotrellis
./install.sh
./ingest.sh # to ingest
./run.sh # to run server on a cluster
```

This demo would be installed into `/data` directory, inside the container.
More information avaible in a [GeoDocker cluster](https://github.com/geodocker/geodocker) repo

* Install and run this demo using [GeoDocker cluster](https://github.com/geodocker/geodocker)

* Modify [application.conf](geotrellis/src/main/resource/application.conf) (working conf example for GeoDocker cluster):

```conf
geotrellis {
port = 8777
server.static-path = "../static"
catalog = "data/catalog.json"
hostname = "spark-master"
backend = "accumulo"
}
accumulo {
instance = "accumulo"
user = "root"
password = "GisPwd"
zookeepers = "zookeeper"
}
```
* Modify [backend-profiles.json](geotrellis/conf/backend-profiles.json) (working conf example for GeoDocker cluster):
```json
{
"name": "accumulo-local",
"type": "accumulo",
"zookeepers": "zookeeper",
"instance": "accumulo",
"user": "root",
"password": "GisPwd"
}
```
* Copy everything into spark master container:
```bash
cd ./geodocker
docker exec geotrellischattademo_spark-master_1 mkdir -p /data/target/scala-2.10/
docker cp target/scala-2.10/GeoTrellis-Tutorial-Project-assembly-0.1-SNAPSHOT.jar geotrellischattademo_spark-master_1:/data/target/scala-2.10/GeoTrellis-Tutorial-Project-assembly-0.1-SNAPSHOT.jar
docker cp data/arg_wm/ geotrellischattademo_spark-master_1:/data/
docker cp conf geotrellischattademo_spark-master_1:/data/
docker cp ingest.sh geotrellischattademo_spark-master_1:/data/
docker cp run-server.sh geotrellischattademo_spark-master_1:/data/
```
```bash
docker exec -it geotrellischattademo_spark-master_1 bash
cd /data/; ./ingest.sh # to ingest data into accumulo
cd /data/; ./run-server.sh # to run server
```
This demo would be installed into `/data` directory, inside spark master container.
74 changes: 74 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: '2'
services:
hdfs-name:
image: quay.io/geodocker/hdfs:latest
command: name
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
ports:
- 50070:50070
# volumes:
# - '/data/gt/hdfs:/data/hdfs'
hdfs-data:
image: quay.io/geodocker/hdfs:latest
command: data
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
depends_on:
- hdfs-name
# volumes:
# - '/data/gt/hdfs:/data/hdfs'
zookeeper:
image: quay.io/geodocker/zookeeper:latest
ports:
- 2181:2181
# volumes:
# - '/data/gt/hdfs:/data/hdfs'
accumulo-master:
image: quay.io/geodocker/accumulo:latest
command: master --auto-init
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
ZOOKEEPERS: zookeeper
ACCUMULO_PASSWORD: GisPwd
depends_on:
- zookeeper
accumulo-monitor:
image: quay.io/geodocker/accumulo:latest
command: monitor
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
ZOOKEEPERS: zookeeper
ports:
- 50095:50095
depends_on:
- zookeeper
- accumulo-master
accumulo-tserver:
image: quay.io/geodocker/accumulo:latest
command: tserver
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
ZOOKEEPERS: zookeeper
depends_on:
- zookeeper
- accumulo-master
spark-master:
image: quay.io/geodocker/spark:latest
command: master
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
ports:
- 4040:4040
- 8080:8080
- 8777:8777
depends_on:
- hdfs-data
spark-worker:
image: quay.io/geodocker/spark:latest
command: worker
environment:
HADOOP_MASTER_ADDRESS: hdfs-name
SPARK_MASTER: spark-master
depends_on:
- spark-master
16 changes: 9 additions & 7 deletions geotrellis/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@ pomIncludeRepository := { _ => false }

resolvers += Resolver.bintrayRepo("azavea", "geotrellis")

val gtVersion = "0.10.0-RC4"
val gtVersion = "1.0.0-SNAPSHOT"

val geotrellis = Seq(
"com.azavea.geotrellis" %% "geotrellis-accumulo" % gtVersion,
"com.azavea.geotrellis" %% "geotrellis-hbase" % gtVersion,
"com.azavea.geotrellis" %% "geotrellis-cassandra" % gtVersion,
"com.azavea.geotrellis" %% "geotrellis-s3" % gtVersion,
"com.azavea.geotrellis" %% "geotrellis-spark" % gtVersion,
"com.azavea.geotrellis" %% "geotrellis-spark-etl" % gtVersion
)

libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.5.2",
"io.spray" %% "spray-routing" % "1.3.3",
"io.spray" %% "spray-can" % "1.3.3",
"org.apache.hadoop" % "hadoop-client" % "2.7.1"
) ++ geotrellis
libraryDependencies ++= (((Seq(
"org.apache.spark" %% "spark-core" % "1.5.2",
"io.spray" %% "spray-routing" % "1.3.3",
"io.spray" %% "spray-can" % "1.3.3",
"org.apache.hadoop" % "hadoop-client" % "2.7.1"
) ++ geotrellis) map (_ exclude("com.google.guava", "guava"))) ++ Seq("com.google.guava" % "guava" % "16.0.1"))

ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }

Expand Down
24 changes: 24 additions & 0 deletions geotrellis/conf/backend-profiles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"backend-profiles": [
{
"name": "accumulo-local",
"type": "accumulo",
"zookeepers": "localhost",
"instance": "gis",
"user": "root",
"password": "secret"
},
{
"name": "cassandra-local",
"type": "cassandra",
"allowRemoteDCsForLocalConsistencyLevel": false,
"localDc": "datacenter1",
"usedHostsPerRemoteDc": 0,
"hosts": "localhost",
"replicationStrategy": "SimpleStrategy",
"replicationFactor": 1,
"user": "",
"password": ""
}
]
}
110 changes: 110 additions & 0 deletions geotrellis/conf/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
[
{
"name": "DevelopedLand",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/DevelopedLand.tiff"
},
"cache": "NONE"
},
{
"name": "ExampleOfWeightedSumOutput",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/ExampleOfWeightedSumOutput.tiff"
},
"cache": "NONE"
},
{
"name": "FarmlandOrForestedLandsWithPrimeAgriculturalSoils",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/FarmlandOrForestedLandsWithPrimeAgriculturalSoils.tiff"
},
"cache": "NONE"
},
{
"name": "FarmlandWithoutPrimeAgriculturalSoils",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/FarmlandWithoutPrimeAgriculturalSoils.tiff"
},
"cache": "NONE"
},
{
"name": "ForestedLands",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/ForestedLands.tiff"
},
"cache": "NONE"
},
{
"name": "ImperviousSurfacesBarrenLandsOpenWater",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/ImperviousSurfacesBarrenLandsOpenWater.tiff"
},
"cache": "NONE"
},
{
"name": "NonWorkingProtectedOrPublicLands",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/NonWorkingProtectedOrPublicLands.tiff"
},
"cache": "NONE"
},
{
"name": "PrimeAgriculturalSoilsNotForestedOrFarmland",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/PrimeAgriculturalSoilsNotForestedOrFarmland.tiff"
},
"cache": "NONE"
},
{
"name": "PrivatelyOwnedWorkingLandsWithEasements",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/PrivatelyOwnedWorkingLandsWithEasements.tiff"
},
"cache": "NONE"
},
{
"name": "PublicallyOwnedWorkingLands",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/PublicallyOwnedWorkingLands.tiff"
},
"cache": "NONE"
},
{
"name": "Wetlands",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/Wetlands.tiff"
},
"cache": "NONE"
},
{
"name": "mask",
"format": "geotiff",
"backend": {
"type": "hadoop",
"path": "file:///data/arg_wm/mask.tiff"
},
"cache": "NONE"
}
]
20 changes: 20 additions & 0 deletions geotrellis/conf/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backend": {
"type": "accumulo",
"path": "chattanooga",
"profile": "accumulo-local"
},
"reprojectMethod": "buffered",
"cellSize": {
"width": 256.0,
"height": 256.0
},
"tileSize": 256,
"pyramid": true,
"resampleMethod": "nearest-neighbor",
"keyIndexMethod": {
"type": "zorder"
},
"layoutScheme": "zoomed",
"crs": "EPSG:3857"
}
Loading

0 comments on commit 9f58a2d

Please sign in to comment.