add more formatting + minimalize kernel info

This commit is contained in:
ImreSamu 2016-11-16 02:29:44 +01:00
parent af423d4d22
commit 79a16709b7

View File

@ -16,6 +16,7 @@ rm -f $log_file
exec &> >(tee -a "$log_file") exec &> >(tee -a "$log_file")
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : OpenMapTiles quickstart! [ https://github.com/openmaptiles/openmaptiles ] " echo "====> : OpenMapTiles quickstart! [ https://github.com/openmaptiles/openmaptiles ] "
echo " : This will be logged to the $log_file file ( for debugging ) and to the screen" echo " : This will be logged to the $log_file file ( for debugging ) and to the screen"
echo " : Git version: $githash / Started: $STARTDATE " echo " : Git version: $githash / Started: $STARTDATE "
@ -24,10 +25,13 @@ echo " : Your system is:"
lsb_release -a lsb_release -a
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo " : This is working on x86_64 ; Your kernel is:" echo " : This is working on x86_64 ; Your kernel is:"
uname -a uname -r
uname -m
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Please check the docker and docker-compose version!" echo "====> : Please check the docker and docker-compose version!"
echo " : We are using docker-compose V2 file format ! see more: https://docs.docker.com/" echo " : We are using docker-compose V2 file format ! see more: https://docs.docker.com/"
echo " : (theoretically;not tested) minumum Docker version is 1.10.0+." echo " : (theoretically;not tested) minumum Docker version is 1.10.0+."
@ -38,48 +42,60 @@ docker --version
docker-compose --version docker-compose --version
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Checking OpenMapTiles docker images " echo "====> : Checking OpenMapTiles docker images "
docker images | grep openmaptiles docker images | grep openmaptiles
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Stopping running services & removing old containers " echo "====> : Stopping running services & removing old containers "
docker-compose down docker-compose down
docker-compose rm -fv docker-compose rm -fv
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : For a clean start, we are removing old postgresql data volume ( if it exists )" echo "====> : For a clean start, we are removing old postgresql data volume ( if it exists )"
docker volume ls -q | grep openmaptiles | xargs -r docker volume rm || true docker volume ls -q | grep openmaptiles | xargs -r docker volume rm || true
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Making directories - if they don't exist ( ./build ./data ) " echo "====> : Making directories - if they don't exist ( ./build ./data ) "
mkdir -p build mkdir -p build
mkdir -p data mkdir -p data
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Removing old MBTILES if exists ( ./data/*.mbtiles ) " echo "====> : Removing old MBTILES if exists ( ./data/*.mbtiles ) "
rm -f ./data/*.mbtiles rm -f ./data/*.mbtiles
testdata=zurich_switzerland.osm.pbf testdata=zurich_switzerland.osm.pbf
testdataurl=https://s3.amazonaws.com/metro-extracts.mapzen.com/$testdata testdataurl=https://s3.amazonaws.com/metro-extracts.mapzen.com/$testdata
if [ ! -f ./data/${testdata} ]; then if [ ! -f ./data/${testdata} ]; then
echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Downloading testdata $testdata " echo "====> : Downloading testdata $testdata "
rm -f ./data/* rm -f ./data/*
wget $testdataurl -P ./data wget $testdataurl -P ./data
else else
echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : The testdata ./data/$testdata exists, we don't need to download! " echo "====> : The testdata ./data/$testdata exists, we don't need to download! "
fi fi
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Remove old generated source files ( ./build/* ) ( if they exist ) " echo "====> : Remove old generated source files ( ./build/* ) ( if they exist ) "
docker run --rm -v $(pwd):/tileset openmaptiles/openmaptiles-tools make clean_build docker run --rm -v $(pwd):/tileset openmaptiles/openmaptiles-tools make clean_build
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Code generating from the layer definitions ( ./build/mapping.yaml; ./build/tileset.sql )" echo "====> : Code generating from the layer definitions ( ./build/mapping.yaml; ./build/tileset.sql )"
echo " : The tool source code: https://github.com/openmaptiles/openmaptiles-tools " echo " : The tool source code: https://github.com/openmaptiles/openmaptiles-tools "
echo " : But we generate the tm2source, Imposm mappings and SQL functions from the layer definitions! " echo " : But we generate the tm2source, Imposm mappings and SQL functions from the layer definitions! "
docker run --rm -v $(pwd):/tileset openmaptiles/openmaptiles-tools make docker run --rm -v $(pwd):/tileset openmaptiles/openmaptiles-tools make
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start PostgreSQL service ; create PostgreSQL data volume " echo "====> : Start PostgreSQL service ; create PostgreSQL data volume "
echo " : Source code: https://github.com/openmaptiles/postgis " echo " : Source code: https://github.com/openmaptiles/postgis "
echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !" echo " : Thank you: https://www.postgresql.org ! Thank you http://postgis.org !"
@ -87,6 +103,7 @@ docker-compose up -d postgres
sleep 30 sleep 30
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start importing water data from http://openstreetmapdata.com into PostgreSQL " echo "====> : Start importing water data from http://openstreetmapdata.com into PostgreSQL "
echo " : Source code: https://github.com/openmaptiles/import-water " echo " : Source code: https://github.com/openmaptiles/import-water "
echo " : Data license: http://openstreetmapdata.com/info/license " echo " : Data license: http://openstreetmapdata.com/info/license "
@ -94,6 +111,7 @@ echo " : Thank you: http://openstreetmapdata.com/info/supporting "
docker-compose run --rm import-water docker-compose run --rm import-water
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start importing http://www.naturalearthdata.com into PostgreSQL " echo "====> : Start importing http://www.naturalearthdata.com into PostgreSQL "
echo " : Source code: https://github.com/openmaptiles/import-natural-earth " echo " : Source code: https://github.com/openmaptiles/import-natural-earth "
echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use " echo " : Terms-of-use: http://www.naturalearthdata.com/about/terms-of-use "
@ -101,6 +119,7 @@ echo " : Thank you: Natural Earth Contributors! "
docker-compose run --rm import-natural-earth docker-compose run --rm import-natural-earth
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start importing OpenStreetMap Lakelines data " echo "====> : Start importing OpenStreetMap Lakelines data "
echo " : Source code: https://github.com/openmaptiles/import-lakelines " echo " : Source code: https://github.com/openmaptiles/import-lakelines "
echo " : https://github.com/lukasmartinelli/osm-lakelines " echo " : https://github.com/lukasmartinelli/osm-lakelines "
@ -108,6 +127,7 @@ echo " : Data license: .. "
docker-compose run --rm import-lakelines docker-compose run --rm import-lakelines
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start importing OpenStreetMap data: ./data/${testdata} -> imposm3[./build/mapping.yaml] -> PostgreSQL" echo "====> : Start importing OpenStreetMap data: ./data/${testdata} -> imposm3[./build/mapping.yaml] -> PostgreSQL"
echo " : Imposm3 documentation: https://imposm.org/docs/imposm3/latest/index.html " echo " : Imposm3 documentation: https://imposm.org/docs/imposm3/latest/index.html "
echo " : Thank you Omniscale! " echo " : Thank you Omniscale! "
@ -117,11 +137,13 @@ echo " : Thank you OpenStreetMap Contributors ! "
docker-compose run --rm import-osm docker-compose run --rm import-osm
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start SQL postprocessing: ./build/tileset.sql -> PostgreSQL " echo "====> : Start SQL postprocessing: ./build/tileset.sql -> PostgreSQL "
echo " : Source code: https://github.com/openmaptiles/import-sql " echo " : Source code: https://github.com/openmaptiles/import-sql "
docker-compose run --rm import-sql docker-compose run --rm import-sql
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Start generating MBTiles (containing gzipped MVT PBF) from a TM2Source project. " echo "====> : Start generating MBTiles (containing gzipped MVT PBF) from a TM2Source project. "
echo " : TM2Source project definitions : ./build/openmaptiles.tm2source/data.yml " echo " : TM2Source project definitions : ./build/openmaptiles.tm2source/data.yml "
echo " : Output MBTiles: ./data/tiles.mbtiles " echo " : Output MBTiles: ./data/tiles.mbtiles "
@ -132,10 +154,12 @@ echo " : See other MVT tools : https://github.com/mapbox/awesome-vector-til
docker-compose -f docker-compose.yml -f docker-compose-test-override.yml run --rm generate-vectortiles docker-compose -f docker-compose.yml -f docker-compose-test-override.yml run --rm generate-vectortiles
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Stop PostgreSQL service ( but we keep PostgreSQL data volume for debugging )" echo "====> : Stop PostgreSQL service ( but we keep PostgreSQL data volume for debugging )"
docker-compose stop postgres docker-compose stop postgres
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : Inputs - Outputs md5sum for debugging " echo "====> : Inputs - Outputs md5sum for debugging "
rm -f quickstart_checklist.chk rm -f quickstart_checklist.chk
md5sum build/mapping.yaml >> quickstart_checklist.chk md5sum build/mapping.yaml >> quickstart_checklist.chk
@ -151,20 +175,23 @@ MODDATE=$(stat -c %y ./data/${testdata} )
echo " " echo " "
echo " " echo " "
echo "------------------------------------------------------------" echo "-------------------------------------------------------------------------------------"
echo "-- S u m m a r y --" echo "-- S u m m a r y --"
echo "------------------------------------------------------------" echo "-------------------------------------------------------------------------------------"
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : (disk space) We have created a lot of docker images: " echo "====> : (disk space) We have created a lot of docker images: "
echo " : Hint: you can remove with: docker rmi IMAGE " echo " : Hint: you can remove with: docker rmi IMAGE "
docker images | grep openmaptiles docker images | grep openmaptiles
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : (disk space) We have created this new docker volume for PostgreSQL data:" echo "====> : (disk space) We have created this new docker volume for PostgreSQL data:"
echo " : Hint: you can remove with : docker volume rm openmaptiles_pgdata " echo " : Hint: you can remove with : docker volume rm openmaptiles_pgdata "
docker volume ls -q | grep openmaptiles docker volume ls -q | grep openmaptiles
echo " " echo " "
echo "-------------------------------------------------------------------------------------"
echo "====> : (disk space) We have created the new vectortiles ( ./data/tiles.mbtiles ) " echo "====> : (disk space) We have created the new vectortiles ( ./data/tiles.mbtiles ) "
echo " : The OpenMapTiles MBTILES license: ..... " echo " : The OpenMapTiles MBTILES license: ..... "
echo " : We created from $testdata ( file moddate: $MODDATE ) " echo " : We created from $testdata ( file moddate: $MODDATE ) "
@ -172,13 +199,11 @@ echo " : Size: "
ls ./data/*.mbtiles -la ls ./data/*.mbtiles -la
echo " " echo " "
echo "============================================================" echo "-------------------------------------------------------------------------------------"
echo "The quickstart.sh is finished! " echo "The quickstart.sh is finished! "
echo "It takes $(($ENDTIME - $STARTTIME)) seconds to complete" echo "It takes $(($ENDTIME - $STARTTIME)) seconds to complete"
echo "We saved the log file to $log_file ( for debugging ) You can compare with the travis log !" echo "We saved the log file to $log_file ( for debugging ) You can compare with the travis log !"
echo " " echo " "
echo "Start experimenting -> see the documentation! " echo "Start experimenting -> see the documentation! "
echo "============================================================" echo "-------------------------------------------------------------------------------------"