-
Notifications
You must be signed in to change notification settings - Fork 21
Adaptation of the overpass scripts to deploy the OSM-FR server #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
laem
wants to merge
13
commits into
osm-fr:master
Choose a base branch
from
cartesapp:cartes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4e94ad4
Missing variable for overpass's db dir
laem 0f132d4
Removing all hosts but mine because toml fails to parse them
laem 258c477
My user and remove the debian distribution test (why was it here ?)
laem fb5ded1
Depreciated use of version_compare
laem d257032
Deactivate a "temp" script to patch for logs
laem e3ee1a2
Overpass state.txt datetime format changed
laem 8da034b
Logs supplémentaires car je ne comprends pas où bloque le script
laem ef87de5
New task "fast startup" and rights to execute
laem e3fd458
Rights one per one
laem 905f42e
It appears that one ansible script was already copying binaries
laem 2fdadee
Option nécessaire pour instance privée
laem 08a9f85
Run fast startup as overpass user to avoid root database files
laem dd7a037
Nécessité probable d'un become user
laem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,8 +1,11 @@ | ||
| - name: overpass-api.yml | ||
| hosts: overpass-api | ||
| hosts: maelito | ||
| remote_user: maelito | ||
| roles: | ||
| - role: overpass-api | ||
| vars: | ||
| overpass_version: v0.7.62.7 | ||
| overpass_database_dir: /data/work/overpass | ||
| when: | ||
| - overpass_version != "skip" | ||
| - ansible_distribution_release == "stretch" | ||
| become: yes | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ | |
| become: yes | ||
| become_user: "{{ overpass_user }}" | ||
|
|
||
|
|
||
| - name: download {{ overpass_version }} release of overpass-api | ||
| unarchive: | ||
| src: "http://dev.overpass-api.de/releases/osm-3s_{{ overpass_version }}.tar.gz" | ||
|
|
@@ -55,6 +54,7 @@ | |
| strip: 1 | ||
| become: yes | ||
| become_user: "{{ overpass_user }}" | ||
| when: false # Looks to me that the diff file used to patch used to target another script and fails in the following versions. Disabling it an hoping it was fixed / not so important :) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On peut supprimer cette task du coup. |
||
|
|
||
| - name: install overpass-api executables | ||
| shell: make install | ||
|
|
@@ -78,6 +78,8 @@ | |
|
|
||
| - name: install rules for areas | ||
| command: cp -r {{ project_dir }}/osm-3s_{{ overpass_version }}/rules {{ overpass_database_dir }}/ | ||
| become: yes | ||
| become_user: "{{ overpass_user }}" | ||
|
|
||
| - name: change delay to fetch diff | ||
| replace: | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -16,15 +16,16 @@ | |
|
|
||
|
|
||
| def parse_state_txt(url): | ||
| log.info(url) | ||
| resp = requests.get(url) | ||
|
|
||
| for line in resp.text.split('\n'): | ||
| if line.startswith('sequenceNumber'): | ||
| sequence_number = line.split('=')[1] | ||
| elif line.startswith('timestamp'): | ||
| timestamp = line.split('=')[1] | ||
|
|
||
| return (sequence_number, datetime.strptime(timestamp[:-5], | ||
| cleaned_timestamp = timestamp.replace("\:", ":") # Looks like the datetime is not escaped in the URL https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/planet/replication/minute/state.txt | ||
| return (sequence_number, datetime.strptime(cleaned_timestamp[:-5], | ||
| '%Y-%m-%dT%H:%M')) | ||
|
|
||
|
|
||
|
|
@@ -68,6 +69,9 @@ def md5(fname): | |
| obj_datetime = pbf_datetime - delta | ||
| url = '{{ overpass_replication_url }}/state.txt' | ||
|
|
||
| log.info(url) | ||
| log.info(obj_datetime) | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commit 8da034b à supprimer maintenant ? |
||
| repl_seq, repl_datetime = parse_state_txt(url) | ||
| diff_datetime = obj_datetime - repl_datetime | ||
| while diff_datetime > timedelta( | ||
|
|
@@ -76,10 +80,12 @@ def md5(fname): | |
| int(repl_seq) + int(diff_datetime.total_seconds() // divider)) | ||
| url = '{{ overpass_replication_url }}/{}/{}/{}.state.txt'.format( | ||
| repl_seq[:-6], repl_seq[-6:-3], repl_seq[-3:]) | ||
|
|
||
| repl_seq, repl_datetime = parse_state_txt(url) | ||
| diff_datetime = obj_datetime - repl_datetime | ||
|
|
||
| log.info('download pbf') | ||
| log.info(url) | ||
| pbf_url = '{{ overpass_pbf_root_url }}/{{ overpass_pbf_region }}-{}.osm.pbf'.format( | ||
| pbf_datetime.strftime('%y%m%d')) | ||
| pbf_dest = '{{ overpass_database_dir }}/{{ overpass_pbf_region }}-{}.osm.pbf'.format( | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> overpass-api
Et mettre ton host dans la section overpass-api.