Skip to content

Commit

Permalink
remove rabbitmq, queue in redis lists, add keys to message instead of…
Browse files Browse the repository at this point in the history
… limit/offset quries
  • Loading branch information
tsurowiec committed Nov 6, 2018
1 parent b6d00b3 commit f8f7e06
Show file tree
Hide file tree
Showing 42 changed files with 570 additions and 677 deletions.
5 changes: 0 additions & 5 deletions .env.dist
Expand Up @@ -8,11 +8,6 @@ APP_SECRET=1b90fda83888e1852b735fdf9d37cf40
SOURCE_DATABASE_URL=mysql://user:pass@source/source
TARGET_DATABASE_URL=mysql://user:pass@target/target
###< doctrine/doctrine-bundle ###

###> php-amqplib/rabbitmq-bundle ###
RABBITMQ_URL=amqp://user:pass@rabbit:5672
###< php-amqplib/rabbitmq-bundle ###

###> snc/redis-bundle ###
# passwords that contain special characters (@, %, :, +) must be urlencoded
REDIS_URL=redis://redis
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -15,7 +15,7 @@ install:
start:
${DOCKER_COMPOSE} up -d
echo "waiting for services to start..."
sleep 30
sleep 16

.PHONY: stop
stop:
Expand Down
13 changes: 3 additions & 10 deletions README.md
Expand Up @@ -10,7 +10,7 @@ You can configure various masking and subsetting strategies, and when what *fogg

## How to use the docker image

*Fogger* requires docker environment, redis and rabbitMq services and two databases: source and target. You can set up this stack using for example this docker-compose file:
*Fogger* requires docker environment, redis for caching and two databases: source and target. You can set up this stack using for example this docker-compose file:
```
version: '2.0'
services:
Expand All @@ -21,24 +21,17 @@ services:
environment:
SOURCE_DATABASE_URL: mysql://user:pass@source:3306/source
TARGET_DATABASE_URL: mysql://user:pass@target:3306/target
RABBITMQ_URL: amqp://user:pass@rabbit:5672
REDIS_URL: redis://redis
worker:
image: tshio/fogger:latest
environment:
SOURCE_DATABASE_URL: mysql://user:pass@source:3306/source
TARGET_DATABASE_URL: mysql://user:pass@target:3306/target
RABBITMQ_URL: amqp://user:pass@rabbit:5672
REDIS_URL: redis://redis
restart: always
command: rabbit:consumer --messages=200 fogger_data_chunks
command: fogger:consumer --messages=200
redis:
image: redis:4
rabbit:
image: rabbitmq:3
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: pass
source:
volumes:
- ./dump.sql:/docker-entrypoint-initdb.d/dump.sql
Expand Down Expand Up @@ -109,7 +102,7 @@ For the clarity and readability of the config files, all the tables that will no
* faker - will use a marvelous [faker](https://github.com/fzaninotto/Faker) library. Pass the `method` of faker that you want to use here as an option.

`email: { maskStrategy: "faker", options: { method: "safeEmail" }`
`date: { maskStrategy: "faker", options: { method: "date", parameters: ["Y::m::d", "2017-12-31 23:59:59"] }`
`date: { maskStrategy: "faker", options: { method: "date", arguments: ["Y::m::d", "2017-12-31 23:59:59"] }`

#### Subsetting data

Expand Down
4 changes: 2 additions & 2 deletions behat.yml.dist
Expand Up @@ -10,8 +10,8 @@ default:
- DatabaseContext:
source: '@doctrine.dbal.source_connection'
target: '@doctrine.dbal.target_connection'
- ChunkCounterContext:
chunkCounter: '@App\Fogger\Data\ChunkCounter'
- ChunkCacheContext:
chunkCache: '@App\Fogger\Data\ChunkCache'

extensions:
Behat\Symfony2Extension:
Expand Down
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -7,7 +7,6 @@
"ext-iconv": "*",
"ext-json": "*",
"fzaninotto/faker": "^1.8",
"php-amqplib/rabbitmq-bundle": "^1.14",
"predis/predis": "^1.1",
"snc/redis-bundle": "^2.1",
"symfony/console": "*",
Expand Down

0 comments on commit f8f7e06

Please sign in to comment.