-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: Provide some scripts to seed some layers #185
- Loading branch information
Christophe Nouguier
committed
Oct 9, 2020
1 parent
5994d3d
commit a91df1c
Showing
2 changed files
with
53 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
#!/bin/bash | ||
|
||
LAYER=$1 | ||
|
||
echo Clearing $LAYER | ||
k-worker-foreach -c "sudo rm -fr $MAPCACHE_DATA_PATH/$LAYER/GLOBAL_WEBMERCATOR" | ||
usage() { | ||
echo "usage: clear-cache <layer>" | ||
} | ||
|
||
help() { | ||
echo "Seeds the given layer up to the specified level using the specified number of threads" | ||
usage | ||
} | ||
|
||
exec() { | ||
local LAYER=$1 | ||
echo Clearing $LAYER | ||
k-worker-foreach -c "sudo rm -fr $MAPCACHE_DATA_PATH/$LAYER/GLOBAL_WEBMERCATOR" | ||
} | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo error: illegal number of arguments | ||
usage | ||
exit 1 | ||
fi | ||
|
||
case $1 in | ||
-h|--help) help;; | ||
*) exec "$1" | ||
esac | ||
|
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,9 +1,31 @@ | ||
#!/bin/bash | ||
|
||
LAYER=$1 | ||
LEVEL=${2:-9} | ||
THREADS=${3:-4} | ||
usage() { | ||
echo "usage: seed-cache <layer> <max-level> <nb-threads>" | ||
} | ||
|
||
echo Seeding $LAYER up to $LEVEL with $THREADS threads | ||
k-worker-foreach -c "docker run -d --rm --network=$DOCKER_NETWORK --user=www-data:www-data --volume=$MAPCACHE_DATA_PATH:/mnt/data --volume=/mnt/share/kargo/.kargo/configs/mapcache:/etc/mapcache kalisio/mapcache:1.10 mapcache_seed -c /etc/mapcache/mapcache.xml -t $LAYER -z0,$LEVEL -n $THREADS" | ||
help() { | ||
echo "Seeds the given layer up to the specified level using the specified number of threads" | ||
usage | ||
} | ||
|
||
exec() { | ||
local LAYER=$1 | ||
local MAX_LEVEL=$2 | ||
local NB_THREADS=$3 | ||
echo Seeding $LAYER up to $MAX_LEVEL level with $NB_THREADS threads | ||
local CONFIG_PATH=`pwd`/../configs/mapcache | ||
k-worker-foreach -c "docker run -d --rm --network=$DOCKER_NETWORK --user=www-data:www-data --volume=$MAPCACHE_DATA_PATH:/mnt/data --volume=$CONFIG_PATH:/etc/mapcache kalisio/mapcache:1.10 mapcache_seed -c /etc/mapcache/mapcache.xml -t $LAYER -z0,$MAX_LEVEL -n $NB_THREADS" | ||
} | ||
|
||
if [ "$#" -ne 3 ]; then | ||
echo error: illegal number of arguments | ||
usage | ||
exit 1 | ||
fi | ||
|
||
case $1 in | ||
-h|--help) help;; | ||
*) exec "$1" "$2" "$3" | ||
esac | ||
|