Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
dbis
dbis-isochrone
isochrone
Commits
0ad16d96
Commit
0ad16d96
authored
10 years ago
by
User expired
Browse files
Options
Downloads
Patches
Plain Diff
deactivating pgrouting in local test deploy mode (by default)
fixing performance problems
parent
5e92a1f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Vagrantfile
+6
-2
6 additions, 2 deletions
Vagrantfile
etc/vagrant/Vagrantfile
+5
-3
5 additions, 3 deletions
etc/vagrant/Vagrantfile
etc/vagrant/bootstrap.sh
+39
-36
39 additions, 36 deletions
etc/vagrant/bootstrap.sh
with
50 additions
and
41 deletions
Vagrantfile
+
6
−
2
View file @
0ad16d96
...
...
@@ -18,10 +18,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config
.
vm
.
boot_timeout
=
600
# Hardware configuration
# WARNING: Be VERY careful with this settings!!!
# -> giving the client more cores can SLOW DOWN the VM (if there is not enough workload on the guest, two less cores on the host...)
config
.
vm
.
provider
"virtualbox"
do
|
v
|
v
.
name
=
(
isLocalMode
?
"isochrone-local"
:
"isochrone"
)
v
.
cpus
=
2
v
.
memory
=
3072
v
.
cpus
=
1
v
.
memory
=
2048
v
.
customize
[
"modifyvm"
,
:id
,
"--cpuexecutioncap"
,
"100"
]
v
.
customize
[
"modifyvm"
,
:id
,
"--ostype"
,
"RedHat_64"
]
end
# Enable vagrant-cachier plugin
...
...
This diff is collapsed.
Click to expand it.
etc/vagrant/Vagrantfile
+
5
−
3
View file @
0ad16d96
...
...
@@ -6,12 +6,14 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
# Hardware configuration
# WARNING: Be VERY careful with this settings!!!
# -> giving the client more cores can SLOW DOWN the VM (if there is not enough workload on the guest, two less cores on the host...)
config
.
vm
.
provider
"virtualbox"
do
|
v
|
v
.
name
=
"isochrone"
v
.
cpus
=
2
v
.
memory
=
3072
v
.
cpus
=
1
v
.
memory
=
2048
v
.
customize
[
"modifyvm"
,
:id
,
"--cpuexecutioncap"
,
"100"
]
v
.
customize
[
"modifyvm"
,
:id
,
"
–
ostype"
"RedHat_64"
]
v
.
customize
[
"modifyvm"
,
:id
,
"
--
ostype"
,
"RedHat_64"
]
end
# Enable vagrant-cachier plugin
...
...
This diff is collapsed.
Click to expand it.
etc/vagrant/bootstrap.sh
+
39
−
36
View file @
0ad16d96
...
...
@@ -34,8 +34,9 @@ fi
# Variable definitions #
############################
IMPORT_OSMDATA
=
false
IMPORT_OSMDATA_CACHED
=
true
IMPORT_DATA_OSM
=
false
IMPORT_DATA_OSM_CACHED
=
false
IMPORT_DATA_SQL
=
true
IMPORT_SCHEDULES
=
true
INSTALL_GEOSERVER
=
false
INSTALL_HTTPD
=
true
...
...
@@ -44,7 +45,7 @@ INSTALL_ISOCHRONE_RELEASE=true # installs latest isochrone release from nexus re
INSTALL_ISOCHRONE_SNAPSHOT
=
true
# installs latest isochrone snapshot from nexus repository
INSTALL_NEO4J
=
false
INSTALL_NEO4J_SPATIAL
=
false
INSTALL_PGROUTING
=
tru
e
INSTALL_PGROUTING
=
fals
e
INSTALL_POSTGIS
=
true
INSTALL_POSTGRES
=
true
INSTALL_POSTGRES_ADMIN
=
true
...
...
@@ -238,32 +239,29 @@ fi
# Calculated configuration #
############################
IMPORT_DATA
=
false
INSTALL_JAVA
=
false
INSTALL_MAVEN
=
false
INSTALL_OSMOSIS
=
false
# should be set to true to automatically resolve issues with cached CACHED_OSM_DATA
INSTALL_TOMCAT
=
false
if
$IS_LOCAL_TEST_DEPLOY
;
then
# Some projects will never be installed when in local deploy mode (like latest release/snapshot from nexus)
INSTALL_PROJECT_CANIGET2
=
false
#
INSTALL_PROJECT_PSIPROBE=false
# for some reason uncommenting this line causes performance issues (is this due to VM dynamic hdd size)
INSTALL_PROJECT_PSIPROBE
=
false
INSTALL_ISOCHRONE_LOCAL
=
false
INSTALL_ISOCHRONE_RELEASE
=
false
INSTALL_ISOCHRONE_SNAPSHOT
=
false
else
# Some projects will only be installed when in local deploy mode (like pgRouting that can be used for performance comparisons)
INSTALL_PGROUTING
=
false
fi
if
$IMPORT_
OSM
DATA
;
then
I
NSTALL_OSMOSIS
=
true
if
$IMPORT_DATA
_OSM
||
$IMPORT_DATA_OSM_CACHED
||
$IMPORT_DATA_SQL
;
then
I
MPORT_DATA
=
true
fi
if
$INSTALL_GEOSERVER
||
$INSTALL_PROJECT_CANIGET2
||
$INSTALL_ISOCHRONE_LOCAL
||
$INSTALL_ISOCHRONE_RELEASE
||
$INSTALL_ISOCHRONE_SNAPSHOT
||
$INSTALL_PROJECT_PSIPROBE
;
then
INSTALL_TOMCAT
=
true
fi
if
$INSTALL_NEO4J_SPATIAL
;
then
INSTALL_MAVEN
=
$IMPORT_
OSM
DATA
||
$IMPORT_
OSM
DATA_CACHED
INSTALL_MAVEN
=
$IMPORT_DATA
_OSM
||
$IMPORT_DATA_
OSM_
CACHED
fi
if
$INSTALL_TOMCAT
||
$INSTALL_GEOSERVER
||
$INSTALL_NEO4J
||
$INSTALL_NEO4J_SPATIAL
||
$IMPORT_
OSM
DATA
;
then
if
$INSTALL_TOMCAT
||
$INSTALL_GEOSERVER
||
$INSTALL_NEO4J
||
$INSTALL_NEO4J_SPATIAL
||
$IMPORT_DATA
_OSM
;
then
INSTALL_JAVA
=
true
fi
if
$INSTALL_PGROUTING
;
then
...
...
@@ -328,7 +326,7 @@ fn_import_data()
local
TABLE_PREFIX
=
"
$6
"
local
VALID_SQL_EXPORT
=
false
if
$INSTALL_POSTGIS
&&
$IMPORT_SCHEDULES
;
then
if
$IMPORT_DATA_SQL
&&
$INSTALL_POSTGIS
&&
$IMPORT_SCHEDULES
;
then
if
[
-n
"
$SQL_EXPORT_FILE
"
]
;
then
VALID_SQL_EXPORT
=
true
fi
...
...
@@ -340,14 +338,34 @@ fn_import_data()
return
1
fi
if
$IMPORT_OSMDATA_CACHED
;
then
if
$VALID_SQL_EXPORT
;
then
echo
" - downloading sql export"
fn_download_newer
$DOWNLOAD_DIR
/
$SQL_EXPORT_FILE
$CACHE_DIR_REMOTE
/
$SQL_EXPORT_FILE
cp
$DOWNLOAD_DIR
/
$SQL_EXPORT_FILE
$DEPLOY_DIR
/
$SQL_EXPORT_FILE
>>
/dev/null 2>&1
echo
" - importing sql export into postgis database"
gunzip
-c
$DEPLOY_DIR
/
$SQL_EXPORT_FILE
|
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-U
"
$PG_DB_USER
"
-h
localhost
"
$PG_DB_NAME
"
>>
"
$WORKING_DIR
/import_schedule_
$NAME
.log"
2>&1
echo
" - fixing table permissions"
tables
=
`
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tableowner = 'postgres';"
"
$PG_DB_NAME
"
`
for
tbl
in
$tables
;
do
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"ALTER TABLE
$tbl
OWNER TO
$PG_DB_USER
"
"
$PG_DB_NAME
"
;
done
fi
if
!
(
$INSTALL_PGROUTING
||
$INSTALL_NEO4J_SPATIAL
)
||
!
(
$IMPORT_DATA_OSM_CACHED
||
$IMPORT_DATA_OSM
)
;
then
# osm data does not need to be downloaded (since it would not be imported afterwards)
return
0
fi
if
$IMPORT_DATA_OSM_CACHED
;
then
echo
" - downloading cached OpenStreetMap file"
fn_download_newer
$DOWNLOAD_DIR
/
$OSM_FILE_FILTERED
$CACHE_DIR_REMOTE
/
$OSM_FILE_FILTERED
cp
$DOWNLOAD_DIR
/
$OSM_FILE_FILTERED
$DEPLOY_DIR
/
$OSM_FILE_FILTERED
>>
/dev/null 2>&1
fi
if
[
!
-f
$DEPLOY_DIR
/
$OSM_FILE_FILTERED
]
;
then
if
$I
NSTALL_OSMOSIS
;
then
if
$I
MPORT_DATA_OSM
;
then
echo
" - downloading OpenStreetMap file (no cached file found)"
OSM_FILENAME
=
$DOWNLOAD_DIR
/
${
OSM_FILE
##*/
}
fn_download_newer
$OSM_FILENAME
$OSM_DOWNLOAD_MIRROR
/
$OSM_FILE
...
...
@@ -363,21 +381,6 @@ fn_import_data()
fi
fi
if
$VALID_SQL_EXPORT
;
then
echo
" - downloading sql export"
fn_download_newer
$DOWNLOAD_DIR
/
$SQL_EXPORT_FILE
$CACHE_DIR_REMOTE
/
$SQL_EXPORT_FILE
cp
$DOWNLOAD_DIR
/
$SQL_EXPORT_FILE
$DEPLOY_DIR
/
$SQL_EXPORT_FILE
>>
/dev/null 2>&1
echo
" - importing sql export into postgis database"
gunzip
-c
$DEPLOY_DIR
/
$SQL_EXPORT_FILE
|
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-U
"
$PG_DB_USER
"
-h
localhost
"
$PG_DB_NAME
"
>>
"
$WORKING_DIR
/import_schedule_
$NAME
.log"
2>&1
echo
" - fixing table permissions"
tables
=
`
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tableowner = 'postgres';"
"
$PG_DB_NAME
"
`
for
tbl
in
$tables
;
do
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"ALTER TABLE
$tbl
OWNER TO
$PG_DB_USER
"
"
$PG_DB_NAME
"
;
done
fi
if
$INSTALL_PGROUTING
;
then
echo
" - importing filtered OpenStreetMap data into pgRouting"
$DEPLOY_DIR
/osm2pgrouting/build/osm2pgrouting
-file
"
$DEPLOY_DIR
/
$OSM_FILE_FILTERED
"
-conf
"
$OSM2PGROUTING_MAPPING_CONF
"
-dbname
$PG_DB_NAME
-user
$PG_DB_USER
-passwd
$PG_DB_PASSWORD
-clean
-prefixtables
$TABLE_PREFIX
>>
"import_osm2pgrouting_
$NAME
.log"
2>&1
...
...
@@ -544,8 +547,8 @@ fi
if
$INSTALL_TOMCAT
;
then
echo
" - tomcat
$TOMCAT_VERSION
"
;
fi
if
$INSTALL_GEOSERVER
;
then
echo
" - geoserver
$GEOSERVER_VERSION
"
;
fi
if
$INSTALL_POSTGRES_ADMIN
;
then
echo
" - phpPgAdmin"
;
fi
if
$IMPORT_
OSM
DATA
;
then
echo
" - osmosis
$OSMOSIS_VERSION
"
;
fi
if
$IMPORT_
OSM
DATA_CACHED
;
then
echo
"Importing cached data from OSM (if possible)"
;
elif
$IMPORT_
OSM
DATA
;
then
echo
"Importing data from OSM"
;
fi
if
$IMPORT_DATA
_OSM
;
then
echo
" - osmosis
$OSMOSIS_VERSION
"
;
fi
if
$IMPORT_DATA_
OSM_
CACHED
;
then
echo
"Importing cached data from OSM (if possible)"
;
elif
$IMPORT_DATA
_OSM
;
then
echo
"Importing data from OSM"
;
fi
if
$IMPORT_SCHEDULES
;
then
echo
"Importing schedules"
;
fi
if
$INSTALL_PROJECT_CANIGET2
;
then
echo
"Importing project
\"
CanIGet2
\"
"
;
fi
if
$INSTALL_ISOCHRONE_LOCAL
;
then
echo
"Importing project
\"
isochrone (local testing)
\"
"
;
fi
...
...
@@ -789,7 +792,7 @@ if $INSTALL_NEO4J_SPATIAL; then
git checkout
-q
$NEO4J_SPATIAL_VERSION
>>
/dev/null 2>&1
if
$INSTALL_GEOSERVER
;
then
if
$IMPORT_
OSM
DATA
||
$IMPORT_
OSM
DATA_CACHED
;
then
if
$IMPORT_DATA
_OSM
||
$IMPORT_DATA_
OSM_
CACHED
;
then
# We need to compile the source when importing data, so that the main class gets compiled
echo
" - copying neo4j-spatial into geoserver (from source)"
mvn clean
install
-DskipTests
>>
$WORKING_DIR
/install_neo4j_spatial.log 2>&1
...
...
@@ -803,7 +806,7 @@ if $INSTALL_NEO4J_SPATIAL; then
cd
$WORKING_DIR
fi
if
$I
NSTALL_OSMOSIS
;
then
if
$I
MPORT_DATA_OSM
;
then
echo
"Installing osmosis
$OSMOSIS_VERSION
"
fn_download_newer
$DOWNLOAD_DIR
/
$OSMOSIS_FILE
"
$OSMOSIS_DOWNLOAD_URL
"
mkdir
-p
$DEPLOY_DIR
/osmosis-
$OSMOSIS_VERSION
...
...
@@ -812,7 +815,7 @@ if $INSTALL_OSMOSIS; then
chmod
a+x
$DEPLOY_DIR
/osmosis/bin/osmosis
fi
if
(
$IMPORT_
OSM
DATA
||
$IMPORT_
OSM
DATA_CACHED
)
&&
$INSTALL_PGROUTING
;
then
if
(
$IMPORT_DATA
_OSM
||
$IMPORT_DATA_
OSM_
CACHED
)
&&
$INSTALL_PGROUTING
;
then
echo
"Installing osm2pgrouting dependencies"
yum
install
-y
expat-devel boost-devel
>>
install_osm2pgrouting_deps.log 2>&1
...
...
@@ -944,7 +947,7 @@ fi
echo
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo
" Services started!"
if
$IMPORT_
OSM
DATA
||
$IMPORT_OSMDATA_CACHED
;
then
if
$IMPORT_DATA
;
then
echo
" Importing data:"
echo
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment