Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
photon-deploy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
POCS
photon-deploy
Commits
6986009d
Commit
6986009d
authored
6 years ago
by
Nicolas Pernoud
Browse files
Options
Downloads
Patches
Plain Diff
Put updates in containers
parent
44ecfda5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
entrypoint.sh
+19
-1
19 additions, 1 deletion
entrypoint.sh
nominatim-3.1/start.sh
+8
-0
8 additions, 0 deletions
nominatim-3.1/start.sh
start.sh
+1
-23
1 addition, 23 deletions
start.sh
with
28 additions
and
24 deletions
entrypoint.sh
+
19
−
1
View file @
6986009d
...
...
@@ -9,7 +9,25 @@ fi
# Start photon if elastic index exists
if
[
-d
"/photon/photon_data/elasticsearch"
]
;
then
echo
"Starting photon"
java
-jar
photon.jar
-host
nominatim
-port
5432
-database
nominatim
-user
nominatim
-password
password1234
java
-jar
photon.jar
-host
nominatim
-port
5432
-database
nominatim
-user
nominatim
-password
password1234 &
### Start continuous update ###
while
true
;
do
starttime
=
$(
date
+%s
)
curl http://localhost:2322/nominatim-update
# sleep a bit if updates take less than 5 minutes
endtime
=
$(
date
+%s
)
elapsed
=
$((
endtime
-
starttime
))
if
[[
$elapsed
-lt
300
]]
;
then
sleepy
=
$((
300
-
$elapsed
))
echo
"Sleeping for
${
sleepy
}
s..."
sleep
$sleepy
fi
done
else
echo
"Could not start photon, the search index could not be found"
fi
This diff is collapsed.
Click to expand it.
nominatim-3.1/start.sh
+
8
−
0
View file @
6986009d
#!/bin/bash
service postgresql start
/usr/sbin/apache2ctl
-D
FOREGROUND
## Set up nominatim updates ###
sudo
-u
nominatim ./src/build/utils/update.php
--init-updates
sudo
-u
nominatim ./src/build/utils/update.php
--import-osmosis-all
&
## Follow log ###
tail
-f
/var/log/postgresql/postgresql-9.5-main.log
This diff is collapsed.
Click to expand it.
start.sh
+
1
−
23
View file @
6986009d
...
...
@@ -3,26 +3,4 @@
### Start all containers ###
docker-compose down
docker-compose up
-d
## Set up nominatim updates ###
docker
exec
-it
photon-deploy_nominatim_1
sudo
-u
nominatim ./src/build/utils/update.php
--init-updates
docker
exec
-it
photon-deploy_nominatim_1
sudo
-u
nominatim ./src/build/utils/update.php
--import-osmosis-all
&
### Start continuous update ###
while
true
;
do
starttime
=
$(
date
+%s
)
curl http://localhost:2322/nominatim-update
# sleep a bit if updates take less than 5 minutes
endtime
=
$(
date
+%s
)
elapsed
=
$((
endtime
-
starttime
))
if
[[
$elapsed
-lt
300
]]
;
then
sleepy
=
$((
300
-
$elapsed
))
echo
"Sleeping for
${
sleepy
}
s..."
sleep
$sleepy
fi
done
docker-compose up
-d
\ No newline at end of file
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