Skip to content

Commit 0e14a89

Browse files
author
Rub21
committed
Add env vars file for replication-job
1 parent 8923960 commit 0e14a89

File tree

3 files changed

+46
-54
lines changed

3 files changed

+46
-54
lines changed

.env.replication-job.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#######################################
2+
# Environment variables for Replication job settings
3+
#######################################
4+
5+
# TODO:update start.sh and helm templates, for making this customizable
6+
REPLICATION_FOLDER=/replication/minute
7+
8+
#Osmosis tuning for server, This variable intends to use much as possible the memory in the server
9+
MEMORY_JAVACMD_OPTIONS=2Gi

docker-compose.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ services:
5858
dockerfile: Dockerfile
5959
volumes:
6060
- ./data/db-backup-restore-data:/mnt/data
61-
depends_on:
62-
- db
6361
command: >
6462
/bin/bash -c "
6563
echo 'Set cron job for backing up DB, every 3m minutes';
@@ -70,26 +68,30 @@ services:
7068
- ./.env.db
7169
- ./.env.backup-restore
7270
- ./.env.cloudprovider
71+
depends_on:
72+
- db
7373
# ######################################################
7474
# ### OSM minute replication files section
7575
# ######################################################
76-
# replication-job:
77-
# image: osmseed-replication-job:v1
78-
# build:
79-
# context: ./images/replication-job
80-
# dockerfile: Dockerfile
81-
# volumes:
82-
# - ./data/replication-job:/mnt/data
83-
# depends_on:
84-
# - db
85-
# command: >
86-
# /bin/bash -c "
87-
# echo Sleep the replication-job for a while!;
88-
# sleep 40;
89-
# echo Creating the replication-job!;
90-
# /start.sh"
91-
# env_file:
92-
# - ./.env
76+
replication-job:
77+
image: osmseed-replication-job:v1
78+
build:
79+
context: ./images/replication-job
80+
dockerfile: Dockerfile
81+
volumes:
82+
- ./data/replication-job-data:/mnt/data
83+
command: >
84+
/bin/bash -c "
85+
echo Sleep the replication-job for 1 minute;
86+
sleep 1m;
87+
echo Creating the replication files!;
88+
/start.sh"
89+
env_file:
90+
- ./.env.db
91+
- ./.env.replication-job
92+
- ./.env.cloudprovider
93+
depends_on:
94+
- db
9395
# ######################################################
9496
# ### OSM data restoring into the database
9597
# ######################################################

images/replication-job/README.md

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,26 @@ This contain is responsible for creating the delta replication files it may be s
44

55
### Configuration
66

7-
In order to run this container, we should pass some environment variables
7+
In order to run this container we need environment variables, these can be found in the following files👇:
88

9-
**Postgres envs**
9+
- [.env.db.example](./../../.env.db.example)
10+
- [.env.replication-job.example](./../../.env.replication-job.example)
11+
- [.env.cloudprovider.example](./../../.env.cloudprovider.example)
1012

11-
- `POSTGRES_HOST` e.g db
12-
- `POSTGRES_DB` e.g openstreetmap
13-
- `POSTGRES_USER` e.g postgres
14-
- `POSTGRES_PASSWORD` e.g 1234
13+
**Note**: Rename the above files name as `.env.db`, `.env.replication-job` and `.env.cloudprovider`
1514

16-
The following env variables are according to which cloud provider you are going to use:
15+
#### Running replication-job container
1716

18-
- `CLOUDPROVIDER`, eg. `aws` or `gcp`
17+
```sh
18+
# Docker compose
19+
docker-compose run replication-job
1920

20-
In case AWS:
21-
22-
- `AWS_S3_BUCKET` e.g `s3://osm-seed-test`
23-
24-
In case GCP:
25-
26-
- `GCP_STORAGE_BUCKET` e.g `gs://osm-seed-test`
27-
28-
**Replication folder**
29-
30-
- `REPLICATION_FOLDER`. a folder where we are going to save the data e.g `/replication/minute`
31-
32-
#### Building the container
33-
34-
```
35-
cd replication-job
36-
docker network create osm-seed_default
37-
docker build -t osmseed-replication-job:v1 .
38-
```
39-
40-
#### Running the container
41-
42-
```
21+
# Docker
4322
docker run \
44-
--env-file ./../.env \
23+
--env-file ./../.env.db \
24+
--env-file ./../.env.replication-job \
25+
--env-file ./../.env.cloudprovider \
26+
-v ${PWD}/data/replication-job-data:/mnt/data \
4527
--network osm-seed_default \
46-
-v ${PWD}:/mnt/data \
47-
-t osmseed-replication-job:v1
48-
```
28+
-it osmseed-replication-job:v1
29+
```

0 commit comments

Comments
 (0)