-
Notifications
You must be signed in to change notification settings - Fork 14
Integrate posm-build with new docker setup. #132
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
Draft
thenav56
wants to merge
2
commits into
docker-experimental
Choose a base branch
from
feature/docker-experimental-tc
base: docker-experimental
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.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -3,3 +3,6 @@ kickstart/bootstrap.log | |
| kickstart/sources/ | ||
| .vscode | ||
| **/.DS_Store | ||
|
|
||
| docker/.tmp/ | ||
| docker/osmosis/pipe_reader_writer.sh | ||
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # NOTE: This environment variable is used within variable used in docker-compose.yml (not individual containers) | ||
| # https://docs.docker.com/compose/environment-variables/#substitute-environment-variables-in-compose-files | ||
|
|
||
| OSM_FQDN=osm.posm.io | ||
| OSM_PG_ADMIN_USER=postgres | ||
| OSM_PG_ADMIN_PASSWORD=openstreetmap | ||
| OSM_PG_OWNER=openstreetmap | ||
| OSM_PG_PASS=openstreetmap | ||
| OSM_PG_DBNAME=openstreetmap | ||
|
|
||
| # Replay tool | ||
| REPLAY_TOOL_PG_DB=replay-tool | ||
| REPLAY_TOOL_PG_USER=replay-tool | ||
| REPLAY_TOOL_PG_PASSOWRD=replay-tool |
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 |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| version: '3.2' | ||
|
|
||
| services: | ||
| osm-db: | ||
| image: posm/osm-pg:0.1 | ||
| build: | ||
| context: ./osm-web/postgres | ||
| args: | ||
| PGSQL_VER: 12 | ||
| POSTGIS_VER: 3 | ||
| environment: | ||
| POSTGRES_USER: $OSM_PG_ADMIN_USER | ||
| POSTGRES_PASSWORD: $OSM_PG_ADMIN_PASSWORD | ||
| networks: | ||
| - osm | ||
|
|
||
| osm-web: | ||
| image: posm/posm-osm:0.1 | ||
| build: | ||
| context: ./osm-web | ||
| args: | ||
| OSM_FQDN: $OSM_FQDN | ||
| environment: | ||
| OSM_DST: /opt/osm | ||
| PG_HOST: osm-db | ||
| PG_ADMIN_USER: $OSM_PG_ADMIN_USER | ||
| PG_ADMIN_PASSWORD: $OSM_PG_ADMIN_PASSWORD | ||
| OSM_USER: $OSM_PG_OWNER | ||
| OSM_PASSWORD: $OSM_PG_PASS | ||
| OSM_DB: $OSM_PG_DBNAME | ||
| volumes: | ||
| - osm-web-static:/web-static/ | ||
| - ./osm-web/config/database.yml:/opt/osm/osm-web/config/database.yml | ||
| - ./osm-web/run_osm.sh:/run_osm.sh | ||
| networks: | ||
| - osm | ||
| depends_on: | ||
| - osm-db | ||
|
|
||
| osmosis: | ||
| image: posm/posm-osmosis:0.1 | ||
| build: | ||
| context: ./osmosis | ||
| args: | ||
| OSMOSIS_VER: 0.48.3 | ||
| JAVA_VER: 8u272-jre-buster | ||
| environment: | ||
| OSM_DST: /opt/osm | ||
| OSMOSIS_INSTALL_DIR: /opt/osmosis | ||
| OSM_PG_HOST: osm-db | ||
| OSM_USER: $OSM_PG_OWNER | ||
| OSM_PASSWORD: $OSM_PG_PASS | ||
| OSM_DB: $OSM_PG_DBNAME | ||
| command: /pipe_reader_writer.sh | ||
| volumes: | ||
| - replay-tool-osmosis:/opt/data/aoi | ||
| - ./osmosis/pipe_reader_writer.sh:/pipe_reader_writer.sh | ||
| - ./.tmp/osmosis_command/:/tmp/osmosis_command/ | ||
| - ./.temp/osm_import/:/osm_import | ||
| - ./.temp/osm_export/:/osm_export | ||
| networks: | ||
| - osm | ||
| depends_on: | ||
| - osm-db | ||
|
|
||
| replay-tool-db: | ||
| image: postgres:9.5 | ||
| environment: | ||
| POSTGRES_DB: $REPLAY_TOOL_PG_DB | ||
| POSTGRES_USER: $REPLAY_TOOL_PG_USER | ||
| POSTGRES_PASSWORD: $REPLAY_TOOL_PG_PASSOWRD | ||
| networks: | ||
| - replay-tool | ||
| restart: always | ||
| volumes: | ||
| - replay-tool-db-data:/var/lib/postgresql/data | ||
|
|
||
| replay-tool-redis: | ||
| image: redis:latest | ||
| networks: | ||
| - replay-tool | ||
| restart: always | ||
| volumes: | ||
| - replay-tool-redis-data:/data | ||
|
|
||
| replay-tool-server: &replay-tool-server | ||
| image: docker.pkg.github.com/posm/posm-replay-server/posm-replay-server:v1.1 | ||
| environment: | ||
| REPLAY_TOOL_CLIENT_VERSION: 1.0 | ||
| DATABASE_HOST: replay-tool-db | ||
| DATABASE_NAME: $REPLAY_TOOL_PG_DB | ||
| DATABASE_USER: $REPLAY_TOOL_PG_USER | ||
| DATABASE_PASSWORD: $REPLAY_TOOL_PG_PASSOWRD | ||
| CELERY_REDIS_URL: redis://replay-tool-redis:6379/0 | ||
| # OSM Related CONFIGS | ||
| AOI_ROOT: /aoi/ | ||
| OSM_BASE_URL: http://osm-web::3000 | ||
| OSMOSIS_DB_HOST: osm-db | ||
| OSMOSIS_AOI_ROOT: /opt/data/aoi | ||
| POSM_DB_HOST: osm-db | ||
| POSM_DB_NAME: $OSM_PG_DBNAME | ||
| POSM_DB_USER: $OSM_PG_OWNER | ||
| POSM_DB_PASSWORD: $OSM_PG_PASS | ||
| command: > | ||
| bash -c " | ||
| [ -f posm-build.zip ] || \ | ||
| ( \ | ||
| curl -o posm-build.zip -L \ | ||
| "https://github.com/posm/posm-replay-client/releases/download/posm-build-v1.0/posm-build.zip" \ | ||
| && rm -rf /client/* && unzip posm-build.zip -d /client/ \ | ||
| ) && bash -c '/code/scripts/wait-for-it.sh replay-tool-db:5432 && /code/scripts/prod_exec.sh' | ||
| " | ||
| volumes: | ||
| - ./.tmp/osmosis_command/:/tmp/osmosis_command/ | ||
| - ./.tmp/replay-tool-logs/:/var/log/ | ||
| - replay-tool-osmosis:/aoi | ||
| - replay-tool-media:/media | ||
| - replay-tool-client:/client | ||
| restart: always | ||
| networks: | ||
| - osm | ||
| - replay-tool | ||
| depends_on: | ||
| - replay-tool-db | ||
| - replay-tool-redis | ||
| - osm-web | ||
| - osm-db | ||
|
|
||
| replay-tool-worker: | ||
| <<: *replay-tool-server | ||
| command: > | ||
| bash -c " | ||
| /code/scripts/wait-for-it.sh replay-tool-db:5432 \ | ||
| && mkdir -p /var/log/celery/ \ | ||
| && celery -A posm_replay worker -f /var/log/celery/celery.log | ||
| " | ||
|
|
||
| nginx: | ||
| image: nginx | ||
| volumes: | ||
| - replay-tool-client:/etc/nginx/templates/replay-tool | ||
| - osm-web-static:/etc/nginx/templates/osm-web | ||
| - ./nginx/sites-available/:/etc/nginx/conf.d/ | ||
| ports: | ||
| - "80:80" | ||
| restart: always | ||
| networks: | ||
| - replay-tool | ||
| - osm | ||
|
|
||
| networks: | ||
| replay-tool: | ||
| osm: | ||
|
|
||
| volumes: | ||
| # replay-tool volumes | ||
| replay-tool-client: | ||
| replay-tool-media: | ||
| replay-tool-db-data: | ||
| replay-tool-redis-data: | ||
| replay-tool-osmosis: | ||
| osm-web-static: |
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 |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| server { | ||
| listen 80; | ||
| listen 81; | ||
| server_name osm.posm.io; | ||
|
|
||
| proxy_buffering off; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection 'upgrade'; | ||
| proxy_set_header Host $host; | ||
| proxy_cache_bypass $http_upgrade; | ||
|
|
||
| client_max_body_size 100M; | ||
|
|
||
| # {{#auth}} | ||
| # auth_basic "POSM"; | ||
| # auth_basic_user_file htpasswd; | ||
| # {{/auth}} | ||
|
|
||
| location ~ /\. { | ||
| # do not serve dot files ever | ||
| return 404; | ||
| } | ||
|
|
||
| # proxied locations | ||
|
|
||
| # location ~ ^/api/0.6/map$ { | ||
| # include /etc/nginx/fastcgi_params; | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
|
|
||
| # location ~ ^/api/0.6/(node|way|relation|changeset)/[0-9]+$ { | ||
| # include /etc/nginx/fastcgi_params; | ||
|
|
||
| # if ($request_method = GET) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
|
|
||
| # if ($request_method = HEAD) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
| # } | ||
|
|
||
| # location ~ ^/api/0.6/(node|way|relation)/[0-9]+/history$ { | ||
| # include /etc/nginx/fastcgi_params; | ||
|
|
||
| # if ($request_method = GET) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
|
|
||
| # if ($request_method = HEAD) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
| # } | ||
|
|
||
| # location ~ ^/api/0.6/(way|relation)/[0-9]+/full$ { | ||
| # include /etc/nginx/fastcgi_params; | ||
|
|
||
| # if ($request_method = GET) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
|
|
||
| # if ($request_method = HEAD) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
| # } | ||
|
|
||
| # location ~ ^/api/0.6/(nodes|ways|relations)$ { | ||
| # include /etc/nginx/fastcgi_params; | ||
|
|
||
| # if ($request_method = GET) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
|
|
||
| # if ($request_method = HEAD) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
| # } | ||
|
|
||
| # location ~ ^/api/0.6/changeset/[0-9]+/download$ { | ||
| # include /etc/nginx/fastcgi_params; | ||
|
|
||
| # if ($request_method = GET) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
|
|
||
| # if ($request_method = HEAD) { | ||
| # fastcgi_pass 127.0.0.1:{{cgimap_port}}; | ||
| # } | ||
| # } | ||
|
|
||
| # som-web/public/land.html is missing required by iD (https://github.com/openstreetmap/iD/blob/develop/dist/land.html) | ||
| # https://github.com/openstreetmap/openstreetmap-website/issues/1760 | ||
| location / { | ||
| proxy_pass http://osm-web:3000; | ||
| proxy_read_timeout 600s; | ||
| } | ||
|
|
||
| # static files for OSM | ||
|
|
||
| # assets | ||
| location /assets/ { | ||
| alias /etc/nginx/templates/osm-web/public/assets/; | ||
| } | ||
|
|
||
| location /iD/ { | ||
| alias /etc/nginx/templates/osm-web/vendor/assets/iD/iD/; | ||
| } | ||
| } | ||
|
|
||
| # vim: set sts=2 sw=2 et si nu: | ||
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 |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| server { | ||
| listen 80; | ||
| server_name replay-tool.posm.io; | ||
|
|
||
| proxy_buffering off; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection 'upgrade'; | ||
| proxy_set_header Host $host; | ||
| proxy_cache_bypass $http_upgrade; | ||
|
|
||
| client_max_body_size 100M; | ||
|
|
||
| set $posm_auth_module 'replay'; | ||
| # auth_request /posm-auth-validate; | ||
| # uth_request_set $auth_status $upstream_status; | ||
|
|
||
| # location = /posm-auth-validate { #} | ||
| # internal; #} | ||
| # proxy_method GET; #} | ||
| # proxy_pass http://auth.posm.io/permission-validate/; #} | ||
| # proxy_pass_request_body off; #} | ||
| # proxy_set_header Content-Length ""; #} | ||
|
|
||
| # # NOTE: X-POSM-AUTH-MODULE is used by server to provided access permission. #} | ||
| # proxy_set_header X-POSM-AUTH-MODULE $posm_auth_module; #} | ||
| # } #} | ||
|
|
||
| location ~ /\. { | ||
| # do not serve dot files ever | ||
| return 404; | ||
| } | ||
|
|
||
| # proxied locations | ||
|
|
||
| location ~ ^/api/ { | ||
| proxy_pass http://replay-tool-server; | ||
| } | ||
|
|
||
| location ~ ^/login/openstreetmap { | ||
| proxy_pass http://replay-tool-server; | ||
| } | ||
|
|
||
| location ~ ^/complete/openstreetmap { | ||
| proxy_pass http://replay-tool-server; | ||
| } | ||
|
|
||
| location / { | ||
| root /etc/nginx/templates/replay-tool; | ||
| try_files $uri /index.html; | ||
| } | ||
|
|
||
| # Include comon scripts | ||
| # include /etc/nginx/snippets/posm-auth.common; | ||
| } | ||
|
|
||
| # vim: set sts=2 sw=2 et si nu: |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.