Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:4.7.0-jdk8-alpine AS build
FROM gradle:7.1-jdk11 AS build
COPY --chown=gradle:gradle *.gradle /home/gradle/src/
COPY --chown=gradle:gradle ./external/ /home/gradle/src/external/
COPY --chown=gradle:gradle ./src/ /home/gradle/src/src/
Expand All @@ -8,7 +8,7 @@ RUN gradle allJars --no-daemon
RUN ls -l /home/gradle/src/*
RUN ls -l /home/gradle/src/build/libs/*

FROM openjdk:8-jre-slim
FROM openjdk:11-jre-slim

RUN mkdir /app

Expand Down
5 changes: 5 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
set -x

docker build --tag shst-builder .
6 changes: 6 additions & 0 deletions build-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e
set -x

/opt/homebrew/opt/gradle@7/bin/gradle allJars --stacktrace
41 changes: 22 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ version '0.3.2'


buildscript {
repositories { jcenter()
mavenCentral()}
repositories {
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
//classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.1'
//classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
} // Note PF : this plugin does not support resource transformation (needed for akka configuration files
}
Expand All @@ -23,34 +26,34 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.*
sourceCompatibility = 1.8

repositories {
maven { url "http://repository.apache.org" }
jcenter()
maven { url "https://repository.apache.org" }
mavenCentral()
mavenLocal()
}


dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
testImplementation group: 'junit', name: 'junit', version: '4.11'
}

def flinkversion = "1.3.2"
def flinkversion = "1.3.3"
def protobufversion = "3.4.0"

dependencies {


compile 'org.slf4j:slf4j-api:2.0.3'
compile 'org.slf4j:slf4j-jdk14:2.0.3'
compile files('external/osmosis-osm-binary.jar')
compile 'com.esri.geometry:esri-geometry-api:1.2.1'
compile "org.apache.flink:flink-java:${flinkversion}"
compile "org.apache.flink:flink-clients_2.10:${flinkversion}"
compile "com.google.protobuf:protobuf-java:${protobufversion}"
compile "com.jsoniter:jsoniter:0.9.15"
compile 'net.sf.geographiclib:GeographicLib-Java:1.46'
compile 'commons-cli:commons-cli:1.4'
implementation 'org.slf4j:slf4j-api:2.0.3'
implementation 'org.slf4j:slf4j-jdk14:2.0.3'
implementation files('external/osmosis-osm-binary.jar')
implementation 'com.esri.geometry:esri-geometry-api:1.2.1'
implementation "org.apache.flink:flink-java:${flinkversion}"
implementation "org.apache.flink:flink-clients_2.10:${flinkversion}"
implementation "com.google.protobuf:protobuf-java:${protobufversion}"
implementation "com.jsoniter:jsoniter:0.9.15"
implementation 'net.sf.geographiclib:GeographicLib-Java:1.46'
implementation 'commons-cli:commons-cli:1.4'

testCompile "junit:junit:4.11"
testImplementation "junit:junit:4.11"
}


Expand Down Expand Up @@ -115,7 +118,7 @@ shadowJar {
// and permit to use the soft from a command line
task allJars(type: ShadowJar) {
from sourceSets.main.output
configurations = [project.configurations.compile]
configurations = [project.configurations.runtimeClasspath]
transform(com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer) { resource = 'reference.conf' }

manifest {
Expand Down
9 changes: 9 additions & 0 deletions generate-tiles-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
set -x

docker run --rm \
-v $(pwd)/data:/data \
-v $(pwd)/out:/out \
shst-builder \
2G greater-london-latest.osm.pbf
18 changes: 18 additions & 0 deletions generate-tiles-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e
set -x

# Usage: ./generate-tiles-local.sh [osmPbf] [xmx] [javabin] [jarfile]
osmPbf=${1:-greater-london-latest.osm.pbf}
xmx=${2:-2G}
javabin=${3:-/opt/homebrew/opt/openjdk@11/bin/java}
jarfile=${4:-build/libs/sharedstreets-builder-0.3.2.jar}


pbfName=$(basename $osmPbf .osm.pbf)

# Download OSM PBF
# wget https://download.geofabrik.de/europe/united-kingdom/england/greater-london-latest.osm.pbf -O data/greater-london-latest.osm.pbf

${javabin} -Xmx${xmx} -jar ${jarfile} --input data/${osmPbf} --output out/shst/tiles/osm/latest/${pbfName}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static void main(String[] args) throws Exception {
conf.setFloat(ConfigConstants.TASK_MANAGER_MEMORY_FRACTION_KEY, 0.5f);
final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf);
ExecutionConfig execConfig = env.getConfig();
execConfig.setParallelism(54);
//execConfig.setParallelism(54);

// load osm data from PBF input
OSMDataStream dataStream = new OSMDataStream(inputFile, env);
Expand Down