-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Tiler containers * Update config for tiler server * Split provider layers * Update docker file - tiler server * Update providers * Update ne layers - tiler server * Update container for tiler
- Loading branch information
Showing
41 changed files
with
3,535 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Create the 'template_postgis' template db | ||
"${psql[@]}" <<- 'EOSQL' | ||
CREATE DATABASE template_postgis; | ||
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'; | ||
EOSQL | ||
|
||
# Load PostGIS into both template_database and $POSTGRES_DB | ||
for DB in template_postgis "$POSTGRES_DB"; do | ||
echo "Loading PostGIS extensions into $DB" | ||
"${psql[@]}" --dbname="$DB" <<-'EOSQL' | ||
CREATE EXTENSION IF NOT EXISTS postgis; | ||
CREATE EXTENSION IF NOT EXISTS postgis_topology; | ||
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; | ||
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder; | ||
CREATE EXTENSION IF NOT EXISTS hstore; | ||
EOSQL | ||
done | ||
# Add hstore into the DB | ||
for DB in template_postgis "$POSTGRES_DB" "${@}"; do | ||
echo "Updating extensions '$DB'" | ||
psql --dbname="$DB" -c " | ||
CREATE EXTENSION IF NOT EXISTS hstore; | ||
" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,41 @@ | ||
FROM golang:1.14.1-alpine3.11 AS build | ||
ENV VERSION="v0.8.1" | ||
RUN apk update | ||
RUN apk add musl-dev=1.1.24-r3 \ | ||
gcc \ | ||
bash \ | ||
git \ | ||
postgresql \ | ||
postgresql-contrib | ||
FROM gospatial/tegola:v0.20.0 | ||
|
||
RUN mkdir -p /go/src/github.com/go-spatial/tegola | ||
RUN git clone https://github.com/go-spatial/tegola.git /go/src/github.com/go-spatial/tegola | ||
RUN cd /go/src/github.com/go-spatial/tegola && git checkout v0.13.0 | ||
RUN cd /go/src/github.com/go-spatial/tegola/cmd/tegola \ | ||
&& go build -gcflags "-N -l" -o /opt/tegola \ | ||
&& chmod a+x /opt/tegola | ||
RUN ln -s /opt/tegola /usr/bin/tegola | ||
|
||
RUN apk add --update \ | ||
python3 \ | ||
py-pip \ | ||
py-cffi \ | ||
py-cryptography \ | ||
&& pip install --upgrade pip \ | ||
&& apk add --virtual build-deps \ | ||
RUN apk --no-cache add \ | ||
gcc \ | ||
libffi-dev \ | ||
python3-dev \ | ||
python3 \ | ||
py3-pip \ | ||
py3-cffi \ | ||
py3-cryptography \ | ||
linux-headers \ | ||
musl-dev \ | ||
openssl-dev \ | ||
curl | ||
bash \ | ||
git \ | ||
postgresql-client \ | ||
coreutils \ | ||
jq | ||
|
||
# Install aws-cli and gsutil | ||
RUN pip3 install awscli | ||
RUN curl -sSL https://sdk.cloud.google.com | bash | ||
RUN ln -f -s /root/google-cloud-sdk/bin/gsutil /usr/bin/gsutil | ||
RUN pip install --upgrade pip && pip3 install awscli mercantile | ||
|
||
RUN pip3 install mercantile \ | ||
&& apk del build-deps \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& apk --purge -v del py-pip | ||
|
||
RUN apk add --update coreutils jq && rm -rf /var/cache/apk/* | ||
RUN ln -s /opt/tegola /usr/bin/tegola | ||
|
||
COPY ./config /opt/config/ | ||
COPY build_config.py /opt/ | ||
RUN mkdir /opt/tegola_config | ||
RUN cd /opt/ && python build_config.py \ | ||
--template config/config.template.toml \ | ||
--providers config/providers \ | ||
--output /opt/tegola_config/config.toml | ||
|
||
# Volumen | ||
VOLUME /mnt/data | ||
# Copy config and exec files | ||
COPY ./config/config.toml /opt/tegola_config/config.toml | ||
COPY ./tile2bounds.py . | ||
COPY ./start.sh . | ||
COPY ./expire-watcher.sh . | ||
COPY ./seed-by-diffs.sh . | ||
COPY ./tile_cache_downloader.sh . | ||
COPY ./rm_tegola_ps.sh . | ||
|
||
ENTRYPOINT ["/bin/bash", "-c"] | ||
CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh & ./rm_tegola_ps.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
import argparse | ||
parser = argparse.ArgumentParser(description='Merge TOML files into a configuration file.') | ||
parser.add_argument('--template', default='config/config.template.toml', help='Path to the configuration template file.') | ||
parser.add_argument('--providers', default='config/providers', help='Directory containing provider TOML files.') | ||
parser.add_argument('--output', default='config/config.toml', help='Output configuration file path.') | ||
args = parser.parse_args() | ||
|
||
config_template_file = args.template | ||
providers_dir = args.providers | ||
output_file_path = args.output | ||
toml_files = [file for file in os.listdir(providers_dir) if file.endswith(".toml")] | ||
|
||
# Read TOML files | ||
new_configs = {} | ||
for toml_file in toml_files: | ||
dir_toml_file = os.path.join(providers_dir, toml_file) | ||
with open(dir_toml_file, "r") as file: | ||
new_configs[dir_toml_file] = file.read() | ||
|
||
with open(config_template_file, "r") as main_file: | ||
content = main_file.read() | ||
|
||
# Replace the content of main.toml with the content read from other TOML files | ||
for toml_file, toml_file_content in new_configs.items(): | ||
print(f"Copy {toml_file} to config.toml") | ||
section_header = "[['{}']]".format(toml_file.replace("config/", "")) | ||
indentation_level = content.find(section_header) | ||
if indentation_level != -1: | ||
# Find the appropriate number of tabs or spaces for indentation | ||
preceding_newline = content.rfind('\n', 0, indentation_level) | ||
indentation = content[preceding_newline + 1:indentation_level] | ||
toml_file_content = f"###### From {toml_file} \n" + toml_file_content | ||
new_values=toml_file_content.replace("\n", "\n" + indentation) | ||
content = content.replace(section_header, new_values) | ||
|
||
with open(output_file_path, "w") as output_file: | ||
output_file.write(content) |
Oops, something went wrong.